Skip to contentSkip to conversation

pico-imx7d: Increase the CONFIG_ENV_OFFSET size

PATCH Superseded Fabio Estevam 1 participant 1 message Nov 30, 2018 Arm i.MX and Layerscape

v3 of 5 Superseded Latest is v5 →

lore
Share & tools
lore

Fabio Estevam

author reviewer
#0 lore raw

PATCH v3 1/1 pico-imx7d: Increase the CONFIG_ENV_OFFSET size

U-Boot binary has grown in such a way that it goes beyond the reserved area for the environment variables.

Running "saveenv" causes U-Boot to hang because of this overlap.

Fix this problem by increasing the CONFIG_ENV_OFFSET size.

Also, in order to prevent this same problem in the future, use CONFIG_BOARD_SIZE_LIMIT, which will detect the overlap in build-time.

CONFIG_BOARD_SIZE_LIMIT does not accept math expressions, so declare CONFIG_ENV_OFFSET with its direct value instead.

---
Changes since v2:
- Use CONFIG_BOARD_SIZE_LIMIT (Stefan)

 include/configs/pico-imx7d.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
include/configs/pico-imx7d.h +4 -1
index 2bc42a0..25b1a51 100644
@@ -134,7 +134,10 @@
 /* FLASH and environment organization */
 #define CONFIG_ENV_SIZE			SZ_8K
 
-#define CONFIG_ENV_OFFSET			(8 * SZ_64K)
+#define CONFIG_ENV_OFFSET		786432
+/* Detect overlap between U-Boot image and environment area in build-time */
+#define CONFIG_BOARD_SIZE_LIMIT		CONFIG_ENV_OFFSET
+
 #define CONFIG_SYS_FSL_USDHC_NUM		2
 
 #define CONFIG_SYS_MMC_ENV_DEV			0
Signature · 1 line
2.7.4