Skip to contentSkip to conversation

StarFive's SDIO/eMMC driver support

PATCH Superseded William Qiu 5 participants 17 messages Feb 3, 2023 – Feb 15, 2023

Subsystems (6)

v3 of 7 Superseded Latest is v7 →

lore
Share & tools
lore

William Qiu

author maintainer
#0 lore raw

v3 cover StarFive's SDIO/eMMC driver support

Hi,

This patchset adds initial rudimentary support for the StarFive designware mobile storage host controller driver. And this driver will be used in StarFive's VisionFive 2 board. The main purpose of adding this driver is to accommodate the ultra-high speed mode of eMMC.

The last patch should be applied after the patchset [1]:
[1] https://lore.kernel.org/all/[email protected]/

Changes since v2:
- Wraped commit message according to Linux coding style.
- Rephrased the description of the patches.
- Changed the description of syscon regsiter.
- Dropped redundant properties.

The patch series is based on v6.1.

William Qiu (3):
dt-bindings: mmc: Add StarFive MMC module
mmc: starfive: Add sdio/emmc driver support
riscv: dts: starfive: Add mmc node

 .../bindings/mmc/starfive,jh7110-mmc.yaml     |  77 ++++++++
 MAINTAINERS                                   |   6 +
 .../jh7110-starfive-visionfive-2.dtsi         |  23 +++
 arch/riscv/boot/dts/starfive/jh7110.dtsi      |  37 ++++
 drivers/mmc/host/Kconfig                      |  10 +
 drivers/mmc/host/Makefile                     |   1 +
 drivers/mmc/host/dw_mmc-starfive.c            | 185 ++++++++++++++++++
 7 files changed, 339 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mmc/starfive,jh7110-mmc.yaml
 create mode 100644 drivers/mmc/host/dw_mmc-starfive.c

--
2.34.1

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

author maintainer
#1 lore raw

PATCH v3 1/3 dt-bindings: mmc: Add StarFive MMC module

Add documentation to describe StarFive designware mobile storage host controller driver.

---
 .../bindings/mmc/starfive,jh7110-mmc.yaml     | 77 +++++++++++++++++++
 1 file changed, 77 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mmc/starfive,jh7110-mmc.yaml
Documentation/devicetree/bindings/mmc/starfive,jh7110-mmc.yaml new file +77 -0
new file mode 100644
index 000000000000..deacf8e9cfb2
@@ -0,0 +1,77 @@
+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/mmc/starfive,jh7110-mmc.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: StarFive Designware Mobile Storage Host Controller
+
+description:
+  StarFive uses the Synopsys designware mobile storage host controller
+  to interface a SoC with storage medium such as eMMC or SD/MMC cards.
+
+allOf:
+  - $ref: synopsys-dw-mshc-common.yaml#
+
+maintainers:
+  - William Qiu <[email protected]>
+
+properties:
+  compatible:
+    const: starfive,jh7110-mmc
+
+  reg:
+    maxItems: 1
+
+  clocks:
+    items:
+      - description: biu clock
+      - description: ciu clock
+
+  clock-names:
+    items:
+      - const: biu
+      - const: ciu
+
+  interrupts:
+    maxItems: 1
+
+  starfive,sysreg:
+    $ref: /schemas/types.yaml#/definitions/phandle-array
+    items:
+      - items:
+          - description: phandle to System Register Controller syscon node
+          - description: offset of SYS_SYSCONSAIF__SYSCFG register for MMC controller
+          - description: shift of SYS_SYSCONSAIF__SYSCFG register for MMC controller
+          - description: mask of SYS_SYSCONSAIF__SYSCFG register for MMC controller
+    description:
+      Should be four parameters, the phandle to System Register Controller
+      syscon node and the offset/shift/mask of SYS_SYSCONSAIF__SYSCFG register
+      for MMC controller.
+
+required:
+  - compatible
+  - reg
+  - clocks
+  - clock-names
+  - interrupts
+  - starfive,sysreg
+
+unevaluatedProperties: false
+
+examples:
+  - |
+    mmc@16010000 {
+        compatible = "starfive,jh7110-mmc";
+        reg = <0x16010000 0x10000>;
+        clocks = <&syscrg 91>,
+                 <&syscrg 93>;
+        clock-names = "biu","ciu";
+        resets = <&syscrg 64>;
+        reset-names = "reset";
+        interrupts = <74>;
+        fifo-depth = <32>;
+        fifo-watermark-aligned;
+        data-addr = <0>;
+        starfive,sysreg = <&sysreg 0x14 0x1a 0x7c000000>;
+    };
Signature · 7 lines
2.34.1


_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
author maintainer
#3 lore raw

PATCH v3 2/3 mmc: starfive: Add sdio/emmc driver support

In reply to William Qiu

Add sdio/emmc driver support for StarFive JH7110 soc.

---
 MAINTAINERS                        |   6 +
 drivers/mmc/host/Kconfig           |  10 ++
 drivers/mmc/host/Makefile          |   1 +
 drivers/mmc/host/dw_mmc-starfive.c | 185 +++++++++++++++++++++++++++++
 4 files changed, 202 insertions(+)
 create mode 100644 drivers/mmc/host/dw_mmc-starfive.c
MAINTAINERS +6 -0
index 85e8f83161d7..0ff348da6463 100644
@@ -19659,6 +19659,12 @@ F:	Documentation/devicetree/bindings/reset/starfive,jh7100-reset.yaml
 F:	drivers/reset/starfive/reset-starfive-jh71*
 F:	include/dt-bindings/reset/starfive?jh71*.h
 
+STARFIVE JH7110 MMC/SD/SDIO DRIVER
+M:	William Qiu <[email protected]>
+S:	Maintained
+F:	Documentation/devicetree/bindings/mmc/starfive*
+F:	drivers/mmc/dw_mmc-starfive.c
+
 STATIC BRANCH/CALL
 M:	Peter Zijlstra <[email protected]>
 M:	Josh Poimboeuf <[email protected]>
drivers/mmc/host/Kconfig +10 -0
index fb1062a6394c..b87262503403 100644
@@ -871,6 +871,16 @@ config MMC_DW_ROCKCHIP
 	  Synopsys DesignWare Memory Card Interface driver. Select this option
 	  for platforms based on RK3066, RK3188 and RK3288 SoC's.
 
+config MMC_DW_STARFIVE
+	tristate "StarFive specific extensions for Synopsys DW Memory Card Interface"
+	depends on SOC_STARFIVE
+	depends on MMC_DW
+	select MMC_DW_PLTFM
+	help
+	  This selects support for StarFive JH7110 SoC specific extensions to the
+	  Synopsys DesignWare Memory Card Interface driver. Select this option
+	  for platforms based on StarFive JH7110 SoC.
+
 config MMC_SH_MMCIF
 	tristate "SuperH Internal MMCIF support"
 	depends on SUPERH || ARCH_RENESAS || COMPILE_TEST
drivers/mmc/host/Makefile +1 -0
index 4e4ceb32c4b4..32c0e5564b9a 100644
@@ -56,6 +56,7 @@ obj-$(CONFIG_MMC_DW_HI3798CV200) += dw_mmc-hi3798cv200.o
 obj-$(CONFIG_MMC_DW_K3)		+= dw_mmc-k3.o
 obj-$(CONFIG_MMC_DW_PCI)	+= dw_mmc-pci.o
 obj-$(CONFIG_MMC_DW_ROCKCHIP)	+= dw_mmc-rockchip.o
+obj-$(CONFIG_MMC_DW_STARFIVE)	+= dw_mmc-starfive.o
 obj-$(CONFIG_MMC_SH_MMCIF)	+= sh_mmcif.o
 obj-$(CONFIG_MMC_JZ4740)	+= jz4740_mmc.o
 obj-$(CONFIG_MMC_VUB300)	+= vub300.o
drivers/mmc/host/dw_mmc-starfive.c new file +185 -0

185 lines not on this page · raw message

Signature · 7 lines
2.34.1


_______________________________________________
linux-riscv mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-riscv
author maintainer
#4 lore raw

PATCH v3 3/3 riscv: dts: starfive: Add mmc node

In reply to William Qiu

This adds the mmc node for the StarFive JH7110 SoC. Set mmco node to emmc and set mmc1 node to sd.

---
 .../jh7110-starfive-visionfive-2.dtsi         | 23 ++++++++++++
 arch/riscv/boot/dts/starfive/jh7110.dtsi      | 37 +++++++++++++++++++
 2 files changed, 60 insertions(+)
arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi +23 -0
index c60280b89c73..e1a0248e907f 100644
@@ -42,6 +42,29 @@ &rtc_osc {
 	clock-frequency = <32768>;
 };
 
+&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>;
+	status = "okay";
+};
+
+&mmc1 {
+	max-frequency = <100000000>;
+	bus-width = <4>;
+	no-sdio;
+	no-mmc;
+	broken-cd;
+	cap-sd-highspeed;
+	post-power-on-delay-ms = <200>;
+	status = "okay";
+};
+
 &gmac0_rmii_refin {
 	clock-frequency = <50000000>;
 };
arch/riscv/boot/dts/starfive/jh7110.dtsi +37 -0
index 64d260ea1f29..ae1a664e7af5 100644
@@ -370,6 +370,11 @@ syscrg: clock-controller@13020000 {
 			#reset-cells = <1>;
 		};
 
+		sysreg: syscon@13030000 {
+			compatible = "starfive,sysreg", "syscon";
+			reg = <0x0 0x13030000 0x0 0x1000>;
+		};
+
 		gpio: gpio@13040000 {
 			compatible = "starfive,jh7110-sys-pinctrl";
 			reg = <0x0 0x13040000 0x0 0x10000>;
@@ -407,5 +412,37 @@ gpioa: gpio@17020000 {
 			gpio-controller;
 			#gpio-cells = <2>;
 		};
+
+		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 = <&sysreg 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 = <&sysreg 0x9c 0x1 0x3e>;
+			status = "disabled";
+		};
 	};
 };
Signature · 7 lines
2.34.1


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

Re: [PATCH v3 3/3] riscv: dts: starfive: Add mmc node

Quoted 1 line · William Qiu

This adds the mmc node for the StarFive JH7110 SoC.

Do not use "This xxx". Use imperative mode.
https://elixir.bootlin.com/linux/v5.17.1/source/Documentation/process/submitting-patches.rst#L95

Quoted 14 lines

Set mmco node to emmc and set mmc1 node to sd.

arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi +1 -0
+
 &gmac0_rmii_refin {
 	clock-frequency = <50000000>;
 };
arch/riscv/boot/dts/starfive/jh7110.dtsi +0 -0
index 64d260ea1f29..ae1a664e7af5 100644

arch/riscv/boot/dts/starfive/jh7110.dtsi syscrg: clock-controller@13020000 { · line 374

Quoted 5 lines
arch/riscv/boot/dts/starfive/jh7110.dtsi +2 -0
@@ -370,6 +370,11 @@ syscrg: clock-controller@13020000 {
 			#reset-cells = <1>;
 		};
 
+		sysreg: syscon@13030000 {
+			compatible = "starfive,sysreg", "syscon";

No:
1. Undocumented.
2. A bit too generic. You should have here SoC specific compatible as well (either as second or third compatible, if all your SoCs share register layout).

arch/riscv/boot/dts/starfive/jh7110.dtsi syscrg: clock-controller@13020000 { · line 377

Quoted 3 lines
arch/riscv/boot/dts/starfive/jh7110.dtsi +3 -0
+			reg = <0x0 0x13030000 0x0 0x1000>;
+		};
+

Best regards,
Krzysztof

author maintainer
#6 lore raw

Re: [PATCH v3 3/3] riscv: dts: starfive: Add mmc node

Quoted 23 lines · Krzysztof Kozlowski
Quoted 1 line · William Qiu

This adds the mmc node for the StarFive JH7110 SoC.

Do not use "This xxx". Use imperative mode.
https://elixir.bootlin.com/linux/v5.17.1/source/Documentation/process/submitting-patches.rst#L95

Quoted 17 lines

Set mmco node to emmc and set mmc1 node to sd.

arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi +1 -0
+
 &gmac0_rmii_refin {
 	clock-frequency = <50000000>;
 };
arch/riscv/boot/dts/starfive/jh7110.dtsi +0 -0
index 64d260ea1f29..ae1a664e7af5 100644
@@ -370,6 +370,11 @@ syscrg: clock-controller@13020000 {
 			#reset-cells = <1>;
 		};
 
Quoted 9 lines

arch/riscv/boot/dts/starfive/jh7110.dtsi syscrg: clock-controller@13020000 { · line 374

Quoted 2 lines
arch/riscv/boot/dts/starfive/jh7110.dtsi +2 -0
+		sysreg: syscon@13030000 {
+			compatible = "starfive,sysreg", "syscon";

No:
1. Undocumented.
2. A bit too generic. You should have here SoC specific compatible as well (either as second or third compatible, if all your SoCs share register layout).

Hi Krzysztof,

As for the compatible, I will change it to "starfive,jh7110-sysreg" in next version,but for undocumented, I don't get it, can you clarify that.
Thank you anyway.

Best regards,
William Qiu

Quoted 7 lines

arch/riscv/boot/dts/starfive/jh7110.dtsi syscrg: clock-controller@13020000 { · line 377

Quoted 3 lines
arch/riscv/boot/dts/starfive/jh7110.dtsi +3 -0
+			reg = <0x0 0x13030000 0x0 0x1000>;
+		};
+

Best regards,
Krzysztof

#7 lore raw

Re: [PATCH v3 3/3] riscv: dts: starfive: Add mmc node

Quoted 36 lines · William Qiu
Quoted 23 lines · Krzysztof Kozlowski
Quoted 1 line · William Qiu

This adds the mmc node for the StarFive JH7110 SoC.

Do not use "This xxx". Use imperative mode.
https://elixir.bootlin.com/linux/v5.17.1/source/Documentation/process/submitting-patches.rst#L95

Quoted 17 lines

Set mmco node to emmc and set mmc1 node to sd.

arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi +1 -0
+
 &gmac0_rmii_refin {
 	clock-frequency = <50000000>;
 };
arch/riscv/boot/dts/starfive/jh7110.dtsi +0 -0
index 64d260ea1f29..ae1a664e7af5 100644
@@ -370,6 +370,11 @@ syscrg: clock-controller@13020000 {
 			#reset-cells = <1>;
 		};
 
Quoted 9 lines

arch/riscv/boot/dts/starfive/jh7110.dtsi syscrg: clock-controller@13020000 { · line 374

Quoted 2 lines
arch/riscv/boot/dts/starfive/jh7110.dtsi +2 -0
+		sysreg: syscon@13030000 {
+			compatible = "starfive,sysreg", "syscon";

No:
1. Undocumented.
2. A bit too generic. You should have here SoC specific compatible as well (either as second or third compatible, if all your SoCs share register layout).

Quoted 6 lines

Hi Krzysztof,

As for the compatible, I will change it to "starfive,jh7110-sysreg" in next version,but for undocumented, I don't get it, can you clarify that.
Thank you anyway.

You need bindings for it. I don't see it in linux-next, cover letter dependencies nor here.

Best regards,
Krzysztof

author maintainer
#8 lore raw

Re: [PATCH v3 3/3] riscv: dts: starfive: Add mmc node

Quoted 39 lines · Krzysztof Kozlowski
Quoted 38 lines · William Qiu
Quoted 23 lines · Krzysztof Kozlowski
Quoted 1 line · William Qiu

This adds the mmc node for the StarFive JH7110 SoC.

Do not use "This xxx". Use imperative mode.
https://elixir.bootlin.com/linux/v5.17.1/source/Documentation/process/submitting-patches.rst#L95

Quoted 17 lines

Set mmco node to emmc and set mmc1 node to sd.

arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi +1 -0
+
 &gmac0_rmii_refin {
 	clock-frequency = <50000000>;
 };
arch/riscv/boot/dts/starfive/jh7110.dtsi +0 -0
index 64d260ea1f29..ae1a664e7af5 100644
@@ -370,6 +370,11 @@ syscrg: clock-controller@13020000 {
 			#reset-cells = <1>;
 		};
 
Quoted 9 lines

arch/riscv/boot/dts/starfive/jh7110.dtsi syscrg: clock-controller@13020000 { · line 374

Quoted 2 lines
arch/riscv/boot/dts/starfive/jh7110.dtsi +2 -0
+		sysreg: syscon@13030000 {
+			compatible = "starfive,sysreg", "syscon";

No:
1. Undocumented.
2. A bit too generic. You should have here SoC specific compatible as well (either as second or third compatible, if all your SoCs share register layout).

Hi Krzysztof,

Quoted 8 lines
Quoted 4 lines

As for the compatible, I will change it to "starfive,jh7110-sysreg" in next version,but for undocumented, I don't get it, can you clarify that.
Thank you anyway.

You need bindings for it. I don't see it in linux-next, cover letter dependencies nor here.

I see, I will update it in next version.
Thank you for taking time to review and provide helpful comments for this patch.

Best regards,
William Qiu

Quoted 3 lines

Best regards,
Krzysztof

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

#9 lore raw

Re: [PATCH v3 3/3] riscv: dts: starfive: Add mmc node

In reply to William Qiu
Quoted 30 lines · William Qiu

This adds the mmc node for the StarFive JH7110 SoC. Set mmco node to emmc and set mmc1 node to sd.

---
 .../jh7110-starfive-visionfive-2.dtsi         | 23 ++++++++++++
 arch/riscv/boot/dts/starfive/jh7110.dtsi      | 37 +++++++++++++++++++
 2 files changed, 60 insertions(+)
arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi +12 -0
index c60280b89c73..e1a0248e907f 100644
@@ -42,6 +42,29 @@ &rtc_osc {
        clock-frequency = <32768>;
 };
 
+&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>;
+       status = "okay";
+};
+

arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi &rtc_osc { · line 66

Quoted 10 lines
arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi +10 -0
+&mmc1 {
+       max-frequency = <100000000>;
+       bus-width = <4>;
+       no-sdio;ru
+       no-mmc;
+       broken-cd;
+       cap-sd-highspeed;
+       post-power-on-delay-ms = <200>;
+       status = "okay";
+};

Please add these so they're sorted alphabetically (but keep the clocks at the top), so there's at least some sort of system.

Quoted 27 lines
arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi +0 -0
 &gmac0_rmii_refin {
        clock-frequency = <50000000>;
 };
arch/riscv/boot/dts/starfive/jh7110.dtsi +9 -0
index 64d260ea1f29..ae1a664e7af5 100644
@@ -370,6 +370,11 @@ syscrg: clock-controller@13020000 {
                        #reset-cells = <1>;
                };
 
+               sysreg: syscon@13030000 {
+                       compatible = "starfive,sysreg", "syscon";
+                       reg = <0x0 0x13030000 0x0 0x1000>;
+               };
+
                gpio: gpio@13040000 {
                        compatible = "starfive,jh7110-sys-pinctrl";
                        reg = <0x0 0x13040000 0x0 0x10000>;
@@ -407,5 +412,37 @@ gpioa: gpio@17020000 {
                        gpio-controller;
                        #gpio-cells = <2>;
                };
+
+               mmc0: mmc@16010000 {
+                       compatible = "starfive,jh7110-mmc";
+                       reg = <0x0 0x16010000 0x0 0x10000>;

arch/riscv/boot/dts/starfive/jh7110.dtsi gpioa: gpio@17020000 { · line 428

Quoted 10 lines
arch/riscv/boot/dts/starfive/jh7110.dtsi +10 -0
+                       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 = <&sysreg 0x14 0x1a 0x7c000000>;

This may need updating depending on whether you fix the driver or bindings.

Quoted 28 lines
arch/riscv/boot/dts/starfive/jh7110.dtsi +18 -1
+                       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 = <&sysreg 0x9c 0x1 0x3e>;
+                       status = "disabled";
+               };
        };
 };
--

2.34.1

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

author maintainer
#10 lore raw

Re: [PATCH v3 3/3] riscv: dts: starfive: Add mmc node

Quoted 76 lines · Emil Renner Berthing
Quoted 30 lines · William Qiu

This adds the mmc node for the StarFive JH7110 SoC. Set mmco node to emmc and set mmc1 node to sd.

---
 .../jh7110-starfive-visionfive-2.dtsi         | 23 ++++++++++++
 arch/riscv/boot/dts/starfive/jh7110.dtsi      | 37 +++++++++++++++++++
 2 files changed, 60 insertions(+)
arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi +12 -0
index c60280b89c73..e1a0248e907f 100644
@@ -42,6 +42,29 @@ &rtc_osc {
        clock-frequency = <32768>;
 };
 
+&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>;
+       status = "okay";
+};
+

arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi &rtc_osc { · line 66

Quoted 10 lines
arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi +10 -0
+&mmc1 {
+       max-frequency = <100000000>;
+       bus-width = <4>;
+       no-sdio;ru
+       no-mmc;
+       broken-cd;
+       cap-sd-highspeed;
+       post-power-on-delay-ms = <200>;
+       status = "okay";
+};

Please add these so they're sorted alphabetically (but keep the clocks at the top), so there's at least some sort of system.

Quoted 31 lines
arch/riscv/boot/dts/starfive/jh7110-starfive-visionfive-2.dtsi +0 -0
 &gmac0_rmii_refin {
        clock-frequency = <50000000>;
 };
arch/riscv/boot/dts/starfive/jh7110.dtsi +13 -0
index 64d260ea1f29..ae1a664e7af5 100644
@@ -370,6 +370,11 @@ syscrg: clock-controller@13020000 {
                        #reset-cells = <1>;
                };
 
+               sysreg: syscon@13030000 {
+                       compatible = "starfive,sysreg", "syscon";
+                       reg = <0x0 0x13030000 0x0 0x1000>;
+               };
+
                gpio: gpio@13040000 {
                        compatible = "starfive,jh7110-sys-pinctrl";
                        reg = <0x0 0x13040000 0x0 0x10000>;
@@ -407,5 +412,37 @@ gpioa: gpio@17020000 {
                        gpio-controller;
                        #gpio-cells = <2>;
                };
+
+               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>;
Quoted 9 lines

arch/riscv/boot/dts/starfive/jh7110.dtsi gpioa: gpio@17020000 { · line 428

Quoted 6 lines
arch/riscv/boot/dts/starfive/jh7110.dtsi +6 -0
+                       reset-names = "reset";
+                       interrupts = <74>;
+                       fifo-depth = <32>;
+                       fifo-watermark-aligned;
+                       data-addr = <0>;
+                       starfive,sysreg = <&sysreg 0x14 0x1a 0x7c000000>;

This may need updating depending on whether you fix the driver or bindings.

I'll do it then

Quoted 28 lines
Quoted 28 lines
arch/riscv/boot/dts/starfive/jh7110.dtsi +18 -1
+                       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 = <&sysreg 0x9c 0x1 0x3e>;
+                       status = "disabled";
+               };
        };
 };
--

2.34.1

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

#11 lore raw
In reply to William Qiu
Quoted 24 lines · William Qiu

Hi,

This patchset adds initial rudimentary support for the StarFive designware mobile storage host controller driver. And this driver will be used in StarFive's VisionFive 2 board. The main purpose of adding this driver is to accommodate the ultra-high speed mode of eMMC.

The last patch should be applied after the patchset [1]:
[1] https://lore.kernel.org/all/[email protected]/

Changes since v2:
- Wraped commit message according to Linux coding style.
- Rephrased the description of the patches.
- Changed the description of syscon regsiter.
- Dropped redundant properties.

The patch series is based on v6.1.

William Qiu (3):
dt-bindings: mmc: Add StarFive MMC module
mmc: starfive: Add sdio/emmc driver support
riscv: dts: starfive: Add mmc node

Quoted 11 lines
 .../bindings/mmc/starfive,jh7110-mmc.yaml     |  77 ++++++++
 MAINTAINERS                                   |   6 +
 .../jh7110-starfive-visionfive-2.dtsi         |  23 +++
 arch/riscv/boot/dts/starfive/jh7110.dtsi      |  37 ++++
 drivers/mmc/host/Kconfig                      |  10 +
 drivers/mmc/host/Makefile                     |   1 +
 drivers/mmc/host/dw_mmc-starfive.c            | 185 ++++++++++++++++++
 7 files changed, 339 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mmc/starfive,jh7110-mmc.yaml
 create mode 100644 drivers/mmc/host/dw_mmc-starfive.c

Patch 1 and patch 2 applied for next, thanks!

Note that I fixed some checkpatch errors/warnings. Next time, please run ./scripts/checkpatch.pl before you submit your patches.

Kind regards
Uffe

author maintainer
#12 lore raw
Quoted 37 lines · Ulf Hansson
Quoted 24 lines · William Qiu

Hi,

This patchset adds initial rudimentary support for the StarFive designware mobile storage host controller driver. And this driver will be used in StarFive's VisionFive 2 board. The main purpose of adding this driver is to accommodate the ultra-high speed mode of eMMC.

The last patch should be applied after the patchset [1]:
[1] https://lore.kernel.org/all/[email protected]/

Changes since v2:
- Wraped commit message according to Linux coding style.
- Rephrased the description of the patches.
- Changed the description of syscon regsiter.
- Dropped redundant properties.

The patch series is based on v6.1.

William Qiu (3):
dt-bindings: mmc: Add StarFive MMC module
mmc: starfive: Add sdio/emmc driver support
riscv: dts: starfive: Add mmc node

Quoted 11 lines
 .../bindings/mmc/starfive,jh7110-mmc.yaml     |  77 ++++++++
 MAINTAINERS                                   |   6 +
 .../jh7110-starfive-visionfive-2.dtsi         |  23 +++
 arch/riscv/boot/dts/starfive/jh7110.dtsi      |  37 ++++
 drivers/mmc/host/Kconfig                      |  10 +
 drivers/mmc/host/Makefile                     |   1 +
 drivers/mmc/host/dw_mmc-starfive.c            | 185 ++++++++++++++++++
 7 files changed, 339 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mmc/starfive,jh7110-mmc.yaml
 create mode 100644 drivers/mmc/host/dw_mmc-starfive.c
Quoted 7 lines

Patch 1 and patch 2 applied for next, thanks!

Note that I fixed some checkpatch errors/warnings. Next time, please run ./scripts/checkpatch.pl before you submit your patches.

Kind regards
Uffe

z
Hi Uffe,

Sorry about that, I'll check the patches before submit next time. Thanks for taking time reviewing this patch series.

Best Regards
William

#13 lore raw
In reply to Ulf Hansson
Quoted 38 lines · Ulf Hansson
Quoted 24 lines · William Qiu

Hi,

This patchset adds initial rudimentary support for the StarFive designware mobile storage host controller driver. And this driver will be used in StarFive's VisionFive 2 board. The main purpose of adding this driver is to accommodate the ultra-high speed mode of eMMC.

The last patch should be applied after the patchset [1]:
[1] https://lore.kernel.org/all/[email protected]/

Changes since v2:
- Wraped commit message according to Linux coding style.
- Rephrased the description of the patches.
- Changed the description of syscon regsiter.
- Dropped redundant properties.

The patch series is based on v6.1.

William Qiu (3):
dt-bindings: mmc: Add StarFive MMC module
mmc: starfive: Add sdio/emmc driver support
riscv: dts: starfive: Add mmc node

Quoted 11 lines
 .../bindings/mmc/starfive,jh7110-mmc.yaml     |  77 ++++++++
 MAINTAINERS                                   |   6 +
 .../jh7110-starfive-visionfive-2.dtsi         |  23 +++
 arch/riscv/boot/dts/starfive/jh7110.dtsi      |  37 ++++
 drivers/mmc/host/Kconfig                      |  10 +
 drivers/mmc/host/Makefile                     |   1 +
 drivers/mmc/host/dw_mmc-starfive.c            | 185 ++++++++++++++++++
 7 files changed, 339 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mmc/starfive,jh7110-mmc.yaml
 create mode 100644 drivers/mmc/host/dw_mmc-starfive.c
Quoted 4 lines

Patch 1 and patch 2 applied for next, thanks!

Note that I fixed some checkpatch errors/warnings. Next time, please run ./scripts/checkpatch.pl before you submit your patches.

Hi,

Something here is not right. The bindings document "starfive,sysreg", but the code is looking for "starfive,syscon".
William, did you test this and run dtbs_check before sending this series?

/Emil

Quoted 7 lines

Kind regards
Uffe

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

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

author maintainer
#14 lore raw
Quoted 44 lines · Emil Renner Berthing
Quoted 38 lines · Ulf Hansson
Quoted 24 lines · William Qiu

Hi,

This patchset adds initial rudimentary support for the StarFive designware mobile storage host controller driver. And this driver will be used in StarFive's VisionFive 2 board. The main purpose of adding this driver is to accommodate the ultra-high speed mode of eMMC.

The last patch should be applied after the patchset [1]:
[1] https://lore.kernel.org/all/[email protected]/

Changes since v2:
- Wraped commit message according to Linux coding style.
- Rephrased the description of the patches.
- Changed the description of syscon regsiter.
- Dropped redundant properties.

The patch series is based on v6.1.

William Qiu (3):
dt-bindings: mmc: Add StarFive MMC module
mmc: starfive: Add sdio/emmc driver support
riscv: dts: starfive: Add mmc node

Quoted 11 lines
 .../bindings/mmc/starfive,jh7110-mmc.yaml     |  77 ++++++++
 MAINTAINERS                                   |   6 +
 .../jh7110-starfive-visionfive-2.dtsi         |  23 +++
 arch/riscv/boot/dts/starfive/jh7110.dtsi      |  37 ++++
 drivers/mmc/host/Kconfig                      |  10 +
 drivers/mmc/host/Makefile                     |   1 +
 drivers/mmc/host/dw_mmc-starfive.c            | 185 ++++++++++++++++++
 7 files changed, 339 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mmc/starfive,jh7110-mmc.yaml
 create mode 100644 drivers/mmc/host/dw_mmc-starfive.c
Quoted 4 lines

Patch 1 and patch 2 applied for next, thanks!

Note that I fixed some checkpatch errors/warnings. Next time, please run ./scripts/checkpatch.pl before you submit your patches.

Quoted 7 lines

Hi,

Something here is not right. The bindings document "starfive,sysreg", but the code is looking for "starfive,syscon".
William, did you test this and run dtbs_check before sending this series?

/Emil

Hi Emil,

Sorry about that, it's my negligence that I did dtbs_check without checking the configuration of CONFIG_SOC_STARFIVE. I made a modification in the next version and add binding for all the syscon at the same time. Next time I'll make sure the check is correct.I'm sorry again for this oversight. I'll send v4 patch series today.

Best Regards
William

Quoted 8 lines
Quoted 8 lines

Kind regards
Uffe

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

maintainer
#15 lore raw
Quoted 53 lines · William Qiu
Quoted 50 lines · Emil Renner Berthing
Quoted 38 lines · Ulf Hansson
Quoted 24 lines · William Qiu

Hi,

This patchset adds initial rudimentary support for the StarFive designware mobile storage host controller driver. And this driver will be used in StarFive's VisionFive 2 board. The main purpose of adding this driver is to accommodate the ultra-high speed mode of eMMC.

The last patch should be applied after the patchset [1]:
[1] https://lore.kernel.org/all/[email protected]/

Changes since v2:
- Wraped commit message according to Linux coding style.
- Rephrased the description of the patches.
- Changed the description of syscon regsiter.
- Dropped redundant properties.

The patch series is based on v6.1.

William Qiu (3):
dt-bindings: mmc: Add StarFive MMC module
mmc: starfive: Add sdio/emmc driver support
riscv: dts: starfive: Add mmc node

Quoted 11 lines
 .../bindings/mmc/starfive,jh7110-mmc.yaml     |  77 ++++++++
 MAINTAINERS                                   |   6 +
 .../jh7110-starfive-visionfive-2.dtsi         |  23 +++
 arch/riscv/boot/dts/starfive/jh7110.dtsi      |  37 ++++
 drivers/mmc/host/Kconfig                      |  10 +
 drivers/mmc/host/Makefile                     |   1 +
 drivers/mmc/host/dw_mmc-starfive.c            | 185 ++++++++++++++++++
 7 files changed, 339 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mmc/starfive,jh7110-mmc.yaml
 create mode 100644 drivers/mmc/host/dw_mmc-starfive.c
Quoted 4 lines

Patch 1 and patch 2 applied for next, thanks!

Note that I fixed some checkpatch errors/warnings. Next time, please run ./scripts/checkpatch.pl before you submit your patches.

Hi,

Something here is not right. The bindings document "starfive,sysreg", but the code is looking for "starfive,syscon".
William, did you test this and run dtbs_check before sending this series?

Quoted 5 lines
Quoted 1 line

/Emil

Hi Emil,

Sorry about that, it's my negligence that I did dtbs_check without

dtbs_check would be okay though, no? The binding and dts (from checking with eyeballs!) are consistent & it is just the driver that is looking for the wrong property name, no?

Quoted 4 lines

checking the configuration of CONFIG_SOC_STARFIVE. I made a modification in the next version and add binding for all the syscon at the same time. Next time I'll make sure the check is correct.I'm sorry again for this oversight. I'll send v4 patch series today.

Ulf's subsystem & his rules, but I would just send a follow-on patch fixing the driver to use the property that is in the dt-binding.

Sorta unrelated, but please remind me about the dts patch once the base dts is merged. It's still in the RISC-V patchwork so *should* be fine, but in case the base dts takes a while it may get automatically archived.

Thanks,
Conor.

author maintainer
#16 lore raw
Quoted 56 lines · Conor Dooley
Quoted 55 lines · William Qiu
Quoted 51 lines · Emil Renner Berthing
Quoted 38 lines · Ulf Hansson
Quoted 24 lines · William Qiu

Hi,

This patchset adds initial rudimentary support for the StarFive designware mobile storage host controller driver. And this driver will be used in StarFive's VisionFive 2 board. The main purpose of adding this driver is to accommodate the ultra-high speed mode of eMMC.

The last patch should be applied after the patchset [1]:
[1] https://lore.kernel.org/all/[email protected]/

Changes since v2:
- Wraped commit message according to Linux coding style.
- Rephrased the description of the patches.
- Changed the description of syscon regsiter.
- Dropped redundant properties.

The patch series is based on v6.1.

William Qiu (3):
dt-bindings: mmc: Add StarFive MMC module
mmc: starfive: Add sdio/emmc driver support
riscv: dts: starfive: Add mmc node

Quoted 11 lines
 .../bindings/mmc/starfive,jh7110-mmc.yaml     |  77 ++++++++
 MAINTAINERS                                   |   6 +
 .../jh7110-starfive-visionfive-2.dtsi         |  23 +++
 arch/riscv/boot/dts/starfive/jh7110.dtsi      |  37 ++++
 drivers/mmc/host/Kconfig                      |  10 +
 drivers/mmc/host/Makefile                     |   1 +
 drivers/mmc/host/dw_mmc-starfive.c            | 185 ++++++++++++++++++
 7 files changed, 339 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/mmc/starfive,jh7110-mmc.yaml
 create mode 100644 drivers/mmc/host/dw_mmc-starfive.c
Quoted 4 lines

Patch 1 and patch 2 applied for next, thanks!

Note that I fixed some checkpatch errors/warnings. Next time, please run ./scripts/checkpatch.pl before you submit your patches.

Hi,

Something here is not right. The bindings document "starfive,sysreg", but the code is looking for "starfive,syscon".
William, did you test this and run dtbs_check before sending this series?

/Emil

Quoted 8 lines
Quoted 3 lines

Hi Emil,

Sorry about that, it's my negligence that I did dtbs_check without

dtbs_check would be okay though, no? The binding and dts (from checking with eyeballs!) are consistent & it is just the driver that is looking for the wrong property name, no?

It was my negligence that I didn't test the function

Quoted 8 lines
Quoted 4 lines

checking the configuration of CONFIG_SOC_STARFIVE. I made a modification in the next version and add binding for all the syscon at the same time. Next time I'll make sure the check is correct.I'm sorry again for this oversight. I'll send v4 patch series today.

Ulf's subsystem & his rules, but I would just send a follow-on patch fixing the driver to use the property that is in the dt-binding.

Quoted 8 lines

Sorta unrelated, but please remind me about the dts patch once the base dts is merged. It's still in the RISC-V patchwork so *should* be fine, but in case the base dts takes a while it may get automatically archived.

Thanks,
Conor.

I'll do it then.
Thanks,
William