public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Tom Rini <trini@konsulko.com>
To: Michael Srba <Michael.Srba@seznam.cz>
Cc: u-boot@lists.denx.de, Sumit Garg <sumit.garg@kernel.org>,
	u-boot-qcom@groups.io,
	Ilias Apalodimas <ilias.apalodimas@linaro.org>,
	Simon Glass <sjg@chromium.org>,
	Sughosh Ganu <sughosh.ganu@arm.com>,
	Anshul Dalal <anshuld@ti.com>, Peng Fan <peng.fan@nxp.com>,
	Mattijs Korpershoek <mkorpershoek@kernel.org>,
	Quentin Schulz <quentin.schulz@cherry.de>,
	Heinrich Schuchardt <xypron.glpk@gmx.de>,
	Andrew Davis <afd@ti.com>, Hrushikesh Salunke <h-salunke@ti.com>,
	Dario Binacchi <dario.binacchi@amarulasolutions.com>,
	Ye Li <ye.li@nxp.com>, Andre Przywara <andre.przywara@arm.com>,
	Alif Zakuan Yuslaimi <alif.zakuan.yuslaimi@altera.com>,
	Leo Yu-Chi Liang <ycliang@andestech.com>,
	Andrew Goodbody <andrew.goodbody@linaro.org>,
	Dhruva Gole <d-gole@ti.com>,
	Kaustabh Chakraborty <kauschluss@disroot.org>,
	Jerome Forissier <jerome.forissier@arm.com>,
	Heiko Schocher <hs@nabladev.com>,
	Marek Vasut <marek.vasut+renesas@mailbox.org>,
	Lukasz Majewski <lukma@denx.de>,
	Mateusz Kulikowski <mateusz.kulikowski@gmail.com>,
	Dinesh Maniyam <dinesh.maniyam@altera.com>,
	Neil Armstrong <neil.armstrong@linaro.org>,
	Patrice Chotard <patrice.chotard@foss.st.com>,
	Patrick Delaunay <patrick.delaunay@foss.st.com>,
	Michal Simek <michal.simek@amd.com>, Yao Zi <me@ziyao.cc>,
	Peter Korsgaard <peter@korsgaard.com>,
	Rayagonda Kokatanur <rayagonda.kokatanur@broadcom.com>,
	Casey Connolly <casey.connolly@linaro.org>,
	Tingting Meng <tingting.meng@altera.com>,
	Tien Fong Chee <tien.fong.chee@altera.com>,
	Alice Guo <alice.guo@nxp.com>, George Chan <gchan9527@gmail.com>,
	Balaji Selvanathan <balaji.selvanathan@oss.qualcomm.com>,
	Alexey Charkov <alchark@gmail.com>,
	Ronald Wahl <ronald.wahl@legrand.com>
Subject: Re: [PATCH v2 06/10] mach-snapdragon: Kconfig: changes / additions to support SPL
Date: Mon, 20 Apr 2026 12:05:40 -0600	[thread overview]
Message-ID: <20260420180540.GW41863@bill-the-cat> (raw)
In-Reply-To: <596c73ef-b0ec-4543-bd06-ac3b18029edd@seznam.cz>

[-- Attachment #1: Type: text/plain, Size: 6847 bytes --]

On Sat, Apr 18, 2026 at 03:01:22AM +0200, Michael Srba wrote:
> Hi,
> 
> On 4/13/26 19:17, Tom Rini wrote:
> > On Sat, Apr 11, 2026 at 02:00:11AM +0200, michael.srba@seznam.cz wrote:
> > 
> > > From: Michael Srba <Michael.Srba@seznam.cz>
> > > 
> > > An SoC to target has to be selected, e.g. SPL_TARGET_SDM845.
> > > This will select reasonable defaults and enable per-SoC linker
> > > script (if required).
> > > 
> > > Signed-off-by: Michael Srba <Michael.Srba@seznam.cz>
> > > ---
> > >   arch/arm/Kconfig                 | 31 +++++++++++++++++++++++++++-
> > >   arch/arm/mach-snapdragon/Kconfig | 44 ++++++++++++++++++++++++++++++++++------
> > >   2 files changed, 68 insertions(+), 7 deletions(-)
> > > 
> > > diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> > > index 03416c55265..8490e336516 100644
> > > --- a/arch/arm/Kconfig
> > > +++ b/arch/arm/Kconfig
> > > @@ -1138,9 +1138,38 @@ config ARCH_SNAPDRAGON
> > >   	select SAVE_PREV_BL_FDT_ADDR if !ENABLE_ARM_SOC_BOOT0_HOOK
> > >   	select LINUX_KERNEL_IMAGE_HEADER if !ENABLE_ARM_SOC_BOOT0_HOOK
> > >   	select SYSRESET
> > > -	select SYSRESET_PSCI
> > > +	select SYSRESET_PSCI if !SPL
> > >   	select ANDROID_BOOT_IMAGE_IGNORE_BLOB_ADDR
> > >   	select MMU_PGPROT
> > > +	select SUPPORT_SPL
> > > +	select ARMV8_SPL_EXCEPTION_VECTORS if SPL
> > > +	select ENABLE_ARM_SOC_BOOT0_HOOK if SPL
> > > +	select SPL_DM if SPL
> > > +	select SPL_DM_GPIO if SPL
> > > +	select SPL_DM_PMIC if SPL
> > > +	select SPL_DM_USB_GADGET if SPL
> > > +	select SPL_ENV_SUPPORT if SPL
> > > +	select SPL_GPIO if SPL
> > > +	select SPL_HAS_BSS_LINKER_SECTION if SPL
> > > +	select SPL_LIBCOMMON_SUPPORT if SPL
> > > +	select SPL_LIBDISK_SUPPORT if SPL
> > > +	select SPL_LIBGENERIC_SUPPORT if SPL
> > > +	select SPL_MMC if SPL
> > > +	select SPL_OF_REAL if SPL
> > > +	select SPL_OF_CONTROL if SPL
> > > +	select SPL_PINCONF if SPL
> > > +	select SPL_PINCTRL if SPL
> > > +	select SPL_PINCTRL_FULL if SPL
> > > +	select SPL_PINCTRL_GENERIC if SPL
> > > +	select SPL_PINCONF_RECURSIVE if SPL
> > > +	select SPL_PINMUX if SPL
> > > +	select SPL_SPRINTF if SPL
> > > +	select SPL_STRTO if SPL
> > > +	select SPL_USB_GADGET if SPL
> > > +	imply DM_EVENT if USB_DWC3_GENERIC || SPL_USB_DWC3_GENERIC
> > > +	imply SPL_EVENT if SPL_USB_DWC3_GENERIC
> > > +	imply OF_LIVE if USB_DWC3_GENERIC
> > > +	imply SPL_OF_LIVE if SPL_USB_DWC3_GENERIC
> > >   	imply OF_UPSTREAM
> > >   	imply CMD_DM
> > >   	imply DM_USB_GADGET
> > This part looks good.
> > 
> > > diff --git a/arch/arm/mach-snapdragon/Kconfig b/arch/arm/mach-snapdragon/Kconfig
> > > index 976c0e35fce..74d687ceee2 100644
> > > --- a/arch/arm/mach-snapdragon/Kconfig
> > > +++ b/arch/arm/mach-snapdragon/Kconfig
> > > @@ -11,18 +11,12 @@ config SYS_VENDOR
> > >   	  Based on this option board/<CONFIG_SYS_VENDOR>/<CONFIG_SYS_BOARD>
> > >   	  will be used as the custom board directory.
> > > -config SYS_MALLOC_LEN
> > > -	default 0x10000000
> > > -
> > >   config SYS_MALLOC_F_LEN
> > >   	default 0x2000
> > >   config SPL_SYS_MALLOC_F
> > >   	default y
> > > -config SPL_SYS_MALLOC_F_LEN
> > > -	default 0x2000
> > > -
> > >   config SYS_MALLOC_LEN
> > >   	default 0x800000
> > > @@ -45,4 +39,42 @@ config SYS_CONFIG_NAME
> > >   	  Based on this option include/configs/<CONFIG_SYS_CONFIG_NAME>.h header
> > >   	  will be used for board configuration.
> > > +config SPL_SHARES_INIT_SP_ADDR
> > > +	default n
> > > +
> > > +config SPL_HAVE_INIT_STACK
> > > +	default y
> > > +
> > > +# SPL targets
> > > +
> > > +config SPL_TARGET_SDM845
> > > +	bool "Set reasonable default values for running SPL in SRAM on sdm845 devices"
> > This namespace is confusing and so shouldn't be used. Does SDM845 get
> > used without SPL? We should probably follow the convention of adding a
> > new defconfig of <whatever board>_spl_defconfig, that enables the
> > options as needed.
> The rationale for this naming was that outside SPL, we don't currently
> discriminate between SoCs at compile time (there is some discrimination
> between legacy board support the and unified "board" which covers all
> non-legacy boards no matter the SoC, but for non-legacy boards there
> is just a single build of U-Boot proper, possibly with a board dtb
> appended if used as the primary bootloader). I suppose the SPL_ prefix
> may be confusing and isn't strictly necessary, and we may need a similar
> target option for msm8916 in the future which wouldn't be used in SPL
> but in u-boot proper, so it makes sense to get rid of the prefix.
> 
> The reason we need this config option at all (even if we move all
> the Kconfig defaults that use it into the defconfig) is that the
> boot0.h is shared among all of mach-snapdragon, and we need a way
> to select which SoC-specific boot0.h we should include.
> Now, it does look like SYS_SOC is intended for stuff like this,
> however changing SYS_SOC from snapdragon seems to completely break
> the unified board support which isn't really worth it.
> 
> Admittedly, it does seem that I somehow completely forgot to mention that
> use of the config option in both the commit message and the Kconfig,
> but it is effectively the only use it has left after moving everything
> into the defconfig.
> 
> So, should I include an SoC selection menu similar to the board selection
> menus in e.g mach-exynos, which would now solely be used by the ifdef
> in boot0.h? Something like
> ```
> choice
>     prompt "Qualcomm SoC select"
>     default TARGET_NONE if !SPL
>     help
>       While U-Boot on Qualcomm platforms doesn't generally need compile-time
>       adjustment based on the target SoC, there are a few exceptions to this.
>       Currently this concerns boot0.h discrimination.
> 
> config TARGET_NONE
>     bool "Generic build"
>     help
>       Select this if you're not building SPL. U-Boot proper builds are currently
>       generic across all SoCs.
> 
> config TARGET_SDM845
>     bool "SPL targeting the sdm845 SoC"
>     help
>       Select this if you are bulding u-boot SPL for sdm845.
>       Currently this gates sdm845-specific boot0.h (only used in SPL).
> 
> endchoice
> ```
> 
> ... or do you have something else in mind? I'm not entirely sure if you're
> suggesting to get rid of TARGET_SDM845 completely (which I really don't see
> as possible at least without a lot of unnecessary pain) or just of it's
> use for the defaults.

That's for explaining more. The SPL_xxx namespace is generally reserved
so that we can do things like:
obj-$(CONFIG_$(PHASE)FOO) += foo.o
in a Makefile, and have symbols for SPL_FOO, FOO (and TPL_FOO).

So I think your suggestion here is fine, pending feedback from the
snapdragon maintainers.

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

  reply	other threads:[~2026-04-20 20:34 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-11  0:00 [PATCH v2 00/10] Add SPL support for Qualcomm platforms, starting with sdm845 michael.srba
2026-04-11  0:00 ` [PATCH v2 01/10] Makefile: add SPL_REMAKE_ELF_LDSCRIPT feature michael.srba
2026-04-11 15:39   ` Simon Glass
2026-04-13 17:12   ` Tom Rini
2026-04-11  0:00 ` [PATCH v2 02/10] of_live: support in SPL michael.srba
2026-04-11 15:39   ` Simon Glass
2026-04-11  0:00 ` [PATCH v2 03/10] drivers: allow clk_stub and spmi " michael.srba
2026-04-11 15:39   ` Simon Glass
2026-04-13 17:13   ` Tom Rini
2026-04-11  0:00 ` [PATCH v2 04/10] mach-snapdragon: boot0.h: split out msm8916_boot0.h michael.srba
2026-04-11 15:39   ` Simon Glass
2026-04-11  0:00 ` [PATCH v2 05/10] mach-snapdragon: add u-boot-spl-elf-sdm845.lds michael.srba
2026-04-11 15:40   ` Simon Glass
2026-04-11  0:00 ` [PATCH v2 06/10] mach-snapdragon: Kconfig: changes / additions to support SPL michael.srba
2026-04-11 15:40   ` Simon Glass
2026-04-13 17:17   ` Tom Rini
2026-04-18  1:01     ` Michael Srba
2026-04-20 18:05       ` Tom Rini [this message]
2026-04-11  0:00 ` [PATCH v2 07/10] mach-snapdragon: boot0.h: add sdm845_spl_boot0.h michael.srba
2026-04-11 15:40   ` Simon Glass
2026-04-16 19:15     ` Michael Srba
2026-04-16 21:09       ` Simon Glass
2026-04-11  0:00 ` [PATCH v2 08/10] mach-snapdragon: add board-spl.c and split out common code michael.srba
2026-04-11 20:30   ` Simon Glass
2026-04-11  0:00 ` [PATCH v2 09/10] qualcomm: add defconfig, env and docs for SPL on sdm845 michael.srba
2026-04-11 20:30   ` Simon Glass
2026-04-13 17:21   ` Tom Rini
2026-04-11  0:00 ` [PATCH v2 10/10] dts: add u-boot specific sdm845 .dtsi a .dtsi for shift-axolotl michael.srba
2026-04-11 15:40   ` Simon Glass

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=20260420180540.GW41863@bill-the-cat \
    --to=trini@konsulko.com \
    --cc=Michael.Srba@seznam.cz \
    --cc=afd@ti.com \
    --cc=alchark@gmail.com \
    --cc=alice.guo@nxp.com \
    --cc=alif.zakuan.yuslaimi@altera.com \
    --cc=andre.przywara@arm.com \
    --cc=andrew.goodbody@linaro.org \
    --cc=anshuld@ti.com \
    --cc=balaji.selvanathan@oss.qualcomm.com \
    --cc=casey.connolly@linaro.org \
    --cc=d-gole@ti.com \
    --cc=dario.binacchi@amarulasolutions.com \
    --cc=dinesh.maniyam@altera.com \
    --cc=gchan9527@gmail.com \
    --cc=h-salunke@ti.com \
    --cc=hs@nabladev.com \
    --cc=ilias.apalodimas@linaro.org \
    --cc=jerome.forissier@arm.com \
    --cc=kauschluss@disroot.org \
    --cc=lukma@denx.de \
    --cc=marek.vasut+renesas@mailbox.org \
    --cc=mateusz.kulikowski@gmail.com \
    --cc=me@ziyao.cc \
    --cc=michal.simek@amd.com \
    --cc=mkorpershoek@kernel.org \
    --cc=neil.armstrong@linaro.org \
    --cc=patrice.chotard@foss.st.com \
    --cc=patrick.delaunay@foss.st.com \
    --cc=peng.fan@nxp.com \
    --cc=peter@korsgaard.com \
    --cc=quentin.schulz@cherry.de \
    --cc=rayagonda.kokatanur@broadcom.com \
    --cc=ronald.wahl@legrand.com \
    --cc=sjg@chromium.org \
    --cc=sughosh.ganu@arm.com \
    --cc=sumit.garg@kernel.org \
    --cc=tien.fong.chee@altera.com \
    --cc=tingting.meng@altera.com \
    --cc=u-boot-qcom@groups.io \
    --cc=u-boot@lists.denx.de \
    --cc=xypron.glpk@gmx.de \
    --cc=ycliang@andestech.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox