[U-Boot-Users] precious boot sectors @ lowboot

Andre Schwarz andre.schwarz at matrix-vision.de
Fri Apr 21 14:01:00 CEST 2006

Hi all,

a lot of embedded systems have no other non-volatile memory than the boot 
flash. This is mostly Nor technology, which is quite expensive.

In case you are not using a uniform sector flash you'll have smaller "boot 
sectors" on top or bottom of memory. They are ideally suited for storing 
small amounts of data (counting operation time, stats or some application 
specific configuration data). Using a large sector, e.g. 64k would be a 
waste ...

I've the following scenario :

MPC5200 processor using low boot, i.e. reset vector @ 0x00000100.
8MB bottom boot sector flash with 8*8k sectors + 127*64k.

u-boot startup code uses the first 2 sectors, followed by the 8k embedded 
environment @ 0x8000. After that follows the rest of u-boot code.

It would be very fine if there would be a possibility to place the rest of 
u-boot code @ offset 0x10000, i.e. sector 8+.

I have modified "common/environment.c" with the attached patch, so there is a 
possibility to define "CFG_ENV_ADD_SPACE" which results in the above 
mentioned code offset. Of course "CFG_ENV_ADD_SPACE" must end on a sector 
boundary ....
I'm using 0x4000 and therefore having 2 small sectors availabe under linux 
through /dev/mtd. Nested partitions are no problem at all.

Any other ideas ?
Should I use u-boot.lds instead ?

diff --git a/common/environment.c b/common/environment.c
index c7f54c6..dc8c89c 100644
--- a/common/environment.c
+++ b/common/environment.c
@@ -99,6 +99,10 @@ #if !defined(ENV_CRC)
 #  define ENV_CRC      ~0

+unsigned char env_add_space[CFG_ENV_ADD_SPACE] __PPCENV__;
 env_t environment __PPCENV__ = {
        ENV_CRC,        /* CRC Sum */


More information about the U-Boot mailing list