[U-Boot-Users] Re: U-Boot Boot Sequence

Martin Winistörfer martinwinistoerfer at gmx.ch
Mon Jan 13 13:34:09 CET 2003


Hi,

> > Since most MPC8xx and MPCxx both start executing at adress 0x100 there
> 
> This is not necessarily true. It may be 0xFFF00100 as well, depending
> on the HRCW...
> 

This is true but lets assume we start from 0x100.

> > What I dont understand is, that the label _start (In cpu/mpc8xx/start.S)
> > will be placed to the runtime
> > adress 0x100, but resides in the .text section which according to the
> linker
> > file 
> > (take as example board/cogent/u-boot.lds)  wont probably start at
> adresse
> > 0x100
> > in the image. The .text section is located after the .interp section.
> 
> See the README.

I've already looked. Here is a part:

> System Initialization:
> ----------------------
> In the reset configuration, U-Boot starts at the reset entry point
> (on most PowerPC systens at address 0x00000100). Because of the reset
> configuration for CS0# this is a mirror of the onboard Flash memory.
> To be able to re-map memory U-Boot then jumps to it's link address.

What means link adress exactly? Run-Time adresses to RAM?

On MPC5xx processors CS0 belongs to the external flash memory. You either
set RCW to boot from external (CS0 asserted) or internal (onboard) flash.
But anyway whether to boot from, at adress 0x100 must be the the _start
label located. How (or where) do you set the _start label to this adress
in U-Boot image?

The other question was why to jump to the in_flash label? Following
some subparts from the mailinglist thread "why jump at absolute
address in start.S":


> CFG_MONITOR_BASE is the physical address where you want the boot device to
> reside. It will be used to program the memory controller registers which
> select the boot device (OR0/BR0). As soon as the mask in OR0 is programmed
> correctly, the boot device will disappear from the entire address space,
and
> be accessible only at the base address programmed in BR0.
 
>This code jumps to the address that the boot device will appear at after
you
>program the memory controller registers, so that the boot device will not
>disappear out from underneath you.
 
When I look what happens before the jump to the in_flash label, I see,
that there no BRx or ORx have been set. Actually we still running, still
the flash is mirrored over the whole adress space. 

Anyway, what important is, are the following statments true:

1) We, for instance, burn U-Boot image to external flash
2) and start at adress 0x100. 
3) Because code is relocatable, you can start executing where you like, for
instance
    on adress X, depending on your processor. 
4) You simply must ensure _start is at your entry point 

-> How is this done on the MPC8xx, since _start will be in .text and .text
    following .interp in the flash image?

5) Since we procced executing from _start in flash,

-> why to jump to in_flash as already been mentioned? 

> Because the code is relocatable you can jump to any address you like - as
> long as the offset within the boot device is correct. "_start" is the
address
> where the CPU will "start" execution - i.e. the hard reset vector.
"in_flash"
> is where we want to continue execution after the jump (its the next
instruction
> after the "blr" above - THEREFORE THIS REALLY ISN'T A JUMP BECAUSE YOU
SIMPLY
> EXECUTE THE NEXT INSTRUCTION). EXC_OFF_SYS_RESET is added because we need
the
> address to be relative to the start of the boot device, not the hard reset
> vector.
 

Best regards, Martin 



-- 
+++ GMX - Mail, Messaging & more  http://www.gmx.net +++
NEU: Mit GMX ins Internet. Rund um die Uhr für 1 ct/ Min. surfen!





More information about the U-Boot mailing list