[PATCH v6 2/4] Makefile: Add size check for u-boot-with-spl.bin

Marek Vasut marek.vasut at mailbox.org
Fri Aug 8 15:10:58 CEST 2025


On 8/7/25 9:56 AM, Philip Oberfichtner wrote:

[...]

> +++ b/Makefile
> @@ -1715,6 +1715,7 @@ OBJCOPYFLAGS_u-boot-with-spl.bin = -I binary -O binary \
>   				   --pad-to=$(CONFIG_SPL_PAD_TO)
>   u-boot-with-spl.bin: $(SPL_IMAGE) $(SPL_PAYLOAD) FORCE
>   	$(call if_changed,pad_cat)
> +	@$(call size_check,$@,$(CONFIG_UBOOT_WITH_SPL_SIZE_LIMIT))

It seems other size checks are not called unconditionally, see Makefile 
around line 1100 . Why is this one called unconditionally ? Won't this 
break boards which default this new option to 0 ?

>   ifeq ($(CONFIG_ARCH_LPC32XX)$(CONFIG_SPL),yy)
>   MKIMAGEFLAGS_lpc32xx-spl.img = -T lpc32xximage -a $(CONFIG_SPL_TEXT_BASE)
> diff --git a/common/spl/Kconfig b/common/spl/Kconfig
> index ab05536bd02..b5c0c60ff6b 100644
> --- a/common/spl/Kconfig
> +++ b/common/spl/Kconfig
> @@ -36,6 +36,13 @@ config SPL_FRAMEWORK_BOARD_INIT_F
>   	  - initialize the serial (preloader_console_init)
>   	  Unless you want to provide your own board_init_f, you should say Y.
>   
> +config UBOOT_WITH_SPL_SIZE_LIMIT
> +	hex "Maximum size of u-boot-with-spl.bin"
> +	default 0x0
> +	help
> +	  Specifies the maximum length of the u-boot-with-spl.bin image.
> +	  If this value is zero, it is ignored.
Why not set SPL_SIZE_LIMIT and BOARD_SIZE_LIMIT ?


More information about the U-Boot mailing list