U-boot environment again. It has been a while since last time I handled a u-boot environment! As stupid as this sounds, I forgot a few things, and I had to find out again. The address and size of the environment is dictated by two constants that are part of the platform definition: CONFIG_ENV_ADDR and CONFIG_ENV_SIZE. The environment image can be constructed using the mkenvimage. The tool accepts a '-r' flag (mnemonic: redundant) which is necessary when the produced image is stored in two redundant copies. The format is simple: 4 bytes of CRC, one optional byte defining which of the redunant copies should be booted, and a sequence of key-values pairs. Easily understandable by means of a simple hex dump. Using the '-r' flag will only add the optional redundancy byte. It will not duplicate the data in the image. The resulting image should be copied on the platform, in the two redundant memory areas.