[U-Boot-Users] Re: Environment in flash rather than EEProm

Wolfgang Denk wd at denx.de
Fri Jan 28 22:00:33 CET 2005


In message <ctafbf$m30$1 at sea.gmane.org> you wrote:
> 
> Is the below recipe the way to put the environment in flash?

Obviously not - as it doesn't work.

> I can't seem to find any other instructions on this...

There are lots of working board config files.

> > I'm using a PPChameleonEVB, and am trying to move the u-boot environment
> > into flash. I've modified the include/configs/PPChameleon.h file as follows:

This  statement  is  bogus.  In  the  default  configuration  of  the
PPChameleonEVB  board,  the envrionment _is_ already in flash, and no
changes are needed at all.

> > #define CFG_ENV_IS_IN_FLASH	1

OK.

> > #define CFG_ENV_ADDR		0xFFFFA000
> > #define CFG_ENV_OFFSET		(CFG_ENV_ADDR - 0xFFFC0000)

This is  redundand  and  extremely  bad  style.  Why  don't  you  use
CFG_FLASH_BASE instead of the hardwired "magic" constant?

> > #define CFG_ENV_SIZE		0x2000


I really don't understand why you don't just  look  at  the  existing
source code and use this. It reads ("include/configs/PPChameleonEVB.h"):

    381 #define CFG_ENV_IS_IN_FLASH     1       /* use FLASH for environment vars */
    382 #define CFG_ENV_ADDR            0xFFFF8000      /* environment starts at the first small sector */
    383 #define CFG_ENV_SECT_SIZE       0x2000  /* 8196 bytes may be used for env vars*/
    384 #define CFG_ENV_ADDR_REDUND     0xFFFFA000
    385 #define CFG_ENV_SIZE_REDUND     0x2000




Best regards,

Wolfgang Denk

-- 
Software Engineering:  Embedded and Realtime Systems,  Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
You can't evaluate a man by logic alone.
	-- McCoy, "I, Mudd", stardate 4513.3




More information about the U-Boot mailing list