U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Fabio Estevam <festevam@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v5] pico-imx7d: Increase the CONFIG_ENV_OFFSET	size
Date: Sat,  8 Dec 2018 11:53:56 -0200	[thread overview]
Message-ID: <1544277236-2016-1-git-send-email-festevam@gmail.com> (raw)

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 to happen again in
the future, use CONFIG_BOARD_SIZE_LIMIT, which will detect the overlap
in build-time.

CONFIG_BOARD_SIZE_LIMIT is CONFIG_ENV_OFFSET - 69 kB, as u-boot.img
is flashed into the 69 kB offset.

Signed-off-by: Fabio Estevam <festevam@gmail.com>
---
Changes since v4:
- Use math expressions for better readability

Hi Stefano,

This one depends on Wolfgang's v2 patch:
https://lists.denx.de/pipermail/u-boot/2018-December/351138.html

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

diff --git a/include/configs/pico-imx7d.h b/include/configs/pico-imx7d.h
index 2bc42a0..333c0b4 100644
--- a/include/configs/pico-imx7d.h
+++ b/include/configs/pico-imx7d.h
@@ -134,7 +134,8 @@
 /* FLASH and environment organization */
 #define CONFIG_ENV_SIZE			SZ_8K
 
-#define CONFIG_ENV_OFFSET			(8 * SZ_64K)
+#define CONFIG_ENV_OFFSET			(768 * 1024)
+#define CONFIG_BOARD_SIZE_LIMIT			((768 - 69) * 1024)
 #define CONFIG_SYS_FSL_USDHC_NUM		2
 
 #define CONFIG_SYS_MMC_ENV_DEV			0
-- 
2.7.4

             reply	other threads:[~2018-12-08 13:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-08 13:53 Fabio Estevam [this message]
2018-12-08 16:37 ` [U-Boot] [PATCH v5] pico-imx7d: Increase the CONFIG_ENV_OFFSET size Stefano Babic

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1544277236-2016-1-git-send-email-festevam@gmail.com \
    --to=festevam@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox