Skip to contentSkip to conversation

configs: ls1021aiot_sdcard: Limit the U-Boot image to 1 MiB

PATCH In review Mateus Lima Alves 2 participants 2 messages Oct 26 – Nov 5

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 configs: ls1021aiot_sdcard: Limit the U-Boot image to 1 MiB

The SPL of the LS1021A-IoT board loads U-Boot to 0x82000000 and keeps its malloc pool right after the CONFIG_SYS_MONITOR_LEN bytes reserved for it. When U-Boot outgrew that space it overwrote the pool and the SPL took a data abort at boot, with nothing at build time to tell.

Enable BOARD_SIZE_LIMIT with the size of that space, 1 MiB, so that an image that no longer fits fails to link instead.

---
This applies on top of "configs: ls1021aiot_sdcard: Reserve 1 MiB for U-Boot in the SPL memory map". Checked that ls1021aiot_sdcard_defconfig builds (u-boot-nodtb.bin is 586688 bytes) and that the build stops with "u-boot-nodtb.bin exceeds file size limit" when the limit is 512 KiB.

 configs/ls1021aiot_sdcard_defconfig | 2 ++
 1 file changed, 2 insertions(+)
configs/ls1021aiot_sdcard_defconfig +2 -0
index 0cee61568e6..1fb8f7b0f6a 100644
@@ -30,6 +30,8 @@ CONFIG_PCI=y
 CONFIG_LAYERSCAPE_NS_ACCESS=y
 CONFIG_PCIE1=y
 CONFIG_PCIE2=y
+CONFIG_HAS_BOARD_SIZE_LIMIT=y
+CONFIG_BOARD_SIZE_LIMIT=1048576
 CONFIG_RAMBOOT_PBL=y
 CONFIG_SYS_FSL_PBL_PBI="board/nxp/ls1021aiot/ls102xa_pbi.cfg"
 CONFIG_SYS_FSL_PBL_RCW="board/nxp/ls1021aiot/ls102xa_rcw_sd.cfg"
Signature · 1 line
2.43.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · Mateus Lima Alves

The SPL of the LS1021A-IoT board loads U-Boot to 0x82000000 and keeps its malloc pool right after the CONFIG_SYS_MONITOR_LEN bytes reserved for it. When U-Boot outgrew that space it overwrote the pool and the SPL took a data abort at boot, with nothing at build time to tell.

Enable BOARD_SIZE_LIMIT with the size of that space, 1 MiB, so that an image that no longer fits fails to link instead.