How can I boot a program from flash on ML403?

Leonid Leonid at a-k-a.net
Fri Feb 16 02:55:05 EST 2007


On Wednesday, February 14, 2007 11:12 PM Lorenz Kolb
> > I use the same scheme (called 3-stage boot) but I don't see what is
dirty
> > about it. For testing/debugging you even can load u-boot directly
into
> > memory using XMD. Of course, image must be compiled to run from
memory, 
> > not flash.

> actually I call it dirty as SREC is a quite stupid format (for a 
> bootloader,
> as it has to be decoded first) and so the loader wastes a lot of time
at
> least for productive use we do not want this three stage boot.
[Leonid] When I use "3-stage boot" name I actually don't mean that SREC
format used in production. This is too slow indeed. Here how it works
for me:
- u-boot is ALWAYS compiled to run directly from RAM. You can place it
on flash using JTAG or u-boot itself on later stage (see below).
Compilation results include binary (for flash burning), ELF and SREC
files.
- Early boot (tiny BRAM based program) wakes up, checks whether u-boot
presents on the flash (can be different criteria) or wait for some input
or read some config to know where pick up u-boot from. If it's on the
flash already, early boot copies u-boot to RAM and launches it,
otherwise waits for SREC file to be sent via serial interface, copies it
into RAM and starts.
- u-boot does the rest of job (linux boot, etc...). On this stage you
can use u-boot to program u-boot image (compiled to run from RAM) onto
the flash for next reboot.

This scheme works perfectly for ARM, Xilinx and actually is a good
choice for any architecture where CPU itself fetches boot code from boot
location into memory (ARM) or code can reside in RAM from the very
beginning (FPGA with soft/hard CPU cores). In traditional approach (with
relocation) u-boot kind of contains both functionalities which probably
best choice for traditional PPC boards.  

> Actually my partner and I even fitted an u-boot directly into BRAM (if
it > is loaded via XMD), 
[Leonid] I also use XMD but load u-boot ELF directly to RAM. Early boot
is not used in this setup and this is quickest and most convenient way
for debug.

Best Regards,

Leonid.




More information about the Linuxppc-embedded mailing list