2009-03-26 14:50:11     Question about generating LDR file for custom u-boot

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

2009-03-26 14:50:11     Question about generating LDR file for custom u-boot

Jay Ku (UNITED STATES)

Message: 71623   

 

I can now load my custom board-specific u-boot into SDRAM and read-write to my SPI flash.  Now I'd like to program u-boot into the SPI flash so the board will start up on its own.  I understand bfin-elf-ldr will generate this file, and there's some description here

 

http://docs.blackfin.uclinux.org/doku.php?id=toolchain:ldr-utils&s=ldr%20files

 

but I still have some questions.

 

When I'm loading u-boot into SDRAM via my JTAG adapter, I first have to run a small initialization program (which can be found here http://docs.blackfin.uclinux.org/doku.php?id=bootloaders:u-boot:debugging#initcode).  This sets up the low-level stuff on my chip before I can load and run u-boot.  Most of the work happens in initcode().

 

When I use bfin-elf-ldr to generate the LDR file it would have to put something like my init.elf in there before u-boot (which, being built with CONFIG_BFIN_BOOT_MODE = BFIN_BOOT_SPI_MASTER, never calls initcode).  How does it do this?  The LDR web page isn't very clear.  When I do this:

 

$ bfin-elf-ldr -T bf532 -c  u-boot.ldr init.elf u-boot --bmode 3

 

And I write u-boot.ldr into flash, it loads init.elf and that runs (I get some output on the console), but u-boot never runs.

 

thanks, Jay

QuoteReplyEditDelete

 

 

2009-03-26 15:25:14     Re: Question about generating LDR file for custom u-boot

Mike Frysinger (UNITED STATES)

Message: 71628   

 

i really havent tested feeding multiple ELFs into ldr utils since there hasnt been a use case yet

 

what you're doing also wont work ... the LDR wont flag any of the blocks as init blocks so the bootrom will load all blocks (including ones into external memory) before attempting to execute any code.

 

why doesnt the normal LDR the u-boot build process produces work ?

QuoteReplyEditDelete

 

 

2009-03-26 15:43:27     Re: Question about generating LDR file for custom u-boot

Jay Ku (UNITED STATES)

Message: 71630   

 

Mike,

 

Now I feel pretty dumb... I didn't even notice the .LDR file sitting there.  Anyway all seems to work fine now (booting from flash, etc).

 

Thanks a lot.

 

- jay

QuoteReplyEditDelete

 

 

2009-03-26 15:48:45     Re: Question about generating LDR file for custom u-boot

Mike Frysinger (UNITED STATES)

Message: 71631   

 

np ... glad it worked

Attachments

    Outcomes