Skip to contentSkip to conversation

arm: qcom: shikra: add SPL SD-card boot

PATCH In review Abhilash V 2 participants 4 messages Oct 30

Subsystems (5)
lore
Share & tools
lore

Abhilash V

author
#0 lore raw

v4 cover arm: qcom: shikra: add SPL SD-card boot

Enable booting the Shikra IQS EVK from a removable SD card in SPL.

Add the required SDHC2 device-tree support and select the eMMC or SD boot device. Update clock handling so only the PLLs required by the selected clock source are enabled during early boot.

Depends on:
- https://lore.kernel.org/u-boot/[email protected]/

Changes in v4:
- Removed changes from shikra-iqs-evk.dts since this has to go into kernel dts

Changes in v3:
- Moved support from cqs to iqs DT

Changes in v2:
- Rebased on top of the updated Shikra SPL series.
- Dropped the standalone MMC boot-source patch, now included in the base series.

Abhilash V (2):
clk: qcom: shikra: gate PLLs by clock source
arm: dts: shikra: enable IQS SPL SD boot

 arch/arm/dts/shikra-iqs-evk-u-boot.dtsi | 19 +++++++++++++++++++
 drivers/clk/qcom/clock-shikra.c         |  3 ++-
 drivers/gpio/msm_gpio.c                 |  3 +--
 3 files changed, 22 insertions(+), 3 deletions(-)
Signature · 1 line
2.34.1
author
#1 lore raw

PATCH v4 1/2 clk: qcom: shikra: gate PLLs by clock source

Select the QUP and SDCC2 source table entry before enabling its PLL.

UART rates from GPLL0_AUX2 must not vote GPLL6. SDCC2 needs a GPLL7 vote only for its GPLL7 table entry. This avoids enabling unrelated PLLs during SPL clock setup.

---
 drivers/clk/qcom/clock-shikra.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/clk/qcom/clock-shikra.c +2 -1
index a74d529f4cf..ae360894082 100644
@@ -152,8 +152,9 @@ static ulong shikra_set_rate(struct clk *clk, ulong rate)
 				     freq->pre_div, freq->m, freq->n, freq->src, 8);
 		return freq->freq;
 	case GCC_SDCC2_APPS_CLK:
-		clk_enable_gpll0(priv->base, &gpll7_vote_clk);
 		freq = qcom_find_freq(ftbl_gcc_sdcc2_apps_clk_src, rate);
+		if (freq->src == CFG_CLK_SRC_GPLL7)
+			clk_enable_gpll0(priv->base, &gpll7_vote_clk);
 		clk_rcg_set_rate_mnd(priv->base, GCC_SDCC2_APPS_CLK_CMD_RCGR,
 				     freq->pre_div, freq->m, freq->n, freq->src, 8);
 		return freq->freq;
Signature · 1 line
2.34.1
author
#2 lore raw

PATCH v4 2/2 arm: dts: shikra: enable IQS SPL SD boot

In reply to Abhilash V

Update the IQS device tree for SD card boot in SPL. Retain the SDHC2 and power dependencies required by the SPL boot flow and configure the controller for SD operation.

---
 arch/arm/dts/shikra-iqs-evk-u-boot.dtsi | 19 +++++++++++++++++++
 drivers/gpio/msm_gpio.c                 |  3 +--
 2 files changed, 20 insertions(+), 2 deletions(-)
arch/arm/dts/shikra-iqs-evk-u-boot.dtsi +19 -0
index a1e506f7dff..f2265c741bd 100644
@@ -46,6 +46,25 @@
 	bootph-all;
 };
 
+&sdc2_default {
+	bootph-all;
+	clk-pins { bootph-all; };
+	cmd-pins { bootph-all; };
+	data-pins { bootph-all; };
+};
+
+&sdc2_sleep {
+	bootph-all;
+	clk-pins { bootph-all; };
+	cmd-pins { bootph-all; };
+	data-pins { bootph-all; };
+};
+
+&sdc2_card_det_n { bootph-all; };
+&sdhc_2 { bootph-all; };
+&pm8150_l10 { bootph-all; };
+&pm8150_l2 { bootph-all; };
+
 &qupv3_0 {
 	bootph-all;
 };
drivers/gpio/msm_gpio.c +1 -2
index 7de332c66ae..affbbe5c880 100644
@@ -274,8 +274,7 @@ static int msm_gpio_of_to_plat(struct udevice *dev)
 
 	/* Get the pin count from the pinctrl driver */
 	uc_priv->gpio_count = pin_data->pin_count;
-	uc_priv->bank_name = fdt_getprop(gd->fdt_blob, dev_of_offset(dev),
-					 "gpio-bank-name", NULL);
+	uc_priv->bank_name = dev_read_string(dev, "gpio-bank-name");
 	if (uc_priv->bank_name == NULL)
 		uc_priv->bank_name = "soc";
 
Signature · 1 line
2.34.1
#3 lore raw

Re: [PATCH v4 2/2] arm: dts: shikra: enable IQS SPL SD boot

Quoted 30 lines · Abhilash V

Update the IQS device tree for SD card boot in SPL. Retain the SDHC2 and power dependencies required by the SPL boot flow and configure the controller for SD operation.

---
 arch/arm/dts/shikra-iqs-evk-u-boot.dtsi | 19 +++++++++++++++++++
 drivers/gpio/msm_gpio.c                 |  3 +--
 2 files changed, 20 insertions(+), 2 deletions(-)
arch/arm/dts/shikra-iqs-evk-u-boot.dtsi +12 -0
index a1e506f7dff..f2265c741bd 100644
@@ -46,6 +46,25 @@
 	bootph-all;
 };
 
+&sdc2_default {
+	bootph-all;
+	clk-pins { bootph-all; };
+	cmd-pins { bootph-all; };
+	data-pins { bootph-all; };
+};
+
+&sdc2_sleep {
+	bootph-all;
+	clk-pins { bootph-all; };
+	cmd-pins { bootph-all; };
+	data-pins { bootph-all; };

arch/arm/dts/shikra-iqs-evk-u-boot.dtsi line 70

Quoted 10 lines
arch/arm/dts/shikra-iqs-evk-u-boot.dtsi +7 -0
+};
+
+&sdc2_card_det_n { bootph-all; };
+&sdhc_2 { bootph-all; };
+&pm8150_l10 { bootph-all; };
+&pm8150_l2 { bootph-all; };
+
 &qupv3_0 {
 	bootph-all;
 };

I thought we had gone with upstream the DTS files first, bring them back to U-Boot.

Signature · 1 line
Tom