2010-10-09 11:19:25     Separating kernel image and u-boot loader in SPI flash

Document created by Aaronwu Employee on Sep 25, 2013
Version 1Show Document
  • View in full screen mode

2010-10-09 11:19:25     Separating kernel image and u-boot loader in SPI flash

Shyam sundar (INDIA)

Message: 94360   

 

Hello world,

 

I am using a Winbond SPI flash of  8 MB for booting BF537 on a customised board. I am able to successfully load the u-boot loader.

 

When i give the command sf probe 1, the SPI flash gets detected successfully.

 

Since I had loaded the SDRAM with the compressed kernel image at 0x1000000, I wanted to copy this compressed image into the SPI flash!  The size of the u-boot loader was around 160 KB. So to ensure that the kernel image doesnt get overlapped with u-boot loader image,  i gave the command sf write 0x32000 0x1000000 0x2f0852 !!

 

Nothing happened !! Even the reset didnt work!! Using the VDSP tool I verified that u-boot loader image had got corrupted!!

 

How can i prevent this over writing? Is there some parameter which I am missing while I am generating the loader image?

QuoteReplyEditDelete

 

 

2010-10-09 11:35:49     Re: Separating kernel image and u-boot loader in SPI flash

Mike Frysinger (UNITED STATES)

Message: 94362   

 

your sf write arguments make no sense.  please read the documentation:

https://docs.blackfin.uclinux.org/doku.php?id=bootloaders:u-boot:serial-flash

QuoteReplyEditDelete

 

 

2010-10-10 05:54:30     Re: Separating kernel image and u-boot loader in SPI flash

Shyam sundar (INDIA)

Message: 94383   

 

Hi Mike,

 

I got the convention wrong !! Thought first argument would be destination ,second source!!

 

As said earlier, I am trying to load the kernel image from the 8MB SPI flash.

 

It displays message saying Wrong Image format for bootm command

 

As per the below document, I loaded the uImage.initramfs file (this image runs fine)

 

http://docs.blackfin.uclinux.org/doku.php?id=bootloaders:u-boot:serial_port_loading_files

 

then as per http://docs.blackfin.uclinux.org/doku.php?id=bootloaders:u-boot:serial-flash

 

I gave following commands

 

bfin>sf write 0x10000000 0x32000 0x2EE668

 

bfin>set sfboot 'sf probe 1; sf read 0x10000000 0x32000 0x2EE668; bootm 0x1000000'

bfin> set bootcmd run sfboot

bfin> save

 

Then restarted the system, but got message saying wrong image format for bootm command.

 

But using the same bootm command I was able to run the kernel image

QuoteReplyEditDelete

 

 

2010-10-10 06:43:55     Re: Separating kernel image and u-boot loader in SPI flash

Mike Frysinger (UNITED STATES)

Message: 94384   

 

please count your digits.  i doubt you actually want "0x10000000".

QuoteReplyEditDelete

 

 

2010-10-14 08:59:31     Re: Separating kernel image and u-boot loader in SPI flash

Shyam sundar (INDIA)

Message: 94516   

 

Though I have configured to boot the kernel image from the SPI flash, on power reset

 

I do get the following error

 

MAC:   50:01:50:01:50:01

Hit any key to stop autoboot:  0

No SPI flash selected. Please run `sf probe'

## Booting kernel from Legacy Image at 01000000 ...

  Image Name:   Linux-2.6.28.10-ADI-2009R1.1-svn

  Created:      2010-10-14  10:41:55 UTC

  Image Type:   Blackfin Linux Kernel Image (gzip compressed)

  Data Size:    3102524 Bytes =  3 MB

  Load Address: 00001000

  Entry Point:  00173f5c

  Verifying Checksum ... Bad Data CRC

ERROR: can't get kernel image!

bfin>

 

 

 

To verify that the kernel image loaded into the flash is correct, on power reset I did the following test!

 

Hit any key to stop autoboot:  0

bfin> tftpboot 0x0 uImage

Using Blackfin EMAC device

TFTP from server 10.7.143.46; our IP address is 10.7.143.99

Filename 'uImage'.

Load address: 0x0

Loading: #################################################################

        #################################################################

        #################################################################

        #################

done

Bytes transferred = 3102588 (2f577c hex)

bfin> sf probe 1

SF: Got idcode ef 40 17

Entering wibond probe

8192 KiB W25Q64 at 0:1 is now current device

bfin> sf read 0x1000000 0x32000 0x2f577c

bfin> cmp.b 0x0 0x1000000 0x2f577c

Total of 3102588 bytes were the same

bfin>

 

 

QuoteReplyEditDelete

 

 

2010-10-14 10:15:43     Re: Separating kernel image and u-boot loader in SPI flash

Mike Frysinger (UNITED STATES)

Message: 94518   

 

are you sure your autorun code is actually running 'sf probe' ?  the output you've shown would suggest you havent configured it correctly:

    No SPI flash selected. Please run `sf probe'

QuoteReplyEditDelete

 

 

2010-10-15 00:19:01     Re: Separating kernel image and u-boot loader in SPI flash

Shyam sundar (INDIA)

Message: 94531   

 

Hello Mike,

 

I have included to the sfprobe in the autorun code.This is how I had set

 

bfin>sf write 0x1000000 0x32000 0x2f577c

 

bfin>set sfboot 'sf probe 1; sf read 0x1000000 0x32000  0x2f577c; bootm 0x1000000'

bfin> set bootcmd run sfboot

bfin> save

QuoteReplyEditDelete

 

 

2010-10-15 01:04:59     Re: Separating kernel image and u-boot loader in SPI flash

Mike Frysinger (UNITED STATES)

Message: 94532   

 

that doesnt show your env actually having those settings.  reset the board and verify 'print' shows the right output.

Attachments

    Outcomes