From: Philip Oberfichtner <pro@denx.de>
To: Tom Rini <trini@konsulko.com>
Cc: u-boot@lists.denx.de, Andre Przywara <andre.przywara@arm.com>,
Anshul Dalal <anshuld@ti.com>,
Dario Binacchi <dario.binacchi@amarulasolutions.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 <marek.vasut@mailbox.org>,
Nathan Barrett-Morrison <nathan.morrison@timesys.com>,
Oliver Gaskell <Oliver.Gaskell@analog.com>,
Paul Barker <paul.barker.ct@bp.renesas.com>,
Peng Fan <peng.fan@nxp.com>, Simon Glass <sjg@chromium.org>,
Trevor Woerner <twoerner@gmail.com>, Ye Li <ye.li@nxp.com>
Subject: Re: [PATCH v3 2/5] Image size checks: Use HAS_SIZE_LIMIT consistently
Date: Thu, 2 Oct 2025 10:55:19 +0200 [thread overview]
Message-ID: <aN49929JEJpWdOee@aristophanes> (raw)
In-Reply-To: <20250930144536.GX6093@bill-the-cat>
Hi Tom,
Thank you for the clarification.
On Tue, Sep 30, 2025 at 08:45:36AM -0600, Tom Rini wrote:
> On Tue, Sep 30, 2025 at 10:33:13AM +0200, Philip Oberfichtner wrote:
> > On Fri, Sep 05, 2025 at 08:19:59AM -0600, Tom Rini wrote:
> > > 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@denx.de>
> > <...>
> > > > 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.
> >
> > Not sure if I'm following you here. So you mean both of the defaults
> > should be moved to common/spl/Kconfig.tpl? - like
> >
> > config HAS_TPL_SIZE_LIMIT
> > [...]
> > default y if INTEL_APOLLOLAKE
> >
> >
> > config TPL_SIZE_LIMIT
> > [...]
> > default 0x7800 if INTEL_APOLLOLAKE
>
> Yes, like that.
Ok.
>
> > > > 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.
> >
> > Which platforms exactly?
>
> So the platforms today which have a default ..size.. if SOC should also
> be listed as default y if SOC, is that I was I believe getting at.
Yes, this part is already included as of now.
>
> > > At least the ones
> > > where today we have default limits provided in Kconfig today.
> >
> > Besides the ones handled above, i.e.
> > arch/arm/mach-socfpga/Kconfig,
> > arch/mips/mach-mtmips/Kconfig and
> > arch/x86/cpu/apollolake/Kconfig,
> >
> > there aren't any.
> >
> > I myself am not very fond of changing that many defconfigs, but I still
> > don't see a way of avoiding it. I guess it would become more clear if
> > you concretely name a few examples.
>
> So, part of the pattern is that we should take this from
> common/spl/Kconfig:
> 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
> ...
> And it becomes:
>
> config HAS_SPL_SIZE_LIMIT
> bool "Enforce a maximum size of the SPL image
> default y if ARCH_MX6 || (ARCH_MVEBU && ARMADA_32BIT) || \
> ARCH_K3
> help
> .. What we had talked about in earlier threads to be clear about what
> .. is / isn't checked by this option.
>
> config SPL_SIZE_LIMIT
> hex "Maximum size of SPL image"
> depends on HAS_SPL_SIZE_LIMIT
> default 0x11000 if ARCH_MX6 && !MX6_OCRAM_256KB
> default 0x31000 if ARCH_MX6 && MX6_OCRAM_256KB
> default 0x30000 if ARCH_MVEBU && ARMADA_32BIT
> help
> ..
>
Ok, I agree until here, but ...
> And note that I've added ARCH_K3 to the list here because from a quick grep, TI
> K3 platforms also set SPL_SIZE_LIMIT and so with this, you won't have to change
> all of those defconfigs as well.
concerning ARCH_K3 I do not yet agree:
git grep -l ARCH_K3=y configs | wc -l
gives me 54 ARCH_K3 platforms. But only 24 of them use SPL_SIZE_LIMITs:
git grep -l ARCH_K3=y configs | xargs grep -l SIZE_LIMIT | wc -l
So if I'm not mistaken, we cannot set default HAS_SPL_SIZE_LIMIT for
ARCH_K3.
Best regards,
Philip
next prev parent reply other threads:[~2025-10-02 8:55 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-03 10:56 [PATCH v3 0/5] Simplify image size checks Philip Oberfichtner
2025-09-03 10:56 ` [PATCH v3 1/5] Image size checks: Move all configs in one place Philip Oberfichtner
2025-09-03 12:50 ` Marek Vasut
2025-09-04 8:12 ` Philip Oberfichtner
2025-09-04 13:54 ` Marek Vasut
2025-09-05 8:13 ` Philip Oberfichtner
2025-09-05 14:22 ` Tom Rini
2025-10-10 14:19 ` Philip Oberfichtner
2025-09-03 10:56 ` [PATCH v3 2/5] Image size checks: Use HAS_SIZE_LIMIT consistently Philip Oberfichtner
2025-09-03 12:51 ` Marek Vasut
2025-09-04 8:19 ` Philip Oberfichtner
2025-09-04 13:56 ` Marek Vasut
2025-09-05 8:15 ` Philip Oberfichtner
2025-09-05 14:19 ` Tom Rini
2025-09-30 8:33 ` Philip Oberfichtner
2025-09-30 14:45 ` Tom Rini
2025-10-02 8:55 ` Philip Oberfichtner [this message]
2025-10-02 21:19 ` Tom Rini
2025-10-10 14:28 ` Philip Oberfichtner
2025-09-03 10:56 ` [PATCH v3 3/5] Image size checks: Use consistent help texts Philip Oberfichtner
2025-09-03 12:54 ` Marek Vasut
2025-09-04 8:20 ` Philip Oberfichtner
2025-09-03 10:56 ` [PATCH v3 4/5] Image size checks: Deduplicate Makefile Philip Oberfichtner
2025-09-03 13:02 ` Marek Vasut
2025-09-04 8:30 ` Philip Oberfichtner
2025-09-04 15:03 ` Marek Vasut
2025-09-05 8:22 ` Philip Oberfichtner
2025-09-03 10:56 ` [PATCH v3 5/5] Image size checks: Simplify SPL_SIZE_LIMIT logic Philip Oberfichtner
2025-09-03 12:08 ` Heinrich Schuchardt
2025-09-03 12:59 ` Marek Vasut
2025-09-04 8:23 ` Philip Oberfichtner
2025-09-04 8:30 ` Heinrich Schuchardt
2025-09-04 15:02 ` Marek Vasut
2025-09-05 8:19 ` 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=aN49929JEJpWdOee@aristophanes \
--to=pro@denx.de \
--cc=Oliver.Gaskell@analog.com \
--cc=andre.przywara@arm.com \
--cc=anshuld@ti.com \
--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=marek.vasut@mailbox.org \
--cc=nathan.morrison@timesys.com \
--cc=paul.barker.ct@bp.renesas.com \
--cc=peng.fan@nxp.com \
--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.