Skip to content

Commit 5541888

Browse files
committed
nanopi-m5: add kernel DT patches (current/edge/bleedingedge)
Replaces checked-in DTS copies with branch-specific patches against upstream. Enables RTL8822CS Wi-Fi, Bluetooth, GMAC RGMII delays, ADC back button, UART3/UART8. 6.18 also enables &ufshc + regulators.
1 parent 8354aea commit 5541888

6 files changed

Lines changed: 572 additions & 3402 deletions

File tree

Lines changed: 216 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,216 @@
1+
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2+
From: SuperKali <hello@superkali.me>
3+
Date: Fri, 8 May 2026 09:00:00 +0200
4+
Subject: arm64: dts: rockchip: Complete NanoPi M5 board description (6.18)
5+
6+
The mainline rk3576-nanopi-m5.dts in 6.18 is a minimal first-cut that
7+
omits several on-board peripherals described in the FriendlyElec
8+
schematics. Fill in the gaps:
9+
10+
- UFS: enable the on-board UFS controller (ufshc @ 0x2a2d0000) by
11+
declaring the vccq / vccq2 fixed regulators (1v2 and 1v8 from
12+
vcc5v0_sys_s5 and vcc_1v8_s3 respectively) and wiring the four
13+
UFS supplies on &ufshc. The driver and SoC binding (rockchip,
14+
rk3576-ufshc) already ship in 6.18; only the board opt-in was
15+
missing.
16+
17+
- Wi-Fi: enable the SDIO host (sdio @ 0x2a320000) for the optional
18+
M.2 RTL8822CS module, with mmc-pwrseq-simple toggling GPIO1_C2 to
19+
power-cycle the chip on probe.
20+
21+
- Bluetooth: enable UART5 with hardware flow control and expose the
22+
BT_REG_ON / BT_HOST_WAKE / BT_DEV_WAKE lines via a
23+
"realtek,rtl8822cs-bt" child node.
24+
25+
- Pinctrl: add the matching wireless-bluetooth and wireless-wlan
26+
groups for uart5_gpios / wifi_host_wake_irq / wifi_poweren_gpio.
27+
28+
- GMAC: set RGMII tx_delay / rx_delay to the values used by the
29+
FriendlyElec vendor kernel (0x21/0x3f on gmac0, 0x20/0x3f on
30+
gmac1). Without these the rockchip dwmac glue logs:
31+
32+
rk_gmac-dwmac 2a230000.ethernet: Can not read property: tx_delay.
33+
rk_gmac-dwmac 2a230000.ethernet: set tx_delay to 0x30
34+
rk_gmac-dwmac 2a230000.ethernet: Can not read property: rx_delay.
35+
rk_gmac-dwmac 2a230000.ethernet: set rx_delay to 0x10
36+
37+
and falls back to defaults that do not match the trace lengths to
38+
the on-board RTL8211F PHYs.
39+
40+
- ADC keys: add the saradc back button on saradc channel 0
41+
(~17 mV press threshold) so the BACK key on the carrier works.
42+
43+
- UART3 / UART8: enable the auxiliary UARTs exposed on the GPIO
44+
header (uart3m0_xfer / uart8m1_xfer pinmuxes) for users wiring up
45+
sensors, GPS, etc.
46+
47+
Signed-off-by: SuperKali <hello@superkali.me>
48+
---
49+
arch/arm64/boot/dts/rockchip/rk3576-nanopi-m5.dts | 109 ++++++++++
50+
1 file changed, 109 insertions(+)
51+
52+
diff --git a/arch/arm64/boot/dts/rockchip/rk3576-nanopi-m5.dts b/arch/arm64/boot/dts/rockchip/rk3576-nanopi-m5.dts
53+
index 111111111111..222222222222 100644
54+
--- a/arch/arm64/boot/dts/rockchip/rk3576-nanopi-m5.dts
55+
+++ b/arch/arm64/boot/dts/rockchip/rk3576-nanopi-m5.dts
56+
@@ -110,6 +110,22 @@ vcc12v_dcin: regulator-vcc12v-dcin {
57+
regulator-name = "vcc12v_dcin";
58+
};
59+
60+
+ vcc1v2_ufs_vccq: regulator-vcc1v2-ufs-vccq {
61+
+ compatible = "regulator-fixed";
62+
+ regulator-min-microvolt = <1200000>;
63+
+ regulator-max-microvolt = <1200000>;
64+
+ regulator-name = "vcc1v2_ufs_vccq";
65+
+ vin-supply = <&vcc5v0_sys_s5>;
66+
+ };
67+
+
68+
+ vcc1v8_ufs_vccq2: regulator-vcc1v8-ufs-vccq2 {
69+
+ compatible = "regulator-fixed";
70+
+ regulator-min-microvolt = <1800000>;
71+
+ regulator-max-microvolt = <1800000>;
72+
+ regulator-name = "vcc1v8_ufs_vccq2";
73+
+ vin-supply = <&vcc_1v8_s3>;
74+
+ };
75+
+
76+
vcc3v3_m2_keym: regulator-vcc3v3-m2-keym {
77+
compatible = "regulator-fixed";
78+
enable-active-high;
79+
@@ -196,6 +212,28 @@ vcc_3v3_s0: regulator-vcc-3v3-s0 {
80+
vin-supply = <&vcc_3v3_s3>;
81+
};
82+
83+
+ saradc_keys: adc-keys {
84+
+ compatible = "adc-keys";
85+
+ io-channels = <&saradc 0>;
86+
+ io-channel-names = "buttons";
87+
+ keyup-threshold-microvolt = <1800000>;
88+
+ poll-interval = <100>;
89+
+
90+
+ button-back {
91+
+ label = "back";
92+
+ linux,code = <KEY_BACK>;
93+
+ press-threshold-microvolt = <17000>;
94+
+ };
95+
+ };
96+
+
97+
+ sdio_pwrseq: sdio-pwrseq {
98+
+ compatible = "mmc-pwrseq-simple";
99+
+ pinctrl-names = "default";
100+
+ pinctrl-0 = <&wifi_poweren_gpio>;
101+
+ post-power-on-delay-ms = <200>;
102+
+ reset-gpios = <&gpio1 RK_PC2 GPIO_ACTIVE_LOW>;
103+
+ };
104+
+
105+
sound {
106+
compatible = "simple-audio-card";
107+
pinctrl-names = "default";
108+
@@ -288,6 +326,8 @@ &gmac0 {
109+
<&eth0m0_rx_bus2>,
110+
<&eth0m0_rgmii_clk>,
111+
<&eth0m0_rgmii_bus>;
112+
+ tx_delay = <0x21>;
113+
+ rx_delay = <0x3f>;
114+
status = "okay";
115+
};
116+
117+
@@ -302,6 +342,8 @@ &gmac1 {
118+
<&eth1m0_rx_bus2>,
119+
<&eth1m0_rgmii_clk>,
120+
<&eth1m0_rgmii_bus>;
121+
+ tx_delay = <0x20>;
122+
+ rx_delay = <0x3f>;
123+
status = "okay";
124+
};
125+
126+
@@ -846,6 +888,22 @@ usb_otg0_pwren_h: usb-otg0-pwren-h {
127+
rockchip,pins = <0 RK_PD1 RK_FUNC_GPIO &pcfg_pull_none>;
128+
};
129+
};
130+
+
131+
+ wireless-bluetooth {
132+
+ uart5_gpios: uart5-gpios {
133+
+ rockchip,pins = <3 RK_PD6 RK_FUNC_GPIO &pcfg_pull_none>;
134+
+ };
135+
+ };
136+
+
137+
+ wireless-wlan {
138+
+ wifi_host_wake_irq: wifi-host-wake-irq {
139+
+ rockchip,pins = <0 RK_PB0 RK_FUNC_GPIO &pcfg_pull_down>;
140+
+ };
141+
+
142+
+ wifi_poweren_gpio: wifi-poweren-gpio {
143+
+ rockchip,pins = <1 RK_PC2 RK_FUNC_GPIO &pcfg_pull_up>;
144+
+ };
145+
+ };
146+
};
147+
148+
&sai2 {
149+
@@ -857,6 +915,24 @@ &saradc {
150+
status = "okay";
151+
};
152+
153+
+&sdio {
154+
+ bus-width = <4>;
155+
+ cap-sdio-irq;
156+
+ keep-power-in-suspend;
157+
+ max-frequency = <200000000>;
158+
+ mmc-pwrseq = <&sdio_pwrseq>;
159+
+ no-mmc;
160+
+ no-sd;
161+
+ non-removable;
162+
+ pinctrl-names = "default";
163+
+ pinctrl-0 = <&sdmmc1m0_bus4>, <&sdmmc1m0_clk>, <&sdmmc1m0_cmd>;
164+
+ sd-uhs-sdr104;
165+
+ vmmc-supply = <&vcc_3v3_s3>;
166+
+ vqmmc-supply = <&vcc_1v8_s3>;
167+
+ wakeup-source;
168+
+ status = "okay";
169+
+};
170+
+
171+
&sdmmc {
172+
bus-width = <4>;
173+
cap-mmc-highspeed;
174+
@@ -910,6 +986,39 @@ &uart0 {
175+
status = "okay";
176+
};
177+
178+
+&uart3 {
179+
+ pinctrl-names = "default";
180+
+ pinctrl-0 = <&uart3m0_xfer>;
181+
+ status = "okay";
182+
+};
183+
+
184+
+&uart5 {
185+
+ pinctrl-names = "default";
186+
+ pinctrl-0 = <&uart5m0_xfer>, <&uart5m0_ctsn>, <&uart5m0_rtsn>;
187+
+ status = "okay";
188+
+
189+
+ bluetooth {
190+
+ compatible = "realtek,rtl8822cs-bt";
191+
+ device-wake-gpios = <&gpio3 RK_PD0 GPIO_ACTIVE_HIGH>;
192+
+ enable-gpios = <&gpio3 RK_PC7 GPIO_ACTIVE_HIGH>;
193+
+ host-wake-gpios = <&gpio0 RK_PB1 GPIO_ACTIVE_HIGH>;
194+
+ };
195+
+};
196+
+
197+
+&uart8 {
198+
+ pinctrl-names = "default";
199+
+ pinctrl-0 = <&uart8m1_xfer>;
200+
+ status = "okay";
201+
+};
202+
+
203+
+&ufshc {
204+
+ vcc-supply = <&vcc_3v3_s3>;
205+
+ vccq-supply = <&vcc1v2_ufs_vccq>;
206+
+ vccq2-supply = <&vcc1v8_ufs_vccq2>;
207+
+ vdd-hba-supply = <&vdda_1v2_s0>;
208+
+ status = "okay";
209+
+};
210+
+
211+
&usbdp_phy {
212+
status = "okay";
213+
};
214+
--
215+
Armbian
216+

0 commit comments

Comments
 (0)