Skip to contentSkip to conversation

rockchip: Add support for onboard eMMC on Radxa E20C

PATCH Applied Jonas Karlman 5 participants 10 messages Mar 5, 2025 – Mar 12, 2025

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

cover rockchip: Add support for onboard eMMC on Radxa E20C

The Radxa E20C may come with an onboard eMMC (8GB / 16GB / 32GB / 64GB).

This series add dt-binding and SoC DT node for the SDHCI controller and enable use of the SDCHI controller on the Radxa E20C.

This series add support for the onboard eMMC on Radxa E20C.

Driver changes to use different delay and tap num is needed to be able to support HS400 modes, something for a future series. With this HS200 mode should work:

mmc0: SDHCI controller on ffbf0000.mmc [ffbf0000.mmc] using ADMA
mmc0: new HS200 MMC card at address 0001
mmcblk0: mmc0:0001 TLi16G 14.7 GiB
mmcblk0: p1 p2 p3
mmcblk0boot0: mmc0:0001 TLi16G 4.00 MiB
mmcblk0boot1: mmc0:0001 TLi16G 4.00 MiB
mmcblk0rpmb: mmc0:0001 TLi16G 4.00 MiB, chardev (499:0)

~ # cat /sys/kernel/debug/mmc0/ios

  clock:          200000000 Hz
  actual clock:   198000000 Hz
  vdd:            21 (3.3 ~ 3.4V)
  bus mode:       2 (push-pull)
  chip select:    0 (don't care)
  power mode:     2 (on)
  bus width:      3 (8bits)
  timing spec:    9 (mmc HS200)

signal voltage: 1 (1.80 V)
driver type: 0 (driver type B)

~ # hdparm -t /dev/mmcblk0p1
/dev/mmcblk0p1:
Timing buffered disk reads: 64 MB in 0.37 seconds = 173154 kB/s

This series depends on v2 of the "Support SD/SDIO controllers on RK3528" series for a clean apply.

Jonas Karlman (3):
dt-bindings: mmc: sdhci-of-dwcmhsc: Add compatible string for RK3528
arm64: dts: rockchip: Add SDHCI controller for RK3528
arm64: dts: rockchip: Enable onboard eMMC on Radxa E20C

 .../bindings/mmc/snps,dwcmshc-sdhci.yaml      |  4 +++-
 .../boot/dts/rockchip/rk3528-radxa-e20c.dts   | 12 ++++++++++
 arch/arm64/boot/dts/rockchip/rk3528.dtsi      | 24 +++++++++++++++++++
 3 files changed, 39 insertions(+), 1 deletion(-)
Signature · 1 line
2.48.1
#1 lore raw

PATCH 1/3 dt-bindings: mmc: sdhci-of-dwcmhsc: Add compatible string for RK3528

The SDHCI controller in Rockchip RK3528 is similar to the one included in RK3588.

Add compatible string for the SDHCI controller in RK3528.

---
 Documentation/devicetree/bindings/mmc/snps,dwcmshc-sdhci.yaml | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/mmc/snps,dwcmshc-sdhci.yaml +3 -1
index c3d5e0230af1..fb2115e805f5 100644
@@ -14,7 +14,9 @@ properties:
   compatible:
     oneOf:
       - items:
-          - const: rockchip,rk3576-dwcmshc
+          - enum:
+              - rockchip,rk3528-dwcmshc
+              - rockchip,rk3576-dwcmshc
           - const: rockchip,rk3588-dwcmshc
       - enum:
           - rockchip,rk3568-dwcmshc
Signature · 1 line
2.48.1
Acked-by on v1 1/3
#2 lore raw

Re: [PATCH 1/3] dt-bindings: mmc: sdhci-of-dwcmhsc: Add compatible string for RK3528

Quoted 7 lines · Jonas Karlman

The SDHCI controller in Rockchip RK3528 is similar to the one included in RK3588.

Add compatible string for the SDHCI controller in RK3528.

---

No power domains here? Post complete support, so this won't have to be changed in near future.

Best regards,
Krzysztof

#3 lore raw

Re: [PATCH 1/3] dt-bindings: mmc: sdhci-of-dwcmhsc: Add compatible string for RK3528

Hi Krzysztof,

Quoted 11 lines · Krzysztof Kozlowski
Quoted 7 lines · Jonas Karlman

The SDHCI controller in Rockchip RK3528 is similar to the one included in RK3588.

Add compatible string for the SDHCI controller in RK3528.

---

No power domains here? Post complete support, so this won't have to be changed in near future.

To my knowledge this should be complete support. However, there are some rx/tx tap num and strobe delay num configuration that needs to be tuned to fully support the faster HS400/HS400ES transfer modes.

For that we could need something like the PHY output/input tap delays described in mmc/sdhci-am654.yaml. Still unclear to me if the different delayed used by vendor driver is SoC specific and can live in driver or if they instead are reference board specific and could be part of the device tree.

Regards,
Jonas

Quoted 6 lines

Best regards,
Krzysztof

#4 lore raw

Re: [PATCH 1/3] dt-bindings: mmc: sdhci-of-dwcmhsc: Add compatible string for RK3528

In reply to Jonas Karlman
Quoted 7 lines · Jonas Karlman

The SDHCI controller in Rockchip RK3528 is similar to the one included in RK3588.

Add compatible string for the SDHCI controller in RK3528.

Applied for next, thanks!

Kind regards
Uffe

Quoted 22 lines
---
 Documentation/devicetree/bindings/mmc/snps,dwcmshc-sdhci.yaml | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/mmc/snps,dwcmshc-sdhci.yaml +3 -2
index c3d5e0230af1..fb2115e805f5 100644
@@ -14,7 +14,9 @@ properties:
   compatible:
     oneOf:
       - items:
-          - const: rockchip,rk3576-dwcmshc
+          - enum:
+              - rockchip,rk3528-dwcmshc
+              - rockchip,rk3576-dwcmshc
           - const: rockchip,rk3588-dwcmshc
       - enum:
           - rockchip,rk3568-dwcmshc
--

2.48.1

#5 lore raw

PATCH 2/3 arm64: dts: rockchip: Add SDHCI controller for RK3528

In reply to Jonas Karlman

The SDHCI controller in Rockchip RK3528 is similar to the one included in RK3588.

Add device tree node for the SDHCI controller in RK3528.

---
 arch/arm64/boot/dts/rockchip/rk3528.dtsi | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)
arch/arm64/boot/dts/rockchip/rk3528.dtsi +24 -0
index 363023314e9c..c1a71ea81e03 100644
@@ -286,6 +286,30 @@ saradc: adc@ffae0000 {
 			#io-channel-cells = <1>;
 		};
 
+		sdhci: mmc@ffbf0000 {
+			compatible = "rockchip,rk3528-dwcmshc",
+				     "rockchip,rk3588-dwcmshc";
+			reg = <0x0 0xffbf0000 0x0 0x10000>;
+			assigned-clocks = <&cru BCLK_EMMC>, <&cru TCLK_EMMC>,
+					  <&cru CCLK_SRC_EMMC>;
+			assigned-clock-rates = <200000000>, <24000000>,
+					       <200000000>;
+			clocks = <&cru CCLK_SRC_EMMC>, <&cru HCLK_EMMC>,
+				 <&cru ACLK_EMMC>, <&cru BCLK_EMMC>,
+				 <&cru TCLK_EMMC>;
+			clock-names = "core", "bus", "axi", "block", "timer";
+			interrupts = <GIC_SPI 136 IRQ_TYPE_LEVEL_HIGH>;
+			max-frequency = <200000000>;
+			pinctrl-names = "default";
+			pinctrl-0 = <&emmc_bus8>, <&emmc_clk>, <&emmc_cmd>,
+				    <&emmc_strb>;
+			resets = <&cru SRST_C_EMMC>, <&cru SRST_H_EMMC>,
+				 <&cru SRST_A_EMMC>, <&cru SRST_B_EMMC>,
+				 <&cru SRST_T_EMMC>;
+			reset-names = "core", "bus", "axi", "block", "timer";
+			status = "disabled";
+		};
+
 		sdio0: mmc@ffc10000 {
 			compatible = "rockchip,rk3528-dw-mshc",
 				     "rockchip,rk3288-dw-mshc";
Signature · 1 line
2.48.1
#6 lore raw

PATCH 3/3 arm64: dts: rockchip: Enable onboard eMMC on Radxa E20C

In reply to Jonas Karlman

The Radxa E20C may come with an onboard eMMC (8GB / 16GB / 32GB / 64GB).

Enable support for the onboard eMMC on Radxa E20C.

---
 arch/arm64/boot/dts/rockchip/rk3528-radxa-e20c.dts | 12 ++++++++++++
 1 file changed, 12 insertions(+)
arch/arm64/boot/dts/rockchip/rk3528-radxa-e20c.dts +12 -0
index a52a7924bb75..a511e2a2d4a5 100644
@@ -16,6 +16,7 @@ / {
 	compatible = "radxa,e20c", "rockchip,rk3528";
 
 	aliases {
+		mmc0 = &sdhci;
 		mmc1 = &sdmmc;
 	};
 
@@ -155,6 +156,17 @@ &saradc {
 	status = "okay";
 };
 
+&sdhci {
+	bus-width = <8>;
+	cap-mmc-highspeed;
+	no-sd;
+	no-sdio;
+	non-removable;
+	vmmc-supply = <&vcc_3v3>;
+	vqmmc-supply = <&vcc_1v8>;
+	status = "okay";
+};
+
 &sdmmc {
 	bus-width = <4>;
 	cap-mmc-highspeed;
Signature · 1 line
2.48.1
#7 lore raw
In reply to Jonas Karlman

Hi,

Quoted 3 lines

Driver changes to use different delay and tap num is needed to be able to support HS400 modes, something for a future series. With this HS200 mode should work:

I have tried HS200 mode on other rk3528 boards and it works fine, so can we enable HS200 mode for Radxa E20C first?

Thanks,
Chukun

Signature · 1 line
2.25.1
#8 lore raw

Hi Chukun,

Quoted 8 lines · Chukun Pan

Hi,

Quoted 3 lines

Driver changes to use different delay and tap num is needed to be able to support HS400 modes, something for a future series. With this HS200 mode should work:

I have tried HS200 mode on other rk3528 boards and it works fine, so can we enable HS200 mode for Radxa E20C first?

The host controller already report the HS200 mode, and as shown in cover letter HS200 mode is being enabled/used with this series.

However, the driver must use different tap/delay num for HS400(ES) modes. At top of [1] there is a commit that changes to use same tap/delay num as vendor kernel and what I have tested worked in U-Boot. That commit needs to be re-worked before it is ready. Also see [2] for pending work before I plan to complete before moving on to the dwcmshc driver.

[1] https://github.com/Kwiboo/linux-rockchip/commits/next-20250227-rk3528-rk3506/
[2] https://github.com/Kwiboo/linux-rockchip/commits/next-20250305-rk3528/

Regards,
Jonas

Quoted 4 lines

Thanks,
Chukun

maintainer Applied
#9 lore raw

Re: (subset) [PATCH 0/3] rockchip: Add support for onboard eMMC on Radxa E20C

In reply to Jonas Karlman
Quoted 8 lines · Jonas Karlman

The Radxa E20C may come with an onboard eMMC (8GB / 16GB / 32GB / 64GB).

This series add dt-binding and SoC DT node for the SDHCI controller and enable use of the SDCHI controller on the Radxa E20C.

This series add support for the onboard eMMC on Radxa E20C.

[...]

Applied, thanks!

[2/3] arm64: dts: rockchip: Add SDHCI controller for RK3528

      commit: d62917b63e9f2c876bd9abf019a25313bd9cbc07
[3/3] arm64: dts: rockchip: Enable onboard eMMC on Radxa E20C
      commit: f25c3b93f50387849db692891e2b2c6f9cc7d055

Best regards,

Signature · 1 line
Heiko Stuebner <[email protected]>