Skip to contentSkip to conversation

StarFive's MMC nodes support

PATCH Applied William Qiu 3 participants 6 messages Aug 9, 2023 – Aug 11, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover StarFive's MMC nodes support

Hi,

This patchset adds dts nodes for the StarFive designware mobile storage host controller driver. In device tree, we set mmc0 to eMMC, and set mmc1 to sd card.

William Qiu (2):
riscv: dts: starfive: enable DCDC1&ALDO4 node in axp15060
riscv: dts: starfive: Add mmc nodes on VisionFive 2 board

 .../jh7110-starfive-visionfive-2.dtsi         | 112 ++++++++++++++++++
 arch/riscv/boot/dts/starfive/jh7110.dtsi      |  32 +++++
 2 files changed, 144 insertions(+)

--
2.34.1

#1 lore raw

PATCH 1/2 riscv: dts: starfive: enable DCDC1&ALDO4 node in axp15060

Enable DCDC1 node for vmmc-supply and enable ALDO4 node for vqmmc-supply.

---
 .../starfive/jh7110-starfive-visionfive-2.dtsi   | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi +16 -0
index d2f3b9eb859b..d67e26b9c791 100644
@@ -165,12 +165,28 @@ axp15060: pmic@36 {
 		#interrupt-cells = <1>;
 
 		regulators {
+			vcc_3v3: dcdc1 {
+				regulator-boot-on;
+				regulator-always-on;
+				regulator-min-microvolt = <3300000>;
+				regulator-max-microvolt = <3300000>;
+				regulator-name = "vcc_3v3";
+			};
+
 			vdd_cpu: dcdc2 {
 				regulator-always-on;
 				regulator-min-microvolt = <500000>;
 				regulator-max-microvolt = <1540000>;
 				regulator-name = "vdd-cpu";
 			};
+
+			emmc_vdd: aldo4 {
+				regulator-boot-on;
+				regulator-always-on;
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <1800000>;
+				regulator-name = "emmc_vdd";
+			};
 		};
 	};
 };
Signature · 1 line
2.34.1
#2 lore raw

Re: [PATCH v1 1/2] riscv: dts: starfive: enable DCDC1&ALDO4 node in axp15060

Quoted 25 lines · William Qiu

Enable DCDC1 node for vmmc-supply and enable ALDO4 node for vqmmc-supply.

---
 .../starfive/jh7110-starfive-visionfive-2.dtsi   | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi +8 -0
index d2f3b9eb859b..d67e26b9c791 100644
@@ -165,12 +165,28 @@ axp15060: pmic@36 {
                #interrupt-cells = <1>;
 
                regulators {
+                       vcc_3v3: dcdc1 {
+                               regulator-boot-on;
+                               regulator-always-on;
+                               regulator-min-microvolt = <3300000>;
+                               regulator-max-microvolt = <3300000>;
+                               regulator-name = "vcc_3v3";
+                       };
+

arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi axp15060: pmic@36 { · line 185

Quoted 10 lines
arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi +4 -0
                        vdd_cpu: dcdc2 {
                                regulator-always-on;
                                regulator-min-microvolt = <500000>;
                                regulator-max-microvolt = <1540000>;
                                regulator-name = "vdd-cpu";
                        };
+
+                       emmc_vdd: aldo4 {
+                               regulator-boot-on;
+                               regulator-always-on;

Hi William,

Just a question: You mark these regulators as always-on, so they'll never be shut off even if the device is suspended. Is that because the mmc driver can't deal with reinitializing the mmc/sd-card if the card has been shut off while suspended or is there some other reason to mark them always-on?

Quoted 15 lines
arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi +4 -1
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-name = "emmc_vdd";
+                       };
                };
        };
 };
--

2.34.1

_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv

#3 lore raw

Re: [PATCH v1 1/2] riscv: dts: starfive: enable DCDC1&ALDO4 node in axp15060

Quoted 39 lines · Emil Renner Berthing
Quoted 25 lines · William Qiu

Enable DCDC1 node for vmmc-supply and enable ALDO4 node for vqmmc-supply.

---
 .../starfive/jh7110-starfive-visionfive-2.dtsi   | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi +8 -0
index d2f3b9eb859b..d67e26b9c791 100644
@@ -165,12 +165,28 @@ axp15060: pmic@36 {
                #interrupt-cells = <1>;
 
                regulators {
+                       vcc_3v3: dcdc1 {
+                               regulator-boot-on;
+                               regulator-always-on;
+                               regulator-min-microvolt = <3300000>;
+                               regulator-max-microvolt = <3300000>;
+                               regulator-name = "vcc_3v3";
+                       };
+

arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi axp15060: pmic@36 { · line 185

Quoted 10 lines
arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi +4 -0
                        vdd_cpu: dcdc2 {
                                regulator-always-on;
                                regulator-min-microvolt = <500000>;
                                regulator-max-microvolt = <1540000>;
                                regulator-name = "vdd-cpu";
                        };
+
+                       emmc_vdd: aldo4 {
+                               regulator-boot-on;
+                               regulator-always-on;

Hi William,

Quoted 6 lines

Just a question: You mark these regulators as always-on, so they'll never be shut off even if the device is suspended. Is that because the mmc driver can't deal with reinitializing the mmc/sd-card if the card has been shut off while suspended or is there some other reason to mark them always-on?

Hi Emil,

Because now hibernation's storage medium is currently SD/eMMC, so we need to mark SD/eMMC always-on.

Best Regards,
William

Quoted 15 lines
Quoted 15 lines
arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi +4 -1
+                               regulator-min-microvolt = <1800000>;
+                               regulator-max-microvolt = <1800000>;
+                               regulator-name = "emmc_vdd";
+                       };
                };
        };
 };
--

2.34.1

_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv

#4 lore raw

PATCH 2/2 riscv: dts: starfive: Add mmc nodes on VisionFive 2 board

In reply to William Qiu

Add the mmc nodes for the StarFive JH7110 SoC.
Set mmc0 node to emmc and set mmc1 node to sd.

---
 .../jh7110-starfive-visionfive-2.dtsi         | 96 +++++++++++++++++++
 arch/riscv/boot/dts/starfive/jh7110.dtsi      | 32 +++++++
 2 files changed, 128 insertions(+)
arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi +96 -0
index d67e26b9c791..d79f94432b27 100644
@@ -17,6 +17,8 @@ aliases {
 		i2c2 = &i2c2;
 		i2c5 = &i2c5;
 		i2c6 = &i2c6;
+		mmc0 = &mmc0;
+		mmc1 = &mmc1;
 		serial0 = &uart0;
 	};
 
@@ -201,6 +203,35 @@ &i2c6 {
 	status = "okay";
 };
 
+&mmc0 {
+	max-frequency = <100000000>;
+	bus-width = <8>;
+	cap-mmc-highspeed;
+	mmc-ddr-1_8v;
+	mmc-hs200-1_8v;
+	non-removable;
+	cap-mmc-hw-reset;
+	post-power-on-delay-ms = <200>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&mmc0_pins>;
+	vmmc-supply = <&vcc_3v3>;
+	vqmmc-supply = <&emmc_vdd>;
+	status = "okay";
+};
+
+&mmc1 {
+	max-frequency = <100000000>;
+	bus-width = <4>;
+	no-sdio;
+	no-mmc;
+	broken-cd;
+	cap-sd-highspeed;
+	post-power-on-delay-ms = <200>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&mmc1_pins>;
+	status = "okay";
+};
+
 &qspi {
 	#address-cells = <1>;
 	#size-cells = <0>;
@@ -306,6 +337,71 @@ GPOEN_SYS_I2C6_DATA,
 		};
 	};
 
+	mmc0_pins: mmc0-0 {
+		 rst-pins {
+			pinmux = <GPIOMUX(62, GPOUT_SYS_SDIO0_RST,
+					      GPOEN_ENABLE,
+					      GPI_NONE)>;
+			bias-pull-up;
+			drive-strength = <12>;
+			input-disable;
+			input-schmitt-disable;
+			slew-rate = <0>;
+		};
+
+		mmc-pins {
+			pinmux = <PINMUX(64, 0)>,
+				 <PINMUX(65, 0)>,
+				 <PINMUX(66, 0)>,
+				 <PINMUX(67, 0)>,
+				 <PINMUX(68, 0)>,
+				 <PINMUX(69, 0)>,
+				 <PINMUX(70, 0)>,
+				 <PINMUX(71, 0)>,
+				 <PINMUX(72, 0)>,
+				 <PINMUX(73, 0)>;
+			bias-pull-up;
+			drive-strength = <12>;
+			input-enable;
+		};
+	};
+
+	mmc1_pins: mmc1-0 {
+		clk-pins {
+			pinmux = <GPIOMUX(10, GPOUT_SYS_SDIO1_CLK,
+					      GPOEN_ENABLE,
+					      GPI_NONE)>;
+			bias-pull-up;
+			drive-strength = <12>;
+			input-disable;
+			input-schmitt-disable;
+			slew-rate = <0>;
+		};
+
+		mmc-pins {
+			pinmux = <GPIOMUX(9, GPOUT_SYS_SDIO1_CMD,
+					     GPOEN_SYS_SDIO1_CMD,
+					     GPI_SYS_SDIO1_CMD)>,
+				 <GPIOMUX(11, GPOUT_SYS_SDIO1_DATA0,
+					      GPOEN_SYS_SDIO1_DATA0,
+					      GPI_SYS_SDIO1_DATA0)>,
+				 <GPIOMUX(12, GPOUT_SYS_SDIO1_DATA1,
+					      GPOEN_SYS_SDIO1_DATA1,
+					      GPI_SYS_SDIO1_DATA1)>,
+				 <GPIOMUX(7, GPOUT_SYS_SDIO1_DATA2,
+					     GPOEN_SYS_SDIO1_DATA2,
+					     GPI_SYS_SDIO1_DATA2)>,
+				 <GPIOMUX(8, GPOUT_SYS_SDIO1_DATA3,
+					     GPOEN_SYS_SDIO1_DATA3,
+					     GPI_SYS_SDIO1_DATA3)>;
+			bias-pull-up;
+			drive-strength = <12>;
+			input-enable;
+			input-schmitt-enable;
+			slew-rate = <0>;
+		};
+	};
+
 	spi0_pins: spi0-0 {
 		mosi-pins {
 			pinmux = <GPIOMUX(52, GPOUT_SYS_SPI0_TXD,
arch/riscv/boot/dts/starfive/jh7110.dtsi +32 -0
index a608433200e8..18d4b60a7bbf 100644
@@ -821,6 +821,38 @@ watchdog@13070000 {
 				 <&syscrg JH7110_SYSRST_WDT_CORE>;
 		};
 
+		mmc0: mmc@16010000 {
+			compatible = "starfive,jh7110-mmc";
+			reg = <0x0 0x16010000 0x0 0x10000>;
+			clocks = <&syscrg JH7110_SYSCLK_SDIO0_AHB>,
+				 <&syscrg JH7110_SYSCLK_SDIO0_SDCARD>;
+			clock-names = "biu","ciu";
+			resets = <&syscrg JH7110_SYSRST_SDIO0_AHB>;
+			reset-names = "reset";
+			interrupts = <74>;
+			fifo-depth = <32>;
+			fifo-watermark-aligned;
+			data-addr = <0>;
+			starfive,sysreg = <&sys_syscon 0x14 0x1a 0x7c000000>;
+			status = "disabled";
+		};
+
+		mmc1: mmc@16020000 {
+			compatible = "starfive,jh7110-mmc";
+			reg = <0x0 0x16020000 0x0 0x10000>;
+			clocks = <&syscrg JH7110_SYSCLK_SDIO1_AHB>,
+				 <&syscrg JH7110_SYSCLK_SDIO1_SDCARD>;
+			clock-names = "biu","ciu";
+			resets = <&syscrg JH7110_SYSRST_SDIO1_AHB>;
+			reset-names = "reset";
+			interrupts = <75>;
+			fifo-depth = <32>;
+			fifo-watermark-aligned;
+			data-addr = <0>;
+			starfive,sysreg = <&sys_syscon 0x9c 0x1 0x3e>;
+			status = "disabled";
+		};
+
 		gmac0: ethernet@16030000 {
 			compatible = "starfive,jh7110-dwmac", "snps,dwmac-5.20";
 			reg = <0x0 0x16030000 0x0 0x10000>;
Signature · 1 line
2.34.1
maintainer Applied
#5 lore raw
In reply to William Qiu

From: Conor Dooley <[email protected]>

Quoted 9 lines · William Qiu

This patchset adds dts nodes for the StarFive designware mobile storage host controller driver. In device tree, we set mmc0 to eMMC, and set mmc1 to sd card.

William Qiu (2):
riscv: dts: starfive: enable DCDC1&ALDO4 node in axp15060
riscv: dts: starfive: Add mmc nodes on VisionFive 2 board

[...]

Applied to riscv-dt-for-next, thanks!

[1/2] riscv: dts: starfive: enable DCDC1&ALDO4 node in axp15060

      https://git.kernel.org/conor/c/7dafcfa79cc9
[2/2] riscv: dts: starfive: Add mmc nodes on VisionFive 2 board
      https://git.kernel.org/conor/c/b127dbf9e1eb

Thanks,
Conor.