devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] Add SDHCI support for SDX75 SoC
@ 2024-05-15 12:09 Naina Mehta
  2024-05-15 12:09 ` [PATCH 1/3] dt-bindings: mmc: sdhci-msm: Document the SDX75 compatible Naina Mehta
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Naina Mehta @ 2024-05-15 12:09 UTC (permalink / raw)
  To: ulf.hansson, robh, krzk+dt, conor+dt, andersson, konrad.dybcio,
	bhupesh.sharma
  Cc: linux-mmc, devicetree, linux-kernel, linux-arm-msm, Naina Mehta

Add SDHC instance for supporting SD card on SDX75 SoC.

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           | 89 +++++++++++++++++++
 3 files changed, 135 insertions(+)

--
2.17.1


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 1/3] dt-bindings: mmc: sdhci-msm: Document the SDX75 compatible
  2024-05-15 12:09 [PATCH 0/3] Add SDHCI support for SDX75 SoC Naina Mehta
@ 2024-05-15 12:09 ` Naina Mehta
  2024-05-15 14:22   ` Krzysztof Kozlowski
  2024-05-15 12:09 ` [PATCH 2/3] arm64: dts: qcom: sdx75: Add SDHCI node Naina Mehta
  2024-05-15 12:09 ` [PATCH 3/3] arm64: dts: qcom: sdx75-idp: add SDHCI for SD Card Naina Mehta
  2 siblings, 1 reply; 9+ messages in thread
From: Naina Mehta @ 2024-05-15 12:09 UTC (permalink / raw)
  To: ulf.hansson, robh, krzk+dt, conor+dt, andersson, konrad.dybcio,
	bhupesh.sharma
  Cc: linux-mmc, devicetree, linux-kernel, linux-arm-msm, Naina Mehta

Document the compatible for SDHCI on SDX75 SoC.

Signed-off-by: Naina Mehta <quic_nainmeht@quicinc.com>
---
 Documentation/devicetree/bindings/mmc/sdhci-msm.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/mmc/sdhci-msm.yaml b/Documentation/devicetree/bindings/mmc/sdhci-msm.yaml
index c24c537f62b1..11979b026d21 100644
--- a/Documentation/devicetree/bindings/mmc/sdhci-msm.yaml
+++ b/Documentation/devicetree/bindings/mmc/sdhci-msm.yaml
@@ -51,6 +51,7 @@ properties:
               - qcom,sdm845-sdhci
               - qcom,sdx55-sdhci
               - qcom,sdx65-sdhci
+              - qcom,sdx75-sdhci
               - qcom,sm6115-sdhci
               - qcom,sm6125-sdhci
               - qcom,sm6350-sdhci
--
2.17.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/3] arm64: dts: qcom: sdx75: Add SDHCI node
  2024-05-15 12:09 [PATCH 0/3] Add SDHCI support for SDX75 SoC Naina Mehta
  2024-05-15 12:09 ` [PATCH 1/3] dt-bindings: mmc: sdhci-msm: Document the SDX75 compatible Naina Mehta
@ 2024-05-15 12:09 ` Naina Mehta
  2024-05-15 12:09 ` [PATCH 3/3] arm64: dts: qcom: sdx75-idp: add SDHCI for SD Card Naina Mehta
  2 siblings, 0 replies; 9+ messages in thread
From: Naina Mehta @ 2024-05-15 12:09 UTC (permalink / raw)
  To: ulf.hansson, robh, krzk+dt, conor+dt, andersson, konrad.dybcio,
	bhupesh.sharma
  Cc: linux-mmc, devicetree, linux-kernel, linux-arm-msm, Naina Mehta

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

Signed-off-by: Naina Mehta <quic_nainmeht@quicinc.com>
---
 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..9723b716f02e 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


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 3/3] arm64: dts: qcom: sdx75-idp: add SDHCI for SD Card
  2024-05-15 12:09 [PATCH 0/3] Add SDHCI support for SDX75 SoC Naina Mehta
  2024-05-15 12:09 ` [PATCH 1/3] dt-bindings: mmc: sdhci-msm: Document the SDX75 compatible Naina Mehta
  2024-05-15 12:09 ` [PATCH 2/3] arm64: dts: qcom: sdx75: Add SDHCI node Naina Mehta
@ 2024-05-15 12:09 ` Naina Mehta
  2024-05-15 14:23   ` Krzysztof Kozlowski
  2 siblings, 1 reply; 9+ messages in thread
From: Naina Mehta @ 2024-05-15 12:09 UTC (permalink / raw)
  To: ulf.hansson, robh, krzk+dt, conor+dt, andersson, konrad.dybcio,
	bhupesh.sharma
  Cc: linux-mmc, devicetree, linux-kernel, linux-arm-msm, Naina Mehta

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

Signed-off-by: Naina Mehta <quic_nainmeht@quicinc.com>
---
 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..6f94278cf837 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>;
 	};
+
+	vreg_sd_vccb: sd-vccb {
+		compatible = "regulator-gpio";
+		regulator-name = "vreg_sd_vccb";
+		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>;
+	};
+
+	vreg_sd_vdd: sd-vdd {
+		compatible = "regulator-fixed";
+		regulator-name = "vreg_sd_vdd";
+		regulator-min-microvolt = <2950000>;
+		regulator-max-microvolt = <2950000>;
+		vin-supply = <&vreg_sd_vccb>;
+	};
 };

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

+&sdhc {
+	cd-gpios = <&tlmm 103 GPIO_ACTIVE_LOW>;
+	vmmc-supply = <&vreg_sd_vdd>;
+	vqmmc-supply = <&vreg_sd_vccb>;
+	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


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/3] dt-bindings: mmc: sdhci-msm: Document the SDX75 compatible
  2024-05-15 12:09 ` [PATCH 1/3] dt-bindings: mmc: sdhci-msm: Document the SDX75 compatible Naina Mehta
@ 2024-05-15 14:22   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 9+ messages in thread
From: Krzysztof Kozlowski @ 2024-05-15 14:22 UTC (permalink / raw)
  To: Naina Mehta, ulf.hansson, robh, krzk+dt, conor+dt, andersson,
	konrad.dybcio, bhupesh.sharma
  Cc: linux-mmc, devicetree, linux-kernel, linux-arm-msm

On 15/05/2024 14:09, Naina Mehta wrote:
> Document the compatible for SDHCI on SDX75 SoC.
> 
> Signed-off-by: Naina Mehta <quic_nainmeht@quicinc.com>
> ---


Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>

---

This is an automated instruction, just in case, because many review tags
are being ignored. If you know the process, you can skip it (please do
not feel offended by me posting it here - no bad intentions intended).
If you do not know the process, here is a short explanation:

Please add Acked-by/Reviewed-by/Tested-by tags when posting new
versions, under or above your Signed-off-by tag. Tag is "received", when
provided in a message replied to you on the mailing list. Tools like b4
can help here. However, there's no need to repost patches *only* to add
the tags. The upstream maintainer will do that for tags received on the
version they apply.

https://elixir.bootlin.com/linux/v6.5-rc3/source/Documentation/process/submitting-patches.rst#L577

Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 3/3] arm64: dts: qcom: sdx75-idp: add SDHCI for SD Card
  2024-05-15 12:09 ` [PATCH 3/3] arm64: dts: qcom: sdx75-idp: add SDHCI for SD Card Naina Mehta
@ 2024-05-15 14:23   ` Krzysztof Kozlowski
  2024-05-16  5:21     ` Naina Mehta
  0 siblings, 1 reply; 9+ messages in thread
From: Krzysztof Kozlowski @ 2024-05-15 14:23 UTC (permalink / raw)
  To: Naina Mehta, ulf.hansson, robh, krzk+dt, conor+dt, andersson,
	konrad.dybcio, bhupesh.sharma
  Cc: linux-mmc, devicetree, linux-kernel, linux-arm-msm

On 15/05/2024 14:09, Naina Mehta wrote:
> Enable SDHCI on sdx75-idp to support SD card.
> Also add the required regulators.
> 
> Signed-off-by: Naina Mehta <quic_nainmeht@quicinc.com>
> ---
>  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..6f94278cf837 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>;
>  	};
> +
> +	vreg_sd_vccb: sd-vccb {

Please use name for all fixed regulators which matches current format
recommendation: 'regulator-[0-9]+v[0-9]+'

https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git/commit/?id=b6d4b3500d57370f5b3abf0701c9166b384db976


Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 3/3] arm64: dts: qcom: sdx75-idp: add SDHCI for SD Card
  2024-05-15 14:23   ` Krzysztof Kozlowski
@ 2024-05-16  5:21     ` Naina Mehta
  2024-05-17  8:52       ` Krzysztof Kozlowski
  0 siblings, 1 reply; 9+ messages in thread
From: Naina Mehta @ 2024-05-16  5:21 UTC (permalink / raw)
  To: Krzysztof Kozlowski, ulf.hansson, robh, krzk+dt, conor+dt,
	andersson, konrad.dybcio, bhupesh.sharma
  Cc: linux-mmc, devicetree, linux-kernel, linux-arm-msm



On 5/15/2024 7:53 PM, Krzysztof Kozlowski wrote:
> On 15/05/2024 14:09, Naina Mehta wrote:
>> Enable SDHCI on sdx75-idp to support SD card.
>> Also add the required regulators.
>>
>> Signed-off-by: Naina Mehta <quic_nainmeht@quicinc.com>
>> ---
>>   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..6f94278cf837 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>;
>>   	};
>> +
>> +	vreg_sd_vccb: sd-vccb {
> 
> Please use name for all fixed regulators which matches current format
> recommendation: 'regulator-[0-9]+v[0-9]+'

Did you mean that vreg_sd_vdd should be updated according to the 
suggested format because vreg_sd_vccb is not a fixed regulator?

Thanks,
Naina

> 
> https://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator.git/commit/?id=b6d4b3500d57370f5b3abf0701c9166b384db976
> 
> 
> Best regards,
> Krzysztof
> 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 3/3] arm64: dts: qcom: sdx75-idp: add SDHCI for SD Card
  2024-05-16  5:21     ` Naina Mehta
@ 2024-05-17  8:52       ` Krzysztof Kozlowski
  2024-05-17 11:09         ` Naina Mehta
  0 siblings, 1 reply; 9+ messages in thread
From: Krzysztof Kozlowski @ 2024-05-17  8:52 UTC (permalink / raw)
  To: Naina Mehta, ulf.hansson, robh, krzk+dt, conor+dt, andersson,
	konrad.dybcio, bhupesh.sharma
  Cc: linux-mmc, devicetree, linux-kernel, linux-arm-msm

On 16/05/2024 07:21, Naina Mehta wrote:
> 
> 
> On 5/15/2024 7:53 PM, Krzysztof Kozlowski wrote:
>> On 15/05/2024 14:09, Naina Mehta wrote:
>>> Enable SDHCI on sdx75-idp to support SD card.
>>> Also add the required regulators.
>>>
>>> Signed-off-by: Naina Mehta <quic_nainmeht@quicinc.com>
>>> ---
>>>   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..6f94278cf837 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>;
>>>   	};
>>> +
>>> +	vreg_sd_vccb: sd-vccb {
>>
>> Please use name for all fixed regulators which matches current format
>> recommendation: 'regulator-[0-9]+v[0-9]+'
> 
> Did you mean that vreg_sd_vdd should be updated according to the 
> suggested format because vreg_sd_vccb is not a fixed regulator?
> 

Yeah, it should be about sd-vdd, but then this one should be named as
well with a similar prefix to have it consistent.



Best regards,
Krzysztof


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 3/3] arm64: dts: qcom: sdx75-idp: add SDHCI for SD Card
  2024-05-17  8:52       ` Krzysztof Kozlowski
@ 2024-05-17 11:09         ` Naina Mehta
  0 siblings, 0 replies; 9+ messages in thread
From: Naina Mehta @ 2024-05-17 11:09 UTC (permalink / raw)
  To: Krzysztof Kozlowski, ulf.hansson, robh, krzk+dt, conor+dt,
	andersson, konrad.dybcio, bhupesh.sharma
  Cc: linux-mmc, devicetree, linux-kernel, linux-arm-msm



On 5/17/2024 2:22 PM, Krzysztof Kozlowski wrote:
> On 16/05/2024 07:21, Naina Mehta wrote:
>>
>>
>> On 5/15/2024 7:53 PM, Krzysztof Kozlowski wrote:
>>> On 15/05/2024 14:09, Naina Mehta wrote:
>>>> Enable SDHCI on sdx75-idp to support SD card.
>>>> Also add the required regulators.
>>>>
>>>> Signed-off-by: Naina Mehta <quic_nainmeht@quicinc.com>
>>>> ---
>>>>    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..6f94278cf837 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>;
>>>>    	};
>>>> +
>>>> +	vreg_sd_vccb: sd-vccb {
>>>
>>> Please use name for all fixed regulators which matches current format
>>> recommendation: 'regulator-[0-9]+v[0-9]+'
>>
>> Did you mean that vreg_sd_vdd should be updated according to the
>> suggested format because vreg_sd_vccb is not a fixed regulator?
>>
> 
> Yeah, it should be about sd-vdd, but then this one should be named as
> well with a similar prefix to have it consistent.

Sure, I will update in next revision.

Thanks,
Naina

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-05-17 11:09 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-15 12:09 [PATCH 0/3] Add SDHCI support for SDX75 SoC Naina Mehta
2024-05-15 12:09 ` [PATCH 1/3] dt-bindings: mmc: sdhci-msm: Document the SDX75 compatible Naina Mehta
2024-05-15 14:22   ` Krzysztof Kozlowski
2024-05-15 12:09 ` [PATCH 2/3] arm64: dts: qcom: sdx75: Add SDHCI node Naina Mehta
2024-05-15 12:09 ` [PATCH 3/3] arm64: dts: qcom: sdx75-idp: add SDHCI for SD Card Naina Mehta
2024-05-15 14:23   ` Krzysztof Kozlowski
2024-05-16  5:21     ` Naina Mehta
2024-05-17  8:52       ` Krzysztof Kozlowski
2024-05-17 11:09         ` Naina Mehta

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).