[U-Boot] howto get the nand flash enviroment variables inenv_init ?

Scott Wood scottwood at freescale.com
Thu Jun 18 23:45:35 CEST 2009


On Thu, Jun 18, 2009 at 01:42:54PM +0200, Manuel Sahm wrote:
> >>> Guennadi Liakhovetski <lg at denx.de> 18.06.2009 13:23 >>>
> On Thu, 18 Jun 2009, Manuel Sahm wrote:
> 
> > Hello,
> 
> Please, do not top-post.

Also, please use quote markers and trim what you're not immediately
replying to.

> Hello,
> all is inside the NAND flash,
> 
> 0x00000 First Level Bootloader (which loads the UBoot from 0x20000 to RAM and execute it)

I guess this is something other than u-boot's own NAND loader -- that
would complicate any effort to use u-boot's NAND loader to load the
environment.

> 0x20000 UBoot
> 0x60000 UBootEnviroment
> 0x80000 UBoot Enviroment Rendundant
> 
> So have a look at /lib_arm/board.c
> The function nand_init() and env_relocate() sre called too late for the "silent" flag.
> 
> I tried to place the functions nand_init() and env_relocate() into the function env_init(), but that crashes...?

The full NAND subsystem will not work before relocation.

Here are some options (not of equal desireability):
- Switch to using u-boot's NAND loader, and use Guennadi's patch.
- Extend your external NAND loader to do something similar to Guennadi's
patch.
- Use code similar to the NAND loader to fetch the environment into a
cache-locked buffer (or search through it as you read it).
- Embed your environment into the u-boot image.
- Make the console unconditionally silent until after the environment is
read from NAND normally.
- Put NOR on your board. :-)

-Scott


More information about the U-Boot mailing list