colibri-imx7: improve env badblock management
authorFrancesco Dolcini <francesco.dolcini@toradex.com>
Wed, 1 Sep 2021 07:48:03 +0000 (09:48 +0200)
committerStefano Babic <sbabic@denx.de>
Sat, 5 Feb 2022 12:38:38 +0000 (13:38 +0100)
Use the complete 512kb (4 blocks) nand partition reserved for u-boot
environment instead of just the first block, this allows the module
to have a working environment even if 3 blocks are bad.

Signed-off-by: Francesco Dolcini <francesco.dolcini@toradex.com>
include/configs/colibri_imx7.h

index faf27ba..92e24ea 100644 (file)
 #define CONFIG_SYS_INIT_SP_ADDR \
        (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
 
+/* environment organization */
+#if defined(CONFIG_ENV_IS_IN_NAND)
+#define CONFIG_ENV_RANGE       (4 * CONFIG_ENV_SIZE)
+#endif
+
 #ifdef CONFIG_TARGET_COLIBRI_IMX7_NAND
 /* NAND stuff */
 #define CONFIG_SYS_MAX_NAND_DEVICE     1