[U-Boot-Users] U-Boot environment for NAND booting scheme

Hi:
If CPU boot from NAND (at least for AMCC Sequoia board) u-boot environment is part of u-boot image itself, see extraction from sequia.h file:
#ifdef CFG_ENV_IS_IN_NAND /* * For NAND booting the environment is embedded in the U-Boot image. Please take * look at the file board/amcc/sequoia/u-boot-nand.lds for details. */ #define CFG_ENV_SIZE CFG_NAND_BLOCK_SIZE #define CFG_ENV_OFFSET (CFG_NAND_U_BOOT_OFFS + CFG_ENV_SIZE) #define CFG_ENV_OFFSET_REDUND (CFG_ENV_OFFSET + CFG_ENV_SIZE) #endif
Such layout supported by u-boot-nand.lds as comment suggests:
/* WARNING - the following is hand-optimized to fit within */ /* the sector layout of our flash chips! XXX FIXME XXX */
cpu/ppc4xx/start.o (.text)
/* Align to next NAND block */ . = ALIGN(0x4000); common/environment.o (.ppcenv) /* Keep some space here for redundant env and potential bad env blocks */ . = ALIGN(0x10000);
The problem is that any time u-boot image is updated, its environment is lost which is not convenient if the environment differs from default one significantly.
Can I put environment elsewhere on NAND flash and what is bad in doing so?
Thanks,
Leonid.

Leonid,
-----Original Message----- From: u-boot-users-bounces@lists.sourceforge.net [mailto:u-boot-users- bounces@lists.sourceforge.net] On Behalf Of Leonid Sent: Thursday, May 01, 2008 1:05 PM To: u-boot-users@lists.sourceforge.net Subject: [U-Boot-Users] U-Boot environment for NAND booting scheme
The problem is that any time u-boot image is updated, its environment
is
lost which is not convenient if the environment differs from default
one
significantly.
One approach from what we did on OMAP: since the smallest erase unit on NAND is a block, reserve as many blocks required to store U-Boot, the Env gets a block of it's own. And the rest go for kernel and Filesystem. So, we can update u-boot without loosing env vars, and env vars without loosing u-boot etc.
Can I put environment elsewhere on NAND flash and what is bad in doing so?
Other than loosing a bit of space, I don't see any as long as u would like to organize them as per your need - e.g. if the board is never going to have env vars change you can save space and not allot one full block for it. It is really usecase driven IMHO.
Regards, Nishanth Menon

Hi, Nishanth:
Thank you for advice. Is any <board.h> and board/<vendor>/<board>/u-boot-nand.lds files available which support such and option in u-boot tree (I use 1.2.0) or any other place or you can send me example?
Thanks,
Leonid.
-----Original Message----- From: Menon, Nishanth [mailto:x0nishan@ti.com] Sent: Thursday, May 01, 2008 11:14 AM To: Leonid; u-boot-users@lists.sourceforge.net Subject: RE: [U-Boot-Users] U-Boot environment for NAND booting scheme
Leonid,
-----Original Message----- From: u-boot-users-bounces@lists.sourceforge.net [mailto:u-boot-users-
bounces@lists.sourceforge.net] On Behalf Of Leonid Sent: Thursday, May 01, 2008 1:05 PM To: u-boot-users@lists.sourceforge.net Subject: [U-Boot-Users] U-Boot environment for NAND booting scheme
The problem is that any time u-boot image is updated, its environment
is
lost which is not convenient if the environment differs from default
one
significantly.
One approach from what we did on OMAP: since the smallest erase unit on NAND is a block, reserve as many blocks required to store U-Boot, the Env gets a block of it's own. And the rest go for kernel and Filesystem. So, we can update u-boot without loosing env vars, and env vars without loosing u-boot etc.
Can I put environment elsewhere on NAND flash and what is bad in doing
so?
Other than loosing a bit of space, I don't see any as long as u would like to organize them as per your need - e.g. if the board is never going to have env vars change you can save space and not allot one full block for it. It is really usecase driven IMHO.
Regards, Nishanth Menon

Leonid,
-----Original Message----- From: Leonid [mailto:Leonid@a-k-a.net] Sent: Thursday, May 01, 2008 1:55 PM To: Menon, Nishanth; u-boot-users@lists.sourceforge.net Subject: RE: [U-Boot-Users] U-Boot environment for NAND booting scheme
Thank you for advice. Is any <board.h> and board/<vendor>/<board>/u-boot-nand.lds files available which support such and option in u-boot tree (I use 1.2.0) or any other place or you can send me example?
OMAP does a 3 stage boot(due to the nature of our SOC): x-loader (as we call it, but really a customized u-boot), loads u-boot which finally loads kernel. Our code unfortunately is not in wdenk's mainline tree yet. Our version for various OMAPs can be found here: http://linux.omap.com/pub/bootloader/ ->U-Boot http://linux.omap.com/pub/xloader/ -> x-loader.
Regards, Nishanth Menon

In message 406A31B117F2734987636D6CCC93EE3C036C5341@ehost011-3.exch011.intermedia.net you wrote:
The problem is that any time u-boot image is updated, its environment is lost which is not convenient if the environment differs from default one significantly.
In which way is this a problem? Just run a "saveenv" each time after you update the U-Boot image.
Best regards,
Wolfgang Denk

Hi, Wolfgang:
This brilliant idea didn't occur to me, thank you very much! It will definitely resolve my current issue. I'll try.
Thanks,
Leonid.
-----Original Message----- From: wd@denx.de [mailto:wd@denx.de] Sent: Thursday, May 01, 2008 12:00 PM To: Leonid Cc: u-boot-users@lists.sourceforge.net Subject: Re: [U-Boot-Users] U-Boot environment for NAND booting scheme
In message <406A31B117F2734987636D6CCC93EE3C036C5341@ehost011-3.exch011.intermedia. net> you wrote:
The problem is that any time u-boot image is updated, its environment is lost which is not convenient if the environment differs from default one significantly.
In which way is this a problem? Just run a "saveenv" each time after you update the U-Boot image.
Best regards,
Wolfgang Denk

It works perfectly if I upgrade NAND u-boot image while running from NAND. However if I happen to upgrade NAND image while running from NOR, saveenv won't help. Minor issue of course...
Leonid.
-----Original Message----- From: u-boot-users-bounces@lists.sourceforge.net [mailto:u-boot-users-bounces@lists.sourceforge.net] On Behalf Of Leonid Sent: Thursday, May 01, 2008 12:07 PM To: wd@denx.de Cc: u-boot-users@lists.sourceforge.net Subject: Re: [U-Boot-Users] U-Boot environment for NAND booting scheme
Hi, Wolfgang:
This brilliant idea didn't occur to me, thank you very much! It will definitely resolve my current issue. I'll try.
Thanks,
Leonid.
-----Original Message----- From: wd@denx.de [mailto:wd@denx.de] Sent: Thursday, May 01, 2008 12:00 PM To: Leonid Cc: u-boot-users@lists.sourceforge.net Subject: Re: [U-Boot-Users] U-Boot environment for NAND booting scheme
In message <406A31B117F2734987636D6CCC93EE3C036C5341@ehost011-3.exch011.intermedia. net> you wrote:
The problem is that any time u-boot image is updated, its environment is lost which is not convenient if the environment differs from default one significantly.
In which way is this a problem? Just run a "saveenv" each time after you update the U-Boot image.
Best regards,
Wolfgang Denk
participants (3)
-
Leonid
-
Menon, Nishanth
-
Wolfgang Denk