Skip to content

Commit 4294a61

Browse files
committed
board: NanoPi M5 add initial support
1 parent f07e924 commit 4294a61

File tree

3 files changed

+337
-25
lines changed

3 files changed

+337
-25
lines changed

arch/arm64/boot/dts/rockchip/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,7 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3576-vehicle-evb-v10-linux.dtb
333333
dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3576-vehicle-evb-v20.dtb
334334
dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3576-vehicle-evb-v20-linux.dtb
335335
dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3576-nanopi-r76s.dtb
336+
dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3576-nanopi-m5.dtb
336337
dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3576s-evb1-v10.dtb
337338
dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3576s-evb1-v10-linux.dtb
338339
dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3576s-tablet-v10.dtb
Lines changed: 336 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,336 @@
1+
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2+
/*
3+
* Copyright (c) 2025 FriendlyElec Computer Tech. Co., Ltd.
4+
* (http://www.friendlyelec.com)
5+
*/
6+
7+
/dts-v1/;
8+
9+
#include "rk3576-nanopi5-common.dtsi"
10+
11+
/ {
12+
model = "FriendlyElec NanoPi M5";
13+
compatible = "friendlyelec,nanopi-m5", "rockchip,rk3576";
14+
15+
/delete-node/ chosen;
16+
17+
gpio_keys: gpio-keys {
18+
compatible = "gpio-keys";
19+
pinctrl-names = "default";
20+
pinctrl-0 = <&key1_pin>;
21+
22+
button@1 {
23+
debounce-interval = <50>;
24+
gpios = <&gpio1 RK_PA0 GPIO_ACTIVE_LOW>;
25+
label = "K1";
26+
linux,code = <BTN_1>;
27+
wakeup-source;
28+
};
29+
};
30+
31+
gpio_leds: gpio-leds {
32+
compatible = "gpio-leds";
33+
34+
sys_led: led-0 {
35+
gpios = <&gpio2 RK_PB3 GPIO_ACTIVE_HIGH>;
36+
label = "sys_led";
37+
linux,default-trigger = "heartbeat";
38+
pinctrl-names = "default";
39+
pinctrl-0 = <&sys_led_pin>;
40+
};
41+
42+
lan_led: led-1 {
43+
gpios = <&gpio2 RK_PB0 GPIO_ACTIVE_HIGH>;
44+
label = "lan_led";
45+
pinctrl-names = "default";
46+
pinctrl-0 = <&lan_led_pin>;
47+
};
48+
49+
wan_led: led-2 {
50+
gpios = <&gpio4 RK_PC5 GPIO_ACTIVE_HIGH>;
51+
label = "wan_led";
52+
pinctrl-names = "default";
53+
pinctrl-0 = <&wan_led_pin>;
54+
};
55+
};
56+
57+
rt5616_sound: rt5616-sound {
58+
status = "okay";
59+
compatible = "simple-audio-card";
60+
pinctrl-names = "default";
61+
pinctrl-0 = <&hp_det>;
62+
63+
simple-audio-card,name = "realtek,rt5616-codec";
64+
simple-audio-card,format = "i2s";
65+
simple-audio-card,mclk-fs = <256>;
66+
67+
simple-audio-card,hp-det-gpio = <&gpio2 RK_PD6 GPIO_ACTIVE_LOW>;
68+
simple-audio-card,hp-pin-name = "Headphone Jack";
69+
70+
simple-audio-card,widgets =
71+
"Headphone", "Headphone Jack",
72+
"Microphone", "Microphone Jack";
73+
simple-audio-card,routing =
74+
"Headphone Jack", "HPOL",
75+
"Headphone Jack", "HPOR",
76+
"MIC1", "Microphone Jack",
77+
"Microphone Jack", "micbias1";
78+
79+
simple-audio-card,cpu {
80+
sound-dai = <&sai2>;
81+
};
82+
simple-audio-card,codec {
83+
sound-dai = <&rt5616>;
84+
};
85+
};
86+
};
87+
88+
&i2c5 {
89+
status = "okay";
90+
clock-frequency = <200000>;
91+
pinctrl-0 = <&i2c5m3_xfer>;
92+
93+
rt5616: rt5616@1b {
94+
status = "okay";
95+
#sound-dai-cells = <0>;
96+
compatible = "rt5616";
97+
reg = <0x1b>;
98+
clocks = <&mclkout_sai2>;
99+
clock-names = "mclk";
100+
assigned-clocks = <&mclkout_sai2>;
101+
assigned-clock-rates = <12288000>;
102+
pinctrl-names = "default";
103+
pinctrl-0 = <&sai2m0_mclk>;
104+
};
105+
};
106+
107+
&i2c8 {
108+
clock-frequency = <200000>;
109+
pinctrl-0 = <&i2c8m2_xfer>;
110+
};
111+
112+
&pinctrl {
113+
gpio-key {
114+
key1_pin: key1-pin {
115+
rockchip,pins = <4 RK_PA2 RK_FUNC_GPIO &pcfg_pull_up>;
116+
};
117+
};
118+
119+
gpio-leds {
120+
sys_led_pin: sys-led-pin {
121+
rockchip,pins = <2 RK_PB3 RK_FUNC_GPIO &pcfg_pull_none>;
122+
};
123+
124+
lan_led_pin: lan-led-pin {
125+
rockchip,pins = <2 RK_PB0 RK_FUNC_GPIO &pcfg_pull_none>;
126+
};
127+
128+
wan_led_pin: wan-led-pin {
129+
rockchip,pins = <4 RK_PC5 RK_FUNC_GPIO &pcfg_pull_none>;
130+
};
131+
};
132+
133+
headphone {
134+
hp_det: hp-det {
135+
rockchip,pins = <2 RK_PD6 RK_FUNC_GPIO &pcfg_pull_none>;
136+
};
137+
};
138+
};
139+
140+
&sai2 {
141+
status = "okay";
142+
};
143+
144+
&sdhci {
145+
status = "disabled";
146+
};
147+
148+
&sdio_pwrseq {
149+
status = "okay";
150+
};
151+
152+
&sdio {
153+
status = "okay";
154+
vqmmc-supply = <&vcc_1v8_s0>;
155+
sd-uhs-sdr104;
156+
#address-cells = <1>;
157+
#size-cells = <0>;
158+
159+
rtl8822cs@1 {
160+
reg = <1>;
161+
compatible = "realtek,rtl8822cs";
162+
};
163+
};
164+
165+
&fspi1m1_pins {
166+
rockchip,pins =
167+
/* clk, d0~4 */
168+
<1 RK_PD5 3 &pcfg_pull_none>,
169+
<1 RK_PC4 3 &pcfg_pull_none>,
170+
<1 RK_PC5 3 &pcfg_pull_none>,
171+
<1 RK_PC6 3 &pcfg_pull_none>,
172+
<1 RK_PC7 3 &pcfg_pull_none>;
173+
};
174+
175+
&sfc1 {
176+
status = "okay";
177+
pinctrl-names = "default";
178+
pinctrl-0 = <&fspi1m1_csn0 &fspi1m1_pins>;
179+
#address-cells = <1>;
180+
#size-cells = <0>;
181+
182+
spi-nor@0 {
183+
compatible = "jedec,spi-nor";
184+
label = "sfc_nor";
185+
reg = <0>;
186+
m25p,fast-read;
187+
spi-max-frequency = <20000000>;
188+
spi-rx-bus-width = <4>;
189+
spi-tx-bus-width = <1>;
190+
};
191+
};
192+
193+
&uart5 {
194+
pinctrl-names = "default";
195+
pinctrl-0 = <&uart5m0_xfer &uart5m0_ctsn &uart5m0_rtsn>;
196+
status = "okay";
197+
198+
bluetooth {
199+
compatible = "realtek,rtl8822cs-bt";
200+
enable-gpios = <&gpio3 RK_PC7 GPIO_ACTIVE_HIGH>;
201+
host-wake-gpios = <&gpio0 RK_PB1 GPIO_ACTIVE_HIGH>;
202+
device-wake-gpios = <&gpio3 RK_PD0 GPIO_ACTIVE_HIGH>;
203+
};
204+
};
205+
206+
&usbdp_phy_dp {
207+
status = "disabled";
208+
};
209+
210+
&vop {
211+
disable-win-move;
212+
};
213+
214+
&vp1 {
215+
status = "okay";
216+
};
217+
218+
&vp2 {
219+
status = "disabled";
220+
};
221+
222+
/* GPIO Connector */
223+
&gpio0 {
224+
gpio-line-names =
225+
/* GPIO0 A0-A7 */
226+
"", "", "", "",
227+
"", "", "", "",
228+
/* GPIO0 B0-B7 */
229+
"", "", "", "",
230+
"", "PIN_12", "", "",
231+
/* GPIO0 C0-C7 */
232+
"", "PIN_05 [I2C0_SCL_M1]", "PIN_03 [I2C0_SDA_M1]", "",
233+
"PIN_22", "", "", "",
234+
/* GPIO0 D0-D7 */
235+
"", "", "", "",
236+
"", "", "", "";
237+
};
238+
239+
&gpio1 {
240+
gpio-line-names =
241+
/* GPIO1 A0-A7 */
242+
"", "", "", "",
243+
"", "", "", "",
244+
/* GPIO1 B0-B7 */
245+
"", "", "", "",
246+
"", "", "", "",
247+
/* GPIO1 C0-C7 */
248+
"", "", "", "",
249+
"", "", "", "",
250+
/* GPIO1 D0-D7 */
251+
"", "", "", "",
252+
"", "", "", "";
253+
};
254+
255+
&gpio2 {
256+
gpio-line-names =
257+
/* GPIO2 A0-A7 */
258+
"", "", "", "",
259+
"", "", "PIN_11 [UART8_TX_M1]", "PIN_13 [UART8_RX_M1]",
260+
/* GPIO2 B0-B7 */
261+
"", "", "", "",
262+
"", "", "", "",
263+
/* GPIO2 C0-C7 */
264+
"", "", "", "",
265+
"", "", "", "",
266+
/* GPIO2 D0-D7 */
267+
"", "", "", "",
268+
"", "", "", "";
269+
};
270+
271+
&gpio3 {
272+
gpio-line-names =
273+
/* GPIO3 A0-A7 */
274+
"PIN_16 [UART3_TX_M0]", "PIN_18 [UART3_RX_M0]", "", "",
275+
"", "", "", "",
276+
/* GPIO3 B0-B7 */
277+
"", "", "", "",
278+
"", "", "", "",
279+
/* GPIO3 C0-C7 */
280+
"", "", "", "",
281+
"", "", "", "",
282+
/* GPIO3 D0-D7 */
283+
"", "", "", "",
284+
"", "", "", "";
285+
};
286+
287+
&gpio4 {
288+
gpio-line-names =
289+
/* GPIO4 A0-A7 */
290+
"", "",
291+
"PIN_15", "PIN_29",
292+
"PIN_28", "PIN_07",
293+
"PIN_26", "PIN_27",
294+
/* GPIO4 B0-B7 */
295+
"PIN_23", "PIN_19",
296+
"PIN_21", "PIN_24",
297+
"PIN_10", "PIN_08",
298+
"", "",
299+
/* GPIO4 C0-C7 */
300+
"", "", "", "",
301+
"", "", "", "",
302+
/* GPIO4 D0-D7 */
303+
"", "", "", "",
304+
"", "", "", "";
305+
};
306+
307+
&spi3 {
308+
status = "disabled";
309+
pinctrl-0 = <&spi3m2_csn0 &spi3m2_csn1 &spi3m2_pins>;
310+
311+
spidev0: spidev@0 {
312+
compatible = "rockchip,spidev";
313+
reg = <0>;
314+
spi-max-frequency = <10000000>;
315+
status = "disabled";
316+
};
317+
};
318+
319+
&sai1 {
320+
status = "disabled";
321+
};
322+
323+
&uart2 {
324+
pinctrl-0 = <&uart2m1_xfer &uart2m1_ctsn &uart2m1_rtsn>;
325+
status = "disabled";
326+
};
327+
328+
&uart3 {
329+
pinctrl-0 = <&uart3m0_xfer>;
330+
status = "okay";
331+
};
332+
333+
&uart8 {
334+
pinctrl-0 = <&uart8m1_xfer>;
335+
status = "okay";
336+
};

arch/arm64/boot/dts/rockchip/rk3576-nanopi5-common.dtsi

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,6 @@
2626
mmc0 = &sdmmc;
2727
mmc1 = &sdio;
2828
mmc2 = &sdhci;
29-
scsi0 = &lun0;
30-
scsi1 = &lun1;
31-
scsi2 = &lun2;
32-
scsi3 = &lun3;
3329
};
3430

3531

@@ -719,27 +715,6 @@
719715
&ufs {
720716
status = "okay";
721717
reset-gpios = <&gpio4 RK_PD0 GPIO_ACTIVE_HIGH>;
722-
723-
scsi {
724-
#address-cells = <1>;
725-
#size-cells = <0>;
726-
727-
lun0: lun@0 {
728-
reg = <0>;
729-
};
730-
731-
lun1: lun@1 {
732-
reg = <1>;
733-
};
734-
735-
lun2: lun@2 {
736-
reg = <2>;
737-
};
738-
739-
lun3: lun@3 {
740-
reg = <3>;
741-
};
742-
};
743718
};
744719

745720
&usbdp_phy {

0 commit comments

Comments
 (0)