2024-05-23 12:04:35

by Naina Mehta

[permalink] [raw]
Subject: [PATCH v2 0/3] Add SDHCI support for SDX75 SoC

Add SDHC instance for supporting SD card on SDX75 SoC.

Changes in v2:
- Renamed the regulators as per the current format for fixed-regulator.
- Collected reviewed-by tag.
- Link to v1: https://lore.kernel.org/linux-arm-msm/[email protected]/

Naina Mehta (3):
dt-bindings: mmc: sdhci-msm: Document the SDX75 compatible
arm64: dts: qcom: sdx75: Add SDHCI node
arm64: dts: qcom: sdx75-idp: add SDHCI for SD Card

.../devicetree/bindings/mmc/sdhci-msm.yaml | 1 +
arch/arm64/boot/dts/qcom/sdx75-idp.dts | 45 ++++++++++
arch/arm64/boot/dts/qcom/sdx75.dtsi | 86 +++++++++++++++++++
3 files changed, 132 insertions(+)

--
2.17.1



2024-05-23 12:04:56

by Naina Mehta

[permalink] [raw]
Subject: [PATCH v2 2/3] arm64: dts: qcom: sdx75: Add SDHCI node

Add sdhc node for SDX75 SoC to support SD card.
Also add pins required for SDHCI.

Signed-off-by: Naina Mehta <[email protected]>
---
arch/arm64/boot/dts/qcom/sdx75.dtsi | 89 +++++++++++++++++++++++++++++
1 file changed, 89 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sdx75.dtsi b/arch/arm64/boot/dts/qcom/sdx75.dtsi
index da1704061d58..16f3a2400d7f 100644
--- a/arch/arm64/boot/dts/qcom/sdx75.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdx75.dtsi
@@ -8,6 +8,7 @@

#include <dt-bindings/clock/qcom,rpmh.h>
#include <dt-bindings/clock/qcom,sdx75-gcc.h>
+#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/interconnect/qcom,icc.h>
#include <dt-bindings/interconnect/qcom,sdx75.h>
#include <dt-bindings/interrupt-controller/arm-gic.h>
@@ -538,6 +539,54 @@
#hwlock-cells = <1>;
};

+ sdhc: mmc@8804000 {
+ compatible = "qcom,sdx75-sdhci", "qcom,sdhci-msm-v5";
+ reg = <0x0 0x08804000 0x0 0x1000>;
+
+ interrupts = <GIC_SPI 210 IRQ_TYPE_LEVEL_HIGH>,
+ <GIC_SPI 227 IRQ_TYPE_LEVEL_HIGH>;
+ interrupt-names = "hc_irq",
+ "pwr_irq";
+
+ clocks = <&gcc GCC_SDCC1_AHB_CLK>,
+ <&gcc GCC_SDCC1_APPS_CLK>,
+ <&rpmhcc RPMH_CXO_CLK>;
+ clock-names = "iface",
+ "core",
+ "xo";
+ iommus = <&apps_smmu 0x00a0 0x0>;
+ qcom,dll-config = <0x0007442c>;
+ qcom,ddr-config = <0x80040868>;
+ power-domains = <&rpmhpd RPMHPD_CX>;
+ operating-points-v2 = <&sdhc1_opp_table>;
+
+ interconnects = <&system_noc MASTER_SDCC_1 &mc_virt SLAVE_EBI1>,
+ <&gem_noc MASTER_APPSS_PROC &system_noc SLAVE_SDCC_1>;
+ interconnect-names = "sdhc-ddr",
+ "cpu-sdhc";
+ bus-width = <4>;
+ dma-coherent;
+
+ /* Forbid SDR104/SDR50 - broken hw! */
+ sdhci-caps-mask = <0x3 0>;
+
+ status = "disabled";
+
+ sdhc1_opp_table: opp-table {
+ compatible = "operating-points-v2";
+
+ opp-100000000 {
+ opp-hz = /bits/ 64 <100000000>;
+ required-opps = <&rpmhpd_opp_low_svs>;
+ };
+
+ opp-384000000 {
+ opp-hz = /bits/ 64 <384000000>;
+ required-opps = <&rpmhpd_opp_nom>;
+ };
+ };
+ };
+
usb: usb@a6f8800 {
compatible = "qcom,sdx75-dwc3", "qcom,dwc3";
reg = <0x0 0x0a6f8800 0x0 0x400>;
@@ -683,6 +732,46 @@
drive-strength = <2>;
bias-pull-down;
};
+
+ sdc1_default: sdc1-default-state {
+ clk-pins {
+ pins = "sdc1_clk";
+ drive-strength = <16>;
+ bias-disable;
+ };
+
+ cmd-pins {
+ pins = "sdc1_cmd";
+ drive-strength = <10>;
+ bias-pull-up;
+ };
+
+ data-pins {
+ pins = "sdc1_data";
+ drive-strength = <10>;
+ bias-pull-up;
+ };
+ };
+
+ sdc1_sleep: sdc1-sleep-state {
+ clk-pins {
+ pins = "sdc1_clk";
+ drive-strength = <2>;
+ bias-disable;
+ };
+
+ cmd-pins {
+ pins = "sdc1_cmd";
+ drive-strength = <2>;
+ bias-pull-up;
+ };
+
+ data-pins {
+ pins = "sdc1_data";
+ drive-strength = <2>;
+ bias-pull-up;
+ };
+ };
};

apps_smmu: iommu@15000000 {
--
2.17.1


2024-05-23 12:05:11

by Naina Mehta

[permalink] [raw]
Subject: [PATCH v2 3/3] arm64: dts: qcom: sdx75-idp: add SDHCI for SD Card

Enable SDHCI on sdx75-idp to support SD card.
Also add the required regulators.

Signed-off-by: Naina Mehta <[email protected]>
---
arch/arm64/boot/dts/qcom/sdx75-idp.dts | 45 ++++++++++++++++++++++++++
1 file changed, 45 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sdx75-idp.dts b/arch/arm64/boot/dts/qcom/sdx75-idp.dts
index f76e72fb2072..fde16308c7e2 100644
--- a/arch/arm64/boot/dts/qcom/sdx75-idp.dts
+++ b/arch/arm64/boot/dts/qcom/sdx75-idp.dts
@@ -41,6 +41,29 @@

vin-supply = <&vph_ext>;
};
+
+ reg_2v952_vcc: regulator-2v952-vcc {
+ compatible = "regulator-gpio";
+ regulator-name = "2v952_vcc";
+ regulator-min-microvolt = <1650000>;
+ regulator-max-microvolt = <3600000>;
+ enable-gpios = <&tlmm 102 GPIO_ACTIVE_HIGH>;
+ gpios = <&tlmm 84 GPIO_ACTIVE_HIGH>;
+ states = <1650000 0>, <3600000 1>;
+ startup-delay-us = <5000>;
+ enable-active-high;
+ regulator-boot-on;
+
+ vin-supply = <&vph_ext>;
+ };
+
+ reg_2v95_vdd: regulator-2v95-vdd {
+ compatible = "regulator-fixed";
+ regulator-name = "2v95_vdd";
+ regulator-min-microvolt = <2950000>;
+ regulator-max-microvolt = <2950000>;
+ vin-supply = <&reg_2v952_vcc>;
+ };
};

&apps_rsc {
@@ -259,8 +282,30 @@
status = "okay";
};

+&sdhc {
+ cd-gpios = <&tlmm 103 GPIO_ACTIVE_LOW>;
+ vmmc-supply = <&reg_2v95_vdd>;
+ vqmmc-supply = <&reg_2v952_vcc>;
+ bus-width = <4>;
+ no-sdio;
+ no-mmc;
+
+ pinctrl-0 = <&sdc1_default &sd_cd>;
+ pinctrl-1 = <&sdc1_sleep &sd_cd>;
+ pinctrl-names = "default", "sleep";
+
+ status = "okay";
+};
+
&tlmm {
gpio-reserved-ranges = <110 6>;
+
+ sd_cd: sd-cd-state {
+ pins = "gpio103";
+ function = "gpio";
+ drive-strength = <2>;
+ bias-pull-up;
+ };
};

&uart1 {
--
2.17.1


2024-05-28 03:39:36

by Bjorn Andersson

[permalink] [raw]
Subject: Re: (subset) [PATCH v2 0/3] Add SDHCI support for SDX75 SoC


On Thu, 23 May 2024 17:33:34 +0530, Naina Mehta wrote:
> Add SDHC instance for supporting SD card on SDX75 SoC.
>
> Changes in v2:
> - Renamed the regulators as per the current format for fixed-regulator.
> - Collected reviewed-by tag.
> - Link to v1: https://lore.kernel.org/linux-arm-msm/[email protected]/
>
> [...]

Applied, thanks!

[2/3] arm64: dts: qcom: sdx75: Add SDHCI node
commit: 37f5169f5c83c5de469d666aea7b9eca4c30e6b9
[3/3] arm64: dts: qcom: sdx75-idp: add SDHCI for SD Card
commit: a1b05c448e74a092c59a84b16e9d4a673c764f1f

Best regards,
--
Bjorn Andersson <[email protected]>