Skip to contentSkip to conversation

arm64: dts: rockchip: NanoPi R2S Plus: fix io-domains, enable SDIO Wi-Fi

PATCH Superseded Deomid rojer Ryabkov 3 participants 7 messages Oct 24 – Oct 31

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover arm64: dts: rockchip: NanoPi R2S Plus: fix io-domains, enable SDIO Wi-Fi

Patch 1 fixes the VCCIO4/VCCIO6 supplies of the NanoPi R2S Plus, which were inherited from the NanoPi R2S but are wired differently (see the schematics referenced in the patch).

Patch 2 enables the M.2 E-key SDIO slot, which FriendlyElec populates with an optional RTL8822CS (Fn-Link 6222B-SRC) Wi-Fi module.

With these the module works at 50 MHz high-speed. Reaching SDR104 needs an mmc core fix for the module's CMD11 handling, posted to linux-mmc:
https://lore.kernel.org/linux-mmc/[email protected]/

Tested on a NanoPi R2S Plus; dtbs_check reports no new warnings.

Deomid rojer Ryabkov (2):
arm64: dts: rockchip: Fix VCCIO4/VCCIO6 supplies on NanoPi R2S Plus
arm64: dts: rockchip: Enable SDIO Wi-Fi on NanoPi R2S Plus

 .../dts/rockchip/rk3328-nanopi-r2s-plus.dts   | 61 +++++++++++++++++++
 1 file changed, 61 insertions(+)
Signature · 1 line
2.53.0
#1 lore raw

PATCH 1/2 arm64: dts: rockchip: Fix VCCIO4/VCCIO6 supplies on NanoPi R2S Plus

The NanoPi R2S Plus inherits its io-domain supplies from the NanoPi R2S, but the two boards are wired differently. From sheet 6 of the schematics:

NanoPi R2S (NanoPi-R2S-V1.1-2009-Schematic.pdf):
VCCIO4 (U12) = VDD_PHY_IO
VCCIO6 (H6) = VCC_IO_33

NanoPi R2S Plus (NanoPi_R2S_Plus_2309_SCH.PDF):
VCCIO4 (U12) = VCC_IO_33
VCCIO6 (H6) = VCC_18

rk3328-nanopi-r2.dtsi describes the R2S. On the R2S Plus this leaves the VCCIO4 domain configured for 1.8V while supplied with 3.3V, and the VCCIO6 domain, which carries the M.2 E-key SDIO signals, configured for 3.3V while supplied with 1.8V; the latter prevents the optional RTL8822CS Wi-Fi module from initialising at all.

Describe the actual supplies. The vendor's own kernel uses the same values [1], although there they come from a .dtsi shared by the whole NanoPi R2 family, so the schematics above are the reference. Tested on an R2S Plus: Ethernet still links at 1Gbps and the SDIO Wi-Fi module enumerates.

[1] https://github.com/friendlyarm/kernel-rockchip/blob/9238df9d21e835bba35c8ba5248784387936cb2e/arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2-common.dtsi#L425-L435

Fixes b8c028782922 ("arm64: dts: rockchip: Add DTS for FriendlyARM NanoPi R2S Plus")
---
 arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s-plus.dts | 5 +++++
 1 file changed, 5 insertions(+)
arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s-plus.dts +5 -0
index 4eff0503928..6ba4a74cb1f 100644
@@ -29,3 +29,8 @@ &emmc {
 	pinctrl-0 = <&emmc_clk &emmc_cmd &emmc_bus8>;
 	status = "okay";
 };
+
+&io_domains {
+	vccio4-supply = <&vcc_io_33>;
+	vccio6-supply = <&vcc_18>;
+};
Signature · 1 line
2.53.0
#2 lore raw

PATCH 2/2 arm64: dts: rockchip: Enable SDIO Wi-Fi on NanoPi R2S Plus

In reply to Deomid rojer Ryabkov

The NanoPi R2S Plus has an M.2 E-key slot wired to the sdmmc_ext controller in 4-bit SDIO mode, where FriendlyElec fit an optional Fn-Link 6222B-SRC (Realtek RTL8822CS) module:

- SDIO signalling at a fixed 1.8V (VCC_18)
- WIFI_REG_ON on GPIO3_B0, 32kHz sleep clock from the RK805 CLKOUT2

Enable the controller and add the power sequence. The SDIO pins need 8mA drive strength for SDR104 tuning to succeed, as in the vendor device tree [1]; with the SoC default of 4mA no sample phase works.

On boards without the module the controller gives up after about 0.2s ("mmc2: Failed to initialize a non-removable card"); nothing else is affected.

With the mmc core change for the module's CMD11 handling at a fixed 1.8V [2], the module is tuned to SDR104 at 150 MHz and works with the rtw88_8822cs driver; without it, it runs in high-speed mode at 50 MHz.

[1] https://github.com/friendlyarm/kernel-rockchip/blob/9238df9d21e835bba35c8ba5248784387936cb2e/arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2-rev24.dts#L144-L172
[2] https://lore.kernel.org/linux-mmc/[email protected]/

---
 .../dts/rockchip/rk3328-nanopi-r2s-plus.dts   | 56 +++++++++++++++++++
 1 file changed, 56 insertions(+)
arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s-plus.dts +56 -0
index 6ba4a74cb1f..db19a18ae45 100644
@@ -17,6 +17,15 @@ / {
 	aliases {
 		mmc1 = &emmc;
 	};
+
+	sdio_pwrseq: sdio-pwrseq {
+		compatible = "mmc-pwrseq-simple";
+		clocks = <&rk805 1>;
+		clock-names = "ext_clock";
+		pinctrl-names = "default";
+		pinctrl-0 = <&wifi_reg_on_h>;
+		reset-gpios = <&gpio3 RK_PB0 GPIO_ACTIVE_LOW>;
+	};
 };
 
 &emmc {
@@ -34,3 +43,50 @@ &io_domains {
 	vccio4-supply = <&vcc_io_33>;
 	vccio6-supply = <&vcc_18>;
 };
+
+&pinctrl {
+	wifi {
+		wifi_reg_on_h: wifi-reg-on-h {
+			rockchip,pins = <3 RK_PB0 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
+	};
+};
+
+/*
+ * SDR104 tuning fails with the default 4mA drive strength, use 8mA like the
+ * vendor device tree.
+ */
+&sdmmc0ext_bus4 {
+	rockchip,pins =
+		<3 RK_PA4 3 &pcfg_pull_up_8ma>,
+		<3 RK_PA5 3 &pcfg_pull_up_8ma>,
+		<3 RK_PA6 3 &pcfg_pull_up_8ma>,
+		<3 RK_PA7 3 &pcfg_pull_up_8ma>;
+};
+
+&sdmmc0ext_clk {
+	rockchip,pins = <3 RK_PA2 3 &pcfg_pull_none_8ma>;
+};
+
+&sdmmc0ext_cmd {
+	rockchip,pins = <3 RK_PA0 3 &pcfg_pull_up_8ma>;
+};
+
+/* Optional M.2 E-key SDIO Wi-Fi module (Fn-Link 6222B-SRC, RTL8822CS) */
+&sdmmc_ext {
+	bus-width = <4>;
+	cap-sd-highspeed;
+	cap-sdio-irq;
+	disable-wp;
+	keep-power-in-suspend;
+	mmc-pwrseq = <&sdio_pwrseq>;
+	no-mmc;
+	no-sd;
+	non-removable;
+	pinctrl-names = "default";
+	pinctrl-0 = <&sdmmc0ext_clk &sdmmc0ext_cmd &sdmmc0ext_bus4>;
+	sd-uhs-sdr104;
+	vmmc-supply = <&vcc_io_33>;
+	vqmmc-supply = <&vcc_18>;
+	status = "okay";
+};
Signature · 1 line
2.53.0
Reviewed-by on v1 2/2
#3 lore raw

Re: [PATCH 2/2] arm64: dts: rockchip: Enable SDIO Wi-Fi on NanoPi R2S Plus

Hi Deomid

Quoted 75 lines · Deomid rojer Ryabkov

The NanoPi R2S Plus has an M.2 E-key slot wired to the sdmmc_ext controller in 4-bit SDIO mode, where FriendlyElec fit an optional Fn-Link 6222B-SRC (Realtek RTL8822CS) module:

- SDIO signalling at a fixed 1.8V (VCC_18)
- WIFI_REG_ON on GPIO3_B0, 32kHz sleep clock from the RK805 CLKOUT2

Enable the controller and add the power sequence. The SDIO pins need 8mA drive strength for SDR104 tuning to succeed, as in the vendor device tree [1]; with the SoC default of 4mA no sample phase works.

On boards without the module the controller gives up after about 0.2s ("mmc2: Failed to initialize a non-removable card"); nothing else is affected.

With the mmc core change for the module's CMD11 handling at a fixed 1.8V [2], the module is tuned to SDR104 at 150 MHz and works with the rtw88_8822cs driver; without it, it runs in high-speed mode at 50 MHz.

[1] https://github.com/friendlyarm/kernel-rockchip/blob/9238df9d21e835bba35c8ba5248784387936cb2e/arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2-rev24.dts#L144-L172
[2] https://lore.kernel.org/linux-mmc/[email protected]/

---
  .../dts/rockchip/rk3328-nanopi-r2s-plus.dts   | 56 +++++++++++++++++++
  1 file changed, 56 insertions(+)
arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s-plus.dts +34 -0
index 6ba4a74cb1f..db19a18ae45 100644
@@ -17,6 +17,15 @@ / {
  	aliases {
  		mmc1 = &emmc;
  	};
+
+	sdio_pwrseq: sdio-pwrseq {
+		compatible = "mmc-pwrseq-simple";
+		clocks = <&rk805 1>;
+		clock-names = "ext_clock";
+		pinctrl-names = "default";
+		pinctrl-0 = <&wifi_reg_on_h>;
+		reset-gpios = <&gpio3 RK_PB0 GPIO_ACTIVE_LOW>;
+	};
  };
 
  &emmc {
@@ -34,3 +43,50 @@ &io_domains {
  	vccio4-supply = <&vcc_io_33>;
  	vccio6-supply = <&vcc_18>;
  };
+
+&pinctrl {
+	wifi {
+		wifi_reg_on_h: wifi-reg-on-h {
+			rockchip,pins = <3 RK_PB0 RK_FUNC_GPIO &pcfg_pull_none>;
+		};
+	};
+};
+
+/*
+ * SDR104 tuning fails with the default 4mA drive strength, use 8mA like the
+ * vendor device tree.
+ */
+&sdmmc0ext_bus4 {
+	rockchip,pins =
+		<3 RK_PA4 3 &pcfg_pull_up_8ma>,
+		<3 RK_PA5 3 &pcfg_pull_up_8ma>,
+		<3 RK_PA6 3 &pcfg_pull_up_8ma>,
+		<3 RK_PA7 3 &pcfg_pull_up_8ma>;
+};
+
+&sdmmc0ext_clk {
+	rockchip,pins = <3 RK_PA2 3 &pcfg_pull_none_8ma>;
+};
+

arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s-plus.dts &io_domains { · line 80

Quoted 10 lines
arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s-plus.dts +10 -0
+&sdmmc0ext_cmd {
+	rockchip,pins = <3 RK_PA0 3 &pcfg_pull_up_8ma>;
+};
+
+/* Optional M.2 E-key SDIO Wi-Fi module (Fn-Link 6222B-SRC, RTL8822CS) */
+&sdmmc_ext {
+	bus-width = <4>;
+	cap-sd-highspeed;
+	cap-sdio-irq;
+	disable-wp;

Drop disable-wp.

Otherwise,

Quoted 12 lines
arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s-plus.dts +12 -0
+	keep-power-in-suspend;
+	mmc-pwrseq = <&sdio_pwrseq>;
+	no-mmc;
+	no-sd;
+	non-removable;
+	pinctrl-names = "default";
+	pinctrl-0 = <&sdmmc0ext_clk &sdmmc0ext_cmd &sdmmc0ext_bus4>;
+	sd-uhs-sdr104;
+	vmmc-supply = <&vcc_io_33>;
+	vqmmc-supply = <&vcc_18>;
+	status = "okay";
+};
#4 lore raw

Re: [PATCH 2/2] arm64: dts: rockchip: Enable SDIO Wi-Fi on NanoPi R2S Plus

Hi Shawn,

agreed, it makes no sense here. will drop in v2, holding on for feedback on patch 1.

Quoted 109 lines · Shawn Lin

Hi Deomid

Quoted 75 lines · Deomid rojer Ryabkov

The NanoPi R2S Plus has an M.2 E-key slot wired to the sdmmc_ext controller in 4-bit SDIO mode, where FriendlyElec fit an optional Fn-Link 6222B-SRC (Realtek RTL8822CS) module:

- SDIO signalling at a fixed 1.8V (VCC_18)
- WIFI_REG_ON on GPIO3_B0, 32kHz sleep clock from the RK805 CLKOUT2

Enable the controller and add the power sequence. The SDIO pins need 8mA drive strength for SDR104 tuning to succeed, as in the vendor device tree [1]; with the SoC default of 4mA no sample phase works.

On boards without the module the controller gives up after about 0.2s ("mmc2: Failed to initialize a non-removable card"); nothing else is affected.

With the mmc core change for the module's CMD11 handling at a fixed 1.8V [2], the module is tuned to SDR104 at 150 MHz and works with the rtw88_8822cs driver; without it, it runs in high-speed mode at 50 MHz.

[1] https://github.com/friendlyarm/kernel-rockchip/blob/9238df9d21e835bba35c8ba5248784387936cb2e/arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2-rev24.dts#L144-L172
[2] https://lore.kernel.org/linux-mmc/[email protected]/

---
  .../dts/rockchip/rk3328-nanopi-r2s-plus.dts   | 56 +++++++++++++++++++
  1 file changed, 56 insertions(+)
arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s-plus.dts +34 -0
index 6ba4a74cb1f..db19a18ae45 100644
@@ -17,6 +17,15 @@ / {
      aliases {
              mmc1 = &emmc;
      };
+
+     sdio_pwrseq: sdio-pwrseq {
+             compatible = "mmc-pwrseq-simple";
+             clocks = <&rk805 1>;
+             clock-names = "ext_clock";
+             pinctrl-names = "default";
+             pinctrl-0 = <&wifi_reg_on_h>;
+             reset-gpios = <&gpio3 RK_PB0 GPIO_ACTIVE_LOW>;
+     };
  };
 
  &emmc {
@@ -34,3 +43,50 @@ &io_domains {
      vccio4-supply = <&vcc_io_33>;
      vccio6-supply = <&vcc_18>;
  };
+
+&pinctrl {
+     wifi {
+             wifi_reg_on_h: wifi-reg-on-h {
+                     rockchip,pins = <3 RK_PB0 RK_FUNC_GPIO &pcfg_pull_none>;
+             };
+     };
+};
+
+/*
+ * SDR104 tuning fails with the default 4mA drive strength, use 8mA like the
+ * vendor device tree.
+ */
+&sdmmc0ext_bus4 {
+     rockchip,pins =
+             <3 RK_PA4 3 &pcfg_pull_up_8ma>,
+             <3 RK_PA5 3 &pcfg_pull_up_8ma>,
+             <3 RK_PA6 3 &pcfg_pull_up_8ma>,
+             <3 RK_PA7 3 &pcfg_pull_up_8ma>;
+};
+
+&sdmmc0ext_clk {
+     rockchip,pins = <3 RK_PA2 3 &pcfg_pull_none_8ma>;
+};
+

arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s-plus.dts &io_domains { · line 80

Quoted 10 lines
arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s-plus.dts +10 -0
+&sdmmc0ext_cmd {
+     rockchip,pins = <3 RK_PA0 3 &pcfg_pull_up_8ma>;
+};
+
+/* Optional M.2 E-key SDIO Wi-Fi module (Fn-Link 6222B-SRC, RTL8822CS) */
+&sdmmc_ext {
+     bus-width = <4>;
+     cap-sd-highspeed;
+     cap-sdio-irq;
+     disable-wp;

Drop disable-wp.

Otherwise,

Quoted 12 lines
arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s-plus.dts +12 -0
+     keep-power-in-suspend;
+     mmc-pwrseq = <&sdio_pwrseq>;
+     no-mmc;
+     no-sd;
+     non-removable;
+     pinctrl-names = "default";
+     pinctrl-0 = <&sdmmc0ext_clk &sdmmc0ext_cmd &sdmmc0ext_bus4>;
+     sd-uhs-sdr104;
+     vmmc-supply = <&vcc_io_33>;
+     vqmmc-supply = <&vcc_18>;
+     status = "okay";
+};
Signature · 2 lines
Deomid "rojer" Ryabkov
[email protected]
maintainer
#5 lore raw

Re: [PATCH 2/2] arm64: dts: rockchip: Enable SDIO Wi-Fi on NanoPi R2S Plus

Hi Deomid,

Am Dienstag, 27. Oktober 2026, 23:10:31 Mitteleuropäische Normalzeit schrieb Deomid "rojer" Ryabkov:

Quoted 4 lines

Hi Shawn,

agreed, it makes no sense here. will drop in v2, holding on for feedback on patch 1.

No direct clue about the board itself, but I assume the schematics should be correct then?

So no change needed there and just send your v2, I guess :-)

Heiko

#6 lore raw

Re: [PATCH 2/2] arm64: dts: rockchip: Enable SDIO Wi-Fi on NanoPi R2S Plus

yes, i double-checked the schematics and this is indeed a difference between the R2S and R2S Plus, the change is necessary to make the wifi card work.
sending v2

Quoted 18 lines · Heiko Stuebner

Hi Deomid,

Am Dienstag, 27. Oktober 2026, 23:10:31 Mitteleuropäische Normalzeit schrieb Deomid "rojer" Ryabkov:

Quoted 4 lines

Hi Shawn,

agreed, it makes no sense here. will drop in v2, holding on for feedback on patch 1.

No direct clue about the board itself, but I assume the schematics should be correct then?

So no change needed there and just send your v2, I guess :-)

Heiko

Signature · 2 lines
Deomid "rojer" Ryabkov
[email protected]