All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v4] pico-imx7d: Increase the CONFIG_ENV_OFFSET size
@ 2018-11-30 14:52 Fabio Estevam
  2018-11-30 15:17 ` Otavio Salvador
                   ` (2 more replies)
  0 siblings, 3 replies; 42+ messages in thread
From: Fabio Estevam @ 2018-11-30 14:52 UTC (permalink / raw)
  To: u-boot

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>
---
Changes since v3:
- Take the 69k u-boot.img offset into account when calculating
CONFIG_BOARD_SIZE_LIMIT (Wolfgang)

 include/configs/pico-imx7d.h | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/include/configs/pico-imx7d.h b/include/configs/pico-imx7d.h
index 2bc42a0..06ede3f 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
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 42+ messages in thread

end of thread, other threads:[~2019-03-15 10:13 UTC | newest]

Thread overview: 42+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-30 14:52 [U-Boot] [PATCH v4] pico-imx7d: Increase the CONFIG_ENV_OFFSET size Fabio Estevam
2018-11-30 15:17 ` Otavio Salvador
2018-11-30 15:33 ` Wolfgang Denk
2018-11-30 16:28   ` Fabio Estevam
2018-12-03 15:52     ` Wolfgang Denk
2018-12-03 16:53       ` Fabio Estevam
2018-12-03 17:39         ` Otavio Salvador
2018-12-04  9:40           ` Wolfgang Denk
2018-12-04  9:37         ` Wolfgang Denk
2018-12-04 10:41           ` Fabio Estevam
2018-12-04 13:03             ` Wolfgang Denk
2018-12-04 13:18               ` Fabio Estevam
2018-12-04 13:35                 ` Wolfgang Denk
2018-12-04 14:15                   ` Fabio Estevam
2018-12-04 15:40                     ` [U-Boot] [PATCH] Enable expression support for CONFIG_BOARD_SIZE_LIMIT Wolfgang Denk
2018-12-04 15:42                       ` Otavio Salvador
2018-12-04 16:15                       ` Fabio Estevam
2018-12-05  9:52                         ` Wolfgang Denk
2018-12-06 13:04                           ` Fabio Estevam
2018-12-06 14:23                             ` Wolfgang Denk
2018-12-06 14:41                               ` Fabio Estevam
2018-12-06 14:44                                 ` Andy Pont
2018-12-06 14:58                                   ` Fabio Estevam
2018-12-06 15:01                                     ` Fabio Estevam
2018-12-06 14:50                                 ` Philipp Tomsich
2018-12-06 15:06                                   ` Fabio Estevam
2018-12-06 15:17                                 ` Fabio Estevam
2018-12-07 15:21                                   ` Wolfgang Denk
2018-12-07 15:37                                     ` Fabio Estevam
2018-12-07 19:28                                       ` Wolfgang Denk
2018-12-07 19:27                       ` [U-Boot] [PATCH v2] " Wolfgang Denk
2018-12-14 19:16                         ` [U-Boot] [U-Boot, " Tom Rini
2019-03-06 20:54                           ` Simon Goldschmidt
2019-03-08 17:17                             ` Tom Rini
2019-03-08 17:28                               ` Martin Husemann
2019-03-08 17:53                                 ` Philipp Tomsich
2019-03-08 18:16                                   ` Simon Goldschmidt
2019-03-08 19:55                                   ` Tom Rini
2019-03-15 10:13                                 ` Ismael Luceno Cortes
2018-12-17 14:13 ` [U-Boot] [PATCH v4] pico-imx7d: Increase the CONFIG_ENV_OFFSET size Fabio Estevam
2018-12-17 14:47   ` Stefano Babic
2018-12-17 14:50     ` Fabio Estevam

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.