Skip to contentSkip to conversation

arm64: dts: qcom: lemans-evk: Update SDHC storage support via overlays

PATCH RESEND Superseded Monish Chunara 3 participants 6 messages Aug 26 – Sep 2

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover arm64: dts: qcom: lemans-evk: Update SDHC storage support via overlays

This series updates the device tree configuration for the LeMans EVK board to support dynamic selection between SD card and eMMC storage.

The LeMans EVK hardware supports either an SD card or eMMC, but the interfaces are mutually exclusive as they share the same controller and resources. Previously, SD card support was hardcoded in the main device tree, preventing easy switching to eMMC.

This series refactors the SDHC configuration by:

1. Moving the existing SD card configuration into a dedicated overlay.
2. Adding a new overlay to support eMMC.
3. Updating the common SDHC node in the SoC dtsi to include necessary resources (clocks, register ranges) required by the eMMC configuration.

This allows the bootloader to apply the appropriate overlay based on the desired storage medium.

Monish Chunara (2):
arm64: dts: qcom: lemans-evk: Move SD card support to overlay
arm64: dts: qcom: lemans-evk: Add SDHCI support for eMMC via overlay

 arch/arm64/boot/dts/qcom/Makefile             |  6 ++
 arch/arm64/boot/dts/qcom/lemans-evk-emmc.dtso | 64 +++++++++++++++++++
 .../boot/dts/qcom/lemans-evk-sd-card.dtso     | 25 ++++++++
 arch/arm64/boot/dts/qcom/lemans-evk.dts       | 16 -----
 arch/arm64/boot/dts/qcom/lemans.dtsi          | 10 ++-
 5 files changed, 102 insertions(+), 19 deletions(-)
 create mode 100644 arch/arm64/boot/dts/qcom/lemans-evk-emmc.dtso
 create mode 100644 arch/arm64/boot/dts/qcom/lemans-evk-sd-card.dtso
Signature · 1 line
2.34.1
#1 lore raw

PATCH RESEND 1/2 arm64: dts: qcom: lemans-evk: Move SD card support to overlay

The lemans EVK board supports either eMMC or SD-card, but only one can be active at a time.

Move the SDHC node for SD card into a dedicated device tree overlay. This decoupling allows the storage medium to be selected dynamically by applying the appropriate overlay for either SD card or eMMC support.

---
 arch/arm64/boot/dts/qcom/Makefile             |  3 +++
 .../boot/dts/qcom/lemans-evk-sd-card.dtso     | 25 +++++++++++++++++++
 arch/arm64/boot/dts/qcom/lemans-evk.dts       | 16 ------------
 3 files changed, 28 insertions(+), 16 deletions(-)
 create mode 100644 arch/arm64/boot/dts/qcom/lemans-evk-sd-card.dtso
arch/arm64/boot/dts/qcom/Makefile +3 -0
index 1c86e7e98f55..67b768fa8063 100644
@@ -46,6 +46,9 @@ dtb-$(CONFIG_ARCH_QCOM)	+= kaanapali-mtp.dtb
 dtb-$(CONFIG_ARCH_QCOM)	+= kaanapali-qrd.dtb
 dtb-$(CONFIG_ARCH_QCOM)	+= lemans-evk.dtb
 
+lemans-evk-sd-card-dtbs := lemans-evk.dtb lemans-evk-sd-card.dtbo
+dtb-$(CONFIG_ARCH_QCOM) += lemans-evk-sd-card.dtb
+
 lemans-evk-camera-csi1-imx577-dtbs	:= lemans-evk.dtb lemans-evk-camera-csi1-imx577.dtbo
 lemans-evk-camera-dtbs	:= lemans-evk.dtb lemans-evk-camera.dtbo
 
arch/arm64/boot/dts/qcom/lemans-evk-sd-card.dtso new file +25 -0
new file mode 100644
index 000000000000..007ab6347349
@@ -0,0 +1,25 @@
+// SPDX-License-Identifier: BSD-3-Clause
+/*
+ * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
+ */
+
+/dts-v1/;
+/plugin/;
+
+#include <dt-bindings/gpio/gpio.h>
+
+&sdhc {
+	vmmc-supply = <&vmmc_sdc>;
+	vqmmc-supply = <&vreg_sdc>;
+
+	pinctrl-0 = <&sdc_default>, <&sd_cd>;
+	pinctrl-1 = <&sdc_sleep>, <&sd_cd>;
+	pinctrl-names = "default", "sleep";
+
+	bus-width = <4>;
+	cd-gpios = <&tlmm 36 GPIO_ACTIVE_LOW>;
+	no-mmc;
+	no-sdio;
+
+	status = "okay";
+};
arch/arm64/boot/dts/qcom/lemans-evk.dts +0 -16
index a45485b54a5b..579a34678949 100644
@@ -961,22 +961,6 @@ &remoteproc_gpdsp1 {
 	status = "okay";
 };
 
-&sdhc {
-	vmmc-supply = <&vmmc_sdc>;
-	vqmmc-supply = <&vreg_sdc>;
-
-	pinctrl-0 = <&sdc_default>, <&sd_cd>;
-	pinctrl-1 = <&sdc_sleep>, <&sd_cd>;
-	pinctrl-names = "default", "sleep";
-
-	bus-width = <4>;
-	cd-gpios = <&tlmm 36 GPIO_ACTIVE_LOW>;
-	no-mmc;
-	no-sdio;
-
-	status = "okay";
-};
-
 &serdes0 {
 	phy-supply = <&vreg_l5a>;
 
Signature · 1 line
2.34.1
Reviewed-by on v1 1/2
#2 lore raw

Re: [PATCH RESEND v1 1/2] arm64: dts: qcom: lemans-evk: Move SD card support to overlay

Quoted 9 lines · Monish Chunara

The lemans EVK board supports either eMMC or SD-card, but only one can be active at a time.

Move the SDHC node for SD card into a dedicated device tree overlay. This decoupling allows the storage medium to be selected dynamically by applying the appropriate overlay for either SD card or eMMC support.

---

Konrad

#3 lore raw

PATCH RESEND 2/2 arm64: dts: qcom: lemans-evk: Add SDHCI support for eMMC via overlay

In reply to Monish Chunara

Enable the SDHCI controller for eMMC functionality on the lemans EVK using a device tree overlay. Configure the corresponding addresse space and resources for eMMC.

---
 arch/arm64/boot/dts/qcom/Makefile             |  3 +
 arch/arm64/boot/dts/qcom/lemans-evk-emmc.dtso | 64 +++++++++++++++++++
 arch/arm64/boot/dts/qcom/lemans.dtsi          | 10 ++-
 3 files changed, 74 insertions(+), 3 deletions(-)
 create mode 100644 arch/arm64/boot/dts/qcom/lemans-evk-emmc.dtso
arch/arm64/boot/dts/qcom/Makefile +3 -0
index 67b768fa8063..2250e16e9366 100644
@@ -46,6 +46,9 @@ dtb-$(CONFIG_ARCH_QCOM)	+= kaanapali-mtp.dtb
 dtb-$(CONFIG_ARCH_QCOM)	+= kaanapali-qrd.dtb
 dtb-$(CONFIG_ARCH_QCOM)	+= lemans-evk.dtb
 
+lemans-evk-emmc-dtbs := lemans-evk.dtb lemans-evk-emmc.dtbo
+dtb-$(CONFIG_ARCH_QCOM) += lemans-evk-emmc.dtb
+
 lemans-evk-sd-card-dtbs := lemans-evk.dtb lemans-evk-sd-card.dtbo
 dtb-$(CONFIG_ARCH_QCOM) += lemans-evk-sd-card.dtb
 
arch/arm64/boot/dts/qcom/lemans-evk-emmc.dtso new file +64 -0

64 lines not on this page · raw message

arch/arm64/boot/dts/qcom/lemans.dtsi +7 -3
index 695eae1b7256..99d21e3d7ab8 100644
@@ -4300,7 +4300,9 @@ apss_tpdm2_out: endpoint {
 
 		sdhc: mmc@87c4000 {
 			compatible = "qcom,sa8775p-sdhci", "qcom,sdhci-msm-v5";
-			reg = <0x0 0x087c4000 0x0 0x1000>;
+			reg = <0x0 0x87C4000 0x0 0x1000>,
+			      <0x0 0x87C5000 0x0 0x1000>;
+			reg-names = "hc", "cqhci";
 
 			interrupts = <GIC_SPI 383 IRQ_TYPE_LEVEL_HIGH>,
 				     <GIC_SPI 521 IRQ_TYPE_LEVEL_HIGH>;
@@ -4308,9 +4310,11 @@ sdhc: mmc@87c4000 {
 					  "pwr_irq";
 
 			clocks = <&gcc GCC_SDCC1_AHB_CLK>,
-				 <&gcc GCC_SDCC1_APPS_CLK>;
+				<&gcc GCC_SDCC1_APPS_CLK>,
+				<&rpmhcc RPMH_CXO_CLK>;
 			clock-names = "iface",
-				      "core";
+				      "core",
+				      "xo";
 
 			interconnects = <&aggre1_noc MASTER_SDC QCOM_ICC_TAG_ALWAYS
 					 &mc_virt SLAVE_EBI1 QCOM_ICC_TAG_ALWAYS>,
Signature · 1 line
2.34.1
#4 lore raw

Re: [PATCH RESEND v1 2/2] arm64: dts: qcom: lemans-evk: Add SDHCI support for eMMC via overlay

Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider: - [High] The eMMC device tree overlay creates dummy fixed regulators instead of referencing the existing…

Thank you for your contribution! Sashiko AI review found 3 potential issue(s) to consider:
- [High] The eMMC device tree overlay creates dummy fixed regulators instead of referencing the existing PMIC RPMH regulators.
- [Low] Unused device tree binding includes in lemans-evk-emmc.dtso.
- [Low] Inconsistent indentation in clock and clock-names assignments.
--

commit 093f95690ab8c3394206ae0a37d52aa9b43fdb76
Author: Monish Chunara <[email protected]>

arm64: dts: qcom: lemans-evk: Add SDHCI support for eMMC via overlay

Enable the SDHCI controller for eMMC functionality on the lemans EVK using a device tree overlay. Configure the corresponding address space and resources for eMMC.

[ ... ]

Quoted 7 lines
arch/arm64/boot/dts/qcom/lemans-evk-emmc.dtso new file +1 -0
new file mode 100644
index 0000000000000..52739d39a1ff8
@@ -0,0 +1,64 @@
+// SPDX-License-Identifier: BSD-3-Clause

arch/arm64/boot/dts/qcom/lemans-evk-emmc.dtso line 11

Quoted 10 lines
arch/arm64/boot/dts/qcom/lemans-evk-emmc.dtso new file +10 -0
+/*
+ * Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
+ */
+
+/dts-v1/;
+/plugin/;
+
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/clock/qcom,rpmh.h>
+#include <dt-bindings/clock/qcom,sa8775p-gcc.h>

[Severity: Low]
Are these include directives necessary? It looks like the definitions from these headers are never used in this overlay, which might just add unnecessary code clutter.

Quoted 12 lines
arch/arm64/boot/dts/qcom/lemans-evk-emmc.dtso new file +12 -0
+
+/ {
+	vmmc_sdc1: regulator-l8c {
+		compatible = "regulator-fixed";
+		regulator-name = "vreg-sdc1";
+
+		regulator-min-microvolt = <2960000>;
+		regulator-max-microvolt = <2960000>;
+	};
+
+	vqmmc_sdc1: regulator-s4a {
+		compatible = "regulator-fixed";

arch/arm64/boot/dts/qcom/lemans-evk-emmc.dtso line 33

Quoted 10 lines
arch/arm64/boot/dts/qcom/lemans-evk-emmc.dtso new file +10 -0
+		regulator-name = "vqmmc-sdc1";
+
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <1800000>;
+	};
+};
+
+&sdhc {
+	vmmc-supply = <&vmmc_sdc1>;
+	vqmmc-supply = <&vqmmc_sdc1>;

[Severity: High]
Does wiring the SDHC controller to these dummy fixed regulators prevent actual hardware control?

By defining these fixed regulators instead of referencing the real PMIC RPMH regulators (vreg_l8c and vreg_s4a which are already defined in the base device tree), the kernel might not issue the actual RPMh commands to enable, disable, or configure voltage for the eMMC.

Could this cause initialization failures if the bootloader has not pre-configured them, or lead to power management regressions during suspend/resume where the kernel incorrectly assumes the hardware is powered down?

[ ... ]

Quoted 4 lines
arch/arm64/boot/dts/qcom/lemans.dtsi +0 -0
index 353a6e6fd3acb..9f54d69c1be63 100644

[ ... ]

arch/arm64/boot/dts/qcom/lemans.dtsi sdhc: mmc@87c4000 { · line 4317

Quoted 7 lines
arch/arm64/boot/dts/qcom/lemans.dtsi +2 -1
@@ -4311,9 +4313,11 @@ sdhc: mmc@87c4000 {
 					  "pwr_irq";
 
 			clocks = <&gcc GCC_SDCC1_AHB_CLK>,
-				 <&gcc GCC_SDCC1_APPS_CLK>;
+				<&gcc GCC_SDCC1_APPS_CLK>,
+				<&rpmhcc RPMH_CXO_CLK>;

[Severity: Low]
This isn't a bug, but is the indentation on the newly added clock items meant to align with the first item in the list? It looks like it is slightly misaligned compared to the original styling in the block.

Quoted 7 lines
arch/arm64/boot/dts/qcom/lemans.dtsi +2 -1
 			clock-names = "iface",
-				      "core";
+				      "core",
+				      "xo";
 
 			interconnects = <&aggre1_noc MASTER_SDC QCOM_ICC_TAG_ALWAYS
 					 &mc_virt SLAVE_EBI1 QCOM_ICC_TAG_ALWAYS>,
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=2
#5 lore raw

Re: [PATCH RESEND v1 2/2] arm64: dts: qcom: lemans-evk: Add SDHCI support for eMMC via overlay

In reply to Monish Chunara
Quoted 3 lines · Monish Chunara

Enable the SDHCI controller for eMMC functionality on the lemans EVK using a device tree overlay. Configure the corresponding addresse space and resources for eMMC.

These are two separate changes that must be two separate patches

[...]

arch/arm64/boot/dts/qcom/lemans.dtsi apss_tpdm2_out: endpoint { · line 4304

Quoted 11 lines
arch/arm64/boot/dts/qcom/lemans.dtsi +2 -1
index 695eae1b7256..99d21e3d7ab8 100644
@@ -4300,7 +4300,9 @@ apss_tpdm2_out: endpoint {
 
 		sdhc: mmc@87c4000 {
 			compatible = "qcom,sa8775p-sdhci", "qcom,sdhci-msm-v5";
-			reg = <0x0 0x087c4000 0x0 0x1000>;
+			reg = <0x0 0x87C4000 0x0 0x1000>,
+			      <0x0 0x87C5000 0x0 0x1000>;

Please don't deviate from the existing style (8 lowercase hex digits, zero-padded in the front if necessary)

Konrad