All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philip Oberfichtner <pro@denx.de>
To: u-boot@lists.denx.de
Cc: Philip Oberfichtner <pro@denx.de>,
	Andre Przywara <andre.przywara@arm.com>,
	Anshul Dalal <anshuld@ti.com>,
	Dario Binacchi <dario.binacchi@amarulasolutions.com>,
	Gary Bisson <bisson.gary@gmail.com>,
	Greg Malysa <malysagreg@gmail.com>,
	Heinrich Schuchardt <heinrich.schuchardt@canonical.com>,
	Ilias Apalodimas <ilias.apalodimas@linaro.org>,
	Jerome Forissier <jerome.forissier@linaro.org>,
	Marek Vasut <marex@denx.de>,
	Nathan Barrett-Morrison <nathan.morrison@timesys.com>,
	Oliver Gaskell <Oliver.Gaskell@analog.com>,
	Paul Barker <paul.barker.ct@bp.renesas.com>,
	Paul Kocialkowski <contact@paulk.fr>, Peng Fan <peng.fan@nxp.com>,
	Quentin Schulz <quentin.schulz@cherry.de>,
	Simon Glass <sjg@chromium.org>, Tom Rini <trini@konsulko.com>,
	Trevor Woerner <twoerner@gmail.com>, Ye Li <ye.li@nxp.com>
Subject: [PATCH v2 2/3] Image size checks: Move all configs in one place
Date: Thu,  7 Aug 2025 12:24:35 +0200	[thread overview]
Message-ID: <20250807102436.452691-3-pro@denx.de> (raw)
In-Reply-To: <20250807102436.452691-1-pro@denx.de>

How image size limiting works in U-Boot should be easier to grasp if we
have all related options in one place.

Signed-off-by: Philip Oberfichtner <pro@denx.de>
---

Notes:
    Changes in v2:
    	- Rebase on current master
    	- Rebase on my pending mips patch series:
    	  https://patchwork.ozlabs.org/project/uboot/list/?series=468232

 Kconfig                | 66 ++++++++++++++++++++++++++++++++++++++++++
 common/spl/Kconfig     | 45 ----------------------------
 common/spl/Kconfig.tpl |  7 -----
 common/spl/Kconfig.vpl |  7 -----
 4 files changed, 66 insertions(+), 59 deletions(-)

diff --git a/Kconfig b/Kconfig
index 99f7bb563df..ec20603883b 100644
--- a/Kconfig
+++ b/Kconfig
@@ -535,6 +535,8 @@ config BUILD_TARGET
 	  special image will be automatically built upon calling
 	  make / buildman.
 
+menu "Image size limits"
+
 config BOARD_SIZE_LIMIT
 	int "Maximum size of the U-Boot image in bytes"
 	default 524288 if RCAR_32
@@ -546,6 +548,70 @@ config BOARD_SIZE_LIMIT
 	  include SPL nor TPL, on platforms that use that functionality, they
 	  have separate options to restrict size.
 
+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.
+
+config SPL_SIZE_LIMIT
+	depends on SPL
+	hex "Maximum size of SPL image"
+	default 0x11000 if ARCH_MX6 && !MX6_OCRAM_256KB
+	default 0x31000 if ARCH_MX6 && MX6_OCRAM_256KB
+	default 0x30000 if ARCH_MVEBU && ARMADA_32BIT
+	default 0x0
+	help
+	  Specifies the maximum length of the U-Boot SPL image.
+	  If this value is zero, it is ignored.
+
+config SPL_SIZE_LIMIT_SUBTRACT_GD
+	bool "SPL image size check: provide space for global data"
+	depends on SPL_SIZE_LIMIT > 0
+	help
+	  If enabled, aligned size of global data is reserved in
+	  SPL_SIZE_LIMIT check to ensure such an image does not overflow SRAM
+	  if SPL_SIZE_LIMIT describes the size of SRAM available for SPL when
+	  pre-reloc global data is put into this SRAM, too.
+
+config SPL_SIZE_LIMIT_SUBTRACT_MALLOC
+	bool "SPL image size check: provide space for malloc() pool before relocation"
+	depends on SPL_SIZE_LIMIT > 0
+	help
+	  If enabled, SPL_SYS_MALLOC_F_LEN is reserved in SPL_SIZE_LIMIT check
+	  to ensure such an image does not overflow SRAM if SPL_SIZE_LIMIT
+	  describes the size of SRAM available for SPL when pre-reloc malloc
+	  pool is put into this SRAM, too.
+
+config SPL_SIZE_LIMIT_PROVIDE_STACK
+	hex "SPL image size check: provide stack space before relocation"
+	depends on SPL_SIZE_LIMIT > 0
+	default 0x0
+	help
+	  If set, this size is reserved in SPL_SIZE_LIMIT check to ensure such
+	  an image does not overflow SRAM if SPL_SIZE_LIMIT describes the size
+	  of SRAM available for SPL when the stack required before reolcation
+	  uses this SRAM, too.
+
+config TPL_SIZE_LIMIT
+	depends on TPL
+	hex "Maximum size of TPL image"
+	default 0x0
+	help
+	  Specifies the maximum length of the U-Boot TPL image.
+	  If this value is zero, it is ignored.
+
+config VPL_SIZE_LIMIT
+	depends on VPL
+	hex "Maximum size of VPL image"
+	default 0x0
+	help
+	  Specifies the maximum length of the U-Boot VPL image.
+	  If this value is zero, it is ignored.
+
+endmenu
+
 config SYS_CUSTOM_LDSCRIPT
 	bool "Use a custom location for the U-Boot linker script"
 	depends on !COMPILE_TEST
diff --git a/common/spl/Kconfig b/common/spl/Kconfig
index b5c0c60ff6b..87a56bd8f8a 100644
--- a/common/spl/Kconfig
+++ b/common/spl/Kconfig
@@ -36,51 +36,6 @@ 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.
-
-config SPL_SIZE_LIMIT
-	hex "Maximum size of SPL image"
-	default 0x11000 if ARCH_MX6 && !MX6_OCRAM_256KB
-	default 0x31000 if ARCH_MX6 && MX6_OCRAM_256KB
-	default 0x30000 if ARCH_MVEBU && ARMADA_32BIT
-	default 0x0
-	help
-	  Specifies the maximum length of the U-Boot SPL image.
-	  If this value is zero, it is ignored.
-
-config SPL_SIZE_LIMIT_SUBTRACT_GD
-	bool "SPL image size check: provide space for global data"
-	depends on SPL_SIZE_LIMIT > 0
-	help
-	  If enabled, aligned size of global data is reserved in
-	  SPL_SIZE_LIMIT check to ensure such an image does not overflow SRAM
-	  if SPL_SIZE_LIMIT describes the size of SRAM available for SPL when
-	  pre-reloc global data is put into this SRAM, too.
-
-config SPL_SIZE_LIMIT_SUBTRACT_MALLOC
-	bool "SPL image size check: provide space for malloc() pool before relocation"
-	depends on SPL_SIZE_LIMIT > 0
-	help
-	  If enabled, SPL_SYS_MALLOC_F_LEN is reserved in SPL_SIZE_LIMIT check
-	  to ensure such an image does not overflow SRAM if SPL_SIZE_LIMIT
-	  describes the size of SRAM available for SPL when pre-reloc malloc
-	  pool is put into this SRAM, too.
-
-config SPL_SIZE_LIMIT_PROVIDE_STACK
-	hex "SPL image size check: provide stack space before relocation"
-	depends on SPL_SIZE_LIMIT > 0
-	default 0x0
-	help
-	  If set, this size is reserved in SPL_SIZE_LIMIT check to ensure such
-	  an image does not overflow SRAM if SPL_SIZE_LIMIT describes the size
-	  of SRAM available for SPL when the stack required before reolcation
-	  uses this SRAM, too.
-
 config SPL_MAX_SIZE
 	hex "Maximum size of the SPL image, excluding BSS"
 	default 0x30000 if ARCH_MX6 && MX6_OCRAM_256KB
diff --git a/common/spl/Kconfig.tpl b/common/spl/Kconfig.tpl
index a535b61ecd3..515bbeec685 100644
--- a/common/spl/Kconfig.tpl
+++ b/common/spl/Kconfig.tpl
@@ -1,13 +1,6 @@
 menu "TPL configuration options"
 	depends on TPL
 
-config TPL_SIZE_LIMIT
-	hex "Maximum size of TPL image"
-	default 0x0
-	help
-	  Specifies the maximum length of the U-Boot TPL image.
-	  If this value is zero, it is ignored.
-
 config TPL_BINMAN_SYMBOLS
 	bool "Support binman symbols in TPL"
 	depends on TPL_FRAMEWORK && BINMAN
diff --git a/common/spl/Kconfig.vpl b/common/spl/Kconfig.vpl
index 434562443ac..739f2805315 100644
--- a/common/spl/Kconfig.vpl
+++ b/common/spl/Kconfig.vpl
@@ -220,13 +220,6 @@ config VPL_SERIAL
 	  Enable support for serial in VPL. See SPL_SERIAL for
 	  details.
 
-config VPL_SIZE_LIMIT
-	hex "Maximum size of VPL image"
-	default 0x0
-	help
-	  Specifies the maximum length of the U-Boot VPL image.
-	  If this value is zero, it is ignored.
-
 config VPL_SPI
 	bool "Support SPI drivers"
 	help
-- 
2.39.5


  parent reply	other threads:[~2025-08-07 10:25 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-07 10:24 [PATCH v2 0/3] Simplify image size checks Philip Oberfichtner
2025-08-07 10:24 ` [PATCH v2 1/3] Image size checks: Remove HAS_BOARD_SIZE_LIMIT Philip Oberfichtner
2025-08-07 13:41   ` Marek Vasut
2025-08-07 16:21     ` Tom Rini
2025-08-07 19:41       ` Marek Vasut
2025-08-07 20:11         ` Tom Rini
2025-08-07 23:15           ` Marek Vasut
2025-08-07 23:24             ` Tom Rini
2025-08-11  8:50               ` Philip Oberfichtner
2025-08-18  9:29                 ` Philip Oberfichtner
2025-08-25  8:59                   ` Philip Oberfichtner
2025-08-28 21:44                 ` Marek Vasut
2025-09-01  9:38                   ` Philip Oberfichtner
2025-09-01 19:41                     ` Marek Vasut
2025-08-11  8:30     ` Philip Oberfichtner
2025-08-07 10:24 ` Philip Oberfichtner [this message]
2025-08-07 10:24 ` [PATCH v2 3/3] Image size checks: Simplify help text Philip Oberfichtner
2025-08-07 13:41   ` Marek Vasut
2025-08-11  8:57     ` Philip Oberfichtner
2025-08-11 10:28       ` Heinrich Schuchardt
2025-08-11 14:25       ` Marek Vasut
2025-08-12  9:51         ` Philip Oberfichtner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250807102436.452691-3-pro@denx.de \
    --to=pro@denx.de \
    --cc=Oliver.Gaskell@analog.com \
    --cc=andre.przywara@arm.com \
    --cc=anshuld@ti.com \
    --cc=bisson.gary@gmail.com \
    --cc=contact@paulk.fr \
    --cc=dario.binacchi@amarulasolutions.com \
    --cc=heinrich.schuchardt@canonical.com \
    --cc=ilias.apalodimas@linaro.org \
    --cc=jerome.forissier@linaro.org \
    --cc=malysagreg@gmail.com \
    --cc=marex@denx.de \
    --cc=nathan.morrison@timesys.com \
    --cc=paul.barker.ct@bp.renesas.com \
    --cc=peng.fan@nxp.com \
    --cc=quentin.schulz@cherry.de \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.com \
    --cc=twoerner@gmail.com \
    --cc=u-boot@lists.denx.de \
    --cc=ye.li@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.