Skip to contentSkip to conversation

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

PATCH Superseded Abhilash V 1 participant 3 messages Oct 29

Subsystems (5)

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore

Abhilash V

author
#0 lore raw

v3 cover arm: qcom: shikra: add SPL SD-card boot support

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 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 +++++++++++++++++++
 arch/arm/dts/shikra-iqs-evk.dts         |  3 ++-
 drivers/clk/qcom/clock-shikra.c         |  3 ++-
 drivers/gpio/msm_gpio.c                 |  3 +--
 4 files changed, 24 insertions(+), 4 deletions(-)
Signature · 1 line
2.34.1
author
#1 lore raw

PATCH v3 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 v3 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 +++++++++++++++++++
 arch/arm/dts/shikra-iqs-evk.dts         |  3 ++-
 drivers/gpio/msm_gpio.c                 |  3 +--
 3 files changed, 22 insertions(+), 3 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;
 };
arch/arm/dts/shikra-iqs-evk.dts +2 -1
index 38b13f79c24..0f91678a3be 100644
@@ -41,8 +41,10 @@
 };
 
 &sdhc_2 {
+	resets = <&gcc GCC_SDCC2_BCR>;
 	vmmc-supply = <&pm8150_l10>;
 	vqmmc-supply = <&pm8150_l2>;
+	max-frequency = <100000000>;
 
 	no-sdio;
 	no-mmc;
@@ -50,7 +52,6 @@
 	pinctrl-0 = <&sdc2_default &sdc2_card_det_n>;
 	pinctrl-1 = <&sdc2_sleep &sdc2_card_det_n>;
 	pinctrl-names = "default", "sleep";
-
 	cd-gpios = <&tlmm 89 GPIO_ACTIVE_LOW>;
 
 	status = "okay";
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