2009-09-23 12:59:48     trouble understanding U-boot

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

2009-09-23 12:59:48     trouble understanding U-boot

Mario Valenta (UNITED STATES)

Message: 80313   

 

I programmed my blackfin 561EZkit with the bypass mode using jtag programmer and when rebooting I get the U-boot splash screen OK.

 

From reading the docs, it says it should now execute code at 0x2000 0000 on power up (when bypass mode).

 

I have been able to get the precompiled uClinux kernel ("uImage_BF561-EZKIT" from the files section) to boot by loading it over serial port ('loadb'... default 0x1000 000 address...  then in kermit 'send').  then running 'bootm' at the u-boot prompt boots linux OK.

 

now.. my first problem:

 

My end goal here is to have linux boot automatically on power up.  If i remove power to the board, I cannot boot linux anymore.  That is, it appears I'm not programming this into resident memory, but perhaps SDRAM.  A look at the dev kits memory map tells me that SDRAM address is 0x0000 0000 to 0x03FF FFFF.  Flash is 0x2000 0000 to 0x207F FFFF

 

So if I want to make linux boot on power up, it seems I would need to program the image file into the flash space (ie 0x20000000)

 

so I had tried 'loadb 0x20000000' , transfer image file, then 'bootm' but then i get "ERROR: can't get kernel image!"

 

Am I doing something obviously wrong here?

 

My second problem is that I can't get my own compiled kernel to run unlike the image file I downloaded separately.  I suspect my first problem mentioned above has something to do with it and by figuring out that one my 2nd problem may resolve itself.

 

QuoteReplyEditDelete

 

 

2009-09-23 13:06:38     Re: trouble understanding U-boot

Mike Frysinger (UNITED STATES)

Message: 80314   

 

please read the documentation:

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

QuoteReplyEditDelete

 

 

2009-09-23 13:38:31     Re: trouble understanding U-boot

Mario Valenta (UNITED STATES)

Message: 80315   

 

Where does one find the board header file? 

QuoteReplyEditDelete

 

 

2009-09-23 13:40:16     Re: trouble understanding U-boot

Mike Frysinger (UNITED STATES)

Message: 80316   

 

there should be no need for you to rebuild things if you're using a stock bf561-ezkit and the precompiled images

QuoteReplyEditDelete

 

 

2009-09-23 13:57:57     Re: trouble understanding U-boot

Mario Valenta (UNITED STATES)

Message: 80317   

 

my end goal here is to teach myself how to compile my own customized kernel  and make it bootable as well.  This is why I am reading thru documentation, asking questions and trying to learn.

 

I will focus on the precompiled image for now so suppose I would like to get this to boot linux on startup automatically.  Am I correct to loadb at 0x2000 0000?  I did a flinfo and I can see the sectors, with the first few as Read Only (RO)

 

I anticipated that someone would tell me to RTFM so, the document link you posted I have read multiple times prior to asking my question.  It explains how you erase/modify/write protect sectors but does not describe what i'm trying to do - boot from flash rather than me having to manually type 'bootm' after transferring the image file over serial port. 

 

by me writing the image to 0x2000 0000 am I not writing the image to flash?  and if I am, why when I type 'bootm' is it failing to find the image?

QuoteReplyEditDelete

 

 

2009-09-23 14:21:15     Re: trouble understanding U-boot

Mike Frysinger (UNITED STATES)

Message: 80318   

 

trying to build linux doesnt mean you need to build u-boot at all.  there is no reason you would need to look at the u-boot source based on what you've said.

 

the documentation tells you how to program flash.  it doesnt tell you to try to use loadb and load it directly into flash.

 

if you go writing to the beginning of flash, then where is u-boot supposed to live ?  u-boot by default takes up the first few sectors (the ones marked RO by default).

 

if you want to change the commands that automatically get run, then modify your environment.

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

QuoteReplyEditDelete

 

 

2009-09-23 14:45:10     Re: trouble understanding U-boot

Mario Valenta (UNITED STATES)

Message: 80319   

 

wasn't trying to or intending to recompile u-boot (or view its source code).  only the linux kernel, sorry if that wasn't clear.

 

So I can transfer the image file to the SDRAM (for example, at default 0x1000 0000) and then copy data to flash being sure not to overwrite the first secrors where U-boot resides?

QuoteReplyEditDelete

 

 

2009-09-23 15:24:00     Re: trouble understanding U-boot

Mike Frysinger (UNITED STATES)

Message: 80320   

 

you asked "Where does one find the board header file?".  that question only applies to the u-boot source and implies trying to rebuild u-boot.

 

at any rate, what you describe sounds fine.

QuoteReplyEditDelete

 

 

2009-09-24 09:32:12     Re: trouble understanding U-boot

Mario Valenta (UNITED STATES)

Message: 80379   

 

when I check flinfo, here is my output:

 

 

 

bfin> flinfo

 

Bank # 1: CFI conformant FLASH (16 x 16)  Size: 8 MB in 135 Sectors

  AMD Standard command set, Manufacturer ID: 0x20, Device ID: 0x22ED

  Erase timeout: 8192 ms, write timeout: 1 ms

  Buffer write timeout: 1 ms, buffer size: 16 bytes

 

  Sector Start Addresses:

  20000000   RO   20002000   RO   20004000   RO   20006000   RO   20008000   RO

  2000A000   RO   2000C000   RO   2000E000   RO   20010000   RO   20020000   RO

  20030000   RO   20040000        20050000        20060000        20070000    

  20080000        20090000        200A0000        200B0000        200C0000    

  200D0000        200E0000        200F0000        20100000        20110000    

  20120000        20130000        20140000        20150000        20160000    

  20170000        20180000        20190000        201A0000        201B0000    

  201C0000        201D0000        201E0000        201F0000        20200000    

  20210000        20220000        20230000        20240000        20250000    

  20260000        20270000        20280000        20290000        202A0000    

  202B0000        202C0000        202D0000        202E0000        202F0000    

  20300000        20310000        20320000        20330000        20340000    

  20350000        20360000        20370000        20380000        20390000    

  203A0000        203B0000        203C0000        203D0000        203E0000    

  203F0000        20400000        20410000        20420000        20430000    

  20440000        20450000        20460000        20470000        20480000    

  20490000        204A0000        204B0000        204C0000        204D0000    

  204E0000        204F0000        20500000        20510000        20520000    

  20530000        20540000        20550000        20560000        20570000    

  20580000        20590000        205A0000        205B0000        205C0000    

  205D0000        205E0000        205F0000        20600000        20610000    

  20620000        20630000        20640000        20650000        20660000    

  20670000        20680000        20690000        206A0000        206B0000    

  206C0000        206D0000        206E0000        206F0000        20700000    

  20710000        20720000        20730000        20740000        20750000    

  20760000        20770000        20780000        20790000        207A0000    

  207B0000        207C0000        207D0000        207E0000        207F0000    

bfin>

 

 

So, is it safe to copy data from SRAM into the flash starting at 20040000?  In other words, will I accidentally overwrite u-boot program data?  I'm assuming the critical u-boot data is in 0x20000000-0x20030000 (marked as Read Only)

 

My visualDSP++ demo license (which I used to program the BF561EZKIT for bypass and start this wonderful journey) expired and I cannot re-program the board using my JTAG programmer now,  so I don't want to accidentally over-write u-boot sector data as there is no going back at this point.

QuoteReplyEditDelete

 

 

2009-09-24 11:05:48     Re: trouble understanding U-boot

Mike Frysinger (UNITED STATES)

Message: 80388   

 

it's simple -- how big was the u-boot file you d/l-ed ?  that's how much space it took up in flash.

 

if you want to be extra sure, then dont stick the kernel image right after u-boot.  it isnt like you're hurting for flash space on the bf561-ezkit -- there's tons of flash on those boards.

QuoteReplyEditDelete

 

 

2009-09-30 10:53:13     Re: trouble understanding U-boot

Mario Valenta (UNITED STATES)

Message: 80715   

 

got it to boot via flash.  thanks for the tips

Attachments

    Outcomes