[PATCH v3 2/5] Image size checks: Use HAS_SIZE_LIMIT consistently
Tom Rini
trini at konsulko.com
Fri Sep 5 16:19:59 CEST 2025
On Wed, Sep 03, 2025 at 12:56:50PM +0200, Philip Oberfichtner wrote:
> Use a consistent logic for image size checks. No functional change.
>
> Before this commit, there were two concurrent approaches of how image
> size checks are disabled: Whereas BOARD_SIZE_LIMIT was gated through a
> dedicated Kconfig symbol to achieve this, all the other size checks were
> disabled by assigning them a limit of zero bytes.
>
> By this commit we achieve a consistent logic for size limiting, by
> introducing CONFIG_HAS_XXX_SIZE_LIMIT for all those options that don't
> have it yet.
>
> Signed-off-by: Philip Oberfichtner <pro at denx.de>
[snip]
> diff --git a/arch/arm/mach-socfpga/Kconfig b/arch/arm/mach-socfpga/Kconfig
> index f2e959b5662..d4d46100736 100644
> --- a/arch/arm/mach-socfpga/Kconfig
> +++ b/arch/arm/mach-socfpga/Kconfig
> @@ -22,8 +22,11 @@ config SOCFPGA_SECURE_VAB_AUTH_ALLOW_NON_FIT_IMAGE
> bool "Allow non-FIT VAB signed images"
> depends on SOCFPGA_SECURE_VAB_AUTH
>
> +config HAS_SPL_SIZE_LIMIT
> + default y if TARGET_SOCFPGA_GEN5
> +
> config SPL_SIZE_LIMIT
> - default 0x10000 if TARGET_SOCFPGA_GEN5
> + default 0x10000 if TARGET_SOCFPGA_GEN5 && HAS_SPL_SIZE_LIMIT
>
> config SPL_SIZE_LIMIT_PROVIDE_STACK
> default 0x200 if TARGET_SOCFPGA_GEN5
> diff --git a/arch/mips/mach-mtmips/Kconfig b/arch/mips/mach-mtmips/Kconfig
> index 3fcd0b8465b..d2a1652954c 100644
> --- a/arch/mips/mach-mtmips/Kconfig
> +++ b/arch/mips/mach-mtmips/Kconfig
> @@ -36,8 +36,11 @@ config SPL_TEXT_BASE
> default 0x9c000000 if !SOC_MT7621
> default 0x80100000 if SOC_MT7621
>
> +config HAS_SPL_SIZE_LIMIT
> + default y if SOC_MT7621
> +
> config SPL_SIZE_LIMIT
> - default 0x30000 if SOC_MT7621
> + default 0x30000 if SOC_MT7621 && HAS_SPL_SIZE_LIMIT
>
> config TPL_TEXT_BASE
> default 0xbfc00000 if SOC_MT7621
> diff --git a/arch/x86/cpu/apollolake/Kconfig b/arch/x86/cpu/apollolake/Kconfig
> index 5dd866ffcfe..d70e8def36f 100644
> --- a/arch/x86/cpu/apollolake/Kconfig
> +++ b/arch/x86/cpu/apollolake/Kconfig
> @@ -78,8 +78,11 @@ config MMCONF_BASE_ADDRESS
> hex
> default 0xe0000000
>
> +config HAS_TPL_SIZE_LIMIT
> + default y
> +
> config TPL_SIZE_LIMIT
> - default 0x7800
> + default 0x7800 if HAS_TPL_SIZE_LIMIT
>
> config CPU_ADDR_BITS
> default 39
These should be "default y if .." in the main Kconfig entry for the
option.
> diff --git a/configs/am62ax_evm_r5_defconfig b/configs/am62ax_evm_r5_defconfig
The reset of these, to Marek's point, show that we need to also add
"default y if .." for a number of other platforms too. At least the ones
where today we have default limits provided in Kconfig today.
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20250905/46065c74/attachment.sig>
More information about the U-Boot
mailing list