[U-Boot] NAND bad environment block handling

David.Kondrad at onqlegrand.com David.Kondrad at onqlegrand.com
Tue Jan 13 15:55:38 CET 2009


Greetings,

I have to agree with Wolfgang.

You should be fine as long as you use multiple blocks per environment range
and use redundant environments.
These are two separate things that both need to be enabled.

Here's the setup that's working good for us.
I tested it by simulating bad blocks with 'nand markbad'.

Davinci DM6441 custom board, 64M small page nand (samsung I believe)

BLOCK
0         Reserved
1-5     TI UBL
2-31   UBoot (redundant copies that new TI UBL supports)
32-35 ENV 1
36-39 ENV 2
...

I didn't list the whole partition table, but we have two copies of every
thing in field update purposes.

Our environment is configured for 16K (1 erase block) with a 64K (4 block)
range.
We use JFFS2 for the rootfs, although as Wolfgang said, UBIFS is much
preferred if your kernel is new enough.

One thing you need to keep in mind is that if you want both copies of your
env. to always match, you need to do:
UBoot> saveenv && saveenv

The environment save does a ping-pong between redundant environments,
presumably for wear leveling.

Regards,
David

DAVID A. KONDRAD
Software Design Engineer
On-Q/Legrand
Telephone (800) 321-2343 x311
www.onqlegrand.com



More information about the U-Boot mailing list