[U-Boot] u-boot NAND memory use

Hi.
I have a board which I am using Uboot on. Arm9, nand flash, etc.
Currently the board has the uboot image and the ENV in one partition, size 0x00200000.
I would like to make another partition for the ENV so that if I have to upgrade Uboot I don't lose my ENV.
What size does the partition have to be?
And where in the Uboot code do I change the memory location and size for the env so I can rebuild Uboot and start using a new ENV partition?
I have eldk set up on my Linux VM and have received our current Uboot project modded for our target. I have successfully built a duplicate of and re-flashed the Uboot I'm currently running on my target card so I know I'm good to go as far as building and deploying.
Another side question is about FW_print/set/saveenv. We are running Linux on this board and would like to mod the ENV from Linux for network config changes? Is this the best way to do it? I'm assuming once I know where my ENV lives I would just put that in the config file for FW_printenv.
Hopefully my questions are not too rudimentary.
Regards,
Michael Galime

On Mon, 4 Oct 2010 14:41:55 -0400 Michael Galime mgalime@datacomsystems.com wrote:
Hi.
I have a board which I am using Uboot on. Arm9, nand flash, etc.
Currently the board has the uboot image and the ENV in one partition, size 0x00200000.
I would like to make another partition for the ENV so that if I have to upgrade Uboot I don't lose my ENV.
What size does the partition have to be?
At a minimum, one block, so you can erase it independently of everything else.
You may want to use CONFIG_ENV_RANGE to assign multiple blocks in case one of the blocks is bad, or you may want to use the env.oob mechanism to dynamically choose a good block for the environment when each board's NAND is first programmed (but be aware that you'll have to run "nand env.oob" again whenever you reflash block zero).
And where in the Uboot code do I change the memory location and size for the env so I can rebuild Uboot and start using a new ENV partition?
Assuming you mean the location in NAND flash, and not in memory, look in your board config header file. You should find CONFIG_ENV_OFFSET, CONFIG_ENV_SIZE, etc.
-Scott
participants (2)
-
Michael Galime
-
Scott Wood