[U-Boot-Users] [SOLVED] How to support multiple flash sizes ?

Laurent Pinchart laurent.pinchart at tbox.biz
Tue May 9 15:07:48 CEST 2006


Hi Wolfgang,

I found out what was wrong with my understanding of the memory mapping.

U-Boot is compiled as position independent code, and jumps to it's link 
address a few instructions after _start. This means TEXT_BASE can be defined 
to anything, as long as

1) TEXT_BASE (which is equal to CFG_MONITOR_BASE for ROM-based boot) is 
located in the flash reset mapping, as defined by HRCW[BMS] (low memory or 
high memory). U-Boot clears OR0[SDAM] and OR0[LSDAM] before jumping to the 
link address, so this might not even be required (not sure about high memory 
boot, as BR0[BA] is not modified).

2) the U-Boot image stored in flash is accessible at the processor initial 
interrupt prefix, as defined by HRCW[CIP] (0x00000000 for low memory boot, 
0xFFF00000 for high memory boot). This means that TEXT_BASE must be equal to 
[0x00000000|0xFFF00000], both modulus flash size (another option would be to 
store two copies of U-Boot in flash, one at TEXT_BASE and the other at 
0x00000000|0xFFF00000, but that would just be a waste of space).

3) the hard reset configuration word, stored at TEXT_BASE in the U-Boot image, 
is located at the beginning of the flash. This is always the case for low 
memory boot, as TEXT_BASE must be equal to 0x00000000 (both modulus flash 
size). For high memory boot the problem can be solved by programming a copy 
of the hard reset configuration word in the first flash sector (is there 
another way ?).

This explanation is of course for reference purpose, I'm not teaching you 
anything you don't already know.

Thank you for your help, and best regards.

Laurent Pinchart




More information about the U-Boot mailing list