
Dear Scott Wood,
In message 20100917194327.GA17192@udp111988uds.am.freescale.net you wrote:
CONFIG_ENV_SIZE only needs page alignment, not block
Document CONFIG_ENV_RANGE and CONFIG_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