[PATCH v4 07/11] mach-snapdragon: Kconfig: changes / additions to support SPL

Sumit Garg sumit.garg at kernel.org
Fri May 1 09:31:17 CEST 2026


On Sun, Apr 26, 2026 at 01:26:09AM +0200, michael.srba at seznam.cz wrote:
> From: Michael Srba <Michael.Srba at seznam.cz>
> 
> An SoC to target has to be selected, e.g. TARGET_SDM845.
> This will enable the per-SoC boot0.h.
> 
> Signed-off-by: Michael Srba <Michael.Srba at seznam.cz>
> ---
>  arch/arm/Kconfig                 | 34 +++++++++++++++++++++++++++++++++-
>  arch/arm/mach-snapdragon/Kconfig | 31 ++++++++++++++++++++++++++++---
>  2 files changed, 61 insertions(+), 4 deletions(-)
> 
> diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
> index 03416c55265..ddabc23fc9e 100644
> --- a/arch/arm/Kconfig
> +++ b/arch/arm/Kconfig
> @@ -1124,6 +1124,7 @@ config ARCH_SNAPDRAGON
>  	bool "Qualcomm Snapdragon SoCs"
>  	select ARM64
>  	select DM
> +	select DM_EVENT if USB_DWC3_GENERIC || SPL_USB_DWC3_GENERIC
>  	select DM_GPIO
>  	select DM_SERIAL
>  	select DM_RESET
> @@ -1138,9 +1139,40 @@ 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 OF_LIVE if USB_DWC3_GENERIC
> +	select SPL_OF_LIVE if SPL_USB_DWC3_GENERIC
> +	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_EVENT if SPL_USB_DWC3_GENERIC
> +	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_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_SPMI if SPL
> +	select SPL_SPMI_MSM if SPL
> +	select SPL_SPRINTF if SPL
> +	select SPL_STRTO if SPL
> +	select SPL_USB_GADGET if SPL
> +	imply SPL_MMC if SPL
>  	imply OF_UPSTREAM
>  	imply CMD_DM
>  	imply DM_USB_GADGET
> diff --git a/arch/arm/mach-snapdragon/Kconfig b/arch/arm/mach-snapdragon/Kconfig
> index f82cd0d3291..3b5ae6d98fb 100644
> --- a/arch/arm/mach-snapdragon/Kconfig
> +++ b/arch/arm/mach-snapdragon/Kconfig
> @@ -17,9 +17,6 @@ config SYS_MALLOC_F_LEN
>  config SPL_SYS_MALLOC_F
>  	default y
>  
> -config SPL_SYS_MALLOC_F_LEN
> -	default 0x2000
> -
>  config SYS_MALLOC_LEN
>  	default 0x800000
>  
> @@ -42,4 +39,32 @@ 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
> +
> +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 building u-boot SPL for sdm845.
> +	  Currently this gates sdm845-specific boot0.h (only used in SPL).

In Qualcomm ecosystem, we have been avoiding any SoC or board specific
config options in an effort to try people migrate to use generic platform
code only.

I think this boot0.h hook code is going to be one exception. Can you
rather define a special Kconfig option for this saying?

	BOOT0_SDM845_WORKAROUND

which can then be enabled in your special defconfig.

-Sumit


More information about the U-Boot mailing list