Skip to contentSkip to conversation

mx6sabresd: Increase CONFIG_ENV_OFFSET to fix boot regression

PATCH In review Fabio Estevam 2 participants 6 messages Jul 4, 2025

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mx6sabresd: Increase CONFIG_ENV_OFFSET to fix boot regression

The CONFIG_ENV_OFFSET value is too low and the imx6dl sabresd board no longer boots.

There have been attempts to increase CONFIG_ENV_OFFSET in the past, but the suggestion was to enable LTO, which worked well for some time.

Give more room to CONFIG_ENV_OFFSET so that the board can boot again.

Adjust the CONFIG_BOARD_SIZE_LIMIT to take this into account:

CONFIG_BOARD_SIZE_LIMIT = CONFIG_BOARD_SIZE_LIMIT - 69k = 9779920

---
 configs/mx6sabresd_defconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
configs/mx6sabresd_defconfig +2 -2
index f041f1fd1a3b..f66d6f413ee7 100644
@@ -8,7 +8,7 @@ CONFIG_SPL_LIBGENERIC_SUPPORT=y
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_SF_DEFAULT_SPEED=20000000
 CONFIG_ENV_SIZE=0x2000
-CONFIG_ENV_OFFSET=0xC0000
+CONFIG_ENV_OFFSET=0x100000
 CONFIG_MX6QDL=y
 CONFIG_TARGET_MX6SABRESD=y
 CONFIG_DM_GPIO=y
@@ -21,7 +21,7 @@ CONFIG_SPL_LIBDISK_SUPPORT=y
 CONFIG_PCI=y
 CONFIG_LTO=y
 CONFIG_HAS_BOARD_SIZE_LIMIT=y
-CONFIG_BOARD_SIZE_LIMIT=715766
+CONFIG_BOARD_SIZE_LIMIT=977920
 CONFIG_FIT=y
 CONFIG_SPL_FIT_PRINT=y
 CONFIG_SPL_LOAD_FIT=y
Signature · 1 line
2.34.1
#1 lore raw
Quoted 8 lines · Fabio Estevam

The CONFIG_ENV_OFFSET value is too low and the imx6dl sabresd board no longer boots.

There have been attempts to increase CONFIG_ENV_OFFSET in the past, but the suggestion was to enable LTO, which worked well for some time.

Give more room to CONFIG_ENV_OFFSET so that the board can boot again.

Quoted 8 lines

Adjust the CONFIG_BOARD_SIZE_LIMIT to take this into account:

CONFIG_BOARD_SIZE_LIMIT = CONFIG_BOARD_SIZE_LIMIT - 69k = 9779920

---
 configs/mx6sabresd_defconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

If we correct the size limit for where the environment is today and switch to CONFIG_MULTI_DTB_FIT_LZO do we fit within the limits again? We could likely save a little space too by dropping PLAN9 and RTEMS bootm support and seeing if we really need CONFIG_MMC_VERBOSE as well.

Signature · 1 line
Tom
#2 lore raw

Hi Tom,

Quoted 2 lines · Tom Rini

If we correct the size limit for where the environment is today and switch to CONFIG_MULTI_DTB_FIT_LZO do we fit within the limits again? We

Yes, changing to CONFIG_MULTI_DTB_FIT_LZO generates a u-boot.img of 715488 bytes.

This fits within the existing 715766 limit with a 278-byte margin, and the board boots.

After disabling RTEM and PLAN9, the binary goes to 715200.

I can submit your suggested changes to fix the boot regression in 2024.07, if you'd like.

For 2024.10, we can discuss whether it is safe to use the current CONFIG_ENV_OFFSET, as this is a topic that has haunted us from time to time.

Thanks

#3 lore raw
Quoted 13 lines · Fabio Estevam

Hi Tom,

Quoted 2 lines · Tom Rini

If we correct the size limit for where the environment is today and switch to CONFIG_MULTI_DTB_FIT_LZO do we fit within the limits again? We

Yes, changing to CONFIG_MULTI_DTB_FIT_LZO generates a u-boot.img of 715488 bytes.

This fits within the existing 715766 limit with a 278-byte margin, and the board boots.

Quoted 8 lines

After disabling RTEM and PLAN9, the binary goes to 715200.

I can submit your suggested changes to fix the boot regression in 2024.07, if you'd like.

For 2024.10, we can discuss whether it is safe to use the current CONFIG_ENV_OFFSET, as this is a topic that has haunted us from time to time.

Yes please, thanks! And I would like to explore a little if some other compression algorithm (that we don't have support for yet) might be a larger win too, for v2025.10.

Signature · 1 line
Tom
#4 lore raw
Quoted 3 lines · Tom Rini

Yes please, thanks! And I would like to explore a little if some other compression algorithm (that we don't have support for yet) might be a larger win too, for v2025.10.

Ah, I manually tried this change below:

configs/mx6sabresd_defconfig +3 -1
@@ -40,6 +40,8 @@ CONFIG_SPL_WATCHDOG=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_MAXARGS=32
 CONFIG_CMD_BOOTZ=y
+# CONFIG_BOOTM_PLAN9 is not set
+# CONFIG_BOOTM_RTEMS is not set
 CONFIG_CMD_SPL=y
 CONFIG_CMD_SPL_WRITE_SIZE=0x20000
 CONFIG_CMD_GPIO=y
@@ -65,7 +67,7 @@ CONFIG_EFI_PARTITION=y
 # CONFIG_SPL_EFI_PARTITION is not set
 CONFIG_OF_CONTROL=y
 CONFIG_OF_LIST="imx6q-sabresd imx6qp-sabresd imx6dl-sabresd"
-CONFIG_MULTI_DTB_FIT=y
+CONFIG_MULTI_DTB_FIT_LZO=y
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y

After running make savedefconfig; cp defconfig configs/mx6sabresd_defconfig, I see that CONFIG_MULTI_DTB_FIT_LZO does not get selected, and CONFIG_MULTI_DTB_FIT=y is removed.

According to doc/README.multi-dtb-fit:

"Usually the DTB is selected by the SPL and passed down to U-Boot. But some platforms don't use the SPL. In this case MULTI_DTB_FIT can used to provide U-Boot with a choice of DTBs"

mx6sabresd uses SPL, so MULTI_DTB_FIT can be safely dropped.

I tested it on a imx6dl and imx6q sabresd boards.

I'll send a v2.

Thanks

#5 lore raw
Quoted 39 lines · Fabio Estevam
Quoted 3 lines · Tom Rini

Yes please, thanks! And I would like to explore a little if some other compression algorithm (that we don't have support for yet) might be a larger win too, for v2025.10.

Ah, I manually tried this change below:

configs/mx6sabresd_defconfig +3 -1
@@ -40,6 +40,8 @@ CONFIG_SPL_WATCHDOG=y
 CONFIG_HUSH_PARSER=y
 CONFIG_SYS_MAXARGS=32
 CONFIG_CMD_BOOTZ=y
+# CONFIG_BOOTM_PLAN9 is not set
+# CONFIG_BOOTM_RTEMS is not set
 CONFIG_CMD_SPL=y
 CONFIG_CMD_SPL_WRITE_SIZE=0x20000
 CONFIG_CMD_GPIO=y
@@ -65,7 +67,7 @@ CONFIG_EFI_PARTITION=y
 # CONFIG_SPL_EFI_PARTITION is not set
 CONFIG_OF_CONTROL=y
 CONFIG_OF_LIST="imx6q-sabresd imx6qp-sabresd imx6dl-sabresd"
-CONFIG_MULTI_DTB_FIT=y
+CONFIG_MULTI_DTB_FIT_LZO=y
 CONFIG_ENV_OVERWRITE=y
 CONFIG_ENV_IS_IN_MMC=y
 CONFIG_SYS_RELOC_GD_ENV_ADDR=y

After running make savedefconfig; cp defconfig configs/mx6sabresd_defconfig, I see that CONFIG_MULTI_DTB_FIT_LZO does not get selected, and CONFIG_MULTI_DTB_FIT=y is removed.

According to doc/README.multi-dtb-fit:

"Usually the DTB is selected by the SPL and passed down to U-Boot. But some platforms don't use the SPL. In this case MULTI_DTB_FIT can used to provide U-Boot with a choice of DTBs"

Quoted 5 lines

mx6sabresd uses SPL, so MULTI_DTB_FIT can be safely dropped.

I tested it on a imx6dl and imx6q sabresd boards.

I'll send a v2.

I guess the question is if we need to be using SPL_MULTI_FIT_DTB to pass the right one along, or if we don't really need to have the exact DTB in any case?

Signature · 1 line
Tom