linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v5 0/2] arm64: dts: qcom: x1e80100: Describe SDCs and enable support on QCP
@ 2024-12-26 11:47 Abel Vesa
  2024-12-26 11:47 ` [PATCH v5 1/2] arm64: dts: qcom: x1e80100: Describe the SDHC controllers Abel Vesa
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Abel Vesa @ 2024-12-26 11:47 UTC (permalink / raw)
  To: Ulf Hansson, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Bjorn Andersson, Konrad Dybcio
  Cc: Johan Hovold, Dmitry Baryshkov, linux-mmc, devicetree,
	linux-kernel, linux-arm-msm, Abel Vesa, Konrad Dybcio

The X1E80100 has two SDHC controllers (called SDC2 and SDC4).
Describe both of them and enable the SDC2 on QCP. This brings
SD card support for the microSD port on QCP.

The SDC4 is described but there is no device outthere yet that makes
use of it, AFAIK.

Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
---
Changes in v5:
- Switched the interconnect paths tags to QCOM_ICC_TAG_ALWAYS and
  QCOM_ICC_TAG_ACTIVE_ONLY, as Konrad suggested. 
- Actually enabled the sdhc on QCP (status = "okay" was missing).
- Rebased to fix conflicts due to smb2360 nodes which were already
  merged.
- Link to v4: https://lore.kernel.org/r/20241212-x1e80100-qcp-sdhc-v4-0-a74c48ee68a3@linaro.org

Changes in v4:
- Squashed the pinconf for SDC2 into the patch that describes the
  controllers.
- Reworded the commit messages a bit.
- Link to v3: https://lore.kernel.org/r/20241022-x1e80100-qcp-sdhc-v3-0-46c401e32cbf@linaro.org

Changes in v3:
- Reordered the default and sleep pinconfs. Also the bias and
  drive-strength properties. As per Konrad's suggestion.
- Link to v2: https://lore.kernel.org/r/20241014-x1e80100-qcp-sdhc-v2-0-868e70a825e0@linaro.org

Changes in v2:
- rebased on next-20241011
- dropped the bindings schema update patch
- dropped the sdhci-caps-mask properties from both
  controllers as SDR104/SDR50 are actually supported
- Link to v1: https://lore.kernel.org/r/20241008-x1e80100-qcp-sdhc-v1-0-dfef4c92ae31@linaro.org

---
Abel Vesa (2):
      arm64: dts: qcom: x1e80100: Describe the SDHC controllers
      arm64: dts: qcom: x1e80100-qcp: Enable SD card support

 arch/arm64/boot/dts/qcom/x1e80100-qcp.dts |  21 +++++
 arch/arm64/boot/dts/qcom/x1e80100.dtsi    | 146 ++++++++++++++++++++++++++++++
 2 files changed, 167 insertions(+)
---
base-commit: 8155b4ef3466f0e289e8fcc9e6e62f3f4dceeac2
change-id: 20241007-x1e80100-qcp-sdhc-15c716dad946

Best regards,
-- 
Abel Vesa <abel.vesa@linaro.org>


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

* [PATCH v5 1/2] arm64: dts: qcom: x1e80100: Describe the SDHC controllers
  2024-12-26 11:47 [PATCH v5 0/2] arm64: dts: qcom: x1e80100: Describe SDCs and enable support on QCP Abel Vesa
@ 2024-12-26 11:47 ` Abel Vesa
  2024-12-26 11:47 ` [PATCH v5 2/2] arm64: dts: qcom: x1e80100-qcp: Enable SD card support Abel Vesa
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Abel Vesa @ 2024-12-26 11:47 UTC (permalink / raw)
  To: Ulf Hansson, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Bjorn Andersson, Konrad Dybcio
  Cc: Johan Hovold, Dmitry Baryshkov, linux-mmc, devicetree,
	linux-kernel, linux-arm-msm, Abel Vesa

The X Elite platform features two SDHC v5 controllers.

Describe the controllers along with the pin configuration in TLMM
for the SDC2, since they are hardwired and cannot be muxed to any
other function. The SDC4 pin configuration can be muxed to different
functions, so leave those to board specific dts.

Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
---
 arch/arm64/boot/dts/qcom/x1e80100.dtsi | 146 +++++++++++++++++++++++++++++++++
 1 file changed, 146 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/x1e80100.dtsi b/arch/arm64/boot/dts/qcom/x1e80100.dtsi
index f25e2d3af4a40125360831367830cb3d217883cf..e05807cf0a8dde319691f1de00d60208a6c71b86 100644
--- a/arch/arm64/boot/dts/qcom/x1e80100.dtsi
+++ b/arch/arm64/boot/dts/qcom/x1e80100.dtsi
@@ -4094,6 +4094,112 @@ lpass_lpicx_noc: interconnect@7430000 {
 			#interconnect-cells = <2>;
 		};
 
+		sdhc_2: mmc@8804000 {
+			compatible = "qcom,x1e80100-sdhci", "qcom,sdhci-msm-v5";
+			reg = <0 0x08804000 0 0x1000>;
+
+			interrupts = <GIC_SPI 207 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 223 IRQ_TYPE_LEVEL_HIGH>;
+			interrupt-names = "hc_irq", "pwr_irq";
+
+			clocks = <&gcc GCC_SDCC2_AHB_CLK>,
+				 <&gcc GCC_SDCC2_APPS_CLK>,
+				 <&rpmhcc RPMH_CXO_CLK>;
+			clock-names = "iface", "core", "xo";
+			iommus = <&apps_smmu 0x520 0>;
+			qcom,dll-config = <0x0007642c>;
+			qcom,ddr-config = <0x80040868>;
+			power-domains = <&rpmhpd RPMHPD_CX>;
+			operating-points-v2 = <&sdhc2_opp_table>;
+
+			interconnects = <&aggre2_noc MASTER_SDCC_2 QCOM_ICC_TAG_ALWAYS
+					 &mc_virt SLAVE_EBI1 QCOM_ICC_TAG_ALWAYS>,
+					<&gem_noc MASTER_APPSS_PROC QCOM_ICC_TAG_ACTIVE_ONLY
+					 &config_noc SLAVE_SDCC_2 QCOM_ICC_TAG_ACTIVE_ONLY>;
+			interconnect-names = "sdhc-ddr", "cpu-sdhc";
+			bus-width = <4>;
+			dma-coherent;
+
+			status = "disabled";
+
+			sdhc2_opp_table: opp-table {
+				compatible = "operating-points-v2";
+
+				opp-19200000 {
+					opp-hz = /bits/ 64 <19200000>;
+					required-opps = <&rpmhpd_opp_min_svs>;
+				};
+
+				opp-50000000 {
+					opp-hz = /bits/ 64 <50000000>;
+					required-opps = <&rpmhpd_opp_low_svs>;
+				};
+
+				opp-100000000 {
+					opp-hz = /bits/ 64 <100000000>;
+					required-opps = <&rpmhpd_opp_svs>;
+				};
+
+				opp-202000000 {
+					opp-hz = /bits/ 64 <202000000>;
+					required-opps = <&rpmhpd_opp_svs_l1>;
+				};
+			};
+		};
+
+		sdhc_4: mmc@8844000 {
+			compatible = "qcom,x1e80100-sdhci", "qcom,sdhci-msm-v5";
+			reg = <0 0x08844000 0 0x1000>;
+
+			interrupts = <GIC_SPI 261 IRQ_TYPE_LEVEL_HIGH>,
+				     <GIC_SPI 227 IRQ_TYPE_LEVEL_HIGH>;
+			interrupt-names = "hc_irq", "pwr_irq";
+
+			clocks = <&gcc GCC_SDCC4_AHB_CLK>,
+				 <&gcc GCC_SDCC4_APPS_CLK>,
+				 <&rpmhcc RPMH_CXO_CLK>;
+			clock-names = "iface", "core", "xo";
+			iommus = <&apps_smmu 0x160 0>;
+			qcom,dll-config = <0x0007642c>;
+			qcom,ddr-config = <0x80040868>;
+			power-domains = <&rpmhpd RPMHPD_CX>;
+			operating-points-v2 = <&sdhc4_opp_table>;
+
+			interconnects = <&aggre2_noc MASTER_SDCC_4 QCOM_ICC_TAG_ALWAYS
+					 &mc_virt SLAVE_EBI1 QCOM_ICC_TAG_ALWAYS>,
+					<&gem_noc MASTER_APPSS_PROC QCOM_ICC_TAG_ACTIVE_ONLY
+					 &config_noc SLAVE_SDCC_4 QCOM_ICC_TAG_ACTIVE_ONLY>;
+			interconnect-names = "sdhc-ddr", "cpu-sdhc";
+			bus-width = <4>;
+			dma-coherent;
+
+			status = "disabled";
+
+			sdhc4_opp_table: opp-table {
+				compatible = "operating-points-v2";
+
+				opp-19200000 {
+					opp-hz = /bits/ 64 <19200000>;
+					required-opps = <&rpmhpd_opp_min_svs>;
+				};
+
+				opp-50000000 {
+					opp-hz = /bits/ 64 <50000000>;
+					required-opps = <&rpmhpd_opp_low_svs>;
+				};
+
+				opp-100000000 {
+					opp-hz = /bits/ 64 <100000000>;
+					required-opps = <&rpmhpd_opp_svs>;
+				};
+
+				opp-202000000 {
+					opp-hz = /bits/ 64 <202000000>;
+					required-opps = <&rpmhpd_opp_svs_l1>;
+				};
+			};
+		};
+
 		usb_2_hsphy: phy@88e0000 {
 			compatible = "qcom,x1e80100-snps-eusb2-phy",
 				     "qcom,sm8550-snps-eusb2-phy";
@@ -5846,6 +5952,46 @@ rx-pins {
 					bias-disable;
 				};
 			};
+
+			sdc2_default: sdc2-default-state {
+				clk-pins {
+					pins = "sdc2_clk";
+					drive-strength = <16>;
+					bias-disable;
+				};
+
+				cmd-pins {
+					pins = "sdc2_cmd";
+					drive-strength = <10>;
+					bias-pull-up;
+				};
+
+				data-pins {
+					pins = "sdc2_data";
+					drive-strength = <10>;
+					bias-pull-up;
+				};
+			};
+
+			sdc2_sleep: sdc2-sleep-state {
+				clk-pins {
+					pins = "sdc2_clk";
+					drive-strength = <2>;
+					bias-disable;
+				};
+
+				cmd-pins {
+					pins = "sdc2_cmd";
+					drive-strength = <2>;
+					bias-pull-up;
+				};
+
+				data-pins {
+					pins = "sdc2_data";
+					drive-strength = <2>;
+					bias-pull-up;
+				};
+			};
 		};
 
 		apps_smmu: iommu@15000000 {

-- 
2.34.1


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

* [PATCH v5 2/2] arm64: dts: qcom: x1e80100-qcp: Enable SD card support
  2024-12-26 11:47 [PATCH v5 0/2] arm64: dts: qcom: x1e80100: Describe SDCs and enable support on QCP Abel Vesa
  2024-12-26 11:47 ` [PATCH v5 1/2] arm64: dts: qcom: x1e80100: Describe the SDHC controllers Abel Vesa
@ 2024-12-26 11:47 ` Abel Vesa
  2024-12-26 18:39 ` [PATCH v5 0/2] arm64: dts: qcom: x1e80100: Describe SDCs and enable support on QCP Bjorn Andersson
  2024-12-26 22:38 ` Bjorn Andersson
  3 siblings, 0 replies; 5+ messages in thread
From: Abel Vesa @ 2024-12-26 11:47 UTC (permalink / raw)
  To: Ulf Hansson, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Bjorn Andersson, Konrad Dybcio
  Cc: Johan Hovold, Dmitry Baryshkov, linux-mmc, devicetree,
	linux-kernel, linux-arm-msm, Abel Vesa, Konrad Dybcio

One of the SD card slots found on the X Elite QCP board is
controlled by the SDC2.

Enable it and describe the board specific resources.

Reviewed-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Signed-off-by: Abel Vesa <abel.vesa@linaro.org>
---
 arch/arm64/boot/dts/qcom/x1e80100-qcp.dts | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/x1e80100-qcp.dts b/arch/arm64/boot/dts/qcom/x1e80100-qcp.dts
index ffd28fd8059895ec345f4ee8fe6a2c37e7989747..92dc409f6d5963790f48a76cc421e7ef4c6d6ea3 100644
--- a/arch/arm64/boot/dts/qcom/x1e80100-qcp.dts
+++ b/arch/arm64/boot/dts/qcom/x1e80100-qcp.dts
@@ -731,6 +731,20 @@ &remoteproc_cdsp {
 	status = "okay";
 };
 
+&sdhc_2 {
+	cd-gpios = <&tlmm 71 GPIO_ACTIVE_LOW>;
+	pinctrl-0 = <&sdc2_default &sdc2_card_det_n>;
+	pinctrl-1 = <&sdc2_sleep &sdc2_card_det_n>;
+	pinctrl-names = "default", "sleep";
+	vmmc-supply = <&vreg_l9b_2p9>;
+	vqmmc-supply = <&vreg_l6b_1p8>;
+	bus-width = <4>;
+	no-sdio;
+	no-mmc;
+
+	status = "okay";
+};
+
 &smb2360_0 {
 	status = "okay";
 };
@@ -880,6 +894,13 @@ wake-n-pins {
 		};
 	};
 
+	sdc2_card_det_n: sdc2-card-det-state {
+		pins = "gpio71";
+		function = "gpio";
+		drive-strength = <2>;
+		bias-pull-up;
+	};
+
 	wcd_default: wcd-reset-n-active-state {
 		pins = "gpio191";
 		function = "gpio";

-- 
2.34.1


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

* Re: [PATCH v5 0/2] arm64: dts: qcom: x1e80100: Describe SDCs and enable support on QCP
  2024-12-26 11:47 [PATCH v5 0/2] arm64: dts: qcom: x1e80100: Describe SDCs and enable support on QCP Abel Vesa
  2024-12-26 11:47 ` [PATCH v5 1/2] arm64: dts: qcom: x1e80100: Describe the SDHC controllers Abel Vesa
  2024-12-26 11:47 ` [PATCH v5 2/2] arm64: dts: qcom: x1e80100-qcp: Enable SD card support Abel Vesa
@ 2024-12-26 18:39 ` Bjorn Andersson
  2024-12-26 22:38 ` Bjorn Andersson
  3 siblings, 0 replies; 5+ messages in thread
From: Bjorn Andersson @ 2024-12-26 18:39 UTC (permalink / raw)
  To: Abel Vesa
  Cc: Ulf Hansson, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Konrad Dybcio, Johan Hovold, Dmitry Baryshkov, linux-mmc,
	devicetree, linux-kernel, linux-arm-msm, Konrad Dybcio

On Thu, Dec 26, 2024 at 01:47:37PM +0200, Abel Vesa wrote:
> The X1E80100 has two SDHC controllers (called SDC2 and SDC4).
> Describe both of them and enable the SDC2 on QCP. This brings
> SD card support for the microSD port on QCP.
> 
> The SDC4 is described but there is no device outthere yet that makes
> use of it, AFAIK.
> 
> Signed-off-by: Abel Vesa <abel.vesa@linaro.org>

Seems we hit a race condition, I fixed up the icc tags while applying
v4, but I didn't adjust the status. Could you please double check what I
did pick up and send an incremental patch with the status update?

Thanks,
Bjorn

> ---
> Changes in v5:
> - Switched the interconnect paths tags to QCOM_ICC_TAG_ALWAYS and
>   QCOM_ICC_TAG_ACTIVE_ONLY, as Konrad suggested. 
> - Actually enabled the sdhc on QCP (status = "okay" was missing).
> - Rebased to fix conflicts due to smb2360 nodes which were already
>   merged.
> - Link to v4: https://lore.kernel.org/r/20241212-x1e80100-qcp-sdhc-v4-0-a74c48ee68a3@linaro.org
> 
> Changes in v4:
> - Squashed the pinconf for SDC2 into the patch that describes the
>   controllers.
> - Reworded the commit messages a bit.
> - Link to v3: https://lore.kernel.org/r/20241022-x1e80100-qcp-sdhc-v3-0-46c401e32cbf@linaro.org
> 
> Changes in v3:
> - Reordered the default and sleep pinconfs. Also the bias and
>   drive-strength properties. As per Konrad's suggestion.
> - Link to v2: https://lore.kernel.org/r/20241014-x1e80100-qcp-sdhc-v2-0-868e70a825e0@linaro.org
> 
> Changes in v2:
> - rebased on next-20241011
> - dropped the bindings schema update patch
> - dropped the sdhci-caps-mask properties from both
>   controllers as SDR104/SDR50 are actually supported
> - Link to v1: https://lore.kernel.org/r/20241008-x1e80100-qcp-sdhc-v1-0-dfef4c92ae31@linaro.org
> 
> ---
> Abel Vesa (2):
>       arm64: dts: qcom: x1e80100: Describe the SDHC controllers
>       arm64: dts: qcom: x1e80100-qcp: Enable SD card support
> 
>  arch/arm64/boot/dts/qcom/x1e80100-qcp.dts |  21 +++++
>  arch/arm64/boot/dts/qcom/x1e80100.dtsi    | 146 ++++++++++++++++++++++++++++++
>  2 files changed, 167 insertions(+)
> ---
> base-commit: 8155b4ef3466f0e289e8fcc9e6e62f3f4dceeac2
> change-id: 20241007-x1e80100-qcp-sdhc-15c716dad946
> 
> Best regards,
> -- 
> Abel Vesa <abel.vesa@linaro.org>
> 

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

* Re: [PATCH v5 0/2] arm64: dts: qcom: x1e80100: Describe SDCs and enable support on QCP
  2024-12-26 11:47 [PATCH v5 0/2] arm64: dts: qcom: x1e80100: Describe SDCs and enable support on QCP Abel Vesa
                   ` (2 preceding siblings ...)
  2024-12-26 18:39 ` [PATCH v5 0/2] arm64: dts: qcom: x1e80100: Describe SDCs and enable support on QCP Bjorn Andersson
@ 2024-12-26 22:38 ` Bjorn Andersson
  3 siblings, 0 replies; 5+ messages in thread
From: Bjorn Andersson @ 2024-12-26 22:38 UTC (permalink / raw)
  To: Ulf Hansson, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Konrad Dybcio, Abel Vesa
  Cc: Johan Hovold, Dmitry Baryshkov, linux-mmc, devicetree,
	linux-kernel, linux-arm-msm, Konrad Dybcio


On Thu, 26 Dec 2024 13:47:37 +0200, Abel Vesa wrote:
> The X1E80100 has two SDHC controllers (called SDC2 and SDC4).
> Describe both of them and enable the SDC2 on QCP. This brings
> SD card support for the microSD port on QCP.
> 
> The SDC4 is described but there is no device outthere yet that makes
> use of it, AFAIK.
> 
> [...]

Applied, thanks!

[1/2] arm64: dts: qcom: x1e80100: Describe the SDHC controllers
      commit: ffb21c1e19b17f3b2f5f56c70e379ef7c96afad5
[2/2] arm64: dts: qcom: x1e80100-qcp: Enable SD card support
      commit: ab8f487d2f8905641541c27c7929363ee538b0f8

Best regards,
-- 
Bjorn Andersson <andersson@kernel.org>

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

end of thread, other threads:[~2024-12-26 22:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-26 11:47 [PATCH v5 0/2] arm64: dts: qcom: x1e80100: Describe SDCs and enable support on QCP Abel Vesa
2024-12-26 11:47 ` [PATCH v5 1/2] arm64: dts: qcom: x1e80100: Describe the SDHC controllers Abel Vesa
2024-12-26 11:47 ` [PATCH v5 2/2] arm64: dts: qcom: x1e80100-qcp: Enable SD card support Abel Vesa
2024-12-26 18:39 ` [PATCH v5 0/2] arm64: dts: qcom: x1e80100: Describe SDCs and enable support on QCP Bjorn Andersson
2024-12-26 22:38 ` Bjorn Andersson

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).