Skip to contentSkip to conversation

arm64: dts: rockchip: Add sdmmc_ext for RK3328

PATCH Superseded Alex Bee 4 participants 8 messages Jun 23, 2021

Subsystems (2)
lore
Share & tools
lore

Alex Bee

author
#0 lore raw

PATCH 1/1 arm64: dts: rockchip: Add sdmmc_ext for RK3328

RK3328 SoC has a fourth mmc controller called SDMMC_EXT. Some boards have sdio wifi connected to it. In order to use it one would have to add the pinctrls from sdmmc0ext group which is done on board level.

While at that also add the reset controls for the other mmc controllers.

---
 arch/arm64/boot/dts/rockchip/rk3328.dtsi | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
arch/arm64/boot/dts/rockchip/rk3328.dtsi +20 -0
index da84be6f4715..c13fa2f3f4cd 100644
@@ -858,6 +858,8 @@ sdmmc: mmc@ff500000 {
 		clock-names = "biu", "ciu", "ciu-drive", "ciu-sample";
 		fifo-depth = <0x100>;
 		max-frequency = <150000000>;
+		resets = <&cru SRST_MMC0>;
+		reset-names = "reset";
 		status = "disabled";
 	};
 
@@ -870,6 +872,8 @@ sdio: mmc@ff510000 {
 		clock-names = "biu", "ciu", "ciu-drive", "ciu-sample";
 		fifo-depth = <0x100>;
 		max-frequency = <150000000>;
+		resets = <&cru SRST_SDIO>;
+		reset-names = "reset";
 		status = "disabled";
 	};
 
@@ -882,6 +886,8 @@ emmc: mmc@ff520000 {
 		clock-names = "biu", "ciu", "ciu-drive", "ciu-sample";
 		fifo-depth = <0x100>;
 		max-frequency = <150000000>;
+		resets = <&cru SRST_EMMC>;
+		reset-names = "reset";
 		status = "disabled";
 	};
 
@@ -980,6 +986,20 @@ usb_host0_ohci: usb@ff5d0000 {
 		status = "disabled";
 	};
 
+	sdmmc_ext: dwmmc@ff5f0000 {
+		compatible = "rockchip,rk3328-dw-mshc", "rockchip,rk3288-dw-mshc";
+		reg = <0x0 0xff5f0000 0x0 0x4000>;
+		interrupts = <GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&cru HCLK_SDMMC_EXT>, <&cru SCLK_SDMMC_EXT>,
+			 <&cru SCLK_SDMMC_EXT_DRV>, <&cru SCLK_SDMMC_EXT_SAMPLE>;
+		clock-names = "biu", "ciu", "ciu-drive", "ciu-sample";
+		fifo-depth = <0x100>;
+		max-frequency = <150000000>;
+		resets = <&cru SRST_SDMMCEXT>;
+		reset-names = "reset";
+		status = "disabled";
+	};
+
 	usbdrd3: usb@ff600000 {
 		compatible = "rockchip,rk3328-dwc3", "snps,dwc3";
 		reg = <0x0 0xff600000 0x0 0x100000>;
Signature · 1 line
2.27.0
#1 lore raw

Hi Alex,

make ARCH=arm64 dtbs_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/mmc/rockchip-dw-mshc.yaml

Quoted 45 lines · Alex Bee

RK3328 SoC has a fourth mmc controller called SDMMC_EXT. Some boards have sdio wifi connected to it. In order to use it one would have to add the pinctrls from sdmmc0ext group which is done on board level.

While at that also add the reset controls for the other mmc controllers.

---
 arch/arm64/boot/dts/rockchip/rk3328.dtsi | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)
arch/arm64/boot/dts/rockchip/rk3328.dtsi +6 -0
index da84be6f4715..c13fa2f3f4cd 100644
@@ -858,6 +858,8 @@ sdmmc: mmc@ff500000 {
 		clock-names = "biu", "ciu", "ciu-drive", "ciu-sample";
 		fifo-depth = <0x100>;
 		max-frequency = <150000000>;
+		resets = <&cru SRST_MMC0>;
+		reset-names = "reset";
 		status = "disabled";
 	};
 
@@ -870,6 +872,8 @@ sdio: mmc@ff510000 {
 		clock-names = "biu", "ciu", "ciu-drive", "ciu-sample";
 		fifo-depth = <0x100>;
 		max-frequency = <150000000>;
+		resets = <&cru SRST_SDIO>;
+		reset-names = "reset";
 		status = "disabled";
 	};
 
@@ -882,6 +886,8 @@ emmc: mmc@ff520000 {
 		clock-names = "biu", "ciu", "ciu-drive", "ciu-sample";
 		fifo-depth = <0x100>;
 		max-frequency = <150000000>;
+		resets = <&cru SRST_EMMC>;
+		reset-names = "reset";
 		status = "disabled";
 	};
 

arch/arm64/boot/dts/rockchip/rk3328.dtsi usb_host0_ohci: usb@ff5d0000 { · line 990

Quoted 5 lines
arch/arm64/boot/dts/rockchip/rk3328.dtsi +1 -0
@@ -980,6 +986,20 @@ usb_host0_ohci: usb@ff5d0000 {
 		status = "disabled";
 	};
 
 
+	sdmmc_ext: dwmmc@ff5f0000 {

/arch/arm64/boot/dts/rockchip/rk3328-evb.dt.yaml: dwmmc@ff5f0000:
$nodename:0: 'dwmmc@ff5f0000' does not match '^mmc(@.*)?$'

Quoted 17 lines
arch/arm64/boot/dts/rockchip/rk3328.dtsi +13 -0
+		compatible = "rockchip,rk3328-dw-mshc", "rockchip,rk3288-dw-mshc";
+		reg = <0x0 0xff5f0000 0x0 0x4000>;
+		interrupts = <GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&cru HCLK_SDMMC_EXT>, <&cru SCLK_SDMMC_EXT>,
+			 <&cru SCLK_SDMMC_EXT_DRV>, <&cru SCLK_SDMMC_EXT_SAMPLE>;
+		clock-names = "biu", "ciu", "ciu-drive", "ciu-sample";
+		fifo-depth = <0x100>;
+		max-frequency = <150000000>;
+		resets = <&cru SRST_SDMMCEXT>;
+		reset-names = "reset";
+		status = "disabled";
+	};
+
 	usbdrd3: usb@ff600000 {
 		compatible = "rockchip,rk3328-dwc3", "snps,dwc3";

reg = <0x0 0xff600000 0x0 0x100000>;

author
#2 lore raw

Hi Johan,

Am 23.06.21 um 14:53 schrieb Johan Jonker:

Quoted 50 lines

Hi Alex,

make ARCH=arm64 dtbs_check DT_SCHEMA_FILES=Documentation/devicetree/bindings/mmc/rockchip-dw-mshc.yaml

Quoted 44 lines · Alex Bee

RK3328 SoC has a fourth mmc controller called SDMMC_EXT. Some boards have sdio wifi connected to it. In order to use it one would have to add the pinctrls from sdmmc0ext group which is done on board level.

While at that also add the reset controls for the other mmc controllers.

---
  arch/arm64/boot/dts/rockchip/rk3328.dtsi | 20 ++++++++++++++++++++
  1 file changed, 20 insertions(+)
arch/arm64/boot/dts/rockchip/rk3328.dtsi +6 -0
index da84be6f4715..c13fa2f3f4cd 100644
@@ -858,6 +858,8 @@ sdmmc: mmc@ff500000 {
  		clock-names = "biu", "ciu", "ciu-drive", "ciu-sample";
  		fifo-depth = <0x100>;
  		max-frequency = <150000000>;
+		resets = <&cru SRST_MMC0>;
+		reset-names = "reset";
  		status = "disabled";
  	};
 
@@ -870,6 +872,8 @@ sdio: mmc@ff510000 {
  		clock-names = "biu", "ciu", "ciu-drive", "ciu-sample";
  		fifo-depth = <0x100>;
  		max-frequency = <150000000>;
+		resets = <&cru SRST_SDIO>;
+		reset-names = "reset";
  		status = "disabled";
  	};
 
@@ -882,6 +886,8 @@ emmc: mmc@ff520000 {
  		clock-names = "biu", "ciu", "ciu-drive", "ciu-sample";
  		fifo-depth = <0x100>;
  		max-frequency = <150000000>;
+		resets = <&cru SRST_EMMC>;
+		reset-names = "reset";
  		status = "disabled";
  	};
 
Quoted 7 lines

arch/arm64/boot/dts/rockchip/rk3328.dtsi usb_host0_ohci: usb@ff5d0000 { · line 989

Quoted 5 lines
arch/arm64/boot/dts/rockchip/rk3328.dtsi +1 -0
@@ -980,6 +986,20 @@ usb_host0_ohci: usb@ff5d0000 {
  		status = "disabled";
  	};
 
+	sdmmc_ext: dwmmc@ff5f0000 {

/arch/arm64/boot/dts/rockchip/rk3328-evb.dt.yaml: dwmmc@ff5f0000:
$nodename:0: 'dwmmc@ff5f0000' does not match '^mmc(@.*)?$'

Argh: I submitted the pre-dtbs_check version. Thanks for checking.

Alex.

Quoted 17 lines
Quoted 17 lines
arch/arm64/boot/dts/rockchip/rk3328.dtsi +13 -0
+		compatible = "rockchip,rk3328-dw-mshc", "rockchip,rk3288-dw-mshc";
+		reg = <0x0 0xff5f0000 0x0 0x4000>;
+		interrupts = <GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&cru HCLK_SDMMC_EXT>, <&cru SCLK_SDMMC_EXT>,
+			 <&cru SCLK_SDMMC_EXT_DRV>, <&cru SCLK_SDMMC_EXT_SAMPLE>;
+		clock-names = "biu", "ciu", "ciu-drive", "ciu-sample";
+		fifo-depth = <0x100>;
+		max-frequency = <150000000>;
+		resets = <&cru SRST_SDMMCEXT>;
+		reset-names = "reset";
+		status = "disabled";
+	};
+
  	usbdrd3: usb@ff600000 {
  		compatible = "rockchip,rk3328-dwc3", "snps,dwc3";
  		reg = <0x0 0xff600000 0x0 0x100000>;
#3 lore raw
In reply to Alex Bee
Quoted 8 lines · Alex Bee

RK3328 SoC has a fourth mmc controller called SDMMC_EXT. Some boards have sdio wifi connected to it. In order to use it one would have to add the pinctrls from sdmmc0ext group which is done on board level.

While at that also add the reset controls for the other mmc controllers.

I recommend splitting this part into a separate patch, and adding an appropriate "Fixes" tag to it.

ChenYu

maintainer
#4 lore raw

Am Mittwoch, 23. Juni 2021, 15:11:12 CEST schrieb Chen-Yu Tsai:

Quoted 7 lines · Alex Bee
Quoted 6 lines

RK3328 SoC has a fourth mmc controller called SDMMC_EXT. Some boards have sdio wifi connected to it. In order to use it one would have to add the pinctrls from sdmmc0ext group which is done on board level.

Quoted 5 lines
Quoted 2 lines

While at that also add the reset controls for the other mmc controllers.

I recommend splitting this part into a separate patch, and adding an appropriate "Fixes" tag to it.

I'm with you on that. Adding the resets to the existing controllers should be a separate patch.

Heiko

author
#5 lore raw

Hi  Chen-Yu, Heiko,

Am 23.06.21 um 15:40 schrieb Heiko Stübner:

Quoted 7 lines

Am Mittwoch, 23. Juni 2021, 15:11:12 CEST schrieb Chen-Yu Tsai:

Quoted 6 lines · Alex Bee
Quoted 5 lines

RK3328 SoC has a fourth mmc controller called SDMMC_EXT. Some boards have sdio wifi connected to it. In order to use it one would have to add the pinctrls from sdmmc0ext group which is done on board level.

Quoted 6 lines
Quoted 4 lines
Quoted 2 lines

While at that also add the reset controls for the other mmc controllers.

I recommend splitting this part into a separate patch, and adding an appropriate "Fixes" tag to it.

I'm with you on that. Adding the resets to the existing controllers should be a separate patch.

Will do.

Alex

Quoted 3 lines

Heiko

author
#6 lore raw

PATCH v2 1/1 arm64: dts: rockchip: Add sdmmc_ext for RK3328

In reply to Alex Bee

RK3328 SoC has a fourth mmc controller called SDMMC_EXT. Some boards have sdio wifi connected to it. In order to use it one would have to add the pinctrls from sdmmc0ext group which is done on board level.

---

Changes in v2:
- fixed node name in accordance to DT bindings (Johan)
- seperated patch which adds reset controls for the other mmc controllers (Chen-Yu)

 arch/arm64/boot/dts/rockchip/rk3328.dtsi | 14 ++++++++++++++
 1 file changed, 14 insertions(+)
arch/arm64/boot/dts/rockchip/rk3328.dtsi +14 -0
index da84be6f4715..aa11bce576a4 100644
@@ -980,6 +980,20 @@ usb_host0_ohci: usb@ff5d0000 {
 		status = "disabled";
 	};
 
+	sdmmc_ext: mmc@ff5f0000 {
+		compatible = "rockchip,rk3328-dw-mshc", "rockchip,rk3288-dw-mshc";
+		reg = <0x0 0xff5f0000 0x0 0x4000>;
+		interrupts = <GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>;
+		clocks = <&cru HCLK_SDMMC_EXT>, <&cru SCLK_SDMMC_EXT>,
+			 <&cru SCLK_SDMMC_EXT_DRV>, <&cru SCLK_SDMMC_EXT_SAMPLE>;
+		clock-names = "biu", "ciu", "ciu-drive", "ciu-sample";
+		fifo-depth = <0x100>;
+		max-frequency = <150000000>;
+		resets = <&cru SRST_SDMMCEXT>;
+		reset-names = "reset";
+		status = "disabled";
+	};
+
 	usbdrd3: usb@ff600000 {
 		compatible = "rockchip,rk3328-dwc3", "snps,dwc3";
 		reg = <0x0 0xff600000 0x0 0x100000>;
Signature · 1 line
2.27.0
author
#7 lore raw

PATCH 1/1 arm64: dts: rockchip: Add sdmmc/sdio/emmc reset controls for RK3328

In reply to Alex Bee

The DW MCI controller driver will use them to reset the IP block before initialisation.

Fixes d717f7352ec6 ("arm64: dts: rockchip: add sdmmc/sdio/emmc nodes for RK3328 SoCs")
---
 arch/arm64/boot/dts/rockchip/rk3328.dtsi | 6 ++++++
 1 file changed, 6 insertions(+)
arch/arm64/boot/dts/rockchip/rk3328.dtsi +6 -0
index aa11bce576a4..a0321897bd5f 100644
@@ -858,6 +858,8 @@ sdmmc: mmc@ff500000 {
 		clock-names = "biu", "ciu", "ciu-drive", "ciu-sample";
 		fifo-depth = <0x100>;
 		max-frequency = <150000000>;
+		resets = <&cru SRST_MMC0>;
+		reset-names = "reset";
 		status = "disabled";
 	};
 
@@ -870,6 +872,8 @@ sdio: mmc@ff510000 {
 		clock-names = "biu", "ciu", "ciu-drive", "ciu-sample";
 		fifo-depth = <0x100>;
 		max-frequency = <150000000>;
+		resets = <&cru SRST_SDIO>;
+		reset-names = "reset";
 		status = "disabled";
 	};
 
@@ -882,6 +886,8 @@ emmc: mmc@ff520000 {
 		clock-names = "biu", "ciu", "ciu-drive", "ciu-sample";
 		fifo-depth = <0x100>;
 		max-frequency = <150000000>;
+		resets = <&cru SRST_EMMC>;
+		reset-names = "reset";
 		status = "disabled";
 	};
 
Signature · 1 line
2.27.0