[PATCH] configs: legoev3: adjust to reduce binary size

David Lechner david at lechnology.com
Fri Jul 4 21:15:20 CEST 2025


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.

Signed-off-by: David Lechner <david at lechnology.com>
---
 configs/legoev3_defconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/configs/legoev3_defconfig b/configs/legoev3_defconfig
index 60b7a84205c0fef1ffed39de7b7c1a3d5cdff217..e234894bcce2a74121d0ca1128faebac0eefa8ca 100644
--- a/configs/legoev3_defconfig
+++ b/configs/legoev3_defconfig
@@ -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,7 @@ 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_DYNAMIC_SYS_CLK_FREQ=y
 CONFIG_BOOTDELAY=0
 CONFIG_AUTOBOOT_KEYED=y
@@ -31,7 +33,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 +57,3 @@ CONFIG_SYS_NS16550=y
 CONFIG_SPI=y
 CONFIG_DM_SPI=y
 CONFIG_DAVINCI_SPI=y
-CONFIG_REGEX=y

---
base-commit: d1d53c252a4a746db5ebcdf0d6de3aa0feec504e
change-id: 20250704-b4-configs-legoev3-use-thumb-instructions-ed648a821543

Best regards,
-- 
David Lechner <david at lechnology.com>



More information about the U-Boot mailing list