Skip to contentSkip to conversation

How can I boot a program from flash on ML403?

DISCUSSION Lorenz Kolb 2 participants 4 messages Feb 13, 2007 – Feb 15, 2007 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Hi,

I wasted a lot of time making fitting u-boot into the 64K of BRAM, just to see data2mem from EDK 8.1 crashing

Thus my current (dirty) solution is:

Using SREC Bootloader from Xilinx' EDK to load a U-Boot and make U-Boot load Linux both located on flash.
Actually, it is quick and dirty, but it works fine for testing...

Greetings,

Lorenz Kolb

Quoted 3 lines · On Tue, 13 Feb 2007 20:17:00 +0800 [email protected] wrote:

hi, all:

I want to porting u-boot to ML403,but first I should master booting a

common app from flash first.Who can tell how to do that?Any details about u-boot on ML403 is also prefered

Quoted 1 line

Thanks for all your kindness!

#2 lore raw

Sent: Tuesday, February 13, 2007 10:57 AM Lorenz Kolb:

Quoted 3 lines

Thus my current (dirty) solution is:

Using SREC Bootloader from Xilinx' EDK to load a U-Boot and make

U-Boot=20

Quoted 2 lines

load Linux both located on flash.
Actually, it is quick and dirty, but it works fine for testing...

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.

BTW, do you (or anybody) have XTEMAC drivers for ML403 u-boot?

Regards,

Leonid.

#3 lore raw

Hi Leonid,

Quoted 1 line

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.

Actually my partner and I even fitted an u-boot directly into BRAM (if it is loaded via XMD), unfortunately the binutils of ELDK from W. Denk screwed the elf (sections were out of segment) and even after fixing that manually (with a hex editor) data2mem from Xilinx messes something up.

Quoted 1 line

BTW, do you (or anybody) have XTEMAC drivers for ML403 u-boot?

Actually we did not yet focus on that, we currently mount our NFS by placing a small initrd image on flash that loads drivers for opb_ethernet and mounts an nfs volume an chroots to it.

Best Regards,

Lorenz

#4 lore raw

On Wednesday, February 14, 2007 11:12 PM Lorenz Kolb

Quoted 1 line
Quoted 1 line

I use the same scheme (called 3-stage boot) but I don't see what is

dirty

Quoted 1 line
Quoted 1 line

about it. For testing/debugging you even can load u-boot directly

into

Quoted 1 line
Quoted 1 line

memory using XMD. Of course, image must be compiled to run from

memory,=20

Quoted 5 lines
Quoted 1 line

not flash.

actually I call it dirty as SREC is a quite stupid format (for a=20 bootloader,
as it has to be decoded first) and so the loader wastes a lot of time

at

Quoted 1 line

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. =20

Quoted 1 line

Actually my partner and I even fitted an u-boot directly into BRAM (if

it > is loaded via XMD),=20
[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.