Skip to contentSkip to conversation

ARM64: dts: meson: update around mmc

PATCH Applied Jerome Brunet 2 participants 11 messages Aug 31, 2017 – Sep 5, 2017

Subsystems (2)
lore
Share & tools
lore

Jerome Brunet

author reviewer
#0 lore raw

v3 cover ARM64: dts: meson: update around mmc

This patchset feature updates around mmc. It is linked to this series [0] but does not strictly depends on it. It adds:

* The regulator settling times for the gpio regulator of nanopi-k2 and the libretech-cc.
* UHS modes for the p20x, nanopi-k2 and the libretech-cc
* clk-gate pins: these are the pinmuxes used for the clk-stop work around explained here [1]

It also removes cap-sd-highspeed from eMMC nodes.

Special note on SDR104:
While the PCB of the p200 and the libretech-cc does not seems to handle SDR104 completely, the nanopi-k2 seems to be handling it correctly.

The patch enabling this mode on the nanopi-k2 is the last one of this series. It should propabably be left out until more people can test sdr104 on the nanopi-k2

This series has been tested on the gxbb-200, the gxbb-nanopi-k2 and the gxl-s905x-libretech-cc

Changes since v2 [3]:
* Rebase on Kevin's v4.14/dt64 branch

Changes since v1 [2]:
* Reorder patches to put fixes first, then enhancements
* Fix error in the SDIO clk_gate pins (GPIOX_5 instead GPIOX_4)

[0]: https://lkml.kernel.org/r/20170828142915.27020-1-jbrunet at baylibre.com [1]: https://lkml.kernel.org/r/20170821160301.21899-11-jbrunet at baylibre.com [2]: https://lkml.kernel.org/r/20170804180816.18737-1-jbrunet at baylibre.com [3]: https://lkml.kernel.org/r/20170821160637.22456-1-jbrunet at baylibre.com

Jerome Brunet (9):
ARM64: dts: meson-gx: Use correct mmc clock source 0
ARM64: dts: meson: remove cap-sd-highspeed from emmc nodes
ARM64: dts: meson: add mmc clk gate pins
ARM64: dts: meson-gxbb: nanopi-k2: add card regulator settle times
ARM64: dts: meson-gxl: libretech-cc: add card regulator settle times
ARM64: dts: meson-gxl: libretech-cc: enable high speed modes
ARM64: dts: meson-gxbb: p20x: enable sdcard UHS modes
ARM64: dts: meson-gxbb: nanopi-k2: enable sdcard UHS modes
ARM64: dts: meson-gxbb: nanopi-k2: enable sdr104 mode

 .../arm64/boot/dts/amlogic/meson-gx-p23x-q20x.dtsi | 10 +++---
 .../boot/dts/amlogic/meson-gxbb-nanopi-k2.dts      | 19 ++++++++---
 .../boot/dts/amlogic/meson-gxbb-nexbox-a95x.dts    | 12 ++++---
 .../arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts |  9 ++---
 arch/arm64/boot/dts/amlogic/meson-gxbb-p20x.dtsi   | 13 +++++---
 .../boot/dts/amlogic/meson-gxbb-vega-s95.dtsi      | 10 +++---
 arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi        | 39 ++++++++++++++++++++--
 .../dts/amlogic/meson-gxl-s905x-hwacom-amazetv.dts |  7 ++--
 .../dts/amlogic/meson-gxl-s905x-libretech-cc.dts   | 13 ++++++--
 .../dts/amlogic/meson-gxl-s905x-nexbox-a95x.dts    | 10 +++---
 .../boot/dts/amlogic/meson-gxl-s905x-p212.dtsi     | 10 +++---
 arch/arm64/boot/dts/amlogic/meson-gxl.dtsi         | 39 ++++++++++++++++++++--
 .../arm64/boot/dts/amlogic/meson-gxm-nexbox-a1.dts |  7 ++--
 arch/arm64/boot/dts/amlogic/meson-gxm-rbox-pro.dts |  1 -
 14 files changed, 150 insertions(+), 49 deletions(-)
Signature · 1 line
2.9.5
author reviewer
#1 lore raw

PATCH v3 1/9 ARM64: dts: meson-gx: Use correct mmc clock source 0

Now that the clock source 0 is properly described in the CCF, use it instead of assuming the default value (xtal)

---
 arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi | 6 +++---
 arch/arm64/boot/dts/amlogic/meson-gxl.dtsi  | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)
arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi +3 -3
index 52f1687e7a09..8f0c0cb02157 100644
@@ -661,21 +661,21 @@
 
 &sd_emmc_a {
 	clocks = <&clkc CLKID_SD_EMMC_A>,
-		 <&xtal>,
+		 <&clkc CLKID_SD_EMMC_A_CLK0>,
 		 <&clkc CLKID_FCLK_DIV2>;
 	clock-names = "core", "clkin0", "clkin1";
 };
 
 &sd_emmc_b {
 	clocks = <&clkc CLKID_SD_EMMC_B>,
-		 <&xtal>,
+		 <&clkc CLKID_SD_EMMC_B_CLK0>,
 		 <&clkc CLKID_FCLK_DIV2>;
 	clock-names = "core", "clkin0", "clkin1";
 };
 
 &sd_emmc_c {
 	clocks = <&clkc CLKID_SD_EMMC_C>,
-		 <&xtal>,
+		 <&clkc CLKID_SD_EMMC_C_CLK0>,
 		 <&clkc CLKID_FCLK_DIV2>;
 	clock-names = "core", "clkin0", "clkin1";
 };
arch/arm64/boot/dts/amlogic/meson-gxl.dtsi +3 -3
index d6876e64979e..829d84db5fc5 100644
@@ -603,21 +603,21 @@
 
 &sd_emmc_a {
 	clocks = <&clkc CLKID_SD_EMMC_A>,
-		 <&xtal>,
+		 <&clkc CLKID_SD_EMMC_A_CLK0>,
 		 <&clkc CLKID_FCLK_DIV2>;
 	clock-names = "core", "clkin0", "clkin1";
 };
 
 &sd_emmc_b {
 	clocks = <&clkc CLKID_SD_EMMC_B>,
-		 <&xtal>,
+		 <&clkc CLKID_SD_EMMC_B_CLK0>,
 		 <&clkc CLKID_FCLK_DIV2>;
        clock-names = "core", "clkin0", "clkin1";
 };
 
 &sd_emmc_c {
 	clocks = <&clkc CLKID_SD_EMMC_C>,
-		 <&xtal>,
+		 <&clkc CLKID_SD_EMMC_C_CLK0>,
 		 <&clkc CLKID_FCLK_DIV2>;
 	clock-names = "core", "clkin0", "clkin1";
 };
Signature · 1 line
2.9.5
author reviewer
#2 lore raw

PATCH v3 2/9 ARM64: dts: meson: remove cap-sd-highspeed from emmc nodes

In reply to Jerome Brunet

It does not make much sense to define cap-sd-highspeed in the emmc nodes Just remove it.

---
 arch/arm64/boot/dts/amlogic/meson-gx-p23x-q20x.dtsi            | 1 -
 arch/arm64/boot/dts/amlogic/meson-gxbb-nanopi-k2.dts           | 1 -
 arch/arm64/boot/dts/amlogic/meson-gxbb-nexbox-a95x.dts         | 1 -
 arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts            | 1 -
 arch/arm64/boot/dts/amlogic/meson-gxbb-p20x.dtsi               | 1 -
 arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95.dtsi           | 1 -
 arch/arm64/boot/dts/amlogic/meson-gxl-s905x-hwacom-amazetv.dts | 1 -
 arch/arm64/boot/dts/amlogic/meson-gxl-s905x-nexbox-a95x.dts    | 1 -
 arch/arm64/boot/dts/amlogic/meson-gxl-s905x-p212.dtsi          | 1 -
 arch/arm64/boot/dts/amlogic/meson-gxm-nexbox-a1.dts            | 1 -
 arch/arm64/boot/dts/amlogic/meson-gxm-rbox-pro.dts             | 1 -
 11 files changed, 11 deletions(-)
arch/arm64/boot/dts/amlogic/meson-gx-p23x-q20x.dtsi +0 -1
index c89010e56488..d4f9c5b550c7 100644
@@ -215,7 +215,6 @@
 	pinctrl-names = "default";
 
 	bus-width = <8>;
-	cap-sd-highspeed;
 	cap-mmc-highspeed;
 	max-frequency = <200000000>;
 	non-removable;
arch/arm64/boot/dts/amlogic/meson-gxbb-nanopi-k2.dts +0 -1
index 9697a7a79464..7dae6acd3c8c 100644
@@ -297,7 +297,6 @@
 	pinctrl-names = "default";
 
 	bus-width = <8>;
-	cap-sd-highspeed;
 	max-frequency = <200000000>;
 	non-removable;
 	disable-wp;
arch/arm64/boot/dts/amlogic/meson-gxbb-nexbox-a95x.dts +0 -1
index 9c59c3c6d1b6..a690956d6c75 100644
@@ -274,7 +274,6 @@
 	pinctrl-names = "default";
 
 	bus-width = <8>;
-	cap-sd-highspeed;
 	cap-mmc-highspeed;
 	max-frequency = <200000000>;
 	non-removable;
arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts +0 -1
index d147c853ab05..a12303becab4 100644
@@ -274,7 +274,6 @@
 	pinctrl-names = "default";
 
 	bus-width = <8>;
-	cap-sd-highspeed;
 	max-frequency = <200000000>;
 	non-removable;
 	disable-wp;
arch/arm64/boot/dts/amlogic/meson-gxbb-p20x.dtsi +0 -1
index 81ffc689a5bf..d77e19591ee3 100644
@@ -241,7 +241,6 @@
 	pinctrl-names = "default";
 
 	bus-width = <8>;
-	cap-sd-highspeed;
 	cap-mmc-highspeed;
 	max-frequency = <200000000>;
 	non-removable;
arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95.dtsi +0 -1
index 346753fb6324..0262ef8d48e4 100644
@@ -201,7 +201,6 @@
 	pinctrl-names = "default";
 
 	bus-width = <8>;
-	cap-sd-highspeed;
 	cap-mmc-highspeed;
 	max-frequency = <200000000>;
 	non-removable;
arch/arm64/boot/dts/amlogic/meson-gxl-s905x-hwacom-amazetv.dts +0 -1
index 2a5804ce7f4b..f779a985f923 100644
@@ -144,7 +144,6 @@
 	pinctrl-names = "default";
 
 	bus-width = <8>;
-	cap-sd-highspeed;
 	cap-mmc-highspeed;
 	max-frequency = <100000000>;
 	non-removable;
arch/arm64/boot/dts/amlogic/meson-gxl-s905x-nexbox-a95x.dts +0 -1
index 4c2ac7650fcd..21274a6c1b9b 100644
@@ -231,7 +231,6 @@
 	pinctrl-names = "default";
 
 	bus-width = <8>;
-	cap-sd-highspeed;
 	cap-mmc-highspeed;
 	max-frequency = <200000000>;
 	non-removable;
arch/arm64/boot/dts/amlogic/meson-gxl-s905x-p212.dtsi +0 -1
index f3eea8e89d12..8899121f79e1 100644
@@ -137,7 +137,6 @@
 	pinctrl-names = "default";
 
 	bus-width = <8>;
-	cap-sd-highspeed;
 	cap-mmc-highspeed;
 	max-frequency = <200000000>;
 	non-removable;
arch/arm64/boot/dts/amlogic/meson-gxm-nexbox-a1.dts +0 -1
index 9b10c5f4f8c0..ff8a9f780485 100644
@@ -196,7 +196,6 @@
 	pinctrl-names = "default";
 
 	bus-width = <8>;
-	cap-sd-highspeed;
 	cap-mmc-highspeed;
 	max-frequency = <200000000>;
 	non-removable;
arch/arm64/boot/dts/amlogic/meson-gxm-rbox-pro.dts +0 -1
index 08f1dd69b679..470f72bb863c 100644
@@ -220,7 +220,6 @@
 	pinctrl-names = "default";
 
 	bus-width = <8>;
-	cap-sd-highspeed;
 	cap-mmc-highspeed;
 	max-frequency = <200000000>;
 	non-removable;
Signature · 1 line
2.9.5
author reviewer
#3 lore raw

PATCH v3 3/9 ARM64: dts: meson: add mmc clk gate pins

In reply to Jerome Brunet

Add the pinctrl to switch mmc clk pins in gpio (pulled down) mode. This is necessary to be able to gate the clk outside of the SoC while keeping it running in the controller

---
 .../arm64/boot/dts/amlogic/meson-gx-p23x-q20x.dtsi |  9 ++++--
 .../boot/dts/amlogic/meson-gxbb-nanopi-k2.dts      |  9 ++++--
 .../boot/dts/amlogic/meson-gxbb-nexbox-a95x.dts    | 11 +++++---
 .../arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts |  8 ++++--
 arch/arm64/boot/dts/amlogic/meson-gxbb-p20x.dtsi   |  9 ++++--
 .../boot/dts/amlogic/meson-gxbb-vega-s95.dtsi      |  9 ++++--
 arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi        | 33 ++++++++++++++++++++++
 .../dts/amlogic/meson-gxl-s905x-hwacom-amazetv.dts |  6 ++--
 .../dts/amlogic/meson-gxl-s905x-libretech-cc.dts   |  6 ++--
 .../dts/amlogic/meson-gxl-s905x-nexbox-a95x.dts    |  9 ++++--
 .../boot/dts/amlogic/meson-gxl-s905x-p212.dtsi     |  9 ++++--
 arch/arm64/boot/dts/amlogic/meson-gxl.dtsi         | 33 ++++++++++++++++++++++
 .../arm64/boot/dts/amlogic/meson-gxm-nexbox-a1.dts |  6 ++--
 13 files changed, 126 insertions(+), 31 deletions(-)
arch/arm64/boot/dts/amlogic/meson-gx-p23x-q20x.dtsi +6 -3
index d4f9c5b550c7..4157987f4a3d 100644
@@ -168,7 +168,8 @@
 &sd_emmc_a {
 	status = "okay";
 	pinctrl-0 = <&sdio_pins>;
-	pinctrl-names = "default";
+	pinctrl-1 = <&sdio_clk_gate_pins>;
+	pinctrl-names = "default", "clk-gate";
 	#address-cells = <1>;
 	#size-cells = <0>;
 
@@ -194,7 +195,8 @@
 &sd_emmc_b {
 	status = "okay";
 	pinctrl-0 = <&sdcard_pins>;
-	pinctrl-names = "default";
+	pinctrl-1 = <&sdcard_clk_gate_pins>;
+	pinctrl-names = "default", "clk-gate";
 
 	bus-width = <4>;
 	cap-sd-highspeed;
@@ -212,7 +214,8 @@
 &sd_emmc_c {
 	status = "okay";
 	pinctrl-0 = <&emmc_pins>;
-	pinctrl-names = "default";
+	pinctrl-1 = <&emmc_clk_gate_pins>;
+	pinctrl-names = "default", "clk-gate";
 
 	bus-width = <8>;
 	cap-mmc-highspeed;
arch/arm64/boot/dts/amlogic/meson-gxbb-nanopi-k2.dts +6 -3
index 7dae6acd3c8c..60d5f2da6916 100644
@@ -250,7 +250,8 @@
 &sd_emmc_a {
 	status = "okay";
 	pinctrl-0 = <&sdio_pins>, <&sdio_irq_pins>;
-	pinctrl-names = "default";
+	pinctrl-1 = <&sdio_clk_gate_pins>;
+	pinctrl-names = "default", "clk-gate";
 	#address-cells = <1>;
 	#size-cells = <0>;
 
@@ -276,7 +277,8 @@
 &sd_emmc_b {
 	status = "okay";
 	pinctrl-0 = <&sdcard_pins>;
-	pinctrl-names = "default";
+	pinctrl-1 = <&sdcard_clk_gate_pins>;
+	pinctrl-names = "default", "clk-gate";
 
 	bus-width = <4>;
 	cap-sd-highspeed;
@@ -294,7 +296,8 @@
 &sd_emmc_c {
 	status = "disabled";
 	pinctrl-0 = <&emmc_pins>;
-	pinctrl-names = "default";
+	pinctrl-1 = <&emmc_clk_gate_pins>;
+	pinctrl-names = "default", "clk-gate";
 
 	bus-width = <8>;
 	max-frequency = <200000000>;
arch/arm64/boot/dts/amlogic/meson-gxbb-nexbox-a95x.dts +7 -4
index a690956d6c75..38dfdde5c147 100644
@@ -51,7 +51,7 @@
 / {
 	compatible = "nexbox,a95x", "amlogic,meson-gxbb";
 	model = "NEXBOX A95X";
-	
+
 	aliases {
 		serial0 = &uart_AO;
 	};
@@ -232,7 +232,8 @@
 &sd_emmc_a {
 	status = "okay";
 	pinctrl-0 = <&sdio_pins>;
-	pinctrl-names = "default";
+	pinctrl-1 = <&sdio_clk_gate_pins>;
+	pinctrl-names = "default", "clk-gate";
 	#address-cells = <1>;
 	#size-cells = <0>;
 
@@ -253,7 +254,8 @@
 &sd_emmc_b {
 	status = "okay";
 	pinctrl-0 = <&sdcard_pins>;
-	pinctrl-names = "default";
+	pinctrl-1 = <&sdcard_clk_gate_pins>;
+	pinctrl-names = "default", "clk-gate";
 
 	bus-width = <4>;
 	cap-sd-highspeed;
@@ -271,7 +273,8 @@
 &sd_emmc_c {
 	status = "okay";
 	pinctrl-0 = <&emmc_pins>;
-	pinctrl-names = "default";
+	pinctrl-1 = <&emmc_clk_gate_pins>;
+	pinctrl-names = "default", "clk-gate";
 
 	bus-width = <8>;
 	cap-mmc-highspeed;
arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts +5 -3
index a12303becab4..1ffa1c238a72 100644
@@ -50,7 +50,7 @@
 / {
 	compatible = "hardkernel,odroid-c2", "amlogic,meson-gxbb";
 	model = "Hardkernel ODROID-C2";
-	
+
 	aliases {
 		serial0 = &uart_AO;
 	};
@@ -253,7 +253,8 @@
 &sd_emmc_b {
 	status = "okay";
 	pinctrl-0 = <&sdcard_pins>;
-	pinctrl-names = "default";
+	pinctrl-1 = <&sdcard_clk_gate_pins>;
+	pinctrl-names = "default", "clk-gate";
 
 	bus-width = <4>;
 	cap-sd-highspeed;
@@ -271,7 +272,8 @@
 &sd_emmc_c {
 	status = "okay";
 	pinctrl-0 = <&emmc_pins>;
-	pinctrl-names = "default";
+	pinctrl-1 = <&emmc_clk_gate_pins>;
+	pinctrl-names = "default", "clk-gate";
 
 	bus-width = <8>;
 	max-frequency = <200000000>;
arch/arm64/boot/dts/amlogic/meson-gxbb-p20x.dtsi +6 -3
index d77e19591ee3..704b214e8894 100644
@@ -194,7 +194,8 @@
 &sd_emmc_a {
 	status = "okay";
 	pinctrl-0 = <&sdio_pins>;
-	pinctrl-names = "default";
+	pinctrl-1 = <&sdio_clk_gate_pins>;
+	pinctrl-names = "default", "clk-gate";
 	#address-cells = <1>;
 	#size-cells = <0>;
 
@@ -220,7 +221,8 @@
 &sd_emmc_b {
 	status = "okay";
 	pinctrl-0 = <&sdcard_pins>;
-	pinctrl-names = "default";
+	pinctrl-1 = <&sdcard_clk_gate_pins>;
+	pinctrl-names = "default", "clk-gate";
 
 	bus-width = <4>;
 	cap-sd-highspeed;
@@ -238,7 +240,8 @@
 &sd_emmc_c {
 	status = "okay";
 	pinctrl-0 = <&emmc_pins>;
-	pinctrl-names = "default";
+	pinctrl-1 = <&emmc_clk_gate_pins>;
+	pinctrl-names = "default", "clk-gate";
 
 	bus-width = <8>;
 	cap-mmc-highspeed;
arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95.dtsi +6 -3
index 0262ef8d48e4..f2bc6dea1fc6 100644
@@ -155,7 +155,8 @@
 &sd_emmc_a {
 	status = "okay";
 	pinctrl-0 = <&sdio_pins &sdio_irq_pins>;
-	pinctrl-names = "default";
+	pinctrl-1 = <&sdio_clk_gate_pins>;
+	pinctrl-names = "default", "clk-gate";
 	#address-cells = <1>;
 	#size-cells = <0>;
 
@@ -181,7 +182,8 @@
 &sd_emmc_b {
 	status = "okay";
 	pinctrl-0 = <&sdcard_pins>;
-	pinctrl-names = "default";
+	pinctrl-1 = <&sdcard_clk_gate_pins>;
+	pinctrl-names = "default", "clk-gate";
 
 	bus-width = <4>;
 	cap-sd-highspeed;
@@ -198,7 +200,8 @@
 &sd_emmc_c {
 	status = "okay";
 	pinctrl-0 = <&emmc_pins>;
-	pinctrl-names = "default";
+	pinctrl-1 = <&emmc_clk_gate_pins>;
+	pinctrl-names = "default", "clk-gate";
 
 	bus-width = <8>;
 	cap-mmc-highspeed;
arch/arm64/boot/dts/amlogic/meson-gxbb.dtsi +33 -0
index 8f0c0cb02157..af834cdbba79 100644
@@ -392,6 +392,17 @@
 			};
 		};
 
+		emmc_clk_gate_pins: emmc_clk_gate {
+			mux {
+				groups = "BOOT_8";
+				function = "gpio_periphs";
+			};
+			cfg-pull-down {
+				pins = "BOOT_8";
+				bias-pull-down;
+			};
+		};
+
 		nor_pins: nor {
 			mux {
 				groups = "nor_d",
@@ -430,6 +441,17 @@
 			};
 		};
 
+		sdcard_clk_gate_pins: sdcard_clk_gate {
+			mux {
+				groups = "CARD_2";
+				function = "gpio_periphs";
+			};
+			cfg-pull-down {
+				pins = "CARD_2";
+				bias-pull-down;
+			};
+		};
+
 		sdio_pins: sdio {
 			mux {
 				groups = "sdio_d0",
@@ -442,6 +464,17 @@
 			};
 		};
 
+		sdio_clk_gate_pins: sdio_clk_gate {
+			mux {
+				groups = "GPIOX_4";
+				function = "gpio_periphs";
+			};
+			cfg-pull-down {
+				pins = "GPIOX_4";
+				bias-pull-down;
+			};
+		};
+
 		sdio_irq_pins: sdio_irq {
 			mux {
 				groups = "sdio_irq";
arch/arm64/boot/dts/amlogic/meson-gxl-s905x-hwacom-amazetv.dts +4 -2
index f779a985f923..977b4240f3c1 100644
@@ -123,7 +123,8 @@
 &sd_emmc_b {
 	status = "okay";
 	pinctrl-0 = <&sdcard_pins>;
-	pinctrl-names = "default";
+	pinctrl-1 = <&sdcard_clk_gate_pins>;
+	pinctrl-names = "default", "clk-gate";
 
 	bus-width = <4>;
 	cap-sd-highspeed;
@@ -141,7 +142,8 @@
 &sd_emmc_c {
 	status = "okay";
 	pinctrl-0 = <&emmc_pins>;
-	pinctrl-names = "default";
+	pinctrl-1 = <&emmc_clk_gate_pins>;
+	pinctrl-names = "default", "clk-gate";
 
 	bus-width = <8>;
 	cap-mmc-highspeed;
arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dts +4 -2
index 69ca14ac10fa..a014c052241e 100644
@@ -197,7 +197,8 @@
 &sd_emmc_b {
 	status = "okay";
 	pinctrl-0 = <&sdcard_pins>;
-	pinctrl-names = "default";
+	pinctrl-1 = <&sdcard_clk_gate_pins>;
+	pinctrl-names = "default", "clk-gate";
 
 	bus-width = <4>;
 	cap-sd-highspeed;
@@ -215,7 +216,8 @@
 &sd_emmc_c {
 	status = "okay";
 	pinctrl-0 = <&emmc_pins>;
-	pinctrl-names = "default";
+	pinctrl-1 = <&emmc_clk_gate_pins>;
+	pinctrl-names = "default", "clk-gate";
 
 	bus-width = <8>;
 	cap-mmc-highspeed;
arch/arm64/boot/dts/amlogic/meson-gxl-s905x-nexbox-a95x.dts +6 -3
index 21274a6c1b9b..1b8f32867aa1 100644
@@ -189,7 +189,8 @@
 &sd_emmc_a {
 	status = "okay";
 	pinctrl-0 = <&sdio_pins>;
-	pinctrl-names = "default";
+	pinctrl-1 = <&sdio_clk_gate_pins>;
+	pinctrl-names = "default", "clk-gate";
 	#address-cells = <1>;
 	#size-cells = <0>;
 
@@ -210,7 +211,8 @@
 &sd_emmc_b {
 	status = "okay";
 	pinctrl-0 = <&sdcard_pins>;
-	pinctrl-names = "default";
+	pinctrl-1 = <&sdcard_clk_gate_pins>;
+	pinctrl-names = "default", "clk-gate";
 
 	bus-width = <4>;
 	cap-sd-highspeed;
@@ -228,7 +230,8 @@
 &sd_emmc_c {
 	status = "okay";
 	pinctrl-0 = <&emmc_pins>;
-	pinctrl-names = "default";
+	pinctrl-1 = <&emmc_clk_gate_pins>;
+	pinctrl-names = "default", "clk-gate";
 
 	bus-width = <8>;
 	cap-mmc-highspeed;
arch/arm64/boot/dts/amlogic/meson-gxl-s905x-p212.dtsi +6 -3
index 8899121f79e1..129af9068814 100644
@@ -95,7 +95,8 @@
 &sd_emmc_a {
 	status = "okay";
 	pinctrl-0 = <&sdio_pins>;
-	pinctrl-names = "default";
+	pinctrl-1 = <&sdio_clk_gate_pins>;
+	pinctrl-names = "default", "clk-gate";
 	#address-cells = <1>;
 	#size-cells = <0>;
 
@@ -116,7 +117,8 @@
 &sd_emmc_b {
 	status = "okay";
 	pinctrl-0 = <&sdcard_pins>;
-	pinctrl-names = "default";
+	pinctrl-1 = <&sdcard_clk_gate_pins>;
+	pinctrl-names = "default", "clk-gate";
 
 	bus-width = <4>;
 	cap-sd-highspeed;
@@ -134,7 +136,8 @@
 &sd_emmc_c {
 	status = "okay";
 	pinctrl-0 = <&emmc_pins>;
-	pinctrl-names = "default";
+	pinctrl-1 = <&emmc_clk_gate_pins>;
+	pinctrl-names = "default", "clk-gate";
 
 	bus-width = <8>;
 	cap-mmc-highspeed;
arch/arm64/boot/dts/amlogic/meson-gxl.dtsi +33 -0
index 829d84db5fc5..d8dd3298b15c 100644
@@ -281,6 +281,17 @@
 			};
 		};
 
+		emmc_clk_gate_pins: emmc_clk_gate {
+			mux {
+				groups = "BOOT_8";
+				function = "gpio_periphs";
+			};
+			cfg-pull-down {
+				pins = "BOOT_8";
+				bias-pull-down;
+			};
+		};
+
 		nor_pins: nor {
 			mux {
 				groups = "nor_d",
@@ -319,6 +330,17 @@
 			};
 		};
 
+		sdcard_clk_gate_pins: sdcard_clk_gate {
+			mux {
+				groups = "CARD_2";
+				function = "gpio_periphs";
+			};
+			cfg-pull-down {
+				pins = "CARD_2";
+				bias-pull-down;
+			};
+		};
+
 		sdio_pins: sdio {
 			mux {
 				groups = "sdio_d0",
@@ -331,6 +353,17 @@
 			};
 		};
 
+		sdio_clk_gate_pins: sdio_clk_gate {
+			mux {
+				groups = "GPIOX_4";
+				function = "gpio_periphs";
+			};
+			cfg-pull-down {
+				pins = "GPIOX_4";
+				bias-pull-down;
+			};
+		};
+
 		sdio_irq_pins: sdio_irq {
 			mux {
 				groups = "sdio_irq";
arch/arm64/boot/dts/amlogic/meson-gxm-nexbox-a1.dts +4 -2
index ff8a9f780485..22c697732f66 100644
@@ -175,7 +175,8 @@
 &sd_emmc_b {
 	status = "okay";
 	pinctrl-0 = <&sdcard_pins>;
-	pinctrl-names = "default";
+	pinctrl-1 = <&sdcard_clk_gate_pins>;
+	pinctrl-names = "default", "clk-gate";
 
 	bus-width = <4>;
 	cap-sd-highspeed;
@@ -193,7 +194,8 @@
 &sd_emmc_c {
 	status = "okay";
 	pinctrl-0 = <&emmc_pins>;
-	pinctrl-names = "default";
+	pinctrl-1 = <&emmc_clk_gate_pins>;
+	pinctrl-names = "default", "clk-gate";
 
 	bus-width = <8>;
 	cap-mmc-highspeed;
Signature · 1 line
2.9.5
author reviewer
#4 lore raw

PATCH v3 4/9 ARM64: dts: meson-gxbb: nanopi-k2: add card regulator settle times

In reply to Jerome Brunet

Changing the card voltage on the nanopi-k2 is not instantaneous, especially when switching from 3.3v to 1.8v.

It take at least 3ms for the regulator to go from 3.3v to 1.8v. Add margin to that to make sure we don't upset the sdcard during the voltage switch

Fixes 9bc7ffb08daf ("arm64: dts: amlogic: Add NanoPi K2")
---
 arch/arm64/boot/dts/amlogic/meson-gxbb-nanopi-k2.dts | 3 +++
 1 file changed, 3 insertions(+)
arch/arm64/boot/dts/amlogic/meson-gxbb-nanopi-k2.dts +3 -0
index 60d5f2da6916..acb6797756e5 100644
@@ -107,6 +107,9 @@
 
 		states = <3300000 0>,
 		         <1800000 1>;
+
+		regulator-settling-time-up-us = <100>;
+		regulator-settling-time-down-us = <5000>;
 	};
 
 	wifi_32k: wifi-32k {
Signature · 1 line
2.9.5
author reviewer
#5 lore raw

PATCH v3 5/9 ARM64: dts: meson-gxl: libretech-cc: add card regulator settle times

In reply to Jerome Brunet

Changing the card voltage on the cc is not instantaneous, especially when switching from 3.3v to 1.8v.

It take at least 30ms for the regulator to go from 3.3v to 1.8v. Add margin to that to make sure we don't upset the sdcard during the voltage switch

Fixes 61ff2af9b278 ("ARM64: dts: fixup libretech cc definition")
---
 arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dts | 3 +++
 1 file changed, 3 insertions(+)
arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dts +3 -0
index a014c052241e..7d252168c2fa 100644
@@ -91,6 +91,9 @@
 
 		states = <3300000 0>,
 			 <1800000 1>;
+
+		regulator-settling-time-up-us = <200>;
+		regulator-settling-time-down-us = <50000>;
 	};
 
 	vddio_boot: regulator-vddio_boot {
Signature · 1 line
2.9.5
author reviewer
#6 lore raw

PATCH v3 6/9 ARM64: dts: meson-gxl: libretech-cc: enable high speed modes

In reply to Jerome Brunet

Enable sdcard UHS modes up to SDR50. Unfortunately, it seems the PCB of the libretech-cc cannot handle SDR104 at 200Mhz reliably. Also enable eMMC DDR52 mode.

---
 arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dts | 4 ++++
 1 file changed, 4 insertions(+)
arch/arm64/boot/dts/amlogic/meson-gxl-s905x-libretech-cc.dts +4 -0
index 7d252168c2fa..64c54c92e214 100644
@@ -205,6 +205,9 @@
 
 	bus-width = <4>;
 	cap-sd-highspeed;
+	sd-uhs-sdr12;
+	sd-uhs-sdr25;
+	sd-uhs-sdr50;
 	max-frequency = <100000000>;
 	disable-wp;
 
@@ -224,6 +227,7 @@
 
 	bus-width = <8>;
 	cap-mmc-highspeed;
+	mmc-ddr-3_3v;
 	max-frequency = <50000000>;
 	non-removable;
 	disable-wp;
Signature · 1 line
2.9.5
author reviewer
#7 lore raw

PATCH v3 7/9 ARM64: dts: meson-gxbb: p20x: enable sdcard UHS modes

In reply to Jerome Brunet

Enable sdcard UHS modes, up to SDR50, on p20x based boards. While the s905 supports SDR104 mode, it appears that the PCB of p20x based boards can't cope with a rate as high as 200Mhz.

---
 arch/arm64/boot/dts/amlogic/meson-gxbb-p20x.dtsi | 3 +++
 1 file changed, 3 insertions(+)
arch/arm64/boot/dts/amlogic/meson-gxbb-p20x.dtsi +3 -0
index 704b214e8894..23c08c3afd0a 100644
@@ -226,6 +226,9 @@
 
 	bus-width = <4>;
 	cap-sd-highspeed;
+	sd-uhs-sdr12;
+	sd-uhs-sdr25;
+	sd-uhs-sdr50;
 	max-frequency = <100000000>;
 	disable-wp;
 
Signature · 1 line
2.9.5
author reviewer
#8 lore raw

PATCH v3 8/9 ARM64: dts: meson-gxbb: nanopi-k2: enable sdcard UHS modes

In reply to Jerome Brunet

Enable UHS modes, up to SDR50, on the nanopi-k2 SBC.

---
 arch/arm64/boot/dts/amlogic/meson-gxbb-nanopi-k2.dts | 3 +++
 1 file changed, 3 insertions(+)
arch/arm64/boot/dts/amlogic/meson-gxbb-nanopi-k2.dts +3 -0
index acb6797756e5..4c1320a93fef 100644
@@ -285,6 +285,9 @@
 
 	bus-width = <4>;
 	cap-sd-highspeed;
+	sd-uhs-sdr12;
+	sd-uhs-sdr25;
+	sd-uhs-sdr50;
 	max-frequency = <100000000>;
 	disable-wp;
 
Signature · 1 line
2.9.5
author reviewer
#9 lore raw

PATCH v3 9/9 ARM64: dts: meson-gxbb: nanopi-k2: enable sdr104 mode

In reply to Jerome Brunet

SDR104 seems to be OK on the nanopi-k2 SBC so enable it

---
 arch/arm64/boot/dts/amlogic/meson-gxbb-nanopi-k2.dts | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/amlogic/meson-gxbb-nanopi-k2.dts +2 -1
index 4c1320a93fef..4b17a76959b2 100644
@@ -288,7 +288,8 @@
 	sd-uhs-sdr12;
 	sd-uhs-sdr25;
 	sd-uhs-sdr50;
-	max-frequency = <100000000>;
+	sd-uhs-sdr104;
+	max-frequency = <200000000>;
 	disable-wp;
 
 	cd-gpios = <&gpio CARD_6 GPIO_ACTIVE_HIGH>;
Signature · 1 line
2.9.5
maintainer Applied
#10 lore raw
In reply to Jerome Brunet
Quoted 34 lines · Jerome Brunet

This patchset feature updates around mmc. It is linked to this series [0] but does not strictly depends on it. It adds:

* The regulator settling times for the gpio regulator of nanopi-k2 and the libretech-cc.
* UHS modes for the p20x, nanopi-k2 and the libretech-cc
* clk-gate pins: these are the pinmuxes used for the clk-stop work around explained here [1]

It also removes cap-sd-highspeed from eMMC nodes.

Special note on SDR104:
While the PCB of the p200 and the libretech-cc does not seems to handle SDR104 completely, the nanopi-k2 seems to be handling it correctly.

The patch enabling this mode on the nanopi-k2 is the last one of this series. It should propabably be left out until more people can test sdr104 on the nanopi-k2

This series has been tested on the gxbb-200, the gxbb-nanopi-k2 and the gxl-s905x-libretech-cc

Changes since v2 [3]:
* Rebase on Kevin's v4.14/dt64 branch

Changes since v1 [2]:
* Reorder patches to put fixes first, then enhancements
* Fix error in the SDIO clk_gate pins (GPIOX_5 instead GPIOX_4)

[0]: https://lkml.kernel.org/r/20170828142915.27020-1-jbrunet at baylibre.com [1]: https://lkml.kernel.org/r/20170821160301.21899-11-jbrunet at baylibre.com [2]: https://lkml.kernel.org/r/20170804180816.18737-1-jbrunet at baylibre.com [3]: https://lkml.kernel.org/r/20170821160637.22456-1-jbrunet at baylibre.com

Quoted 10 lines

Jerome Brunet (9):
ARM64: dts: meson-gx: Use correct mmc clock source 0
ARM64: dts: meson: remove cap-sd-highspeed from emmc nodes
ARM64: dts: meson: add mmc clk gate pins
ARM64: dts: meson-gxbb: nanopi-k2: add card regulator settle times
ARM64: dts: meson-gxl: libretech-cc: add card regulator settle times
ARM64: dts: meson-gxl: libretech-cc: enable high speed modes
ARM64: dts: meson-gxbb: p20x: enable sdcard UHS modes
ARM64: dts: meson-gxbb: nanopi-k2: enable sdcard UHS modes
ARM64: dts: meson-gxbb: nanopi-k2: enable sdr104 mode

Applied to v4.14/dt64, and submitted to arm-soc. It may miss this merge window, but if it does, we can submit for the first round of fixes after -rc1 is out.

Thanks,

Kevin