[PATCH 4/5] mach-snapdragon: support building SPL

Casey Connolly casey.connolly at linaro.org
Wed Apr 8 10:52:15 CEST 2026


Hi Michael,

On 04/04/2026 01:18, 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.
> 

[snip]

> diff --git a/arch/arm/mach-snapdragon/board.c b/arch/arm/mach-snapdragon/board.c
> index 5fb3240acc5..0f980a954e4 100644
> --- a/arch/arm/mach-snapdragon/board.c
> +++ b/arch/arm/mach-snapdragon/board.c
> @@ -33,6 +33,8 @@
>  #include <sort.h>
>  #include <time.h>
>  
> +#include <spl.h>

I think it would be preferable to split out the SPL specific parts,
particularly since a lot of the functions here won't be called in SPL,
and even if they are the context is quite different. Like if
board_fdt_blob_setup() is called in SPL I would still suggest having a
separate version of it since the logic surely would be different.

Could you put any common code you do need in SPL into common.c and add a
new spl.c with the spl-specific parts?

> +
>  #include "qcom-priv.h"
>  
>  DECLARE_GLOBAL_DATA_PTR;
> @@ -223,6 +225,7 @@ int board_fdt_blob_setup(void **fdtp)
>  		panic("Internal FDT is invalid and no external FDT was provided! (fdt=%#llx)\n",
>  		      (phys_addr_t)external_fdt);
>  
> +#if !defined(CONFIG_SPL_BUILD)
>  	/* Prefer memory information from internal DT if it's present */
>  	if (internal_valid)
>  		ret = qcom_parse_memory(internal_fdt);
> @@ -239,6 +242,7 @@ int board_fdt_blob_setup(void **fdtp)
>  
>  	if (ret < 0)
>  		panic("No valid memory ranges found!\n");
> +#endif
>  
>  	/* If we have an external FDT, it can only have come from the Android bootloader. */
>  	if (external_valid)
> @@ -258,7 +262,9 @@ int board_fdt_blob_setup(void **fdtp)
>  		ret = 0;
>  	}
>  
> +#if CONFIG_IS_ENABLED(SYSRESET_PSCI) && !defined(CONFIG_SPL_BUILD)
>  	qcom_psci_fixup(*fdtp);
> +#endif
>  
>  	return ret;
>  }
> @@ -313,7 +319,9 @@ void __weak qcom_board_init(void)
>  
>  int board_init(void)
>  {
> +#if CONFIG_IS_ENABLED(SYSRESET_PSCI) && !defined(CONFIG_SPL_BUILD)
>  	show_psci_version();
> +#endif
>  	qcom_board_init();
>  	return 0;
>  }
> @@ -749,3 +757,21 @@ void enable_caches(void)
>  	}
>  	dcache_enable();
>  }
> +
> +/* for SPL */
> +
> +__weak void reset_cpu(void)
> +{
> +	/* TODO */

Could you puts() something here to indicate that the board will hang?

Thanks,

-- 
// Casey (she/her)



More information about the U-Boot mailing list