Skip to content

Commit 424c43c

Browse files
committed
rockchip: add MangoPi M28C support
1 parent 171cb58 commit 424c43c

File tree

9 files changed

+455
-327
lines changed

9 files changed

+455
-327
lines changed

target/linux/rockchip/armv8/base-files/etc/board.d/01_leds

+4
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,10 @@ radxa,e20c)
5858
ucidef_set_led_netdev "lan" "LAN" "green:lan" "eth0"
5959
ucidef_set_led_netdev "wan" "WAN" "green:wan" "eth1"
6060
;;
61+
widora,mangopi-m28c)
62+
ucidef_set_led_netdev "modem" "MODEM" "blue:modem" "usb0"
63+
ucidef_set_led_netdev "wifi" "WIFI" "yellow:wifi" "wlan0"
64+
;;
6165
widora,mangopi-m28k|\
6266
widora,mangopi-m28k-pro)
6367
ucidef_set_led_netdev "lan" "LAN" "white:lan" "eth0"

target/linux/rockchip/armv8/base-files/etc/hotplug.d/net/40-net-smp-affinity

+4
Original file line numberDiff line numberDiff line change
@@ -69,5 +69,9 @@ friendlyarm,nanopi-r6s)
6969
set_interface_core 4 "eth1"
7070
set_interface_core 8 "eth2"
7171
;;
72+
widora,mangopi-m28c)
73+
set_interface_core 4 "eth0"
74+
set_interface_core 8 "xhci-hcd:usb1"
75+
;;
7276
esac
7377

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,328 @@
1+
// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2+
// Copyright (c) 2024 AY <[email protected]>
3+
4+
#include <dt-bindings/gpio/gpio.h>
5+
#include <dt-bindings/input/input.h>
6+
#include <dt-bindings/pinctrl/rockchip.h>
7+
8+
#include "rk3528.dtsi"
9+
10+
/ {
11+
aliases {
12+
mmc0 = &sdhci;
13+
mmc1 = &sdmmc;
14+
mmc2 = &sdio0;
15+
ethernet0 = &gmac1;
16+
};
17+
18+
chosen {
19+
stdout-path = "serial0:1500000n8";
20+
};
21+
22+
ir-receiver {
23+
compatible = "gpio-ir-receiver";
24+
gpios = <&gpio4 RK_PC6 GPIO_ACTIVE_LOW>;
25+
pinctrl-names = "default";
26+
pinctrl-0 = <&ir_int_pin>;
27+
};
28+
29+
sdio_pwrseq: sdio-pwrseq {
30+
compatible = "mmc-pwrseq-simple";
31+
pinctrl-names = "default";
32+
pinctrl-0 = <&wifi_reg_on_h>;
33+
post-power-on-delay-ms = <100>;
34+
power-off-delay-us = <5000000>;
35+
reset-gpios = <&gpio1 RK_PA6 GPIO_ACTIVE_LOW>;
36+
};
37+
38+
vcc_1v8: vcc-1v8 {
39+
compatible = "regulator-fixed";
40+
regulator-name = "vcc_1v8";
41+
regulator-always-on;
42+
regulator-boot-on;
43+
regulator-min-microvolt = <1800000>;
44+
regulator-max-microvolt = <1800000>;
45+
vin-supply = <&vcc_3v3>;
46+
};
47+
48+
vcc_3v3: vcc-3v3 {
49+
compatible = "regulator-fixed";
50+
regulator-name = "vcc_3v3";
51+
regulator-always-on;
52+
regulator-boot-on;
53+
regulator-min-microvolt = <3300000>;
54+
regulator-max-microvolt = <3300000>;
55+
vin-supply = <&vcc_sys>;
56+
};
57+
58+
vcc3v3_sd: vcc3v3-sd {
59+
compatible = "regulator-fixed";
60+
gpio = <&gpio4 RK_PA1 GPIO_ACTIVE_LOW>;
61+
regulator-name = "vcc3v3_sd";
62+
regulator-always-on;
63+
regulator-boot-on;
64+
regulator-min-microvolt = <3300000>;
65+
regulator-max-microvolt = <3300000>;
66+
vin-supply = <&vcc_3v3>;
67+
};
68+
69+
vccio_sd: vccio-sd {
70+
compatible = "regulator-gpio";
71+
gpios = <&gpio4 RK_PB6 GPIO_ACTIVE_HIGH>;
72+
regulator-name = "vccio_sd";
73+
regulator-min-microvolt = <1800000>;
74+
regulator-max-microvolt = <3300000>;
75+
states = <1800000 0x0>, <3300000 0x1>;
76+
vin-supply = <&vcc_sys>;
77+
};
78+
79+
vcc_ddr: vcc-ddr {
80+
compatible = "regulator-fixed";
81+
regulator-name = "vcc_ddr";
82+
regulator-always-on;
83+
regulator-boot-on;
84+
regulator-min-microvolt = <1200000>;
85+
regulator-max-microvolt = <1200000>;
86+
vin-supply = <&vcc_sys>;
87+
};
88+
89+
vcc_sys: vcc5v0-sys {
90+
compatible = "regulator-fixed";
91+
regulator-name = "vcc_sys";
92+
regulator-always-on;
93+
regulator-boot-on;
94+
regulator-min-microvolt = <5000000>;
95+
regulator-max-microvolt = <5000000>;
96+
};
97+
98+
vdd_0v9: vdd-0v9 {
99+
compatible = "regulator-fixed";
100+
regulator-name = "vdd_0v9";
101+
regulator-always-on;
102+
regulator-boot-on;
103+
regulator-min-microvolt = <900000>;
104+
regulator-max-microvolt = <900000>;
105+
vin-supply = <&vcc_sys>;
106+
};
107+
108+
vdd_arm: vdd-arm {
109+
compatible = "pwm-regulator";
110+
pwms = <&pwm1 0 5000 1>;
111+
pwm-supply = <&vcc_sys>;
112+
regulator-name = "vdd_arm";
113+
regulator-always-on;
114+
regulator-boot-on;
115+
regulator-min-microvolt = <746000>;
116+
regulator-max-microvolt = <1201000>;
117+
regulator-settling-time-up-us = <250>;
118+
};
119+
120+
vdd_logic: vdd-logic {
121+
compatible = "pwm-regulator";
122+
pwms = <&pwm2 0 5000 1>;
123+
pwm-supply = <&vcc_sys>;
124+
regulator-name = "vdd_logic";
125+
regulator-always-on;
126+
regulator-boot-on;
127+
regulator-min-microvolt = <705000>;
128+
regulator-max-microvolt = <1006000>;
129+
regulator-settling-time-up-us = <250>;
130+
};
131+
};
132+
133+
&combphy {
134+
status = "okay";
135+
};
136+
137+
&cpu0 {
138+
cpu-supply = <&vdd_arm>;
139+
};
140+
141+
&cpu1 {
142+
cpu-supply = <&vdd_arm>;
143+
};
144+
145+
&cpu2 {
146+
cpu-supply = <&vdd_arm>;
147+
};
148+
149+
&cpu3 {
150+
cpu-supply = <&vdd_arm>;
151+
};
152+
153+
&gmac1 {
154+
clock_in_out = "output";
155+
pinctrl-names = "default";
156+
pinctrl-0 = <&rgmii_miim
157+
&rgmii_tx_bus2
158+
&rgmii_rx_bus2
159+
&rgmii_rgmii_clk
160+
&rgmii_rgmii_bus>;
161+
phy-handle = <&rgmii_phy>;
162+
phy-mode = "rgmii-id";
163+
phy-supply = <&vcc_3v3>;
164+
snps,reset-active-low;
165+
snps,reset-delays-us = <0 20000 100000>;
166+
snps,reset-gpio = <&gpio4 RK_PC2 GPIO_ACTIVE_LOW>;
167+
status = "okay";
168+
};
169+
170+
&gpu {
171+
mali-supply = <&vdd_logic>;
172+
status = "okay";
173+
};
174+
175+
&mdio1 {
176+
rgmii_phy: phy@1 {
177+
compatible = "ethernet-phy-ieee802.3-c22";
178+
reg = <0x1>;
179+
realtek,led-data = <0x6d60>;
180+
};
181+
};
182+
183+
&pinctrl {
184+
ir {
185+
ir_int_pin: ir-int-pin {
186+
rockchip,pins = <4 RK_PC6 RK_FUNC_GPIO &pcfg_pull_up>;
187+
};
188+
};
189+
190+
leds {
191+
lan_led_en: lan-led-en {
192+
rockchip,pins = <4 RK_PB5 RK_FUNC_GPIO &pcfg_pull_none>;
193+
};
194+
195+
wan_led_en: wan-led-en {
196+
rockchip,pins = <4 RK_PC0 RK_FUNC_GPIO &pcfg_pull_none>;
197+
};
198+
199+
work_led_en: work-led-en {
200+
rockchip,pins = <4 RK_PB7 RK_FUNC_GPIO &pcfg_pull_none>;
201+
};
202+
};
203+
204+
wifi {
205+
wifi_reg_on_h: wifi-reg-on-h {
206+
rockchip,pins = <1 RK_PA6 RK_FUNC_GPIO &pcfg_pull_none>;
207+
};
208+
209+
wifi_wake_host_h: wifi-wake-host-h {
210+
rockchip,pins = <1 RK_PA7 RK_FUNC_GPIO &pcfg_pull_down>;
211+
};
212+
};
213+
214+
bluetooth {
215+
bt_reg_on_h: bt-reg-on-h {
216+
rockchip,pins = <1 RK_PC1 RK_FUNC_GPIO &pcfg_pull_down>;
217+
};
218+
};
219+
};
220+
221+
&pwm1 {
222+
status = "okay";
223+
};
224+
225+
&pwm2 {
226+
status = "okay";
227+
};
228+
229+
&rng {
230+
status = "okay";
231+
};
232+
233+
&sdhci {
234+
bus-width = <8>;
235+
mmc-hs200-1_8v;
236+
max-frequency = <200000000>;
237+
non-removable;
238+
pinctrl-names = "default";
239+
pinctrl-0 = <&emmc_bus8 &emmc_clk &emmc_cmd &emmc_strb>;
240+
vmmc-supply = <&vcc_3v3>;
241+
vqmmc-supply = <&vcc_1v8>;
242+
status = "okay";
243+
};
244+
245+
&sdio0 {
246+
#address-cells = <1>;
247+
#size-cells = <0>;
248+
bus-width = <4>;
249+
cap-sd-highspeed;
250+
cap-sdio-irq;
251+
keep-power-in-suspend;
252+
max-frequency = <200000000>;
253+
mmc-pwrseq = <&sdio_pwrseq>;
254+
pinctrl-names = "default";
255+
pinctrl-0 = <&sdio0_bus4 &sdio0_cmd &sdio0_clk>;
256+
non-removable;
257+
sd-uhs-sdr104;
258+
status = "okay";
259+
260+
wifi@1 {
261+
reg = <1>;
262+
interrupt-parent = <&gpio1>;
263+
interrupts = <RK_PA7 IRQ_TYPE_LEVEL_HIGH>;
264+
interrupt-names = "host-wake";
265+
pinctrl-names = "default";
266+
pinctrl-0 = <&wifi_wake_host_h>;
267+
};
268+
};
269+
270+
&sdmmc {
271+
bus-width = <4>;
272+
cap-sd-highspeed;
273+
disable-wp;
274+
max-frequency = <150000000>;
275+
pinctrl-names = "default";
276+
pinctrl-0 = <&sdmmc_bus4 &sdmmc_clk &sdmmc_cmd &sdmmc_det>;
277+
rockchip,default-sample-phase = <90>;
278+
sd-uhs-sdr12;
279+
sd-uhs-sdr25;
280+
sd-uhs-sdr50;
281+
sd-uhs-sdr104;
282+
vmmc-supply = <&vcc3v3_sd>;
283+
vqmmc-supply = <&vccio_sd>;
284+
status = "okay";
285+
};
286+
287+
&tsadc {
288+
status = "okay";
289+
};
290+
291+
&uart0 {
292+
pinctrl-names = "default";
293+
pinctrl-0 = <&uart0m0_xfer>;
294+
status = "okay";
295+
};
296+
297+
&uart2 {
298+
pinctrl-names = "default";
299+
pinctrl-0 = <&uart2m1_xfer &uart2m1_ctsn>;
300+
status = "okay";
301+
};
302+
303+
&usb2phy {
304+
status = "okay";
305+
};
306+
307+
&usb2phy0_host {
308+
phy-supply = <&vcc_sys>;
309+
status = "okay";
310+
};
311+
312+
&usb2phy0_otg {
313+
phy-supply = <&vcc_sys>;
314+
status = "okay";
315+
};
316+
317+
&usb_host0_ehci {
318+
status = "okay";
319+
};
320+
321+
&usb_host0_ohci {
322+
status = "okay";
323+
};
324+
325+
&usb_host0_xhci {
326+
dr_mode = "host";
327+
status = "okay";
328+
};

0 commit comments

Comments
 (0)