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>,
	Greg Malysa <malysagreg@gmail.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 Kocialkowski <contact@paulk.fr>, Peng Fan <peng.fan@nxp.com>,
	Peter Robinson <pbrobinson@gmail.com>,
	Simon Glass <sjg@chromium.org>, Tom Rini <trini@konsulko.com>
Subject: [PATCH v5 2/4] Makefile: Add size check for u-boot-with-spl.bin
Date: Wed, 30 Jul 2025 14:38:31 +0200	[thread overview]
Message-ID: <20250730123833.249923-3-pro@denx.de> (raw)
In-Reply-To: <20250730123833.249923-1-pro@denx.de>

Introduce another SIZE_CHECK macro for u-boot-with-spl.bin.

Note that we cannot reuse BOARD_SIZE_LIMIT here, as this also applies to
intermediate u-boot*bin images, which, before being compressed, may be
larger than the final combined image.

Also SPL_SIZE_LIMIT has to be a separate option, as some boards might
just want to restrict SPL size while still allowing u-boot-with-spl.bin
to be bigger.

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

Notes:
    Changes in v5:
    	- Fix for broken boards reported in v4
    	- See https://patchwork.ozlabs.org/project/uboot/patch/20250708103959.26129-2-pro@denx.de/
    
    Changes in v4: none
    
    Changes in v3:
    	Reuse existing SPL_SIZE_LIMIT instead of implementing a new option
    
    Changes in v2: none

 Makefile           | 1 +
 common/spl/Kconfig | 7 +++++++
 2 files changed, 8 insertions(+)

diff --git a/Makefile b/Makefile
index aefa44c327f..e10d75384bf 100644
--- a/Makefile
+++ b/Makefile
@@ -1716,6 +1716,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))
 
 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.
+
 config SPL_SIZE_LIMIT
 	hex "Maximum size of SPL image"
 	default 0x11000 if ARCH_MX6 && !MX6_OCRAM_256KB
-- 
2.39.5


  parent reply	other threads:[~2025-07-30 12:39 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-30 12:38 [PATCH v5 0/4] Add Onion Omega2/2+ board support Philip Oberfichtner
2025-07-30 12:38 ` [PATCH v5 1/4] Makefile: Simplify size check Philip Oberfichtner
2025-07-31 16:05   ` Tom Rini
2025-07-30 12:38 ` Philip Oberfichtner [this message]
2025-07-31 16:05   ` [PATCH v5 2/4] Makefile: Add size check for u-boot-with-spl.bin Tom Rini
2025-07-30 12:38 ` [PATCH v5 3/4] mips: serial: Silence "unused variable" warning Philip Oberfichtner
2025-07-30 12:38 ` [PATCH v5 4/4] mips: mt7628: Add Onion Omega2/2+ board support Philip Oberfichtner
2025-08-04 15:02   ` Daniel Schwierzeck
2025-08-07  7:59     ` Philip Oberfichtner
2025-08-04 10:00 ` [PATCH v5 0/4] " 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=20250730123833.249923-3-pro@denx.de \
    --to=pro@denx.de \
    --cc=Oliver.Gaskell@analog.com \
    --cc=andre.przywara@arm.com \
    --cc=anshuld@ti.com \
    --cc=contact@paulk.fr \
    --cc=dario.binacchi@amarulasolutions.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=pbrobinson@gmail.com \
    --cc=peng.fan@nxp.com \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /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.