[PATCH v2 7/9] mach-snapdragon: Add initial support for IPQ5210 SPL

Simon Glass sjg at chromium.org
Sat Apr 11 15:12:33 CEST 2026


Hi Varadarajan,

On 2026-04-10T09:11:45, Varadarajan Narayanan
<varadarajan.narayanan at oss.qualcomm.com> wrote:
> mach-snapdragon: Add initial support for IPQ5210 SPL
>
> Add basic SPL infrastructure for IPQ5210 SoC. This handles basic serial
> console init, identifying the boot media, loading the additional
> firmware binaries to setup DDR, TFA and eventually jump to U-Boot.
>
> Signed-off-by: Varadarajan Narayanan <varadarajan.narayanan at oss.qualcomm.com>
>
> arch/arm/Kconfig                  |   5 +-
>  arch/arm/mach-snapdragon/Makefile |   3 +
>  arch/arm/mach-snapdragon/spl.c    | 701 ++++++++++++++++++++++++++++++++++++++
>  include/smem.h                    |   3 +
>  4 files changed, 710 insertions(+), 2 deletions(-)

> diff --git a/arch/arm/mach-snapdragon/spl.c b/arch/arm/mach-snapdragon/spl.c
> @@ -0,0 +1,701 @@
> +#include <hang.h>
> +#include <cpu_func.h>
> +#include <init.h>

You should add DECLARE_GLOBAL_DATA_PTR here as the code uses gd in
qcom_spl_malloc_init_f(), for example.

> diff --git a/arch/arm/mach-snapdragon/spl.c b/arch/arm/mach-snapdragon/spl.c
> @@ -0,0 +1,701 @@
> +#define QCOM_SPL_DLOAD_MASK          GENMASK(4, 4)
> +#define QCOM_SPL_DLOAD_SHFT          0x4

GENMASK(4, 4) is just BIT(4). Please use BIT(4) directly.

> diff --git a/arch/arm/mach-snapdragon/spl.c b/arch/arm/mach-snapdragon/spl.c
> @@ -0,0 +1,701 @@
> +static int qcom_spl_get_iftbl_entry_by_name(struct interface_table *if_tbl,
> +                                         char *name,
> +                                         struct interface_table_entry *entry)
> +{
> +     u8 uc_index;
> +...
> +     for (uc_index = 0; uc_index < MAX_ENTRIES; uc_index++) {

This should iterate up to if_tbl->num_entries rather than MAX_ENTRIES,
otherwise you will search uninitialised entries. Also name should be
const char *

Also how about uint instead of u8 ?

> diff --git a/arch/arm/mach-snapdragon/spl.c b/arch/arm/mach-snapdragon/spl.c
> @@ -0,0 +1,701 @@
> +     fit = (const void *)CONFIG_SPL_LOAD_FIT_ADDRESS;
> +
> +     if (!fit) {
> +             pr_err("FIT image not found at CONFIG_SPL_LOAD_FIT_ADDRESS\n");
> +             return -EINVAL;
> +     }

CONFIG_SPL_LOAD_FIT_ADDRESS is a compile-time constant which (08cbe000
?) so cannot be zero.

> diff --git a/arch/arm/mach-snapdragon/spl.c b/arch/arm/mach-snapdragon/spl.c
> @@ -0,0 +1,701 @@
> +void board_init_f(ulong dummy)
> +{
> +...
> +     qclib_post_process_from_spl();
> +
> +     board_init_r(NULL, 0);

The return value from qclib_post_process_from_spl() is ignored. If it
fails, you should call qcom_spl_error_handler() like you do for the
other errors in this function.

> diff --git a/arch/arm/mach-snapdragon/spl.c b/arch/arm/mach-snapdragon/spl.c
> @@ -0,0 +1,701 @@
> +void reset_cpu(void)
> +{
> +}

Please add a comment as to why it is empty.

Regards,
Simon


More information about the U-Boot mailing list