* [PATCH v5 01/13] arm: qcom: add common QCLIB SPL extension helpers
2026-10-29 10:57 [PATCH v5 00/13] qcom: shikra: add eMMC SPL boot support Abhilash V
@ 2026-10-29 10:57 ` Abhilash V
2026-10-29 16:47 ` Tom Rini
2026-10-29 10:57 ` [PATCH v5 02/13] pinctrl: qcom: add Shikra SPL pinctrl option Abhilash V
` (11 subsequent siblings)
12 siblings, 1 reply; 21+ messages in thread
From: Abhilash V @ 2026-10-29 10:57 UTC (permalink / raw)
To: trini, ilias.apalodimas, aswin.murugan, casey.connolly,
neil.armstrong, sumit.garg, lukma, peng.fan, jh80.chung,
tanmay.kathpalia, abhilash.v, sjg, Michael.Srba,
varadarajan.narayanan, nikroks, balaji.selvanathan, nathbappai,
jbx6244, u-boot, u-boot-qcom
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=yes, Size: 8156 bytes --]
Add helpers for adding QCLIB interface-table entries and FIT
blobs, expose the DDR self-refresh exit address, preserve
U-Boot global data across the QCLIB call, and provide weak
reset hooks for SoC-specific SPL code.
Signed-off-by: Abhilash V <abhilash.v@oss.qualcomm.com>
---
arch/arm/mach-snapdragon/board_spl.c | 50 ++++++++++++
arch/arm/mach-snapdragon/include/mach/qclib.h | 16 +++-
arch/arm/mach-snapdragon/include/mach/spl.h | 3 +
arch/arm/mach-snapdragon/qclib.c | 77 +++++++++++++++----
4 files changed, 130 insertions(+), 16 deletions(-)
diff --git a/arch/arm/mach-snapdragon/board_spl.c b/arch/arm/mach-snapdragon/board_spl.c
index 3293eab8f81..4e3b2527a7b 100644
--- a/arch/arm/mach-snapdragon/board_spl.c
+++ b/arch/arm/mach-snapdragon/board_spl.c
@@ -6,8 +6,11 @@
*/
#include <asm/sections.h>
+#include <blk.h>
+#include <dm/uclass.h>
#include <hang.h>
#include <init.h>
+#include <linux/err.h>
#include <mach/qclib.h>
#include <spl.h>
#include <soc/qcom/smem.h>
@@ -27,6 +30,53 @@ __weak void reset_cpu(void)
hang();
}
+void __weak qcom_spl_soc_shrm_reset(void)
+{
+}
+
+void __weak qcom_spl_soc_rpm_reset(void)
+{
+}
+
+/**
+ * qcom_spl_get_boot_blk_desc() - Get the boot medium's block device.
+ * @descp: Set to the resolved block device on success.
+ *
+ * Maps the already-detected boot device to the uclass/devnum pair.
+ *
+ * Return: 0 on success, or a negative error code if the boot device is
+ * unsupported or its block device cannot be found.
+ */
+int qcom_spl_get_boot_blk_desc(struct blk_desc **descp)
+{
+ enum uclass_id uclass_id;
+ int devnum;
+
+ switch (spl_boot_device()) {
+ case BOOT_DEVICE_MMC1:
+ uclass_id = UCLASS_MMC;
+ devnum = 0;
+ break;
+ case BOOT_DEVICE_MMC2:
+ case BOOT_DEVICE_MMC2_2:
+ uclass_id = UCLASS_MMC;
+ devnum = 1;
+ break;
+ case BOOT_DEVICE_UFS:
+ uclass_id = UCLASS_SCSI;
+ devnum = 0;
+ break;
+ default:
+ return -ENOSYS;
+ }
+
+ *descp = blk_get_devnum_by_uclass_id(uclass_id, devnum);
+ if (!*descp)
+ return -ENODEV;
+
+ return 0;
+}
+
#if IS_ENABLED(CONFIG_SPL_SMEM)
/**
* qcom_spl_populate_smem() - Populate shared memory (SMEM) information.
diff --git a/arch/arm/mach-snapdragon/include/mach/qclib.h b/arch/arm/mach-snapdragon/include/mach/qclib.h
index b44874c514e..10865b03ea1 100644
--- a/arch/arm/mach-snapdragon/include/mach/qclib.h
+++ b/arch/arm/mach-snapdragon/include/mach/qclib.h
@@ -65,11 +65,25 @@ void qclib_set_qcsdi_address(u64 address);
u64 qclib_get_log_buffer_entry(void);
void qclib_set_log_buffer_entry(u64 address);
+/* DDR self-refresh exit address accessors, populated post-QCLIB */
+u64 qclib_get_ddr_sr_exit_address(void);
+void qclib_set_ddr_sr_exit_address(u64 address);
+
+/* Interface-table entry helpers */
+int qclib_add_iftbl_entry(struct interface_table *table,
+ const char *name, u64 address, u32 size);
+int qclib_add_iftbl_fit_blob(struct interface_table *table,
+ const void *fit, int images_node,
+ const char *name, u32 size);
+
/*
* __weak SoC extension points. A board's spl-<soc>.c may provide a strong
- * override for any of these; the defaults in qclib.c are all no-ops.
+ * override for any of these; the defaults are provided by the common
+ * Snapdragon SPL implementation.
*/
bool qcom_spl_soc_check_dload_mode(void);
+void qcom_spl_soc_shrm_reset(void);
+void qcom_spl_soc_rpm_reset(void);
int qcom_spl_soc_pre_qclib_routine(void);
int qcom_spl_soc_qclib_override(struct interface_table *table, const void *fit,
int images_node);
diff --git a/arch/arm/mach-snapdragon/include/mach/spl.h b/arch/arm/mach-snapdragon/include/mach/spl.h
index 50cc8dc4e8f..a32a85c48fd 100644
--- a/arch/arm/mach-snapdragon/include/mach/spl.h
+++ b/arch/arm/mach-snapdragon/include/mach/spl.h
@@ -6,8 +6,11 @@
#ifndef __SPL_H__
#define __SPL_H__
+struct blk_desc;
+
void qcom_spl_malloc_init_f(void);
int qcom_spl_loader_pre_ddr(u8 boot_device);
void qcom_spl_error_handler(void *arg);
+int qcom_spl_get_boot_blk_desc(struct blk_desc **descp);
#endif /* __SPL_H__ */
diff --git a/arch/arm/mach-snapdragon/qclib.c b/arch/arm/mach-snapdragon/qclib.c
index 7f25f37b5d9..b9a74863c1c 100644
--- a/arch/arm/mach-snapdragon/qclib.c
+++ b/arch/arm/mach-snapdragon/qclib.c
@@ -2,7 +2,8 @@
/*
* QCLIB interface-table protocol: generic, SoC-agnostic orchestration of the
* hand-off to the QCLIB firmware image, plus __weak extension points a
- * per-board spl-<soc>.c may override to populate SoC-specific table entries.
+ * per-board spl-<soc>.c may override to populate SoC-specific table entries
+ * and provide SoC-specific reset sequences.
*/
#include <cpu_func.h>
@@ -15,6 +16,17 @@
static u64 g_qcsdi_address __section(".data");
static u64 g_log_buffer_entry __section(".data");
+static u64 g_ddr_sr_exit_address __section(".data");
+
+u64 qclib_get_ddr_sr_exit_address(void)
+{
+ return g_ddr_sr_exit_address;
+}
+
+void qclib_set_ddr_sr_exit_address(u64 address)
+{
+ g_ddr_sr_exit_address = address;
+}
u64 qclib_get_qcsdi_address(void)
{
@@ -36,6 +48,42 @@ void qclib_set_log_buffer_entry(u64 address)
g_log_buffer_entry = address;
}
+int qclib_add_iftbl_entry(struct interface_table *table,
+ const char *name, u64 address, u32 size)
+{
+ uint entry_idx = table->num_entries;
+
+ if (entry_idx >= table->max_entries)
+ return -ENOSPC;
+
+ memset(&table->if_table_entries[entry_idx], 0,
+ sizeof(table->if_table_entries[entry_idx]));
+ memcpy(table->if_table_entries[entry_idx].entry_name, name, strlen(name));
+ table->if_table_entries[entry_idx].address = address;
+ table->if_table_entries[entry_idx].size = size;
+ table->num_entries = entry_idx + 1;
+
+ return 0;
+}
+
+int qclib_add_iftbl_fit_blob(struct interface_table *table,
+ const void *fit, int images_node,
+ const char *name, u32 size)
+{
+ int node, ret;
+ u64 address;
+
+ node = fdt_subnode_offset(fit, images_node, name);
+ if (node < 0)
+ return -ENOENT;
+
+ ret = qcom_spl_get_fit_img_entry_point((void *)fit, node, &address);
+ if (ret)
+ return ret;
+
+ return qclib_add_iftbl_entry(table, name, address, size);
+}
+
bool __weak qcom_spl_soc_check_dload_mode(void)
{
return false;
@@ -43,6 +91,8 @@ bool __weak qcom_spl_soc_check_dload_mode(void)
int __weak qcom_spl_soc_pre_qclib_routine(void)
{
+ qcom_spl_soc_shrm_reset();
+
return 0;
}
@@ -60,7 +110,7 @@ int __weak qcom_spl_soc_post_qclib_routine(struct interface_table *if_tbl)
int __weak qclib_populate_interface_table(struct interface_table *if_tbl,
const void *fit, int images_node)
{
- struct interface_table_entry *log_buffer_entry;
+ int ret;
memset(if_tbl, 0, sizeof(struct interface_table));
memcpy(if_tbl->magic_key, MAGIC_KEY, strlen(MAGIC_KEY));
@@ -68,17 +118,10 @@ int __weak qclib_populate_interface_table(struct interface_table *if_tbl,
if_tbl->num_entries = 0;
if_tbl->max_entries = MAX_ENTRIES;
- /*
- * Reserve the "qclib_log_buffer" slot — common to every SoC.
- * QCLIB fills in the address itself; SPL just allocates the entry.
- */
- log_buffer_entry = &if_tbl->if_table_entries[if_tbl->num_entries];
- memcpy(log_buffer_entry->entry_name, QCLIB_LOG_BUFFER,
- strlen(QCLIB_LOG_BUFFER));
- log_buffer_entry->address = 0;
- log_buffer_entry->size = 0;
- log_buffer_entry->attributes = 0;
- if_tbl->num_entries++;
+ /* Reserve the common qclib_log_buffer slot. */
+ ret = qclib_add_iftbl_entry(if_tbl, QCLIB_LOG_BUFFER, 0, 0);
+ if (ret)
+ return ret;
return qcom_spl_soc_qclib_override(if_tbl, fit, images_node);
}
@@ -146,9 +189,13 @@ int qcom_spl_invoke_qclib(void)
register void *x0 asm("x0") = &if_tbl;
register void *x1 asm("x1") = NULL;
register u64 x8 asm("x8") = entry_point;
+ u64 saved_x18;
- asm volatile ("blr x8"
- : "+r" (x0)
+ /* U-Boot keeps global data in x18 on AArch64. */
+ asm volatile ("str x18, %1\n\t"
+ "blr x8\n\t"
+ "ldr x18, %1"
+ : "+r" (x0), "=m" (saved_x18)
: "r" (x1), "r" (x8)
: "x2", "x3", "x4", "x5", "x6", "x7", "x9", "x10",
"x11", "x12", "x13", "x14", "x15", "x16", "x17",
--
2.34.1
^ permalink raw reply related [flat|nested] 21+ messages in thread* Re: [PATCH v5 01/13] arm: qcom: add common QCLIB SPL extension helpers
2026-10-29 10:57 ` [PATCH v5 01/13] arm: qcom: add common QCLIB SPL extension helpers Abhilash V
@ 2026-10-29 16:47 ` Tom Rini
0 siblings, 0 replies; 21+ messages in thread
From: Tom Rini @ 2026-10-29 16:47 UTC (permalink / raw)
To: Abhilash V
Cc: ilias.apalodimas, aswin.murugan, casey.connolly, neil.armstrong,
sumit.garg, lukma, peng.fan, jh80.chung, tanmay.kathpalia, sjg,
Michael.Srba, varadarajan.narayanan, nikroks, balaji.selvanathan,
nathbappai, jbx6244, u-boot, u-boot-qcom
[-- Attachment #1: Type: text/plain, Size: 989 bytes --]
On Thu, Oct 29, 2026 at 03:57:34AM -0700, Abhilash V wrote:
> Add helpers for adding QCLIB interface-table entries and FIT
> blobs, expose the DDR self-refresh exit address, preserve
> U-Boot global data across the QCLIB call, and provide weak
> reset hooks for SoC-specific SPL code.
>
> Signed-off-by: Abhilash V <abhilash.v@oss.qualcomm.com>
Why are we doing this:
[snip]
> +void __weak qcom_spl_soc_shrm_reset(void)
> +{
> +}
[snip]
> @@ -43,6 +91,8 @@ bool __weak qcom_spl_soc_check_dload_mode(void)
>
> int __weak qcom_spl_soc_pre_qclib_routine(void)
> {
> + qcom_spl_soc_shrm_reset();
> +
> return 0;
> }
Where presumably qcom_spl_soc_pre_qclib_routine was added in one of the
listed pre-requisite series. Is there some future point where a chip
provides a non-weak version (I hope so)? How many different chips do
this (I hope more than one, to justify using weak rather than just a
conditional check or some other abstraction)?
--
Tom
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH v5 02/13] pinctrl: qcom: add Shikra SPL pinctrl option
2026-10-29 10:57 [PATCH v5 00/13] qcom: shikra: add eMMC SPL boot support Abhilash V
2026-10-29 10:57 ` [PATCH v5 01/13] arm: qcom: add common QCLIB SPL extension helpers Abhilash V
@ 2026-10-29 10:57 ` Abhilash V
2026-10-29 10:57 ` [PATCH v5 03/13] board: qualcomm: shikra: add SPL board support Abhilash V
` (10 subsequent siblings)
12 siblings, 0 replies; 21+ messages in thread
From: Abhilash V @ 2026-10-29 10:57 UTC (permalink / raw)
To: trini, ilias.apalodimas, aswin.murugan, casey.connolly,
neil.armstrong, sumit.garg, lukma, peng.fan, jh80.chung,
tanmay.kathpalia, abhilash.v, sjg, Michael.Srba,
varadarajan.narayanan, nikroks, balaji.selvanathan, nathbappai,
jbx6244, u-boot, u-boot-qcom
Add the SPL Kconfig variant for the Shikra pinctrl driver so
SPL can configure eMMC and console pins during early boot.
Signed-off-by: Abhilash V <abhilash.v@oss.qualcomm.com>
---
drivers/pinctrl/qcom/Kconfig | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/pinctrl/qcom/Kconfig b/drivers/pinctrl/qcom/Kconfig
index bb12e93853d..ac0103631ad 100644
--- a/drivers/pinctrl/qcom/Kconfig
+++ b/drivers/pinctrl/qcom/Kconfig
@@ -116,6 +116,14 @@ config PINCTRL_QCOM_SC7280
help
Say Y here to enable support for pinctrl on the Snapdragon SC7280 SoC,
+config SPL_PINCTRL_QCOM_SHIKRA
+ bool "Qualcomm Shikra Pinctrl in SPL"
+ depends on SPL_PINCTRL_GENERIC
+ select SPL_PINCTRL_QCOM
+ help
+ SPL variant of PINCTRL_QCOM_SHIKRA.
+ See the help of PINCTRL_QCOM_SHIKRA for details.
+
config PINCTRL_QCOM_SDM670
bool "Qualcomm SDM670 Pinctrl"
default y if PINCTRL_QCOM_GENERIC
--
2.34.1
^ permalink raw reply related [flat|nested] 21+ messages in thread* [PATCH v5 03/13] board: qualcomm: shikra: add SPL board support
2026-10-29 10:57 [PATCH v5 00/13] qcom: shikra: add eMMC SPL boot support Abhilash V
2026-10-29 10:57 ` [PATCH v5 01/13] arm: qcom: add common QCLIB SPL extension helpers Abhilash V
2026-10-29 10:57 ` [PATCH v5 02/13] pinctrl: qcom: add Shikra SPL pinctrl option Abhilash V
@ 2026-10-29 10:57 ` Abhilash V
2026-10-29 16:50 ` Tom Rini
2026-10-29 10:57 ` [PATCH v5 04/13] clk: qcom: add configurable FSM-voted PLL helper Abhilash V
` (9 subsequent siblings)
12 siblings, 1 reply; 21+ messages in thread
From: Abhilash V @ 2026-10-29 10:57 UTC (permalink / raw)
To: trini, ilias.apalodimas, aswin.murugan, casey.connolly,
neil.armstrong, sumit.garg, lukma, peng.fan, jh80.chung,
tanmay.kathpalia, abhilash.v, sjg, Michael.Srba,
varadarajan.narayanan, nikroks, balaji.selvanathan, nathbappai,
jbx6244, u-boot, u-boot-qcom
Add Shikra SPL board implementation, build rules, and linker
wrapper, board configuration header, and QCLIB handoff data.
Configure early reset handling and MMC boot selection.
Decode the Shikra boot configuration and map eMMC and SD
sources to SPL MMC devices for boot-device and FIT partition
selection.
Signed-off-by: Abhilash V <abhilash.v@oss.qualcomm.com>
---
arch/arm/mach-snapdragon/board_spl.c | 4 +-
board/qualcomm/shikra/Makefile | 3 +
board/qualcomm/shikra/shikra-spl-wrap-elf.lds | 18 ++
board/qualcomm/shikra/spl-shikra.c | 194 ++++++++++++++++++
include/configs/shikra.h | 11 +
5 files changed, 228 insertions(+), 2 deletions(-)
create mode 100644 board/qualcomm/shikra/Makefile
create mode 100644 board/qualcomm/shikra/shikra-spl-wrap-elf.lds
create mode 100644 board/qualcomm/shikra/spl-shikra.c
create mode 100644 include/configs/shikra.h
diff --git a/arch/arm/mach-snapdragon/board_spl.c b/arch/arm/mach-snapdragon/board_spl.c
index 4e3b2527a7b..31a06b1e002 100644
--- a/arch/arm/mach-snapdragon/board_spl.c
+++ b/arch/arm/mach-snapdragon/board_spl.c
@@ -141,13 +141,13 @@ u32 spl_mmc_boot_mode(struct mmc *mmc, const u32 boot_device)
*
* Return: Partition number to boot from, or default partition on error
*/
-int __weak spl_mmc_boot_partition(const u32 boot_device)
+int __weak spl_mmc_boot_partition(struct mmc *mmc, const u32 boot_device)
{
int p_no;
struct blk_desc *desc;
struct disk_partition info;
- desc = blk_get_devnum_by_uclass_id(UCLASS_MMC, 0);
+ desc = mmc_get_blk_desc(mmc);
if (!desc) {
pr_err("%s: Block device not found\n", __func__);
return -ENODEV;
diff --git a/board/qualcomm/shikra/Makefile b/board/qualcomm/shikra/Makefile
new file mode 100644
index 00000000000..eb3961a3ead
--- /dev/null
+++ b/board/qualcomm/shikra/Makefile
@@ -0,0 +1,3 @@
+# SPDX-License-Identifier: GPL-2.0-only
+
+obj-$(CONFIG_SPL) := spl-shikra.o
diff --git a/board/qualcomm/shikra/shikra-spl-wrap-elf.lds b/board/qualcomm/shikra/shikra-spl-wrap-elf.lds
new file mode 100644
index 00000000000..b2922cd2c2c
--- /dev/null
+++ b/board/qualcomm/shikra/shikra-spl-wrap-elf.lds
@@ -0,0 +1,18 @@
+/*
+ * SPDX-License-Identifier: GPL-2.0-only
+ * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
+ */
+PHDRS {
+ ptype PT_LOAD FLAGS(0x7);
+}
+
+ENTRY(_entry)
+
+SECTIONS {
+ . = CONFIG_PLATFORM_ELFENTRY;
+ _entry = . ;
+ data : {
+ *(.data)
+ . = ALIGN(4);
+ } :ptype
+}
diff --git a/board/qualcomm/shikra/spl-shikra.c b/board/qualcomm/shikra/spl-shikra.c
new file mode 100644
index 00000000000..b41877743b2
--- /dev/null
+++ b/board/qualcomm/shikra/spl-shikra.c
@@ -0,0 +1,194 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
+ */
+#include <blk.h>
+#include <asm/io.h>
+#include <dm/uclass.h>
+#include <linux/err.h>
+#include <linux/string.h>
+#include <mach/qclib.h>
+#include <mach/spl.h>
+#include <part.h>
+#include <spl.h>
+
+#define IPQ_SPL_BOOTCFG_REG_ADDR 0x1B46070
+#define IPQ_SPL_BOOTCFG_DEV_MASK GENMASK(5, 1)
+#define IPQ_SPL_BOOTCFG_DEV_SHFT 0x1
+
+#define SHIKRA_DDR_INFORMATION "ddr_information"
+#define SHIKRA_DDR_TRAINING_DATA "ddr_training_data"
+#define SHIKRA_DDR_SR_EXIT "ddr_sr_exit"
+#define SHIKRA_PMIC_COCOS "pmic_cocos"
+#define SHIKRA_PMIC_WAILUA "pmic_wailua"
+#define SHIKRA_DCB_LP4 "dcb_lp4"
+#define SHIKRA_DCB_LP5 "dcb_lp5"
+#define SHIKRA_ECC "ecc"
+
+#define SHIKRA_DDR_TRAINING_DATA_ADDR 0x0c368000
+#define SHIKRA_DDR_TRAINING_DATA_SIZE 0x8000
+#define SHIKRA_PMIC_COCOS_SIZE 0xbc00
+#define SHIKRA_PMIC_WAILUA_SIZE 0x6000
+#define SHIKRA_DCB_LP4_SIZE 0x4800
+#define SHIKRA_DCB_LP5_SIZE 0x4800
+#define SHIKRA_ECC_SIZE 0x400
+
+#define SHIKRA_SHRM2_SPROC_CTRL_ADDR 0x0c36000
+#define SHIKRA_SHRM2_SPROC_CTRL_CORE_SW_RESET_BMSK BIT(1)
+#define SHIKRA_SHRM2_SPROC_CTRL_DEBUG_SW_RESET_BMSK BIT(3)
+
+/* GCC_APCS_MISC contains the RPM reset control bit. */
+#define SHIKRA_GCC_APCS_MISC_ADDR 0x01491000
+#define SHIKRA_GCC_APCS_MISC_RPM_RESET_BMSK BIT(0)
+
+#define SHIKRA_RPM_STAGING_ADDR 0x04690000
+#define SHIKRA_RPM_STAGING_SIZE 0x1363c
+
+#define QCOM_SPL_FIT_IMG_PARTITION "uefi_a"
+
+enum {
+ IPQ_SPL_BOOTCFG_DEV_MMC = 0x0,
+ IPQ_SPL_BOOTCFG_DEV_SD_EMMC = 0x1,
+};
+
+int qcom_spl_soc_qclib_override(struct interface_table *table,
+ const void *fit, int images_node)
+{
+ static const struct {
+ const char *name;
+ u32 size;
+ } fit_blobs[] = {
+ { SHIKRA_PMIC_COCOS, SHIKRA_PMIC_COCOS_SIZE },
+ { SHIKRA_PMIC_WAILUA, SHIKRA_PMIC_WAILUA_SIZE },
+ { SHIKRA_DCB_LP4, SHIKRA_DCB_LP4_SIZE },
+ { SHIKRA_DCB_LP5, SHIKRA_DCB_LP5_SIZE },
+ { SHIKRA_ECC, SHIKRA_ECC_SIZE },
+ };
+ uint i;
+ int ret;
+
+ table->global_attributes |= QCLIB_GA_ENABLE_UART_LOGGING;
+ for (i = 0; i < ARRAY_SIZE(fit_blobs); i++) {
+ ret = qclib_add_iftbl_fit_blob(table, fit, images_node,
+ fit_blobs[i].name, fit_blobs[i].size);
+ if (ret)
+ return ret;
+ }
+
+ ret = qclib_add_iftbl_entry(table, SHIKRA_DDR_TRAINING_DATA,
+ SHIKRA_DDR_TRAINING_DATA_ADDR,
+ SHIKRA_DDR_TRAINING_DATA_SIZE);
+ if (ret)
+ return ret;
+ ret = qclib_add_iftbl_entry(table, SHIKRA_DDR_INFORMATION, 0, 0);
+ if (ret)
+ return ret;
+
+ return qclib_add_iftbl_entry(table, SHIKRA_DDR_SR_EXIT, 0, 0);
+}
+
+void qcom_spl_soc_shrm_reset(void)
+{
+ writel(SHIKRA_SHRM2_SPROC_CTRL_DEBUG_SW_RESET_BMSK |
+ SHIKRA_SHRM2_SPROC_CTRL_CORE_SW_RESET_BMSK,
+ (void *)SHIKRA_SHRM2_SPROC_CTRL_ADDR);
+ writel(SHIKRA_SHRM2_SPROC_CTRL_CORE_SW_RESET_BMSK,
+ (void *)SHIKRA_SHRM2_SPROC_CTRL_ADDR);
+ writel(0, (void *)SHIKRA_SHRM2_SPROC_CTRL_ADDR);
+}
+
+int qcom_spl_soc_pre_qclib_routine(void)
+{
+ qcom_spl_soc_shrm_reset();
+
+ return 0;
+}
+
+void qcom_spl_soc_rpm_reset(void)
+{
+ clrbits_le32((void *)SHIKRA_GCC_APCS_MISC_ADDR,
+ SHIKRA_GCC_APCS_MISC_RPM_RESET_BMSK);
+}
+
+int spl_check_board_image(struct spl_image_info *spl_image,
+ const struct spl_boot_device *bootdev)
+{
+ qcom_spl_soc_rpm_reset();
+
+ return 0;
+}
+
+int qcom_spl_soc_post_qclib_routine(struct interface_table *table)
+{
+ struct interface_table_entry entry;
+ int ret;
+
+ /*
+ * Clear the full memory region reserved for the RPM image before loading
+ * the post-DDR FIT, including its zero-initialized data.
+ */
+ memset((void *)SHIKRA_RPM_STAGING_ADDR, 0, SHIKRA_RPM_STAGING_SIZE);
+
+ ret = qcom_spl_get_iftbl_entry_by_name(table, SHIKRA_DDR_SR_EXIT,
+ &entry);
+ if (ret)
+ return ret;
+
+ qclib_set_ddr_sr_exit_address(entry.address);
+ return 0;
+}
+
+int spl_mmc_boot_partition(struct mmc *mmc, const u32 boot_device)
+{
+ struct blk_desc *desc;
+ struct disk_partition info;
+ int partition, ret;
+
+ if (!IS_ENABLED(CONFIG_MMC))
+ return -ENOSYS;
+
+ if (boot_device != BOOT_DEVICE_MMC1 &&
+ boot_device != BOOT_DEVICE_MMC2)
+ return -ENODEV;
+
+ ret = qcom_spl_get_boot_blk_desc(&desc);
+ if (ret)
+ return ret;
+
+ partition = part_get_info_by_name(desc, QCOM_SPL_FIT_IMG_PARTITION,
+ &info);
+ if (partition < 0)
+ return -ENOENT;
+
+ return partition;
+}
+
+/**
+ * spl_boot_device() - Get the boot device.
+ *
+ * Return: U-Boot SPL boot device identifier, or -EINVAL if the device is invalid.
+ */
+u32 spl_boot_device(void)
+{
+ int boot_device;
+
+ boot_device =
+ (readl(IPQ_SPL_BOOTCFG_REG_ADDR) & IPQ_SPL_BOOTCFG_DEV_MASK) >>
+ IPQ_SPL_BOOTCFG_DEV_SHFT;
+
+ switch (boot_device) {
+ case IPQ_SPL_BOOTCFG_DEV_MMC:
+ boot_device = BOOT_DEVICE_MMC1;
+ printf("Selected boot device: MMC\n");
+ break;
+ case IPQ_SPL_BOOTCFG_DEV_SD_EMMC:
+ boot_device = BOOT_DEVICE_MMC2;
+ printf("Selected boot device: SD MMC\n");
+ break;
+ default:
+ pr_err("Invalid boot device configured\n");
+ return -EINVAL;
+ }
+
+ return boot_device;
+}
diff --git a/include/configs/shikra.h b/include/configs/shikra.h
new file mode 100644
index 00000000000..7d88dc0e670
--- /dev/null
+++ b/include/configs/shikra.h
@@ -0,0 +1,11 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
+ */
+
+#ifndef __CONFIGS_SHIKRA_H
+#define __CONFIGS_SHIKRA_H
+
+#include <linux/sizes.h>
+
+#endif
--
2.34.1
^ permalink raw reply related [flat|nested] 21+ messages in thread* Re: [PATCH v5 03/13] board: qualcomm: shikra: add SPL board support
2026-10-29 10:57 ` [PATCH v5 03/13] board: qualcomm: shikra: add SPL board support Abhilash V
@ 2026-10-29 16:50 ` Tom Rini
0 siblings, 0 replies; 21+ messages in thread
From: Tom Rini @ 2026-10-29 16:50 UTC (permalink / raw)
To: Abhilash V
Cc: ilias.apalodimas, aswin.murugan, casey.connolly, neil.armstrong,
sumit.garg, lukma, peng.fan, jh80.chung, tanmay.kathpalia, sjg,
Michael.Srba, varadarajan.narayanan, nikroks, balaji.selvanathan,
nathbappai, jbx6244, u-boot, u-boot-qcom
[-- Attachment #1: Type: text/plain, Size: 1204 bytes --]
On Thu, Oct 29, 2026 at 03:57:36AM -0700, Abhilash V wrote:
> Add Shikra SPL board implementation, build rules, and linker
> wrapper, board configuration header, and QCLIB handoff data.
> Configure early reset handling and MMC boot selection.
>
> Decode the Shikra boot configuration and map eMMC and SD
> sources to SPL MMC devices for boot-device and FIT partition
> selection.
>
> Signed-off-by: Abhilash V <abhilash.v@oss.qualcomm.com>
[snip]
> diff --git a/include/configs/shikra.h b/include/configs/shikra.h
> new file mode 100644
> index 00000000000..7d88dc0e670
> --- /dev/null
> +++ b/include/configs/shikra.h
> @@ -0,0 +1,11 @@
> +/* SPDX-License-Identifier: GPL-2.0-only */
> +/*
> + * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
> + */
> +
> +#ifndef __CONFIGS_SHIKRA_H
> +#define __CONFIGS_SHIKRA_H
> +
> +#include <linux/sizes.h>
> +
> +#endif
It's possible to not have an include/configs/board.h header file now. If
you need this file later and are also including some "#define FOO SZ_1K"
or whatever, that's OK but needs to be re-ordered for when you need it.
But just having this and using <linux/sizes.h> is not.
--
Tom
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH v5 04/13] clk: qcom: add configurable FSM-voted PLL helper
2026-10-29 10:57 [PATCH v5 00/13] qcom: shikra: add eMMC SPL boot support Abhilash V
` (2 preceding siblings ...)
2026-10-29 10:57 ` [PATCH v5 03/13] board: qualcomm: shikra: add SPL board support Abhilash V
@ 2026-10-29 10:57 ` Abhilash V
2026-10-29 10:57 ` [PATCH v5 05/13] arm: dts: shikra: retain QUP SPL dependencies Abhilash V
` (8 subsequent siblings)
12 siblings, 0 replies; 21+ messages in thread
From: Abhilash V @ 2026-10-29 10:57 UTC (permalink / raw)
To: trini, ilias.apalodimas, aswin.murugan, casey.connolly,
neil.armstrong, sumit.garg, lukma, peng.fan, jh80.chung,
tanmay.kathpalia, abhilash.v, sjg, Michael.Srba,
varadarajan.narayanan, nikroks, balaji.selvanathan, nathbappai,
jbx6244, u-boot, u-boot-qcom
Add a reusable helper to configure and vote for Alpha PLLs
controlled by the GCC vote FSM. Per-PLL register offsets
support targets with different PLL layouts.
Signed-off-by: Abhilash V <abhilash.v@oss.qualcomm.com>
---
drivers/clk/qcom/clock-qcom.c | 48 +++++++++++++++++++++++++++++++++++
drivers/clk/qcom/clock-qcom.h | 24 ++++++++++++++++++
2 files changed, 72 insertions(+)
diff --git a/drivers/clk/qcom/clock-qcom.c b/drivers/clk/qcom/clock-qcom.c
index 6b46d9db744..30127c1fffe 100644
--- a/drivers/clk/qcom/clock-qcom.c
+++ b/drivers/clk/qcom/clock-qcom.c
@@ -59,6 +59,54 @@ void clk_enable_gpll0(phys_addr_t base, const struct pll_vote_clk *gpll0)
;
}
+#define PLL_MODE_ACTIVE_FLAG BIT(30)
+#define PLL_MODE_BIAS_COUNT GENMASK(19, 14)
+#define PLL_MODE_LOCK_COUNT GENMASK(13, 8)
+#define PLL_MODE_VOTE_FSM_ENA BIT(20)
+
+#define PLL_MODE_BIAS_COUNT_VAL (0x6 << 14)
+#define PLL_MODE_LOCK_COUNT_VAL (0x0 << 8)
+
+#define PLL_LOCK_TIMEOUT_US 200
+
+void clk_configure_enable_pll(phys_addr_t base, const struct pll_config *pll)
+{
+ u32 mode = readl(base + pll->mode_reg);
+ unsigned int count;
+
+ if ((mode & PLL_MODE_VOTE_FSM_ENA) &&
+ (readl(base + pll->ena_vote) & pll->vote_bit) == pll->vote_bit &&
+ (mode & PLL_MODE_ACTIVE_FLAG))
+ return;
+
+ writel(0, base + pll->mode_reg);
+ writel(pll->user_ctl_u, base + pll->mode_reg + pll->user_ctl_u_offset);
+ writel(pll->config_ctl, base + pll->mode_reg + pll->config_ctl_offset);
+ writel(pll->test_ctl, base + pll->mode_reg + pll->test_ctl_offset);
+ writel(pll->test_ctl_u, base + pll->mode_reg + pll->test_ctl_u_offset);
+ writel(pll->user_ctl, base + pll->mode_reg + pll->user_ctl_offset);
+ writel(pll->l_val, base + pll->mode_reg + pll->l_val_offset);
+ writel(pll->alpha_val, base + pll->mode_reg + pll->alpha_val_offset);
+ writel(pll->alpha_val_u, base + pll->mode_reg + pll->alpha_val_u_offset);
+
+ mode &= ~(PLL_MODE_BIAS_COUNT | PLL_MODE_LOCK_COUNT);
+ mode |= PLL_MODE_BIAS_COUNT_VAL | PLL_MODE_LOCK_COUNT_VAL |
+ PLL_MODE_VOTE_FSM_ENA;
+ writel(mode, base + pll->mode_reg);
+
+ setbits_le32(base + pll->ena_vote, pll->vote_bit);
+
+ for (count = 0; count < PLL_LOCK_TIMEOUT_US; count++) {
+ if (readl(base + pll->mode_reg) & PLL_MODE_ACTIVE_FLAG)
+ return;
+ udelay(1);
+ }
+
+ WARN(count == PLL_LOCK_TIMEOUT_US,
+ "PLL @ %#llx [%#010x] never locked\n",
+ base + pll->mode_reg, readl(base + pll->mode_reg));
+}
+
#define BRANCH_ON_VAL (0)
#define BRANCH_NOC_FSM_ON_VAL BIT(29)
#define BRANCH_CHECK_MASK GENMASK(31, 28)
diff --git a/drivers/clk/qcom/clock-qcom.h b/drivers/clk/qcom/clock-qcom.h
index 9899cd28aad..47930ae9d5e 100644
--- a/drivers/clk/qcom/clock-qcom.h
+++ b/drivers/clk/qcom/clock-qcom.h
@@ -36,6 +36,29 @@ struct pll_vote_clk {
int vote_bit;
};
+/* Configuration for an FSM-voteable Alpha PLL. */
+struct pll_config {
+ uintptr_t mode_reg;
+ uintptr_t ena_vote;
+ u32 vote_bit;
+ u32 l_val;
+ u32 alpha_val;
+ u32 alpha_val_u;
+ u32 user_ctl;
+ u32 user_ctl_u;
+ u32 config_ctl;
+ u32 test_ctl;
+ u32 test_ctl_u;
+ u32 l_val_offset;
+ u32 alpha_val_offset;
+ u32 alpha_val_u_offset;
+ u32 test_ctl_offset;
+ u32 test_ctl_u_offset;
+ u32 user_ctl_offset;
+ u32 user_ctl_u_offset;
+ u32 config_ctl_offset;
+};
+
struct vote_clk {
uintptr_t cbcr_reg;
uintptr_t ena_vote;
@@ -107,6 +130,7 @@ struct msm_clk_priv {
int qcom_cc_bind(struct udevice *parent);
void clk_enable_gpll0(phys_addr_t base, const struct pll_vote_clk *gpll0);
+void clk_configure_enable_pll(phys_addr_t base, const struct pll_config *pll);
void clk_bcr_update(phys_addr_t apps_cmd_rgcr);
void clk_enable_cbc(phys_addr_t cbcr);
void clk_enable_vote_clk(phys_addr_t base, const struct vote_clk *vclk);
--
2.34.1
^ permalink raw reply related [flat|nested] 21+ messages in thread* [PATCH v5 05/13] arm: dts: shikra: retain QUP SPL dependencies
2026-10-29 10:57 [PATCH v5 00/13] qcom: shikra: add eMMC SPL boot support Abhilash V
` (3 preceding siblings ...)
2026-10-29 10:57 ` [PATCH v5 04/13] clk: qcom: add configurable FSM-voted PLL helper Abhilash V
@ 2026-10-29 10:57 ` Abhilash V
2026-10-29 16:51 ` Tom Rini
2026-10-29 10:57 ` [PATCH v5 06/13] clk: qcom: configure Shikra GPLL6 for SDCC1 Abhilash V
` (7 subsequent siblings)
12 siblings, 1 reply; 21+ messages in thread
From: Abhilash V @ 2026-10-29 10:57 UTC (permalink / raw)
To: trini, ilias.apalodimas, aswin.murugan, casey.connolly,
neil.armstrong, sumit.garg, lukma, peng.fan, jh80.chung,
tanmay.kathpalia, abhilash.v, sjg, Michael.Srba,
varadarajan.narayanan, nikroks, balaji.selvanathan, nathbappai,
jbx6244, u-boot, u-boot-qcom
Retain QUP, console, pinctrl, clock, power-domain, RPM,
and MMC dependencies in the SPL device tree so the firmware
loader can use the boot medium once probed in SPL.
Signed-off-by: Abhilash V <abhilash.v@oss.qualcomm.com>
---
arch/arm/dts/shikra-cqs-evk-u-boot.dtsi | 44 +++++++++++++++++++++++++
1 file changed, 44 insertions(+)
diff --git a/arch/arm/dts/shikra-cqs-evk-u-boot.dtsi b/arch/arm/dts/shikra-cqs-evk-u-boot.dtsi
index e807b91ef1f..c79c63ad732 100644
--- a/arch/arm/dts/shikra-cqs-evk-u-boot.dtsi
+++ b/arch/arm/dts/shikra-cqs-evk-u-boot.dtsi
@@ -20,3 +20,47 @@
&usb_qmpphy {
status = "okay";
};
+
+/*
+ * Keep SPL console and QUP dependencies.
+ */
+&gcc {
+ bootph-all;
+};
+
+&tlmm {
+ bootph-all;
+};
+
+&qup_uart0_default {
+ bootph-all;
+};
+
+&sdc1_state_on {
+ bootph-all;
+};
+
+&sdc1_state_off {
+ bootph-all;
+};
+
+&sdhc_1 {
+ bootph-all;
+};
+
+&qupv3_0 {
+ bootph-all;
+};
+
+&uart0 {
+ bootph-all;
+};
+
+/* Retain the RPM clock and power-domain providers for boot consumers. */
+&rpmcc {
+ bootph-all;
+};
+
+&rpmpd {
+ bootph-all;
+};
--
2.34.1
^ permalink raw reply related [flat|nested] 21+ messages in thread* Re: [PATCH v5 05/13] arm: dts: shikra: retain QUP SPL dependencies
2026-10-29 10:57 ` [PATCH v5 05/13] arm: dts: shikra: retain QUP SPL dependencies Abhilash V
@ 2026-10-29 16:51 ` Tom Rini
2026-10-30 6:16 ` Sumit Garg
0 siblings, 1 reply; 21+ messages in thread
From: Tom Rini @ 2026-10-29 16:51 UTC (permalink / raw)
To: Abhilash V
Cc: ilias.apalodimas, aswin.murugan, casey.connolly, neil.armstrong,
sumit.garg, lukma, peng.fan, jh80.chung, tanmay.kathpalia, sjg,
Michael.Srba, varadarajan.narayanan, nikroks, balaji.selvanathan,
nathbappai, jbx6244, u-boot, u-boot-qcom
[-- Attachment #1: Type: text/plain, Size: 1368 bytes --]
On Thu, Oct 29, 2026 at 03:57:38AM -0700, Abhilash V wrote:
> Retain QUP, console, pinctrl, clock, power-domain, RPM,
> and MMC dependencies in the SPL device tree so the firmware
> loader can use the boot medium once probed in SPL.
>
> Signed-off-by: Abhilash V <abhilash.v@oss.qualcomm.com>
> ---
> arch/arm/dts/shikra-cqs-evk-u-boot.dtsi | 44 +++++++++++++++++++++++++
> 1 file changed, 44 insertions(+)
>
> diff --git a/arch/arm/dts/shikra-cqs-evk-u-boot.dtsi b/arch/arm/dts/shikra-cqs-evk-u-boot.dtsi
> index e807b91ef1f..c79c63ad732 100644
> --- a/arch/arm/dts/shikra-cqs-evk-u-boot.dtsi
> +++ b/arch/arm/dts/shikra-cqs-evk-u-boot.dtsi
> @@ -20,3 +20,47 @@
> &usb_qmpphy {
> status = "okay";
> };
> +
> +/*
> + * Keep SPL console and QUP dependencies.
> + */
> +&gcc {
> + bootph-all;
> +};
> +
> +&tlmm {
> + bootph-all;
> +};
> +
> +&qup_uart0_default {
> + bootph-all;
> +};
> +
> +&sdc1_state_on {
> + bootph-all;
> +};
> +
> +&sdc1_state_off {
> + bootph-all;
> +};
> +
> +&sdhc_1 {
> + bootph-all;
> +};
> +
> +&qupv3_0 {
> + bootph-all;
> +};
> +
> +&uart0 {
> + bootph-all;
> +};
> +
> +/* Retain the RPM clock and power-domain providers for boot consumers. */
> +&rpmcc {
> + bootph-all;
> +};
> +
> +&rpmpd {
> + bootph-all;
> +};
Why aren't you upstreaming these?
--
Tom
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 21+ messages in thread* Re: [PATCH v5 05/13] arm: dts: shikra: retain QUP SPL dependencies
2026-10-29 16:51 ` Tom Rini
@ 2026-10-30 6:16 ` Sumit Garg
0 siblings, 0 replies; 21+ messages in thread
From: Sumit Garg @ 2026-10-30 6:16 UTC (permalink / raw)
To: Tom Rini
Cc: Abhilash V, ilias.apalodimas, aswin.murugan, casey.connolly,
neil.armstrong, sumit.garg, lukma, peng.fan, jh80.chung,
tanmay.kathpalia, sjg, Michael.Srba, varadarajan.narayanan,
nikroks, balaji.selvanathan, nathbappai, jbx6244, u-boot,
u-boot-qcom
Hey Abhilash, Aswin, Balaji, Varda,
Just wanted to reiterate the general OF_UPSTREAM DT guideline below.
On Thu, 29 Oct 2026 at 10:51:38 -0600, Tom Rini wrote:
>On Thu, Oct 29, 2026 at 03:57:38AM -0700, Abhilash V wrote:
>
>> Retain QUP, console, pinctrl, clock, power-domain, RPM,
>> and MMC dependencies in the SPL device tree so the firmware
>> loader can use the boot medium once probed in SPL.
>>
>> Signed-off-by: Abhilash V <abhilash.v@oss.qualcomm.com>
>> ---
>> arch/arm/dts/shikra-cqs-evk-u-boot.dtsi | 44 +++++++++++++++++++++++++
>> 1 file changed, 44 insertions(+)
>>
>> diff --git a/arch/arm/dts/shikra-cqs-evk-u-boot.dtsi b/arch/arm/dts/shikra-cqs-evk-u-boot.dtsi
>> index e807b91ef1f..c79c63ad732 100644
>> --- a/arch/arm/dts/shikra-cqs-evk-u-boot.dtsi
>> +++ b/arch/arm/dts/shikra-cqs-evk-u-boot.dtsi
>> @@ -20,3 +20,47 @@
>> &usb_qmpphy {
>> status = "okay";
>> };
>> +
>> +/*
>> + * Keep SPL console and QUP dependencies.
>> + */
>> +&gcc {
>> + bootph-all;
>> +};
>> +
>> +&tlmm {
>> + bootph-all;
>> +};
>> +
>> +&qup_uart0_default {
>> + bootph-all;
>> +};
>> +
>> +&sdc1_state_on {
>> + bootph-all;
>> +};
>> +
>> +&sdc1_state_off {
>> + bootph-all;
>> +};
>> +
>> +&sdhc_1 {
>> + bootph-all;
>> +};
>> +
>> +&qupv3_0 {
>> + bootph-all;
>> +};
>> +
>> +&uart0 {
>> + bootph-all;
>> +};
>> +
>> +/* Retain the RPM clock and power-domain providers for boot consumers. */
>> +&rpmcc {
>> + bootph-all;
>> +};
>> +
>> +&rpmpd {
>> + bootph-all;
>> +};
>
>Why aren't you upstreaming these?
+1
Please don't push any DT overrides in U-Boot without any upstream path
to get rid of DT overrides in future. Always provide a link to upstream
kernel DT posting whenever any exception is needed to add DT overrides
in U-Boot. This applies to all the patch-sets adding DT overrides
especially in case of U-Boot SPL support series.
bootph-all is well upstream kernel DT accepted approach, so first go for
kernel DT updates always.
-Sumit
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH v5 06/13] clk: qcom: configure Shikra GPLL6 for SDCC1
2026-10-29 10:57 [PATCH v5 00/13] qcom: shikra: add eMMC SPL boot support Abhilash V
` (4 preceding siblings ...)
2026-10-29 10:57 ` [PATCH v5 05/13] arm: dts: shikra: retain QUP SPL dependencies Abhilash V
@ 2026-10-29 10:57 ` Abhilash V
2026-10-29 10:57 ` [PATCH v5 07/13] clk: qcom: enable Shikra QUP wrapper clocks Abhilash V
` (6 subsequent siblings)
12 siblings, 0 replies; 21+ messages in thread
From: Abhilash V @ 2026-10-29 10:57 UTC (permalink / raw)
To: trini, ilias.apalodimas, aswin.murugan, casey.connolly,
neil.armstrong, sumit.garg, lukma, peng.fan, jh80.chung,
tanmay.kathpalia, abhilash.v, sjg, Michael.Srba,
varadarajan.narayanan, nikroks, balaji.selvanathan, nathbappai,
jbx6244, u-boot, u-boot-qcom
Configure GPLL6 through the common FSM-voted PLL helper
when SDCC1 selects a GPLL6 clock source. This provides the
192 MHz and 384 MHz eMMC source clocks required by Shikra.
Signed-off-by: Abhilash V <abhilash.v@oss.qualcomm.com>
---
drivers/clk/qcom/clock-shikra.c | 61 ++++++++++++++++++++++++++++-----
1 file changed, 52 insertions(+), 9 deletions(-)
diff --git a/drivers/clk/qcom/clock-shikra.c b/drivers/clk/qcom/clock-shikra.c
index 2c3c5c9b4d8..94501b838fc 100644
--- a/drivers/clk/qcom/clock-shikra.c
+++ b/drivers/clk/qcom/clock-shikra.c
@@ -20,11 +20,35 @@
#define GCC_USB30_PRIM_MOCK_UTMI_CLK_CMD_RCGR 0x1a034
#define GCC_USB3_PRIM_PHY_AUX_CLK_CMD_RCGR 0x1a060
+#define SHIKRA_GPLL6_MODE_REG 0x6000
+#define SHIKRA_GPLL6_ENA_VOTE_REG 0x79000
+#define SHIKRA_GPLL6_VOTE_BIT BIT(6)
+#define SHIKRA_GPLL6_L_VAL 40
+#define SHIKRA_GPLL6_USER_CTL 0x01200109
+#define SHIKRA_GPLL6_USER_CTL_U 0x00000004
+#define SHIKRA_GPLL6_CONFIG_CTL 0x4001055b
+
+#define SHIKRA_PLL_MODE_ACTIVE_FLAG BIT(30)
+#define SHIKRA_PLL_MODE_BIAS_COUNT GENMASK(19, 14)
+#define SHIKRA_PLL_MODE_LOCK_COUNT GENMASK(13, 8)
+#define SHIKRA_PLL_MODE_VOTE_FSM_ENA BIT(20)
+#define SHIKRA_PLL_MODE_BIAS_COUNT_VAL (0x6 << 14)
+
+#define SHIKRA_PLL_L_VAL_OFFSET 0x4
+#define SHIKRA_PLL_ALPHA_VAL_OFFSET 0x8
+#define SHIKRA_PLL_ALPHA_VAL_U_OFFSET 0xc
+#define SHIKRA_PLL_TEST_CTL_OFFSET 0x10
+#define SHIKRA_PLL_TEST_CTL_U_OFFSET 0x14
+#define SHIKRA_PLL_USER_CTL_OFFSET 0x18
+#define SHIKRA_PLL_USER_CTL_U_OFFSET 0x1c
+#define SHIKRA_PLL_CONFIG_CTL_OFFSET 0x20
+#define SHIKRA_PLL_LOCK_TIMEOUT_US 200
+
static const struct pll_vote_clk gpll6_vote_clk = {
.status = 0x6024,
.status_bit = BIT(31),
- .ena_vote = 0x79000,
- .vote_bit = BIT(6),
+ .ena_vote = SHIKRA_GPLL6_ENA_VOTE_REG,
+ .vote_bit = SHIKRA_GPLL6_VOTE_BIT,
};
static const struct pll_vote_clk gpll7_vote_clk = {
@@ -84,6 +108,29 @@ static const struct freq_tbl ftbl_gcc_usb30_prim_master_clk_src[] = {
{ }
};
+/* GPLL6 configuration required by the SDCC1 clock in SPL. */
+static const struct pll_config gpll6_config = {
+ .mode_reg = SHIKRA_GPLL6_MODE_REG,
+ .ena_vote = SHIKRA_GPLL6_ENA_VOTE_REG,
+ .vote_bit = SHIKRA_GPLL6_VOTE_BIT,
+ .l_val = SHIKRA_GPLL6_L_VAL,
+ .alpha_val = 0x00000000,
+ .alpha_val_u = 0x00000000,
+ .user_ctl = SHIKRA_GPLL6_USER_CTL,
+ .user_ctl_u = SHIKRA_GPLL6_USER_CTL_U,
+ .config_ctl = SHIKRA_GPLL6_CONFIG_CTL,
+ .test_ctl = 0x00000000,
+ .test_ctl_u = 0x00000000,
+ .l_val_offset = SHIKRA_PLL_L_VAL_OFFSET,
+ .alpha_val_offset = SHIKRA_PLL_ALPHA_VAL_OFFSET,
+ .alpha_val_u_offset = SHIKRA_PLL_ALPHA_VAL_U_OFFSET,
+ .test_ctl_offset = SHIKRA_PLL_TEST_CTL_OFFSET,
+ .test_ctl_u_offset = SHIKRA_PLL_TEST_CTL_U_OFFSET,
+ .user_ctl_offset = SHIKRA_PLL_USER_CTL_OFFSET,
+ .user_ctl_u_offset = SHIKRA_PLL_USER_CTL_U_OFFSET,
+ .config_ctl_offset = SHIKRA_PLL_CONFIG_CTL_OFFSET,
+};
+
static ulong shikra_set_rate(struct clk *clk, ulong rate)
{
struct msm_clk_priv *priv = dev_get_priv(clk->dev);
@@ -91,20 +138,16 @@ static ulong shikra_set_rate(struct clk *clk, ulong rate)
switch (clk->id) {
case GCC_QUPV3_WRAP0_S0_CLK:
- /*
- * ftbl_gcc_qupv3_wrap0_s0_clk_src[]'s last entry is
- * GPLL6-sourced; vote defensively even though this port's
- * only requested rate (debug_uart_clock, 14745600) resolves
- * to the GPLL0-sourced entry.
- */
+ /* The QUP clock table includes a GPLL6 source. */
clk_enable_gpll0(priv->base, &gpll6_vote_clk);
freq = qcom_find_freq(ftbl_gcc_qupv3_wrap0_s0_clk_src, rate);
clk_rcg_set_rate_mnd(priv->base, GCC_QUPV3_WRAP0_S0_CLK_CMD_RCGR,
freq->pre_div, freq->m, freq->n, freq->src, 16);
return freq->freq;
case GCC_SDCC1_APPS_CLK:
- clk_enable_gpll0(priv->base, &gpll6_vote_clk);
freq = qcom_find_freq(ftbl_gcc_sdcc1_apps_clk_src, rate);
+ if (freq->src == CFG_CLK_SRC_GPLL6)
+ clk_configure_enable_pll(priv->base, &gpll6_config);
clk_rcg_set_rate_mnd(priv->base, GCC_SDCC1_APPS_CLK_CMD_RCGR,
freq->pre_div, freq->m, freq->n, freq->src, 8);
return freq->freq;
--
2.34.1
^ permalink raw reply related [flat|nested] 21+ messages in thread* [PATCH v5 07/13] clk: qcom: enable Shikra QUP wrapper clocks
2026-10-29 10:57 [PATCH v5 00/13] qcom: shikra: add eMMC SPL boot support Abhilash V
` (5 preceding siblings ...)
2026-10-29 10:57 ` [PATCH v5 06/13] clk: qcom: configure Shikra GPLL6 for SDCC1 Abhilash V
@ 2026-10-29 10:57 ` Abhilash V
2026-10-29 10:57 ` [PATCH v5 08/13] mmc: msm_sdhci: make tuning callbacks optional Abhilash V
` (5 subsequent siblings)
12 siblings, 0 replies; 21+ messages in thread
From: Abhilash V @ 2026-10-29 10:57 UTC (permalink / raw)
To: trini, ilias.apalodimas, aswin.murugan, casey.connolly,
neil.armstrong, sumit.garg, lukma, peng.fan, jh80.chung,
tanmay.kathpalia, abhilash.v, sjg, Michael.Srba,
varadarajan.narayanan, nikroks, balaji.selvanathan, nathbappai,
jbx6244, u-boot, u-boot-qcom
Enable QUP wrapper CORE and CORE_2X clocks whenever
its master or slave AHB clock is enabled. The wrapper
requires these clocks for serial-engine register access.
Signed-off-by: Abhilash V <abhilash.v@oss.qualcomm.com>
---
drivers/clk/qcom/clock-shikra.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/drivers/clk/qcom/clock-shikra.c b/drivers/clk/qcom/clock-shikra.c
index 94501b838fc..a74d529f4cf 100644
--- a/drivers/clk/qcom/clock-shikra.c
+++ b/drivers/clk/qcom/clock-shikra.c
@@ -315,6 +315,18 @@ static int shikra_enable(struct clk *clk)
debug("%s: clk %ld: %s\n", __func__, clk->id, shikra_clks[clk->id].name);
+ switch (clk->id) {
+ case GCC_QUPV3_WRAP_0_M_AHB_CLK:
+ case GCC_QUPV3_WRAP_0_S_AHB_CLK:
+ /*
+ * The wrapper's core clocks are required along with its AHB
+ * clocks, but are not listed in the wrapper's clock specifiers.
+ */
+ qcom_gate_clk_en(priv, GCC_QUPV3_WRAP0_CORE_CLK);
+ qcom_gate_clk_en(priv, GCC_QUPV3_WRAP0_CORE_2X_CLK);
+ break;
+ }
+
return qcom_gate_clk_en(priv, clk->id);
}
--
2.34.1
^ permalink raw reply related [flat|nested] 21+ messages in thread* [PATCH v5 08/13] mmc: msm_sdhci: make tuning callbacks optional
2026-10-29 10:57 [PATCH v5 00/13] qcom: shikra: add eMMC SPL boot support Abhilash V
` (6 preceding siblings ...)
2026-10-29 10:57 ` [PATCH v5 07/13] clk: qcom: enable Shikra QUP wrapper clocks Abhilash V
@ 2026-10-29 10:57 ` Abhilash V
2026-10-29 10:57 ` [PATCH v5 09/13] arm: qcom: enable MMU and cache setup for Shikra SPL Abhilash V
` (4 subsequent siblings)
12 siblings, 0 replies; 21+ messages in thread
From: Abhilash V @ 2026-10-29 10:57 UTC (permalink / raw)
To: trini, ilias.apalodimas, aswin.murugan, casey.connolly,
neil.armstrong, sumit.garg, lukma, peng.fan, jh80.chung,
tanmay.kathpalia, abhilash.v, sjg, Michael.Srba,
varadarajan.narayanan, nikroks, balaji.selvanathan, nathbappai,
jbx6244, u-boot, u-boot-qcom
Build the tuning implementation and callback only when the
active configuration supports MMC tuning. This lets Shikra
SPL use MSM SDHCI without unused tuning support.
Signed-off-by: Abhilash V <abhilash.v@oss.qualcomm.com>
---
drivers/mmc/msm_sdhci.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/mmc/msm_sdhci.c b/drivers/mmc/msm_sdhci.c
index 503ebf0c5ee..40e2ee15801 100644
--- a/drivers/mmc/msm_sdhci.c
+++ b/drivers/mmc/msm_sdhci.c
@@ -558,6 +558,7 @@ static int sdhci_msm_hs400_dll_calibration(struct sdhci_host *host)
return sdhci_msm_cm_dll_sdc4_calibration(host);
}
+#if CONFIG_IS_ENABLED(MMC_SUPPORTS_TUNING)
static int msm_find_most_appropriate_phase(struct sdhci_host *host,
u8 *phase_table,
u8 total_phases)
@@ -711,6 +712,7 @@ retry:
return rc;
}
+#endif
/*
* Configure HC mode selection. Runs from set_control_reg(), which the
@@ -907,7 +909,9 @@ static int msm_sdhci_config_dll(struct sdhci_host *host, u32 clock, bool enable)
struct sdhci_ops msm_sdhci_ops = {
.config_dll = &msm_sdhci_config_dll,
.set_control_reg = &sdhci_msm_set_control_reg,
+#if CONFIG_IS_ENABLED(MMC_SUPPORTS_TUNING)
.platform_execute_tuning = &sdhci_msm_execute_tuning,
+#endif
};
static int msm_sdc_probe(struct udevice *dev)
--
2.34.1
^ permalink raw reply related [flat|nested] 21+ messages in thread* [PATCH v5 09/13] arm: qcom: enable MMU and cache setup for Shikra SPL
2026-10-29 10:57 [PATCH v5 00/13] qcom: shikra: add eMMC SPL boot support Abhilash V
` (7 preceding siblings ...)
2026-10-29 10:57 ` [PATCH v5 08/13] mmc: msm_sdhci: make tuning callbacks optional Abhilash V
@ 2026-10-29 10:57 ` Abhilash V
2026-10-29 17:14 ` Tom Rini
2026-10-29 10:57 ` [PATCH v5 10/13] board: qualcomm: shikra: prepare QUP firmware in SPL Abhilash V
` (3 subsequent siblings)
12 siblings, 1 reply; 21+ messages in thread
From: Abhilash V @ 2026-10-29 10:57 UTC (permalink / raw)
To: trini, ilias.apalodimas, aswin.murugan, casey.connolly,
neil.armstrong, sumit.garg, lukma, peng.fan, jh80.chung,
tanmay.kathpalia, abhilash.v, sjg, Michael.Srba,
varadarajan.narayanan, nikroks, balaji.selvanathan, nathbappai,
jbx6244, u-boot, u-boot-qcom
Use Shikra fixed pre-DDR memory map when enabling caches in
SPL. Allocate page tables from the early malloc-F heap and
select the board map through a common Qualcomm hook.
Signed-off-by: Abhilash V <abhilash.v@oss.qualcomm.com>
---
arch/arm/mach-snapdragon/mem_map.c | 22 ++++-
arch/arm/mach-snapdragon/qcom-priv.h | 4 +
board/qualcomm/shikra/spl-shikra.c | 140 +++++++++++++++++++++++++++
3 files changed, 165 insertions(+), 1 deletion(-)
diff --git a/arch/arm/mach-snapdragon/mem_map.c b/arch/arm/mach-snapdragon/mem_map.c
index f64ec0c674e..9df522f7a4e 100644
--- a/arch/arm/mach-snapdragon/mem_map.c
+++ b/arch/arm/mach-snapdragon/mem_map.c
@@ -28,6 +28,19 @@ static struct mm_region rbx_mem_map[CONFIG_NR_DRAM_BANKS + 2] = { { 0 } };
struct mm_region *mem_map = rbx_mem_map;
+#if defined(CONFIG_SPL_BUILD)
+enum qcom_memmap_source qcom_memmap_source __section(".data") = 0;
+#endif
+
+/*
+ * SPL platforms whose pre-DRAM address map differs from the common Qualcomm
+ * map may override this hook.
+ */
+struct mm_region *__weak qcom_spl_mem_map(void)
+{
+ return NULL;
+}
+
static void build_mem_map(void)
{
int i, j;
@@ -65,10 +78,12 @@ static void build_mem_map(void)
#endif
}
+#if !defined(CONFIG_SPL_BUILD)
u64 get_page_table_size(void)
{
return SZ_1M;
}
+#endif
struct mem_resource_attrs {
fdt_addr_t start;
@@ -185,6 +200,7 @@ static void configure_reserved_memory(void)
*/
void enable_caches(void)
{
+ struct mm_region *spl_mem_map;
u64 tlb_addr = gd->arch.tlb_addr;
u64 tlb_size = gd->arch.tlb_size;
u64 pt_size;
@@ -192,7 +208,11 @@ void enable_caches(void)
gd->arch.tlb_fillptr = tlb_addr;
- build_mem_map();
+ spl_mem_map = qcom_spl_mem_map();
+ if (spl_mem_map)
+ mem_map = spl_mem_map;
+ else
+ build_mem_map();
icache_enable();
diff --git a/arch/arm/mach-snapdragon/qcom-priv.h b/arch/arm/mach-snapdragon/qcom-priv.h
index 27e5c54e512..c267c0d9aec 100644
--- a/arch/arm/mach-snapdragon/qcom-priv.h
+++ b/arch/arm/mach-snapdragon/qcom-priv.h
@@ -5,6 +5,8 @@
#include <stdbool.h>
+struct mm_region;
+
/**
* enum qcom_boot_source - Track where we got loaded from.
* Used for capsule update logic.
@@ -40,4 +42,6 @@ static inline void qcom_configure_capsule_updates(void) {}
int qcom_parse_memory(const void *fdt, bool fdt_is_internal);
+struct mm_region *qcom_spl_mem_map(void);
+
#endif /* __QCOM_PRIV_H__ */
diff --git a/board/qualcomm/shikra/spl-shikra.c b/board/qualcomm/shikra/spl-shikra.c
index b41877743b2..c6327a14767 100644
--- a/board/qualcomm/shikra/spl-shikra.c
+++ b/board/qualcomm/shikra/spl-shikra.c
@@ -3,15 +3,107 @@
* Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
*/
#include <blk.h>
+#include <cpu_func.h>
#include <asm/io.h>
+#include <asm/sections.h>
+#include <asm/system.h>
+#include <asm/armv8/mmu.h>
#include <dm/uclass.h>
+#include <init.h>
#include <linux/err.h>
+#include <linux/sizes.h>
#include <linux/string.h>
+#include <malloc.h>
#include <mach/qclib.h>
#include <mach/spl.h>
#include <part.h>
#include <spl.h>
+DECLARE_GLOBAL_DATA_PTR;
+
+#if defined(CONFIG_SPL_BUILD)
+/*
+ * The SPL device tree does not describe the complete early physical layout,
+ * so use Shikra's fixed map when enabling the MMU.
+ */
+#define SHIKRA_SPL_DEVICE_REG_LOW_BASE 0x00000000UL
+#define SHIKRA_SPL_SYSTEM_IMEM_BASE 0x0c100000UL
+#define SHIKRA_SPL_SYSTEM_IMEM_SIZE 0x00020000UL
+#define SHIKRA_SPL_BOOTIMEM_BASE 0x0c200000UL
+#define SHIKRA_SPL_BOOTIMEM_SIZE 0x001c0000UL
+#define SHIKRA_SPL_DEVICE_REG_HIGH_BASE (SHIKRA_SPL_BOOTIMEM_BASE + \
+ SHIKRA_SPL_BOOTIMEM_SIZE)
+#define SHIKRA_SPL_DDR_BASE 0x80000000UL
+#define SHIKRA_SPL_DDR_SIZE 0x80000000UL
+#define SHIKRA_SPL_DDR2_BASE 0x880000000ULL
+#define SHIKRA_SPL_DDR2_SIZE (SZ_32G - SZ_2G)
+#define SHIKRA_SPL_DEVICE_REG_LOW_SIZE (SHIKRA_SPL_SYSTEM_IMEM_BASE - \
+ SHIKRA_SPL_DEVICE_REG_LOW_BASE)
+#define SHIKRA_SPL_DEVICE_REG_HIGH_SIZE (SHIKRA_SPL_DDR_BASE - \
+ SHIKRA_SPL_DEVICE_REG_HIGH_BASE)
+
+static struct mm_region shikra_spl_mem_map[] = {
+ {
+ .virt = SHIKRA_SPL_DEVICE_REG_LOW_BASE,
+ .phys = SHIKRA_SPL_DEVICE_REG_LOW_BASE,
+ .size = SHIKRA_SPL_DEVICE_REG_LOW_SIZE,
+ .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
+ PTE_BLOCK_NON_SHARE,
+ }, {
+ .virt = SHIKRA_SPL_SYSTEM_IMEM_BASE,
+ .phys = SHIKRA_SPL_SYSTEM_IMEM_BASE,
+ .size = SHIKRA_SPL_SYSTEM_IMEM_SIZE,
+ .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) |
+ PTE_BLOCK_INNER_SHARE,
+ }, {
+ /* SPL and QCLIB execute directly from BOOT_IMEM. */
+ .virt = SHIKRA_SPL_BOOTIMEM_BASE,
+ .phys = SHIKRA_SPL_BOOTIMEM_BASE,
+ .size = SHIKRA_SPL_BOOTIMEM_SIZE,
+ .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL) |
+ PTE_BLOCK_INNER_SHARE,
+ }, {
+ .virt = SHIKRA_SPL_DEVICE_REG_HIGH_BASE,
+ .phys = SHIKRA_SPL_DEVICE_REG_HIGH_BASE,
+ .size = SHIKRA_SPL_DEVICE_REG_HIGH_SIZE,
+ .attrs = PTE_BLOCK_MEMTYPE(MT_DEVICE_NGNRNE) |
+ PTE_BLOCK_NON_SHARE,
+ }, {
+ .virt = SHIKRA_SPL_DDR_BASE,
+ .phys = SHIKRA_SPL_DDR_BASE,
+ .size = SHIKRA_SPL_DDR_SIZE,
+ .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL_NC) |
+ PTE_BLOCK_INNER_SHARE,
+ }, {
+ .virt = SHIKRA_SPL_DDR2_BASE,
+ .phys = SHIKRA_SPL_DDR2_BASE,
+ .size = SHIKRA_SPL_DDR2_SIZE,
+ .attrs = PTE_BLOCK_MEMTYPE(MT_NORMAL_NC) |
+ PTE_BLOCK_INNER_SHARE,
+ }, {
+ 0,
+ }
+};
+
+struct mm_region *qcom_spl_mem_map(void)
+{
+ return shikra_spl_mem_map;
+}
+
+int arm_reserve_mmu(void)
+{
+#if !(CONFIG_IS_ENABLED(SYS_ICACHE_OFF) && CONFIG_IS_ENABLED(SYS_DCACHE_OFF))
+ mem_map = qcom_spl_mem_map();
+ gd->arch.tlb_size = PGTABLE_SIZE;
+ gd->arch.tlb_addr = (unsigned long)memalign(SZ_64K, gd->arch.tlb_size);
+ if (!gd->arch.tlb_addr)
+ return -ENOMEM;
+#endif
+
+ return 0;
+}
+#endif
+
#define IPQ_SPL_BOOTCFG_REG_ADDR 0x1B46070
#define IPQ_SPL_BOOTCFG_DEV_MASK GENMASK(5, 1)
#define IPQ_SPL_BOOTCFG_DEV_SHFT 0x1
@@ -51,6 +143,54 @@ enum {
IPQ_SPL_BOOTCFG_DEV_SD_EMMC = 0x1,
};
+#if defined(CONFIG_SPL_BUILD)
+void board_init_f(ulong dummy)
+{
+ int ret = 0;
+
+ memset(__bss_start, 0, __bss_end - __bss_start);
+
+ qcom_spl_malloc_init_f();
+
+ ret = spl_early_init();
+ if (ret) {
+ pr_debug("spl_early_init() failed (%d)\n", ret);
+ goto fail;
+ }
+
+ event_notify_null(EVT_LAST_STAGE_INIT);
+
+ preloader_console_init();
+
+#if !(CONFIG_IS_ENABLED(SYS_ICACHE_OFF) && CONFIG_IS_ENABLED(SYS_DCACHE_OFF))
+ ret = arm_reserve_mmu();
+ if (ret) {
+ pr_debug("arm_reserve_mmu() failed (%d)\n", ret);
+ goto fail;
+ }
+
+ enable_caches();
+#endif
+
+ ret = qcom_spl_loader_pre_ddr(spl_boot_device());
+ if (ret) {
+ pr_debug("qcom_spl_loader_pre_ddr() failed (%d)\n", ret);
+ goto fail;
+ }
+
+ ret = qcom_spl_invoke_qclib();
+ if (ret) {
+ pr_debug("qcom_spl_invoke_qclib() failed (%d)\n", ret);
+ goto fail;
+ }
+
+ board_init_r(NULL, 0);
+
+fail:
+ if (ret)
+ reset_cpu();
+}
+#endif
int qcom_spl_soc_qclib_override(struct interface_table *table,
const void *fit, int images_node)
{
--
2.34.1
^ permalink raw reply related [flat|nested] 21+ messages in thread* Re: [PATCH v5 09/13] arm: qcom: enable MMU and cache setup for Shikra SPL
2026-10-29 10:57 ` [PATCH v5 09/13] arm: qcom: enable MMU and cache setup for Shikra SPL Abhilash V
@ 2026-10-29 17:14 ` Tom Rini
0 siblings, 0 replies; 21+ messages in thread
From: Tom Rini @ 2026-10-29 17:14 UTC (permalink / raw)
To: Abhilash V
Cc: ilias.apalodimas, aswin.murugan, casey.connolly, neil.armstrong,
sumit.garg, lukma, peng.fan, jh80.chung, tanmay.kathpalia, sjg,
Michael.Srba, varadarajan.narayanan, nikroks, balaji.selvanathan,
nathbappai, jbx6244, u-boot, u-boot-qcom
[-- Attachment #1: Type: text/plain, Size: 981 bytes --]
On Thu, Oct 29, 2026 at 03:57:42AM -0700, Abhilash V wrote:
> Use Shikra fixed pre-DDR memory map when enabling caches in
> SPL. Allocate page tables from the early malloc-F heap and
> select the board map through a common Qualcomm hook.
>
> Signed-off-by: Abhilash V <abhilash.v@oss.qualcomm.com>
[snip]
> +/*
> + * SPL platforms whose pre-DRAM address map differs from the common Qualcomm
> + * map may override this hook.
> + */
> +struct mm_region *__weak qcom_spl_mem_map(void)
> +{
> + return NULL;
> +}
[snip]
> @@ -192,7 +208,11 @@ void enable_caches(void)
>
> gd->arch.tlb_fillptr = tlb_addr;
>
> - build_mem_map();
> + spl_mem_map = qcom_spl_mem_map();
> + if (spl_mem_map)
> + mem_map = spl_mem_map;
> + else
> + build_mem_map();
This is kind of odd. Which pre-requisite series brings this in? I wonder
if a better abstraction would help, and if this is still the right way
to go, the weak part should come in then.
--
Tom
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH v5 10/13] board: qualcomm: shikra: prepare QUP firmware in SPL
2026-10-29 10:57 [PATCH v5 00/13] qcom: shikra: add eMMC SPL boot support Abhilash V
` (8 preceding siblings ...)
2026-10-29 10:57 ` [PATCH v5 09/13] arm: qcom: enable MMU and cache setup for Shikra SPL Abhilash V
@ 2026-10-29 10:57 ` Abhilash V
2026-10-29 10:57 ` [PATCH v5 11/13] board: qualcomm: shikra: embed XBL-sec in SPL ELF Abhilash V
` (2 subsequent siblings)
12 siblings, 0 replies; 21+ messages in thread
From: Abhilash V @ 2026-10-29 10:57 UTC (permalink / raw)
To: trini, ilias.apalodimas, aswin.murugan, casey.connolly,
neil.armstrong, sumit.garg, lukma, peng.fan, jh80.chung,
tanmay.kathpalia, abhilash.v, sjg, Michael.Srba,
varadarajan.narayanan, nikroks, balaji.selvanathan, nathbappai,
jbx6244, u-boot, u-boot-qcom
Prepare QUP firmware support before serial-engine children
are probed during SPL initialization.
Enable QUP wrapper clocks before firmware detection. Resolve
the selected MMC boot source once and initialize it before
last-stage init, so QUPFW media preparation and pre-DDR
loading use the same source.
Make QUP firmware available from the selected boot medium.
Release the firmware buffer after children are probed so SPL
can reserve memory for the MMU page table.
Signed-off-by: Abhilash V <abhilash.v@oss.qualcomm.com>
---
board/qualcomm/shikra/spl-shikra.c | 144 ++++++++++++++++++++++++++++-
1 file changed, 143 insertions(+), 1 deletion(-)
diff --git a/board/qualcomm/shikra/spl-shikra.c b/board/qualcomm/shikra/spl-shikra.c
index c6327a14767..000571d32a1 100644
--- a/board/qualcomm/shikra/spl-shikra.c
+++ b/board/qualcomm/shikra/spl-shikra.c
@@ -3,6 +3,7 @@
* Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
*/
#include <blk.h>
+#include <clk.h>
#include <cpu_func.h>
#include <asm/io.h>
#include <asm/sections.h>
@@ -16,6 +17,7 @@
#include <malloc.h>
#include <mach/qclib.h>
#include <mach/spl.h>
+#include <mmc.h>
#include <part.h>
#include <spl.h>
@@ -144,8 +146,129 @@ enum {
};
#if defined(CONFIG_SPL_BUILD)
+/**
+ * shikra_prepare_qup_clocks() - Enable QUP wrapper clocks.
+ *
+ * Enable wrapper clocks before detecting the QUP firmware state.
+ *
+ * Return: 0 on success, or a negative error code.
+ */
+static int shikra_prepare_qup_clocks(void)
+{
+ struct clk_bulk clks;
+ struct uclass *uc;
+ struct udevice *dev;
+ int ret;
+
+ ret = uclass_get(UCLASS_MISC, &uc);
+ if (ret)
+ return ret;
+
+ uclass_foreach_dev(dev, uc) {
+ if (!device_is_compatible(dev, "qcom,geni-se-qup"))
+ continue;
+
+ ret = clk_get_bulk(dev, &clks);
+ if (ret)
+ return ret;
+
+ ret = clk_enable_bulk(&clks);
+ if (ret)
+ clk_release_bulk(&clks);
+
+ return ret;
+ }
+
+ return -ENODEV;
+}
+
+/**
+ * shikra_prepare_mmc() - Initialize the selected MMC boot device.
+ *
+ * Make the boot MMC device available before loading QUP firmware.
+ *
+ * Return: 0 on success, or a negative error code.
+ */
+static int shikra_prepare_mmc(u32 boot_device)
+{
+ struct udevice *dev;
+ struct mmc *mmc;
+ int seq, ret;
+
+ switch (boot_device) {
+ case BOOT_DEVICE_MMC1:
+ seq = 0;
+ break;
+ case BOOT_DEVICE_MMC2:
+ seq = 1;
+ break;
+ default:
+ return -ENODEV;
+ }
+
+ ret = uclass_get_device_by_seq(UCLASS_MMC, seq, &dev);
+ if (ret)
+ return ret;
+
+ mmc = mmc_get_mmc_dev(dev);
+ if (!mmc)
+ return -ENODEV;
+
+ return mmc_init(mmc);
+}
+
+/**
+ * qcom_spl_prepare_qupfw_media() - Prepare media for QUPFW loading.
+ * @boot_device: U-Boot boot-device identifier.
+ *
+ * Prepare media that must be initialized before QUP firmware loading.
+ * Media without an early-preparation requirement are intentionally left as
+ * placeholders and are handled by their SPL image loader later in the flow.
+ *
+ * Return: 0 on success, or a negative error code.
+ */
+static int qcom_spl_prepare_qupfw_media(u32 boot_device)
+{
+ switch (boot_device) {
+ case BOOT_DEVICE_MMC1:
+ case BOOT_DEVICE_MMC2:
+ return shikra_prepare_mmc(boot_device);
+
+ default:
+ return -EOPNOTSUPP;
+ }
+}
+
+/**
+ * shikra_release_qupfw() - Free the QUP firmware buffer.
+ *
+ * Free the dynamic QUPFW buffer before allocating the MMU table.
+ */
+static void shikra_release_qupfw(void)
+{
+#if !IS_ENABLED(CONFIG_QCOM_GENI_MINICORE)
+ struct uclass *uc;
+ struct udevice *dev;
+ void *fw;
+
+ if (uclass_get(UCLASS_MISC, &uc))
+ return;
+
+ uclass_foreach_dev(dev, uc) {
+ if (!device_is_compatible(dev, "qcom,geni-se-qup"))
+ continue;
+
+ fw = dev_get_priv(dev);
+ if (fw)
+ free(fw);
+ return;
+ }
+#endif
+}
+
void board_init_f(ulong dummy)
{
+ int boot_device;
int ret = 0;
memset(__bss_start, 0, __bss_end - __bss_start);
@@ -158,7 +281,26 @@ void board_init_f(ulong dummy)
goto fail;
}
+ ret = shikra_prepare_qup_clocks();
+ if (ret) {
+ pr_debug("failed to prepare QUP clocks (%d)\n", ret);
+ goto fail;
+ }
+
+ boot_device = (int)spl_boot_device();
+ if (boot_device < 0) {
+ ret = boot_device;
+ goto fail;
+ }
+
+ ret = qcom_spl_prepare_qupfw_media(boot_device);
+ if (ret) {
+ pr_debug("failed to prepare QUPFW media (%d)\n", ret);
+ goto fail;
+ }
+
event_notify_null(EVT_LAST_STAGE_INIT);
+ shikra_release_qupfw();
preloader_console_init();
@@ -172,7 +314,7 @@ void board_init_f(ulong dummy)
enable_caches();
#endif
- ret = qcom_spl_loader_pre_ddr(spl_boot_device());
+ ret = qcom_spl_loader_pre_ddr(boot_device);
if (ret) {
pr_debug("qcom_spl_loader_pre_ddr() failed (%d)\n", ret);
goto fail;
--
2.34.1
^ permalink raw reply related [flat|nested] 21+ messages in thread* [PATCH v5 11/13] board: qualcomm: shikra: embed XBL-sec in SPL ELF
2026-10-29 10:57 [PATCH v5 00/13] qcom: shikra: add eMMC SPL boot support Abhilash V
` (9 preceding siblings ...)
2026-10-29 10:57 ` [PATCH v5 10/13] board: qualcomm: shikra: prepare QUP firmware in SPL Abhilash V
@ 2026-10-29 10:57 ` Abhilash V
2026-10-29 16:55 ` Tom Rini
2026-10-29 10:57 ` [PATCH v5 12/13] arm: dts: shikra: retain SPL dependencies in IQS overlay Abhilash V
2026-10-29 10:57 ` [PATCH v5 13/13] clk: qcom: build only selected clock drivers in SPL Abhilash V
12 siblings, 1 reply; 21+ messages in thread
From: Abhilash V @ 2026-10-29 10:57 UTC (permalink / raw)
To: trini, ilias.apalodimas, aswin.murugan, casey.connolly,
neil.armstrong, sumit.garg, lukma, peng.fan, jh80.chung,
tanmay.kathpalia, abhilash.v, sjg, Michael.Srba,
varadarajan.narayanan, nikroks, balaji.selvanathan, nathbappai,
jbx6244, u-boot, u-boot-qcom
Stage the configured XBL-sec ELF and embed it as a type-5
PT_LOAD segment in the remade SPL ELF. The linker script
places its complete ELF image at the configured Shikra
address, alongside the U-Boot SPL load segment.
The resulting u-boot-spl.elf is unsigned; external tooling
performs signing after the normal build.
Signed-off-by: Abhilash V <abhilash.v@oss.qualcomm.com>
---
arch/arm/mach-snapdragon/Kconfig | 10 +++++
board/qualcomm/shikra/config.mk | 24 +++++++++++
board/qualcomm/shikra/shikra-spl-wrap-elf.lds | 42 ++++++++++++++-----
3 files changed, 66 insertions(+), 10 deletions(-)
create mode 100644 board/qualcomm/shikra/config.mk
diff --git a/arch/arm/mach-snapdragon/Kconfig b/arch/arm/mach-snapdragon/Kconfig
index 5718b66cde1..b4fb05eec09 100644
--- a/arch/arm/mach-snapdragon/Kconfig
+++ b/arch/arm/mach-snapdragon/Kconfig
@@ -66,6 +66,16 @@ config QCOM_TMEL_ELF
Path of the TME Elf file to be concatenated to u-boot.mbn to create
boot rom expected multi-elf image
+config QCOM_XBL_SEC_ELF
+ string "XBL-sec ELF image"
+ depends on SPL && SPL_REMAKE_ELF
+ help
+ Name of the XBL-sec ELF image in the U-Boot source-tree root to
+ embed in the SPL ELF.
+
+ The image is copied to the build output as xbl_sec.elf and embedded
+ by the platform SPL linker script as a Qualcomm XBL-sec segment.
+
choice
prompt "Qualcomm boot0.h workaround"
optional
diff --git a/board/qualcomm/shikra/config.mk b/board/qualcomm/shikra/config.mk
new file mode 100644
index 00000000000..51480059410
--- /dev/null
+++ b/board/qualcomm/shikra/config.mk
@@ -0,0 +1,24 @@
+# SPDX-License-Identifier: GPL-2.0-only
+#
+# Shikra secure SPL image generation.
+#
+# The XBL-sec image is provided to the SPL linker script as xbl_sec.elf.
+# The generated spl/u-boot-spl.elf contains the XBL-sec type-5 PT_LOAD
+# segment.
+
+# The input name is selected by CONFIG_QCOM_XBL_SEC_ELF and is resolved in
+# the source-tree root. Signing is intentionally performed outside the
+# U-Boot build.
+QCOM_SHIKRA_XBL_SEC_INPUT := $(srctree)/$(CONFIG_QCOM_XBL_SEC_ELF:"%"=%)
+
+QCOM_SHIKRA_XBL_SEC_ELF := xbl_sec.elf
+
+quiet_cmd_shikra_xbl_sec = XBLSEC $@
+ cmd_shikra_xbl_sec = cp $< $@
+
+# Stage the configured XBL-sec image in the output directory before linking
+# the SPL ELF.
+$(QCOM_SHIKRA_XBL_SEC_ELF): $(QCOM_SHIKRA_XBL_SEC_INPUT) FORCE
+ $(call if_changed,shikra_xbl_sec)
+
+spl/u-boot-spl.elf: $(QCOM_SHIKRA_XBL_SEC_ELF)
diff --git a/board/qualcomm/shikra/shikra-spl-wrap-elf.lds b/board/qualcomm/shikra/shikra-spl-wrap-elf.lds
index b2922cd2c2c..387b83ae6dc 100644
--- a/board/qualcomm/shikra/shikra-spl-wrap-elf.lds
+++ b/board/qualcomm/shikra/shikra-spl-wrap-elf.lds
@@ -1,18 +1,40 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/* Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. */
+
+/* The boot ROM identifies XBL-sec by the segment type in p_flags. */
+#define PF_SEGMENT_TYPE_XBL_SEC 5
+
/*
- * SPDX-License-Identifier: GPL-2.0-only
- * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
+ * The XBL-sec segment address must match the address encoded by the supplied
+ * XBL-sec image:
+ *
+ * entry address 0x0c350000
+ * LOAD offset 0x00002000
+ * base address 0x0c34e000
*/
+#define XBL_SEC_SEGMENT_ADDR 0x000000000c34e000
+
+/* xbl_sec.elf is staged in the output directory by the board build rules. */
+TARGET("binary")
+INPUT("./xbl_sec.elf")
+
+OUTPUT_FORMAT("default")
+
+ENTRY(CONFIG_PLATFORM_ELFENTRY)
+
PHDRS {
- ptype PT_LOAD FLAGS(0x7);
+ data PT_LOAD FLAGS(7);
+ xbl_sec PT_LOAD FLAGS(5 | (PF_SEGMENT_TYPE_XBL_SEC << 24));
}
-ENTRY(_entry)
-
SECTIONS {
+ . = XBL_SEC_SEGMENT_ADDR;
+ .xbl_sec : {
+ "./xbl_sec.elf"
+ } :xbl_sec
+
. = CONFIG_PLATFORM_ELFENTRY;
- _entry = . ;
- data : {
- *(.data)
- . = ALIGN(4);
- } :ptype
+ .data : {
+ *(.data*)
+ } :data
}
--
2.34.1
^ permalink raw reply related [flat|nested] 21+ messages in thread* Re: [PATCH v5 11/13] board: qualcomm: shikra: embed XBL-sec in SPL ELF
2026-10-29 10:57 ` [PATCH v5 11/13] board: qualcomm: shikra: embed XBL-sec in SPL ELF Abhilash V
@ 2026-10-29 16:55 ` Tom Rini
0 siblings, 0 replies; 21+ messages in thread
From: Tom Rini @ 2026-10-29 16:55 UTC (permalink / raw)
To: Abhilash V
Cc: ilias.apalodimas, aswin.murugan, casey.connolly, neil.armstrong,
sumit.garg, lukma, peng.fan, jh80.chung, tanmay.kathpalia, sjg,
Michael.Srba, varadarajan.narayanan, nikroks, balaji.selvanathan,
nathbappai, jbx6244, u-boot, u-boot-qcom
[-- Attachment #1: Type: text/plain, Size: 1205 bytes --]
On Thu, Oct 29, 2026 at 03:57:44AM -0700, Abhilash V wrote:
> Stage the configured XBL-sec ELF and embed it as a type-5
> PT_LOAD segment in the remade SPL ELF. The linker script
> places its complete ELF image at the configured Shikra
> address, alongside the U-Boot SPL load segment.
>
> The resulting u-boot-spl.elf is unsigned; external tooling
> performs signing after the normal build.
>
> Signed-off-by: Abhilash V <abhilash.v@oss.qualcomm.com>
[snip]
> diff --git a/board/qualcomm/shikra/shikra-spl-wrap-elf.lds b/board/qualcomm/shikra/shikra-spl-wrap-elf.lds
> index b2922cd2c2c..387b83ae6dc 100644
> --- a/board/qualcomm/shikra/shikra-spl-wrap-elf.lds
> +++ b/board/qualcomm/shikra/shikra-spl-wrap-elf.lds
> @@ -1,18 +1,40 @@
> +/* SPDX-License-Identifier: GPL-2.0-only */
> +/* Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries. */
> +
> +/* The boot ROM identifies XBL-sec by the segment type in p_flags. */
> +#define PF_SEGMENT_TYPE_XBL_SEC 5
> +
> /*
> - * SPDX-License-Identifier: GPL-2.0-only
> - * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
Please just get this part right when you introduce the file.
--
Tom
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 21+ messages in thread
* [PATCH v5 12/13] arm: dts: shikra: retain SPL dependencies in IQS overlay
2026-10-29 10:57 [PATCH v5 00/13] qcom: shikra: add eMMC SPL boot support Abhilash V
` (10 preceding siblings ...)
2026-10-29 10:57 ` [PATCH v5 11/13] board: qualcomm: shikra: embed XBL-sec in SPL ELF Abhilash V
@ 2026-10-29 10:57 ` Abhilash V
2026-10-29 10:57 ` [PATCH v5 13/13] clk: qcom: build only selected clock drivers in SPL Abhilash V
12 siblings, 0 replies; 21+ messages in thread
From: Abhilash V @ 2026-10-29 10:57 UTC (permalink / raw)
To: trini, ilias.apalodimas, aswin.murugan, casey.connolly,
neil.armstrong, sumit.garg, lukma, peng.fan, jh80.chung,
tanmay.kathpalia, abhilash.v, sjg, Michael.Srba,
varadarajan.narayanan, nikroks, balaji.selvanathan, nathbappai,
jbx6244, u-boot, u-boot-qcom
From: Aswin Murugan <aswin.murugan@oss.qualcomm.com>
U-Boot proper uses the IQS device tree on Shikra. Retain the SPL console,
QUP firmware storage, MMC, clock, pinctrl, and power dependencies in the
same overlay.
Signed-off-by: Abhilash V <abhilash.v@oss.qualcomm.com>
Signed-off-by: Aswin Murugan <aswin.murugan@oss.qualcomm.com>
---
arch/arm/dts/shikra-iqs-evk-u-boot.dtsi | 42 +++++++++++++++++++++++++
1 file changed, 42 insertions(+)
diff --git a/arch/arm/dts/shikra-iqs-evk-u-boot.dtsi b/arch/arm/dts/shikra-iqs-evk-u-boot.dtsi
index e807b91ef1f..a1e506f7dff 100644
--- a/arch/arm/dts/shikra-iqs-evk-u-boot.dtsi
+++ b/arch/arm/dts/shikra-iqs-evk-u-boot.dtsi
@@ -20,3 +20,45 @@
&usb_qmpphy {
status = "okay";
};
+
+/* Keep the console and QUPFW storage paths in the SPL device tree. */
+&gcc {
+ bootph-all;
+};
+
+&tlmm {
+ bootph-all;
+};
+
+&qup_uart0_default {
+ bootph-all;
+};
+
+&sdc1_state_on {
+ bootph-all;
+};
+
+&sdc1_state_off {
+ bootph-all;
+};
+
+&sdhc_1 {
+ bootph-all;
+};
+
+&qupv3_0 {
+ bootph-all;
+};
+
+&uart0 {
+ bootph-all;
+};
+
+/* Retain the RPM clock and power-domain providers for boot consumers. */
+&rpmcc {
+ bootph-all;
+};
+
+&rpmpd {
+ bootph-all;
+};
--
2.34.1
^ permalink raw reply related [flat|nested] 21+ messages in thread* [PATCH v5 13/13] clk: qcom: build only selected clock drivers in SPL
2026-10-29 10:57 [PATCH v5 00/13] qcom: shikra: add eMMC SPL boot support Abhilash V
` (11 preceding siblings ...)
2026-10-29 10:57 ` [PATCH v5 12/13] arm: dts: shikra: retain SPL dependencies in IQS overlay Abhilash V
@ 2026-10-29 10:57 ` Abhilash V
2026-10-29 17:21 ` Tom Rini
12 siblings, 1 reply; 21+ messages in thread
From: Abhilash V @ 2026-10-29 10:57 UTC (permalink / raw)
To: trini, ilias.apalodimas, aswin.murugan, casey.connolly,
neil.armstrong, sumit.garg, lukma, peng.fan, jh80.chung,
tanmay.kathpalia, abhilash.v, sjg, Michael.Srba,
varadarajan.narayanan, nikroks, balaji.selvanathan, nathbappai,
jbx6244, u-boot, u-boot-qcom
From: Aswin Murugan <aswin.murugan@oss.qualcomm.com>
Make Qualcomm clock-driver selection phase-aware so SPL builds only the
drivers it needs, reducing the SPL image size.
Signed-off-by: Abhilash V <abhilash.v@oss.qualcomm.com>
Signed-off-by: Aswin Murugan <aswin.murugan@oss.qualcomm.com>
---
drivers/clk/qcom/Kconfig | 208 ++++++++++++++++++++++++++++++++++++++
drivers/clk/qcom/Makefile | 48 ++++-----
2 files changed, 232 insertions(+), 24 deletions(-)
diff --git a/drivers/clk/qcom/Kconfig b/drivers/clk/qcom/Kconfig
index aff3f5418a0..899f44cb8dc 100644
--- a/drivers/clk/qcom/Kconfig
+++ b/drivers/clk/qcom/Kconfig
@@ -5,6 +5,11 @@ config CLK_QCOM
depends on CLK && DM_RESET && POWER_DOMAIN
def_bool n
+config SPL_CLK_QCOM
+ bool
+ depends on SPL_CLK && SPL_DM_RESET && SPL_POWER_DOMAIN
+ def_bool n
+
menu "Qualcomm clock drivers"
config CLK_QCOM_APQ8016
@@ -15,6 +20,14 @@ config CLK_QCOM_APQ8016
on the Snapdragon APQ8016 SoC. This driver supports the clocks
and resets exposed by the GCC hardware block.
+config SPL_CLK_QCOM_APQ8016
+ bool "Qualcomm APQ8016 GCC in SPL"
+ depends on SPL_CLK
+ select SPL_CLK_QCOM
+ help
+ SPL variant of CLK_QCOM_APQ8016.
+ See the help of CLK_QCOM_APQ8016 for details.
+
config CLK_QCOM_APQ8096
bool "Qualcomm APQ8096 GCC"
select CLK_QCOM
@@ -23,6 +36,14 @@ config CLK_QCOM_APQ8096
on the Snapdragon APQ8096 SoC. This driver supports the clocks
and resets exposed by the GCC hardware block.
+config SPL_CLK_QCOM_APQ8096
+ bool "Qualcomm APQ8096 GCC in SPL"
+ depends on SPL_CLK
+ select SPL_CLK_QCOM
+ help
+ SPL variant of CLK_QCOM_APQ8096.
+ See the help of CLK_QCOM_APQ8096 for details.
+
config CLK_QCOM_IPQ4019
bool "Qualcomm IPQ4019 GCC"
select CLK_QCOM
@@ -206,6 +227,193 @@ config CLK_QCOM_X1E80100
on the Snapdragon X1E80100 SoC. This driver supports the clocks
and resets exposed by the GCC hardware block.
+config SPL_CLK_QCOM_IPQ4019
+ bool "Qualcomm IPQ4019 GCC in SPL"
+ depends on SPL_CLK
+ select SPL_CLK_QCOM
+ help
+ Enable the Qualcomm IPQ4019 Global Clock Controller in SPL.
+ This includes only the clock driver needed during early boot.
+
+config SPL_CLK_QCOM_IPQ5210
+ bool "Qualcomm IPQ5210 GCC in SPL"
+ depends on SPL_CLK
+ select SPL_CLK_QCOM
+ help
+ Enable the Qualcomm IPQ5210 Global Clock Controller in SPL.
+ This includes only the clock driver needed during early boot.
+
+config SPL_CLK_QCOM_IPQ5424
+ bool "Qualcomm IPQ5424 GCC in SPL"
+ depends on SPL_CLK
+ select SPL_CLK_QCOM
+ help
+ Enable the Qualcomm IPQ5424 Global Clock Controller in SPL.
+ This includes only the clock driver needed during early boot.
+
+config SPL_CLK_QCOM_IPQ9574
+ bool "Qualcomm IPQ9574 GCC in SPL"
+ depends on SPL_CLK
+ select SPL_CLK_QCOM
+ help
+ Enable the Qualcomm IPQ9574 Global Clock Controller in SPL.
+ This includes only the clock driver needed during early boot.
+
+config SPL_CLK_QCOM_MILOS
+ bool "Qualcomm Milos GCC in SPL"
+ depends on SPL_CLK
+ select SPL_CLK_QCOM
+ help
+ Enable the Qualcomm Milos Global Clock Controller in SPL.
+ This includes only the clock driver needed during early boot.
+
+config SPL_CLK_QCOM_QCM2290
+ bool "Qualcomm QCM2290 GCC in SPL"
+ depends on SPL_CLK
+ select SPL_CLK_QCOM
+ help
+ Enable the Qualcomm QCM2290 Global Clock Controller in SPL.
+ This includes only the clock driver needed during early boot.
+
+config SPL_CLK_QCOM_QCS404
+ bool "Qualcomm QCS404 GCC in SPL"
+ depends on SPL_CLK
+ select SPL_CLK_QCOM
+ help
+ Enable the Qualcomm QCS404 Global Clock Controller in SPL.
+ This includes only the clock driver needed during early boot.
+
+config SPL_CLK_QCOM_QCS615
+ bool "Qualcomm QCS615 GCC in SPL"
+ depends on SPL_CLK
+ select SPL_CLK_QCOM
+ help
+ Enable the Qualcomm QCS615 Global Clock Controller in SPL.
+ This includes only the clock driver needed during early boot.
+
+config SPL_CLK_QCOM_QCS8300
+ bool "Qualcomm QCS8300 GCC in SPL"
+ depends on SPL_CLK
+ select SPL_CLK_QCOM
+ help
+ Enable the Qualcomm QCS8300 Global Clock Controller in SPL.
+ This includes only the clock driver needed during early boot.
+
+config SPL_CLK_QCOM_RPMH
+ bool "Qualcomm RPMh clock driver in SPL"
+ depends on SPL_CLK
+ help
+ Enable the Qualcomm RPMh clock driver in SPL.
+ This provides RPMh-managed clocks needed during early boot.
+
+config SPL_CLK_QCOM_SA8775P
+ bool "Qualcomm SA8775 GCC in SPL"
+ depends on SPL_CLK
+ select SPL_CLK_QCOM
+ select SPL_CLK_QCOM_RPMH
+ help
+ Enable the Qualcomm SA8775P Global Clock Controller in SPL.
+ This includes only the clock driver needed during early boot.
+
+config SPL_CLK_QCOM_SDM845
+ bool "Qualcomm SDM845 GCC in SPL"
+ depends on SPL_CLK
+ select SPL_CLK_QCOM
+ help
+ Enable the Qualcomm SDM845 Global Clock Controller in SPL.
+ This includes only the clock driver needed during early boot.
+
+config SPL_CLK_QCOM_SHIKRA
+ bool "Qualcomm Shikra GCC in SPL"
+ depends on SPL_CLK
+ select SPL_CLK_QCOM
+ help
+ Enable the Qualcomm Shikra Global Clock Controller in SPL.
+ This includes only the clock driver needed during early boot.
+
+config SPL_CLK_QCOM_SM6115
+ bool "Qualcomm SM6115 GCC in SPL"
+ depends on SPL_CLK
+ select SPL_CLK_QCOM
+ help
+ Enable the Qualcomm SM6115 Global Clock Controller in SPL.
+ This includes only the clock driver needed during early boot.
+
+config SPL_CLK_QCOM_SM6125
+ bool "Qualcomm SM6125 GCC in SPL"
+ depends on SPL_CLK
+ select SPL_CLK_QCOM
+ help
+ Enable the Qualcomm SM6125 Global Clock Controller in SPL.
+ This includes only the clock driver needed during early boot.
+
+config SPL_CLK_QCOM_SM6350
+ bool "Qualcomm SM6350 GCC in SPL"
+ depends on SPL_CLK
+ select SPL_CLK_QCOM
+ help
+ Enable the Qualcomm SM6350 Global Clock Controller in SPL.
+ This includes only the clock driver needed during early boot.
+
+config SPL_CLK_QCOM_SM7150
+ bool "Qualcomm SM7150 GCC in SPL"
+ depends on SPL_CLK
+ select SPL_CLK_QCOM
+ help
+ Enable the Qualcomm SM7150 Global Clock Controller in SPL.
+ This includes only the clock driver needed during early boot.
+
+config SPL_CLK_QCOM_SM8150
+ bool "Qualcomm SM8150 GCC in SPL"
+ depends on SPL_CLK
+ select SPL_CLK_QCOM
+ help
+ Enable the Qualcomm SM8150 Global Clock Controller in SPL.
+ This includes only the clock driver needed during early boot.
+
+config SPL_CLK_QCOM_SM8250
+ bool "Qualcomm SM8250 GCC in SPL"
+ depends on SPL_CLK
+ select SPL_CLK_QCOM
+ help
+ Enable the Qualcomm SM8250 Global Clock Controller in SPL.
+ This includes only the clock driver needed during early boot.
+
+config SPL_CLK_QCOM_SM8550
+ bool "Qualcomm SM8550 GCC in SPL"
+ depends on SPL_CLK
+ select SPL_CLK_QCOM
+ select SPL_CLK_QCOM_RPMH
+ help
+ Enable the Qualcomm SM8550 Global Clock Controller in SPL.
+ This includes only the clock driver needed during early boot.
+
+config SPL_CLK_QCOM_SM8650
+ bool "Qualcomm SM8650 GCC in SPL"
+ depends on SPL_CLK
+ select SPL_CLK_QCOM
+ select SPL_CLK_QCOM_RPMH
+ help
+ Enable the Qualcomm SM8650 Global Clock Controller in SPL.
+ This includes only the clock driver needed during early boot.
+
+config SPL_CLK_QCOM_SC7280
+ bool "Qualcomm SC7280 GCC in SPL"
+ depends on SPL_CLK
+ select SPL_CLK_QCOM
+ select SPL_CLK_QCOM_RPMH
+ help
+ Enable the Qualcomm SC7280 Global Clock Controller in SPL.
+ This includes only the clock driver needed during early boot.
+
+config SPL_CLK_QCOM_X1E80100
+ bool "Qualcomm X1E80100 GCC in SPL"
+ depends on SPL_CLK
+ select SPL_CLK_QCOM
+ help
+ Enable the Qualcomm X1E80100 Global Clock Controller in SPL.
+ This includes only the clock driver needed during early boot.
+
endmenu
endif
diff --git a/drivers/clk/qcom/Makefile b/drivers/clk/qcom/Makefile
index 8da2ff7e73e..7c4db9986d1 100644
--- a/drivers/clk/qcom/Makefile
+++ b/drivers/clk/qcom/Makefile
@@ -3,28 +3,28 @@
# (C) Copyright 2023 Linaro
obj-y += clock-qcom.o
-obj-$(CONFIG_CLK_QCOM_SDM845) += clock-sdm845.o
-obj-$(CONFIG_CLK_QCOM_APQ8016) += clock-apq8016.o
-obj-$(CONFIG_CLK_QCOM_APQ8096) += clock-apq8096.o
-obj-$(CONFIG_CLK_QCOM_IPQ4019) += clock-ipq4019.o
-obj-$(CONFIG_CLK_QCOM_IPQ5210) += clock-ipq5210.o
-obj-$(CONFIG_CLK_QCOM_IPQ5424) += clock-ipq5424.o
-obj-$(CONFIG_CLK_QCOM_IPQ9574) += clock-ipq9574.o
-obj-$(CONFIG_CLK_QCOM_MILOS) += clock-milos.o
-obj-$(CONFIG_CLK_QCOM_QCM2290) += clock-qcm2290.o
-obj-$(CONFIG_CLK_QCOM_QCS404) += clock-qcs404.o
-obj-$(CONFIG_CLK_QCOM_QCS8300) += clock-qcs8300.o
-obj-$(CONFIG_CLK_QCOM_QCS615) += clock-qcs615.o
-obj-$(CONFIG_CLK_QCOM_SA8775P) += clock-sa8775p.o
+obj-$(CONFIG_$(PHASE_)CLK_QCOM_SDM845) += clock-sdm845.o
+obj-$(CONFIG_$(PHASE_)CLK_QCOM_APQ8016) += clock-apq8016.o
+obj-$(CONFIG_$(PHASE_)CLK_QCOM_APQ8096) += clock-apq8096.o
+obj-$(CONFIG_$(PHASE_)CLK_QCOM_IPQ4019) += clock-ipq4019.o
+obj-$(CONFIG_$(PHASE_)CLK_QCOM_IPQ5210) += clock-ipq5210.o
+obj-$(CONFIG_$(PHASE_)CLK_QCOM_IPQ5424) += clock-ipq5424.o
+obj-$(CONFIG_$(PHASE_)CLK_QCOM_IPQ9574) += clock-ipq9574.o
+obj-$(CONFIG_$(PHASE_)CLK_QCOM_MILOS) += clock-milos.o
+obj-$(CONFIG_$(PHASE_)CLK_QCOM_QCM2290) += clock-qcm2290.o
+obj-$(CONFIG_$(PHASE_)CLK_QCOM_QCS404) += clock-qcs404.o
+obj-$(CONFIG_$(PHASE_)CLK_QCOM_QCS8300) += clock-qcs8300.o
+obj-$(CONFIG_$(PHASE_)CLK_QCOM_QCS615) += clock-qcs615.o
+obj-$(CONFIG_$(PHASE_)CLK_QCOM_SA8775P) += clock-sa8775p.o
obj-$(CONFIG_CLK_QCOM_SC7180) += clock-sc7180.o
-obj-$(CONFIG_CLK_QCOM_SC7280) += clock-sc7280.o
-obj-$(CONFIG_CLK_QCOM_SHIKRA) += clock-shikra.o
-obj-$(CONFIG_CLK_QCOM_SM6115) += clock-sm6115.o
-obj-$(CONFIG_CLK_QCOM_SM6125) += clock-sm6125.o
-obj-$(CONFIG_CLK_QCOM_SM6350) += clock-sm6350.o
-obj-$(CONFIG_CLK_QCOM_SM7150) += clock-sm7150.o
-obj-$(CONFIG_CLK_QCOM_SM8150) += clock-sm8150.o
-obj-$(CONFIG_CLK_QCOM_SM8250) += clock-sm8250.o
-obj-$(CONFIG_CLK_QCOM_SM8550) += clock-sm8550.o
-obj-$(CONFIG_CLK_QCOM_SM8650) += clock-sm8650.o
-obj-$(CONFIG_CLK_QCOM_X1E80100) += clock-x1e80100.o
+obj-$(CONFIG_$(PHASE_)CLK_QCOM_SC7280) += clock-sc7280.o
+obj-$(CONFIG_$(PHASE_)CLK_QCOM_SHIKRA) += clock-shikra.o
+obj-$(CONFIG_$(PHASE_)CLK_QCOM_SM6115) += clock-sm6115.o
+obj-$(CONFIG_$(PHASE_)CLK_QCOM_SM6125) += clock-sm6125.o
+obj-$(CONFIG_$(PHASE_)CLK_QCOM_SM6350) += clock-sm6350.o
+obj-$(CONFIG_$(PHASE_)CLK_QCOM_SM7150) += clock-sm7150.o
+obj-$(CONFIG_$(PHASE_)CLK_QCOM_SM8150) += clock-sm8150.o
+obj-$(CONFIG_$(PHASE_)CLK_QCOM_SM8250) += clock-sm8250.o
+obj-$(CONFIG_$(PHASE_)CLK_QCOM_SM8550) += clock-sm8550.o
+obj-$(CONFIG_$(PHASE_)CLK_QCOM_SM8650) += clock-sm8650.o
+obj-$(CONFIG_$(PHASE_)CLK_QCOM_X1E80100) += clock-x1e80100.o
--
2.34.1
^ permalink raw reply related [flat|nested] 21+ messages in thread* Re: [PATCH v5 13/13] clk: qcom: build only selected clock drivers in SPL
2026-10-29 10:57 ` [PATCH v5 13/13] clk: qcom: build only selected clock drivers in SPL Abhilash V
@ 2026-10-29 17:21 ` Tom Rini
0 siblings, 0 replies; 21+ messages in thread
From: Tom Rini @ 2026-10-29 17:21 UTC (permalink / raw)
To: Abhilash V
Cc: ilias.apalodimas, aswin.murugan, casey.connolly, neil.armstrong,
sumit.garg, lukma, peng.fan, jh80.chung, tanmay.kathpalia, sjg,
Michael.Srba, varadarajan.narayanan, nikroks, balaji.selvanathan,
nathbappai, jbx6244, u-boot, u-boot-qcom
[-- Attachment #1: Type: text/plain, Size: 3140 bytes --]
On Thu, Oct 29, 2026 at 03:57:46AM -0700, Abhilash V wrote:
> From: Aswin Murugan <aswin.murugan@oss.qualcomm.com>
>
> Make Qualcomm clock-driver selection phase-aware so SPL builds only the
> drivers it needs, reducing the SPL image size.
>
> Signed-off-by: Abhilash V <abhilash.v@oss.qualcomm.com>
> Signed-off-by: Aswin Murugan <aswin.murugan@oss.qualcomm.com>
> ---
> drivers/clk/qcom/Kconfig | 208 ++++++++++++++++++++++++++++++++++++++
> drivers/clk/qcom/Makefile | 48 ++++-----
> 2 files changed, 232 insertions(+), 24 deletions(-)
>
> diff --git a/drivers/clk/qcom/Kconfig b/drivers/clk/qcom/Kconfig
> index aff3f5418a0..899f44cb8dc 100644
> --- a/drivers/clk/qcom/Kconfig
> +++ b/drivers/clk/qcom/Kconfig
> @@ -5,6 +5,11 @@ config CLK_QCOM
> depends on CLK && DM_RESET && POWER_DOMAIN
> def_bool n
>
> +config SPL_CLK_QCOM
> + bool
> + depends on SPL_CLK && SPL_DM_RESET && SPL_POWER_DOMAIN
> + def_bool n
Are you sure you need the def_bool n? I see you're copying CLK_QCOM but
I don't think that's needed either.
> +
> menu "Qualcomm clock drivers"
>
> config CLK_QCOM_APQ8016
> @@ -15,6 +20,14 @@ config CLK_QCOM_APQ8016
> on the Snapdragon APQ8016 SoC. This driver supports the clocks
> and resets exposed by the GCC hardware block.
>
> +config SPL_CLK_QCOM_APQ8016
> + bool "Qualcomm APQ8016 GCC in SPL"
> + depends on SPL_CLK
> + select SPL_CLK_QCOM
> + help
> + SPL variant of CLK_QCOM_APQ8016.
> + See the help of CLK_QCOM_APQ8016 for details.
> +
> config CLK_QCOM_APQ8096
> bool "Qualcomm APQ8096 GCC"
> select CLK_QCOM
> @@ -23,6 +36,14 @@ config CLK_QCOM_APQ8096
> on the Snapdragon APQ8096 SoC. This driver supports the clocks
> and resets exposed by the GCC hardware block.
>
> +config SPL_CLK_QCOM_APQ8096
> + bool "Qualcomm APQ8096 GCC in SPL"
> + depends on SPL_CLK
> + select SPL_CLK_QCOM
> + help
> + SPL variant of CLK_QCOM_APQ8096.
> + See the help of CLK_QCOM_APQ8096 for details.
> +
> config CLK_QCOM_IPQ4019
> bool "Qualcomm IPQ4019 GCC"
> select CLK_QCOM
> @@ -206,6 +227,193 @@ config CLK_QCOM_X1E80100
> on the Snapdragon X1E80100 SoC. This driver supports the clocks
> and resets exposed by the GCC hardware block.
>
> +config SPL_CLK_QCOM_IPQ4019
> + bool "Qualcomm IPQ4019 GCC in SPL"
> + depends on SPL_CLK
> + select SPL_CLK_QCOM
> + help
> + Enable the Qualcomm IPQ4019 Global Clock Controller in SPL.
> + This includes only the clock driver needed during early boot.
> +
> +config SPL_CLK_QCOM_IPQ5210
> + bool "Qualcomm IPQ5210 GCC in SPL"
> + depends on SPL_CLK
> + select SPL_CLK_QCOM
> + help
> + Enable the Qualcomm IPQ5210 Global Clock Controller in SPL.
> + This includes only the clock driver needed during early boot.
For readability you should keep these interspersed with the non-SPL
variant. And since there's such a backlog, the right thing to have done
would be to update what we have in drivers/clk/qcom/{Makefile,Kconfig}
to have SPL variants, and then add each as you go. So lets step back and
do that.
--
Tom
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 21+ messages in thread