README: Add new NAND env features
PATCH 1/1 README: Add new NAND env features
CONFIG_ENV_SIZE only needs page alignment, not block
Document CONFIG_ENV_RANGE and CONFIG_ENV_OFFSET_OOB.
--- README | 22 +++++++++++++++++++--- 1 files changed, 19 insertions(+), 3 deletions(-)
README +19 -3
@@ -2551,16 +2551,32 @@ to save the current settings. These two #defines specify the offset and size of the environment area within the first NAND device. - - CONFIG_ENV_OFFSET_REDUND + - CONFIG_ENV_OFFSET_REDUND (optional): This setting describes a second storage area of CONFIG_ENV_SIZE size used to hold a redundant copy of the environment data, so that there is a valid backup copy in case there is a power failure during a "saveenv" operation. + - CONFIG_ENV_RANGE (optional): + + Specifies the length of the region in which the environment + can be written. This should be a multiple of the NAND device's + block size. Specifying a range with more erase blocks than + are needed to hold CONFIG_ENV_SIZE allows bad blocks within + the range to be avoided. + + - CONFIG_ENV_OFFSET_OOB (optional): + + Enables support for dynamically retrieving the offset of the + environment from block zero's out-of-band data. The + "nand env.oob" command can be used to record this offset. + Currently, CONFIG_ENV_OFFSET_REDUND is not supported when + using CONFIG_ENV_OFFSET_OOB. + Note: CONFIG_ENV_OFFSET and CONFIG_ENV_OFFSET_REDUND must be aligned - to a block boundary, and CONFIG_ENV_SIZE must be a multiple of - the NAND devices block size. + to an erase block boundary, and CONFIG_ENV_SIZE must be a multiple + of the NAND device's page size. - CONFIG_NAND_ENV_DST
Signature · 1 line
1.7.0.4
PATCH 1/1 README: Add new NAND env features
Quoted 6 lines · Scott Wood
CONFIG_ENV_SIZEonly needs page alignment, not blockDocument
CONFIG_ENV_RANGEandCONFIG_ENV_OFFSET_OOB.Signed-off-by Scott Wood <[email protected]>
Quoted 7 lines
+ ? ? ? -
CONFIG_ENV_OFFSET_OOB(optional):
+
+ ? ? ? ? Enables support for dynamically retrieving the offset of the
+ ? ? ? ? environment from block zero's out-of-band data. ?The
+ ? ? ? ? "nand env.oob" command can be used to record this offset.
+ ? ? ? ? Currently,CONFIG_ENV_OFFSET_REDUNDis not supported when
+ ? ? ? ? usingCONFIG_ENV_OFFSET_OOB.
Looks good (CONFIG_ENV_OFFSET_REDUND + CONFIG_ENV_OFFSET_OOB is on my TODO-list still).
Best Regards,
Ben Gardiner
---
Nanometrics Inc.
http://www.nanometrics.ca
PATCH 1/1 README: Add new NAND env features
In reply to Scott WoodDear Scott Wood,
Quoted 3 lines · In message <[email protected]> you wrote:
CONFIG_ENV_SIZEonly needs page alignment, not blockDocument
CONFIG_ENV_RANGEandCONFIG_ENV_OFFSET_OOB.
I appreciate your efforts, but I think we should also fix the code.
For me it seems important to keep concepts identical no matter which kind of storage device is used. The first implementations of the envrionment used either NOR flash or EEPROMs (I2C or SPI attached) for storage.
Here, CONFIG_ENV_SIZE defines the actually used part of the available storage medium.
For example, on NOR flash we might see an erase block size of 256 KiB (resulting in a "#define CONFIG_ENV_SECT_SIZE (256 << 10)" or similar). But normally we don't need so much space for the environment, so we set CONFIG_ENV_SIZE to (for example) 16 KiB. The advantage is that with this setting the checksum calculation includes only CONFIG_ENV_SIZE, which can be a measurable difference in boot time.
So CONFIG_ENV_SIZE is supposed to mean the actually available size for the envrionment, and there are no alignment or other requirements for it. It is perfectly legal to "#define CONFIG_ENV_SIZE 12345" or similar.
I would like to keep this meaning consistent for other storage types, including NAND. If the current code (mis-) uses CONFIG_ENV_SIZE in a way that needs any form of alignment to the NAND device geometry, this code is broken and should be fixed.
Best regards,
Wolfgang Denk
Signature · 5 lines
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: [email protected] Die ganzen Zahlen hat der liebe Gott geschaffen, alles andere ist Menschenwerk... Leopold Kronecker
PATCH 1/1 README: Add new NAND env features
Quoted 7 lines · On Fri, 17 Sep 2010 22:47:04 +0200 Wolfgang Denk <[email protected]> wrote:
For example, on NOR flash we might see an erase block size of 256 KiB (resulting in a "#define
CONFIG_ENV_SECT_SIZE(256 << 10)" or similar). But normally we don't need so much space for the environment, so we setCONFIG_ENV_SIZEto (for example) 16 KiB. The advantage is that with this setting the checksum calculation includes onlyCONFIG_ENV_SIZE, which can be a measurable difference in boot time.
The largest NAND page size that I'm aware of is 8 KiB (with 2 or 4 KiB currently being more common), so it's not as burdensome a restriction -- and NOR flash doesn't have the concept of a NAND-style page; you can write a word at a time.
However, I was looking at the master branch when I wrote that. I forgot that in my next branch, I have a patch that removes this requirement (there was existing read-modify-write code, but it was blocked by an unnecessary check in nand_do_write_ops). :-)
I'll respin the README patch.
-Scott