2023-08-09 02:16:58

by William Qiu

[permalink] [raw]
Subject: [PATCH v1 0/2] 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



2023-08-09 03:22:51

by William Qiu

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

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

Signed-off-by: William Qiu <[email protected]>
---
.../starfive/jh7110-starfive-visionfive-2.dtsi | 16 ++++++++++++++++
1 file changed, 16 insertions(+)

diff --git a/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi b/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi
index d2f3b9eb859b..d67e26b9c791 100644
--- a/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi
+++ b/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi
@@ -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";
+ };
};
};
};
--
2.34.1


2023-08-09 03:28:08

by William Qiu

[permalink] [raw]
Subject: [PATCH v1 2/2] riscv: dts: starfive: Add mmc nodes on VisionFive 2 board

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

Signed-off-by: William Qiu <[email protected]>
Reviewed-by: Hal Feng <[email protected]>
---
.../jh7110-starfive-visionfive-2.dtsi | 96 +++++++++++++++++++
arch/riscv/boot/dts/starfive/jh7110.dtsi | 32 +++++++
2 files changed, 128 insertions(+)

diff --git a/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi b/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi
index d67e26b9c791..d79f94432b27 100644
--- a/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi
+++ b/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi
@@ -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,
diff --git a/arch/riscv/boot/dts/starfive/jh7110.dtsi b/arch/riscv/boot/dts/starfive/jh7110.dtsi
index a608433200e8..18d4b60a7bbf 100644
--- a/arch/riscv/boot/dts/starfive/jh7110.dtsi
+++ b/arch/riscv/boot/dts/starfive/jh7110.dtsi
@@ -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>;
--
2.34.1


2023-08-09 19:06:54

by Conor Dooley

[permalink] [raw]
Subject: Re: [PATCH v1 0/2] StarFive's MMC nodes support

From: Conor Dooley <[email protected]>

On Wed, 09 Aug 2023 09:39:15 +0800, William Qiu wrote:
> 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.

2023-08-10 12:13:07

by Emil Renner Berthing

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

On Wed, 9 Aug 2023 at 03:41, William Qiu <[email protected]> wrote:
>
> Enable DCDC1 node for vmmc-supply and enable ALDO4 node for
> vqmmc-supply.
>
> Signed-off-by: William Qiu <[email protected]>
> ---
> .../starfive/jh7110-starfive-visionfive-2.dtsi | 16 ++++++++++++++++
> 1 file changed, 16 insertions(+)
>
> diff --git a/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi b/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi
> index d2f3b9eb859b..d67e26b9c791 100644
> --- a/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi
> +++ b/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi
> @@ -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;

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?

> + 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

2023-08-11 02:49:36

by William Qiu

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



On 2023/8/10 19:31, Emil Renner Berthing wrote:
> On Wed, 9 Aug 2023 at 03:41, William Qiu <[email protected]> wrote:
>>
>> Enable DCDC1 node for vmmc-supply and enable ALDO4 node for
>> vqmmc-supply.
>>
>> Signed-off-by: William Qiu <[email protected]>
>> ---
>> .../starfive/jh7110-starfive-visionfive-2.dtsi | 16 ++++++++++++++++
>> 1 file changed, 16 insertions(+)
>>
>> diff --git a/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi b/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi
>> index d2f3b9eb859b..d67e26b9c791 100644
>> --- a/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi
>> +++ b/arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi
>> @@ -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;
>
> 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?
>

Hi Emil,

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

Best Regards,
William
>> + 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