[PATCH 4/5] mach-snapdragon: support building SPL
Tom Rini
trini at konsulko.com
Mon Apr 6 16:27:37 CEST 2026
On Sat, Apr 04, 2026 at 01:18:19AM +0200, michael.srba at seznam.cz wrote:
> From: Michael Srba <Michael.Srba at seznam.cz>
>
> Initially sdm845 support is added, and only usb boot
> is supported for the next stage.
>
> Signed-off-by: Michael Srba <Michael.Srba at seznam.cz>
[snip]
> diff --git a/arch/arm/mach-snapdragon/Kconfig b/arch/arm/mach-snapdragon/Kconfig
> index 976c0e35fce..938e6ebd8bf 100644
> --- a/arch/arm/mach-snapdragon/Kconfig
> +++ b/arch/arm/mach-snapdragon/Kconfig
> @@ -1,6 +1,24 @@
> if ARCH_SNAPDRAGON
>
> +# SoC specific SRAM addresses
> +
> +# sdm845
> +SDM845_BOOT_IMEM_BASE := 0x14800000
> +SDM845_BOOT_IMEM_SIZE := 0x180000
> +# we may not be able to use the whole BOOT_IMEM depending on the whitelisted regions hardcoded in PBL
> +# (we could technically relocate ourselves after the fact)
> +SDM845_BOOT_IMEM_OFFSET := 0x3f000
> +SDM845_BOOT_IMEM_USABLE_SIZE := 0xc1000
> +# technically the below would work, except the memory from 0x14833000 to 0x1483F000 gets trashed
> +# between the ELF getting loaded and XBL_SEC jumping to our code
> +#SDM845_BOOT_IMEM_OFFSET := 0x16000
> +#SDM845_BOOT_IMEM_USABLE_SIZE := 0xea000
> +SDM845_OCIMEM_BASE := 0x14680000
> +SDM845_OCIMEM_SIZE := 0x00040000
> +SDM845_OCIMEM_END := $(shell, printf "0x%x\n" "$(dollar)(($(SDM845_OCIMEM_BASE) + $(SDM845_OCIMEM_SIZE) - 1))")
I didn't know Kconfig even allowed this. And I *really* don't like it,
and I think it's going in the wrong direction with respect to being able
to configure a system. If these are configurable, then they need to be
"hex" type "config" options, and then used later on. Otherwise they
should just be the evaluated value as "default ... if ..." later on,
instead.
[snip]
> +config QCOM_SPL
> + bool "Enable SPL for Snapdragon SOCs"
> + select SUPPORT_SPL
> + select ARMV8_SPL_EXCEPTION_VECTORS
> + select ENABLE_ARM_SOC_BOOT0_HOOK
> + select SPL
> + select SPL_DM
> + select SPL_DM_GPIO
> + select SPL_DM_PMIC
> + select SPL_DM_USB_GADGET
> + select SPL_ENV_SUPPORT
> + select SPL_GPIO
> + select SPL_HAS_BSS_LINKER_SECTION
> + select SPL_LIBCOMMON_SUPPORT
> + select SPL_LIBDISK_SUPPORT
> + select SPL_LIBGENERIC_SUPPORT
> + select SPL_MMC
> + select SPL_OF_REAL
> + select SPL_OF_CONTROL
> + select SPL_PINCONF
> + select SPL_PINCTRL
> + select SPL_PINCTRL_FULL
> + select SPL_PINCTRL_GENERIC
> + select SPL_PINCONF_RECURSIVE
> + select SPL_PINMUX
> + select SPL_SPRINTF
> + select SPL_STRTO
> + select SPL_USB_GADGET
This should be in the appropriate defconfig, or a config fragment if
re-used a lot. Or mirroring other platforms, as part of the stanza for
TARGET_... (or ARCH_...) as needed.
[snip]
> diff --git a/doc/board/qualcomm/spl.rst b/doc/board/qualcomm/spl.rst
> new file mode 100644
> index 00000000000..817c76b659e
> --- /dev/null
> +++ b/doc/board/qualcomm/spl.rst
> @@ -0,0 +1,70 @@
> +.. SPDX-License-Identifier: GPL-2.0+
> +.. sectionauthor:: Michael Srba <Michael.Srba at seznam.cz>
> +
> +======================================
> +Booting U-Boot SPL on Qualcomm SoCs
> +======================================
> +
> +Overview
> +----------
These are style errors that will trip up CI when it builds the docs.
Please run "make htmldocs KDOC_WERROR=1" for v2, thanks.
--
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/20260406/cfe7f723/attachment.sig>
More information about the U-Boot
mailing list