Linux-Tegra Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH v3 0/5] arm64: tegra: Xavier SDMMC changes
@ 2020-10-14 17:56 Tamás Szűcs
  2020-10-14 17:56 ` [PATCH v3 1/5] arm64: tegra: Enable signal voltage switching on Tegra194 SDMMC1 and SDMMC3 Tamás Szűcs
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Tamás Szűcs @ 2020-10-14 17:56 UTC (permalink / raw)
  To: Rob Herring, Thierry Reding, Jonathan Hunter, JC Kuo,
	Vidya Sagar, Sameer Pujar, devicetree, linux-tegra, linux-kernel
  Cc: Tamás Szűcs

Upstream Xavier SDMMC needs some love. I've been able to test with a Jetson AGX Xavier.
Changes here work for me with 1.8 V and 3.3 V SD and SDIO devices.

Changes in v3:
- I started seeing ocasional eMMC init timeouts on cold starts when HS400 is enabled, so drop this until fix is found
- add missing vmmc-supply regulator for SDMMC1
- specify bus width and disable WP for SDMMC1
- specify primary clock source for SDMMC1 and SDMMC3

Changes in v2:
- fix board name in commit messages
- rebase on for-next

Kind regards,
Tamas


Tamás Szűcs (5):
  arm64: tegra: Enable signal voltage switching on Tegra194 SDMMC1 and
    SDMMC3
  arm64: tegra: Specify sdhci clock parent for Tegra194 SDMMC1 and
    SDMMC3
  arm64: tegra: Fix CD on Jetson AGX Xavier SDMMC1
  arm64: tegra: Add vmmc-supply regulator for Jetson AGX Xavier SDMMC1
  arm64: tegra: Configure SDIO cards on Jetson AGX Xavier SDMMC1

 .../arm64/boot/dts/nvidia/tegra194-p2888.dtsi | 18 ++++++-
 arch/arm64/boot/dts/nvidia/tegra194.dtsi      | 51 +++++++++++++++++++
 2 files changed, 68 insertions(+), 1 deletion(-)

-- 
2.20.1


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

* [PATCH v3 1/5] arm64: tegra: Enable signal voltage switching on Tegra194 SDMMC1 and SDMMC3
  2020-10-14 17:56 [PATCH v3 0/5] arm64: tegra: Xavier SDMMC changes Tamás Szűcs
@ 2020-10-14 17:56 ` Tamás Szűcs
  2020-10-14 17:56 ` [PATCH v3 2/5] arm64: tegra: Specify sdhci clock parent for " Tamás Szűcs
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Tamás Szűcs @ 2020-10-14 17:56 UTC (permalink / raw)
  To: Rob Herring, Thierry Reding, Jonathan Hunter, JC Kuo,
	Vidya Sagar, Sameer Pujar, devicetree, linux-tegra, linux-kernel
  Cc: Tamás Szűcs

Add pad voltage configuration nodes for SDMMC pads with configurable voltages
and enable supported SD card, SDIO and eMMC modes.

Signed-off-by: Tamás Szűcs <tszucs@protonmail.ch>
---
 arch/arm64/boot/dts/nvidia/tegra194.dtsi | 45 ++++++++++++++++++++++++
 1 file changed, 45 insertions(+)

diff --git a/arch/arm64/boot/dts/nvidia/tegra194.dtsi b/arch/arm64/boot/dts/nvidia/tegra194.dtsi
index e9c90f0f44ff..058fdb1ffa1a 100644
--- a/arch/arm64/boot/dts/nvidia/tegra194.dtsi
+++ b/arch/arm64/boot/dts/nvidia/tegra194.dtsi
@@ -4,6 +4,7 @@
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 #include <dt-bindings/mailbox/tegra186-hsp.h>
 #include <dt-bindings/pinctrl/pinctrl-tegra.h>
+#include <dt-bindings/pinctrl/pinctrl-tegra-io-pad.h>
 #include <dt-bindings/power/tegra194-powergate.h>
 #include <dt-bindings/reset/tegra194-reset.h>
 #include <dt-bindings/thermal/tegra194-bpmp-thermal.h>
@@ -705,6 +706,9 @@
 			interconnects = <&mc TEGRA194_MEMORY_CLIENT_SDMMCRA &emc>,
 					<&mc TEGRA194_MEMORY_CLIENT_SDMMCWA &emc>;
 			interconnect-names = "dma-mem", "write";
+			pinctrl-names = "sdmmc-3v3", "sdmmc-1v8";
+			pinctrl-0 = <&sdmmc1_3v3>;
+			pinctrl-1 = <&sdmmc1_1v8>;
 			nvidia,pad-autocal-pull-up-offset-3v3-timeout =
 									<0x07>;
 			nvidia,pad-autocal-pull-down-offset-3v3-timeout =
@@ -716,6 +720,15 @@
 			nvidia,pad-autocal-pull-down-offset-sdr104 = <0x00>;
 			nvidia,default-tap = <0x9>;
 			nvidia,default-trim = <0x5>;
+			cap-sd-highspeed;
+			cap-mmc-highspeed;
+			sd-uhs-sdr12;
+			sd-uhs-sdr25;
+			sd-uhs-sdr50;
+			sd-uhs-sdr104;
+			cap-sdio-irq;
+			mmc-ddr-1_8v;
+			mmc-hs200-1_8v;
 			status = "disabled";
 		};
 
@@ -731,6 +744,9 @@
 			interconnects = <&mc TEGRA194_MEMORY_CLIENT_SDMMCR &emc>,
 					<&mc TEGRA194_MEMORY_CLIENT_SDMMCW &emc>;
 			interconnect-names = "dma-mem", "write";
+			pinctrl-names = "sdmmc-3v3", "sdmmc-1v8";
+			pinctrl-0 = <&sdmmc3_3v3>;
+			pinctrl-1 = <&sdmmc3_1v8>;
 			nvidia,pad-autocal-pull-up-offset-1v8 = <0x00>;
 			nvidia,pad-autocal-pull-down-offset-1v8 = <0x7a>;
 			nvidia,pad-autocal-pull-up-offset-3v3-timeout = <0x07>;
@@ -743,6 +759,15 @@
 			nvidia,pad-autocal-pull-down-offset-sdr104 = <0x00>;
 			nvidia,default-tap = <0x9>;
 			nvidia,default-trim = <0x5>;
+			cap-sd-highspeed;
+			cap-mmc-highspeed;
+			sd-uhs-sdr12;
+			sd-uhs-sdr25;
+			sd-uhs-sdr50;
+			sd-uhs-sdr104;
+			cap-sdio-irq;
+			mmc-ddr-1_8v;
+			mmc-hs200-1_8v;
 			status = "disabled";
 		};
 
@@ -1269,6 +1294,26 @@
 
 			#interrupt-cells = <2>;
 			interrupt-controller;
+
+			sdmmc1_3v3: sdmmc1-3v3 {
+				pins = "sdmmc1-hv";
+				power-source = <TEGRA_IO_PAD_VOLTAGE_3V3>;
+			};
+
+			sdmmc1_1v8: sdmmc1-1v8 {
+				pins = "sdmmc1-hv";
+				power-source = <TEGRA_IO_PAD_VOLTAGE_1V8>;
+			};
+
+			sdmmc3_3v3: sdmmc3-3v3 {
+				pins = "sdmmc3-hv";
+				power-source = <TEGRA_IO_PAD_VOLTAGE_3V3>;
+			};
+
+			sdmmc3_1v8: sdmmc3-1v8 {
+				pins = "sdmmc3-hv";
+				power-source = <TEGRA_IO_PAD_VOLTAGE_1V8>;
+			};
 		};
 
 		host1x@13e00000 {
-- 
2.20.1


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

* [PATCH v3 2/5] arm64: tegra: Specify sdhci clock parent for Tegra194 SDMMC1 and SDMMC3
  2020-10-14 17:56 [PATCH v3 0/5] arm64: tegra: Xavier SDMMC changes Tamás Szűcs
  2020-10-14 17:56 ` [PATCH v3 1/5] arm64: tegra: Enable signal voltage switching on Tegra194 SDMMC1 and SDMMC3 Tamás Szűcs
@ 2020-10-14 17:56 ` Tamás Szűcs
  2020-10-14 17:56 ` [PATCH v3 3/5] arm64: tegra: Fix CD on Jetson AGX Xavier SDMMC1 Tamás Szűcs
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Tamás Szűcs @ 2020-10-14 17:56 UTC (permalink / raw)
  To: Rob Herring, Thierry Reding, Jonathan Hunter, JC Kuo,
	Vidya Sagar, Sameer Pujar, devicetree, linux-tegra, linux-kernel
  Cc: Tamás Szűcs

Use PLLC4_MUXED as clock source for SDMMC1 and SDMMC3 core clocks. This enables
more suitable interface clocks for higher data rate modes.

Signed-off-by: Tamás Szűcs <tszucs@protonmail.ch>
---
 arch/arm64/boot/dts/nvidia/tegra194.dtsi | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/arch/arm64/boot/dts/nvidia/tegra194.dtsi b/arch/arm64/boot/dts/nvidia/tegra194.dtsi
index 058fdb1ffa1a..7e3ceeb5bc43 100644
--- a/arch/arm64/boot/dts/nvidia/tegra194.dtsi
+++ b/arch/arm64/boot/dts/nvidia/tegra194.dtsi
@@ -701,6 +701,9 @@
 			clocks = <&bpmp TEGRA194_CLK_SDMMC1>,
 				 <&bpmp TEGRA194_CLK_SDMMC_LEGACY_TM>;
 			clock-names = "sdhci", "tmclk";
+			assigned-clocks = <&bpmp TEGRA194_CLK_SDMMC1>,
+					  <&bpmp TEGRA194_CLK_PLLC4_MUXED>;
+			assigned-clock-parents = <&bpmp TEGRA194_CLK_PLLC4_MUXED>;
 			resets = <&bpmp TEGRA194_RESET_SDMMC1>;
 			reset-names = "sdhci";
 			interconnects = <&mc TEGRA194_MEMORY_CLIENT_SDMMCRA &emc>,
@@ -739,6 +742,9 @@
 			clocks = <&bpmp TEGRA194_CLK_SDMMC3>,
 				 <&bpmp TEGRA194_CLK_SDMMC_LEGACY_TM>;
 			clock-names = "sdhci", "tmclk";
+			assigned-clocks = <&bpmp TEGRA194_CLK_SDMMC3>,
+					  <&bpmp TEGRA194_CLK_PLLC4_MUXED>;
+			assigned-clock-parents = <&bpmp TEGRA194_CLK_PLLC4_MUXED>;
 			resets = <&bpmp TEGRA194_RESET_SDMMC3>;
 			reset-names = "sdhci";
 			interconnects = <&mc TEGRA194_MEMORY_CLIENT_SDMMCR &emc>,
-- 
2.20.1


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

* [PATCH v3 3/5] arm64: tegra: Fix CD on Jetson AGX Xavier SDMMC1
  2020-10-14 17:56 [PATCH v3 0/5] arm64: tegra: Xavier SDMMC changes Tamás Szűcs
  2020-10-14 17:56 ` [PATCH v3 1/5] arm64: tegra: Enable signal voltage switching on Tegra194 SDMMC1 and SDMMC3 Tamás Szűcs
  2020-10-14 17:56 ` [PATCH v3 2/5] arm64: tegra: Specify sdhci clock parent for " Tamás Szűcs
@ 2020-10-14 17:56 ` Tamás Szűcs
  2020-10-14 17:56 ` [PATCH v3 4/5] arm64: tegra: Add vmmc-supply regulator for " Tamás Szűcs
  2020-10-14 17:56 ` [PATCH v3 5/5] arm64: tegra: Configure SDIO cards on " Tamás Szűcs
  4 siblings, 0 replies; 6+ messages in thread
From: Tamás Szűcs @ 2020-10-14 17:56 UTC (permalink / raw)
  To: Rob Herring, Thierry Reding, Jonathan Hunter, JC Kuo,
	Vidya Sagar, Sameer Pujar, devicetree, linux-tegra, linux-kernel
  Cc: Tamás Szűcs

Change GPIO used for card detection on SDMMC1. Also, specify bus width and
disable write protect while at it.

Signed-off-by: Tamás Szűcs <tszucs@protonmail.ch>
---
 arch/arm64/boot/dts/nvidia/tegra194-p2888.dtsi | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/nvidia/tegra194-p2888.dtsi b/arch/arm64/boot/dts/nvidia/tegra194-p2888.dtsi
index d71b7a1140fe..31b5f00a7547 100644
--- a/arch/arm64/boot/dts/nvidia/tegra194-p2888.dtsi
+++ b/arch/arm64/boot/dts/nvidia/tegra194-p2888.dtsi
@@ -75,7 +75,9 @@
 
 		/* SDMMC1 (SD/MMC) */
 		mmc@3400000 {
-			cd-gpios = <&gpio TEGRA194_MAIN_GPIO(A, 0) GPIO_ACTIVE_LOW>;
+			bus-width = <4>;
+			cd-gpios = <&gpio TEGRA194_MAIN_GPIO(G, 7) GPIO_ACTIVE_LOW>;
+			disable-wp;
 		};
 
 		/* SDMMC4 (eMMC) */
-- 
2.20.1


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

* [PATCH v3 4/5] arm64: tegra: Add vmmc-supply regulator for Jetson AGX Xavier SDMMC1
  2020-10-14 17:56 [PATCH v3 0/5] arm64: tegra: Xavier SDMMC changes Tamás Szűcs
                   ` (2 preceding siblings ...)
  2020-10-14 17:56 ` [PATCH v3 3/5] arm64: tegra: Fix CD on Jetson AGX Xavier SDMMC1 Tamás Szűcs
@ 2020-10-14 17:56 ` Tamás Szűcs
  2020-10-14 17:56 ` [PATCH v3 5/5] arm64: tegra: Configure SDIO cards on " Tamás Szűcs
  4 siblings, 0 replies; 6+ messages in thread
From: Tamás Szűcs @ 2020-10-14 17:56 UTC (permalink / raw)
  To: Rob Herring, Thierry Reding, Jonathan Hunter, JC Kuo,
	Vidya Sagar, Sameer Pujar, devicetree, linux-tegra, linux-kernel
  Cc: Tamás Szűcs

Create regulator for VDD_3V3_SD and add it to SDMMC1. When vmmc-supply is
undefined the initialization sequence specified in aliases is disregarded.

Signed-off-by: Tamás Szűcs <tszucs@protonmail.ch>
---
 arch/arm64/boot/dts/nvidia/tegra194-p2888.dtsi | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/arch/arm64/boot/dts/nvidia/tegra194-p2888.dtsi b/arch/arm64/boot/dts/nvidia/tegra194-p2888.dtsi
index 31b5f00a7547..604a2c8a7478 100644
--- a/arch/arm64/boot/dts/nvidia/tegra194-p2888.dtsi
+++ b/arch/arm64/boot/dts/nvidia/tegra194-p2888.dtsi
@@ -78,6 +78,8 @@
 			bus-width = <4>;
 			cd-gpios = <&gpio TEGRA194_MAIN_GPIO(G, 7) GPIO_ACTIVE_LOW>;
 			disable-wp;
+
+			vmmc-supply = <&vdd_3v3_sd>;
 		};
 
 		/* SDMMC4 (eMMC) */
@@ -356,4 +358,14 @@
 		gpio = <&gpio TEGRA194_MAIN_GPIO(Z, 1) GPIO_ACTIVE_HIGH>;
 		enable-active-high;
 	};
+
+	vdd_3v3_sd: regulator@5 {
+		compatible = "regulator-fixed";
+		regulator-name = "VDD_3V3_SD";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		gpio = <&gpio TEGRA194_MAIN_GPIO(A, 0) GPIO_ACTIVE_HIGH>;
+		regulator-boot-on;
+		enable-active-high;
+	};
 };
-- 
2.20.1


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

* [PATCH v3 5/5] arm64: tegra: Configure SDIO cards on Jetson AGX Xavier SDMMC1
  2020-10-14 17:56 [PATCH v3 0/5] arm64: tegra: Xavier SDMMC changes Tamás Szűcs
                   ` (3 preceding siblings ...)
  2020-10-14 17:56 ` [PATCH v3 4/5] arm64: tegra: Add vmmc-supply regulator for " Tamás Szűcs
@ 2020-10-14 17:56 ` Tamás Szűcs
  4 siblings, 0 replies; 6+ messages in thread
From: Tamás Szűcs @ 2020-10-14 17:56 UTC (permalink / raw)
  To: Rob Herring, Thierry Reding, Jonathan Hunter, JC Kuo,
	Vidya Sagar, Sameer Pujar, devicetree, linux-tegra, linux-kernel
  Cc: Tamás Szűcs

Preserve SDIO card power during suspend/resume cycles and enable waking up the
host system on SDIO IRQ assertion.

Signed-off-by: Tamás Szűcs <tszucs@protonmail.ch>
---
 arch/arm64/boot/dts/nvidia/tegra194-p2888.dtsi | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm64/boot/dts/nvidia/tegra194-p2888.dtsi b/arch/arm64/boot/dts/nvidia/tegra194-p2888.dtsi
index 604a2c8a7478..e3098b1555bc 100644
--- a/arch/arm64/boot/dts/nvidia/tegra194-p2888.dtsi
+++ b/arch/arm64/boot/dts/nvidia/tegra194-p2888.dtsi
@@ -78,6 +78,8 @@
 			bus-width = <4>;
 			cd-gpios = <&gpio TEGRA194_MAIN_GPIO(G, 7) GPIO_ACTIVE_LOW>;
 			disable-wp;
+			keep-power-in-suspend;
+			wakeup-source;
 
 			vmmc-supply = <&vdd_3v3_sd>;
 		};
-- 
2.20.1


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

end of thread, back to index

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-14 17:56 [PATCH v3 0/5] arm64: tegra: Xavier SDMMC changes Tamás Szűcs
2020-10-14 17:56 ` [PATCH v3 1/5] arm64: tegra: Enable signal voltage switching on Tegra194 SDMMC1 and SDMMC3 Tamás Szűcs
2020-10-14 17:56 ` [PATCH v3 2/5] arm64: tegra: Specify sdhci clock parent for " Tamás Szűcs
2020-10-14 17:56 ` [PATCH v3 3/5] arm64: tegra: Fix CD on Jetson AGX Xavier SDMMC1 Tamás Szűcs
2020-10-14 17:56 ` [PATCH v3 4/5] arm64: tegra: Add vmmc-supply regulator for " Tamás Szűcs
2020-10-14 17:56 ` [PATCH v3 5/5] arm64: tegra: Configure SDIO cards on " Tamás Szűcs

Linux-Tegra Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-tegra/0 linux-tegra/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-tegra linux-tegra/ https://lore.kernel.org/linux-tegra \
		linux-tegra@vger.kernel.org
	public-inbox-index linux-tegra

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-tegra


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git