All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v5] pico-imx7d: Increase the CONFIG_ENV_OFFSET size
@ 2018-12-08 13:53 Fabio Estevam
  2018-12-08 16:37 ` Stefano Babic
  0 siblings, 1 reply; 2+ messages in thread
From: Fabio Estevam @ 2018-12-08 13:53 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 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

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

* [U-Boot] [PATCH v5] pico-imx7d: Increase the CONFIG_ENV_OFFSET size
  2018-12-08 13:53 [U-Boot] [PATCH v5] pico-imx7d: Increase the CONFIG_ENV_OFFSET size Fabio Estevam
@ 2018-12-08 16:37 ` Stefano Babic
  0 siblings, 0 replies; 2+ messages in thread
From: Stefano Babic @ 2018-12-08 16:37 UTC (permalink / raw)
  To: u-boot

Hi Fabio,

On 08/12/18 14:53, Fabio Estevam wrote:
> 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
> 

Yes, I see the long  thread with Wolfgang. IMHO it is better I apply
both of them to u-boot.imx, even if Wolfgang's is quite "shared" (he
patches /Makefile, too).

Regards,
Stefano

>  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
> 

-- 
=====================================================================
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de
=====================================================================

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

end of thread, other threads:[~2018-12-08 16:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-08 13:53 [U-Boot] [PATCH v5] pico-imx7d: Increase the CONFIG_ENV_OFFSET size Fabio Estevam
2018-12-08 16:37 ` Stefano Babic

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.