summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorFabio Estevam <festevam@gmail.com>2018-11-30 12:52:13 -0200
committerStefano Babic <sbabic@denx.de>2019-01-01 14:12:18 +0100
commit57d2beb91d705bccdfee5e9e5fd267f5e363a100 (patch)
treeac62242005584a9a2288e742c0a7b0849fc6a1bc /include
parentacdf10e17937f4b23fb2613e148caf25aac62c37 (diff)
downloadu-boot-57d2beb91d705bccdfee5e9e5fd267f5e363a100.tar.gz
u-boot-57d2beb91d705bccdfee5e9e5fd267f5e363a100.tar.bz2
u-boot-57d2beb91d705bccdfee5e9e5fd267f5e363a100.zip
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. Signed-off-by: Fabio Estevam <festevam@gmail.com> Acked-by: Otavio Salvador <otavio@ossystems.com.br>
Diffstat (limited to 'include')
-rw-r--r--include/configs/pico-imx7d.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/include/configs/pico-imx7d.h b/include/configs/pico-imx7d.h
index 2bc42a04a0..1884c5844d 100644
--- a/include/configs/pico-imx7d.h
+++ b/include/configs/pico-imx7d.h
@@ -134,7 +134,19 @@
/* FLASH and environment organization */
#define CONFIG_ENV_SIZE SZ_8K
-#define CONFIG_ENV_OFFSET (8 * SZ_64K)
+/* Environment starts at 768k = 768 * 1024 = 786432 */
+#define CONFIG_ENV_OFFSET 786432
+/*
+ * Detect overlap between U-Boot image and environment area in build-time
+ *
+ * CONFIG_BOARD_SIZE_LIMIT = CONFIG_ENV_OFFSET - u-boot.img offset
+ * CONFIG_BOARD_SIZE_LIMIT = 768k - 69k = 699k = 715776
+ *
+ * Currently CONFIG_BOARD_SIZE_LIMIT does not handle expressions, so
+ * write the direct value here
+ */
+#define CONFIG_BOARD_SIZE_LIMIT 715776
+
#define CONFIG_SYS_FSL_USDHC_NUM 2
#define CONFIG_SYS_MMC_ENV_DEV 0