[U-Boot] skip relocation

Marcel korgull at home.nl
Mon Jan 3 20:41:14 CET 2011


On Monday, January 03, 2011 07:57:33 pm Marcel wrote:
> On Sunday, January 02, 2011 10:08:59 pm Reinhard Meyer wrote:
> > Dear Marcel,
> > 
> > > Dear Reinhard,
> > > 
> > >> Dear Marcel,
> > >> 
> > >>>> Is there any example that boots from NOR ?
> > >> 
> > >> looking at the defines below, you are not really booting u-boot from
> > >> NOR...
> > >> 
> > >>> #define CONFIG_SKIP_LOWLEVEL_INIT
> > >> 
> > >> If you do that, you must have an initial boot code before u-boot. See
> > >> below...
> > >> 
> > >>> #define CONFIG_SKIP_RELOCATE_UBOOT
> > >> 
> > >> Not used anymore.
> > >> 
> > >>> /* SDRAM */
> > >>> #define CONFIG_NR_DRAM_BANKS		1
> > >>> #define PHYS_SDRAM			0x70000000
> > >>> #define PHYS_SDRAM_SIZE			0x08000000	/* 128 megs */
> > >> 
> > >> Those defines have had their names changed.
> > > 
> > > These I have changed already. I think they are fine.
> > > 
> > >>> #define CONFIG_SYS_GBL_DATA_SIZE	128
> > >> 
> > >> This constant is wrong, use the auto-generated value.
> > > 
> > > OK
> > > 
> > >>> /*
> > >>> 
> > >>>    * Size of malloc() pool
> > >>>    */
> > >>> 
> > >>> #define CONFIG_SYS_GBL_DATA_SIZE	128 /* 128 bytes for initial data 
*/
> > >> 
> > >> This constant is wrong, use the auto-generated value.
> > > 
> > > OK
> > > 
> > >>   >  Forgot to mention a few items :
> > >>   >  
> > >>   >  I flash the NOR at address 0x10020000
> > >>   >  TEXT_BASE is 0x10020000
> > >> 
> > >> That really implies you have another boot program running before
> > >> u-boot. Proably AT91 bootstrap? Is it configured to jumo to
> > >> 0x1002000, or does it copy u-boot to some SDRAM address and jumps
> > >> there?
> > > 
> > > Yes I run AT91 bootstrap. Is there a way to skip this ?
> > 
> > Sure, if you put an u-boot *with low level init* at the begin of NOR and
> > wire BMS to start from CS0 NOR.
> > 
> > However I am not sure a functional low level init (in u-bbot) exists
> > (yet) for your board. Even with NOR it is customary to use at91bootstrap
> > which does the hardware including SDRAM init.
> > 
> > If you touch at91bootstrap, configure it such that it either loads u-boot
> > to start of SDRAM and jumps there, or directly jumps to the address in
> > NOR where u-boot is stored. Make sure CONFIG_SYS_TEXT_BASE is correct!
> > 
> > > That's a good question if at91bootstrap jumps to the right address. How
> > > can I tell ? (maybe I find out myself, at least your question got me
> > > thinking ! ) Let's say it does copy u-boot to SDRAM, do I need to set
> > > that address as TEXT_BASE ?
> > 
> > Exactly. CONFIG_SYS_TEXT_BASE must be the address where u-boot is running
> > before relocation. If that address is different, relocation will fail.
> > 
> > > I tried setting TEXT_BASE to 0x10020000 or 0x73f00000
> > > If I use another address, AT91bootstrap doesn't do anything, but at
> > > both of these addresses it behaves the same.
> > 
> > You should have the source of your at91 bootstrap. Without source its
> > near impossible to tell how it is configured.
> > 
> > >> Have a look at the current implementation for top9000 in
> > >> u-boot-arm/master and compare your files to it. Any differences to
> > >> your code that are not board and/or SoC specific probably have to be
> > >> fixed in your board code or you should be able to reason why it must
> > >> be different for your board.
> 
> I did find a couple of addresses in my AT91bootstrap :
> 
>  ******************************************************************* */
> /* BootStrap Settings                                                  */
> /*                                                                     */
> /* ******************************************************************* */
> #define IMG_ADDRESS                 0x20000                        /* Image
> Address in NandFlash */
> #define        IMG_SIZE                0x40000                        /*
> Image Size in NandFlash */
> 
> #define MACH_TYPE                0x86F                        /*
> AT91SAM9G45- EKES */
> #define JUMP_ADDR                0x73F00000                /* Final Jump
> Address */
> 
> 
> I used 0x73f00000 before without success. But I'm very much wondering about
> the comment in this file saying " Image address in NAND flash"
> 
> Could it be that AT91bootstrap is jumping to 0x20000 and than expects
> u-boot to boot from NAND flash instead of SDRAM ?
> 
> I tried to set CONFIG_SYS_TEXT_BASE to both 0x73f00000 and 0x00020000. In
> both case AT91bootstrap starts u-boot but it hangs at relocation.
> 
> I'll first check my board config to see if I find anything strange in
> there.

Great, I've got it to boot.

I have no idea why it suddenly works, but I guess after reviewing my config and 
changing a couple of things one of those things must have been the cause.

CONFIG_SYS_TEXT_BASE is 0x7f300000 which is the final jump address as mentioned 
in AT91bootstrap.

I guess the issue is solved now and I'll certainly check out at91bootstrap to 
create my own low level init in u-boot. It eventually saves time at production 
level I think and I generally like to keep things as simple as possible 
anyways. Since all initialisation code is in at91bootstrap I guess I can just 
move it from there to u-boot (sounds easy, but I guess there's some more to 
it).

Thanks for all the help and I hope at some time in the near future I can 
submit some code for this board. Since I travel a lot it may take some time 
before I can submit something that's clean enough, but if someone is 
interested in my current code I can send it.

Best regards,
Marcel








More information about the U-Boot mailing list