]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
configs: legoev3: adjust to reduce binary size
authorDavid Lechner <david@lechnology.com>
Fri, 4 Jul 2025 20:39:27 +0000 (15:39 -0500)
committerTom Rini <trini@konsulko.com>
Fri, 4 Jul 2025 20:48:06 +0000 (14:48 -0600)
Adjust legoev3_defconfig to reduce the binary output size.

As u-boot has bloated a bit over the years, the legoev3_defconfig can no
longer build something that fits in the 256kB size limit of the EV3.
This drops a few unused features, but the real difference-makers are
enabling thumb instructions and using link time optimization to reduce
the size.

This reduced u-boot.bin from 279,920 to 198,416 bytes on my local
machine with arm-none-eabi-gcc (15:13.2.rel1-2) 13.2.1 20231009.

HAS_BOARD_SIZE_LIMIT is also added to catch any future regressions.

Signed-off-by: David Lechner <david@lechnology.com>
configs/legoev3_defconfig

index 60b7a84205c0fef1ffed39de7b7c1a3d5cdff217..54976501e11ee1145c071fa731a03aa53db9fd89 100644 (file)
@@ -1,5 +1,6 @@
 CONFIG_ARM=y
 CONFIG_SKIP_LOWLEVEL_INIT=y
+CONFIG_SYS_THUMB_BUILD=y
 CONFIG_ARCH_DAVINCI=y
 CONFIG_TEXT_BASE=0xc1080000
 CONFIG_SYS_MALLOC_LEN=0x110000
@@ -12,6 +13,9 @@ CONFIG_SF_DEFAULT_SPEED=50000000
 CONFIG_ENV_SIZE=0x4000
 CONFIG_DEFAULT_DEVICE_TREE="da850-lego-ev3"
 CONFIG_SYS_LOAD_ADDR=0xc0700000
+CONFIG_LTO=y
+CONFIG_HAS_BOARD_SIZE_LIMIT=y
+CONFIG_BOARD_SIZE_LIMIT=262144
 CONFIG_DYNAMIC_SYS_CLK_FREQ=y
 CONFIG_BOOTDELAY=0
 CONFIG_AUTOBOOT_KEYED=y
@@ -31,7 +35,6 @@ CONFIG_HUSH_PARSER=y
 # CONFIG_BOOTM_RTEMS is not set
 # CONFIG_BOOTM_VXWORKS is not set
 CONFIG_CMD_ASKENV=y
-CONFIG_CRC32_VERIFY=y
 CONFIG_CMD_MX_CYCLIC=y
 CONFIG_CMD_MMC=y
 CONFIG_CMD_SPI=y
@@ -56,4 +59,3 @@ CONFIG_SYS_NS16550=y
 CONFIG_SPI=y
 CONFIG_DM_SPI=y
 CONFIG_DAVINCI_SPI=y
-CONFIG_REGEX=y