Debian Codegraph @

scripts/dtc/include-prefixes/arm64/rockchip/rk3566-nanopi-r3s.dts

raw
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2 /*
3 * Copyright (c) 2020 Rockchip Electronics Co., Ltd.
4 *
5 * Copyright (c) 2024 FriendlyElec Computer Tech. Co., Ltd.
6 * (http://www.friendlyelec.com)
7 *
8 * Copyright (c) 2024 Tianling Shen <[email protected]>
9 */
10
11 /dts-v1/;
12 #include <dt-bindings/gpio/gpio.h>
13 #include <dt-bindings/input/input.h>
14 #include <dt-bindings/leds/common.h>
15 #include <dt-bindings/pinctrl/rockchip.h>
16 #include <dt-bindings/soc/rockchip,vop2.h>
17 #include "rk3566.dtsi"
18
19 / {
20 model = "FriendlyElec NanoPi R3S";
21 compatible = "friendlyarm,nanopi-r3s", "rockchip,rk3566";
22
23 aliases {
24 ethernet0 = &gmac1;
25 mmc0 = &sdhci;
26 mmc1 = &sdmmc0;
27 };
28
29 chosen: chosen {
30 stdout-path = "serial2:1500000n8";
31 };
32
33 gpio-keys {
34 compatible = "gpio-keys";
35 pinctrl-names = "default";
36 pinctrl-0 = <&reset_button_pin>;
37
38 button-reset {
39 label = "reset";
40 gpios = <&gpio0 RK_PC2 GPIO_ACTIVE_LOW>;
41 linux,code = <KEY_RESTART>;
42 debounce-interval = <50>;
43 };
44 };
45
46 gpio-leds {
47 compatible = "gpio-leds";
48 pinctrl-names = "default";
49 pinctrl-0 = <&power_led_pin>, <&lan_led_pin>, <&wan_led_pin>;
50
51 power_led: led-0 {
52 color = <LED_COLOR_ID_RED>;
53 function = LED_FUNCTION_POWER;
54 gpios = <&gpio0 RK_PB7 GPIO_ACTIVE_HIGH>;
55 default-state = "on";
56 };
57
58 lan_led: led-1 {
59 color = <LED_COLOR_ID_GREEN>;
60 function = LED_FUNCTION_LAN;
61 gpios = <&gpio3 RK_PC2 GPIO_ACTIVE_HIGH>;
62 };
63
64 wan_led: led-2 {
65 color = <LED_COLOR_ID_GREEN>;
66 function = LED_FUNCTION_WAN;
67 gpios = <&gpio3 RK_PC3 GPIO_ACTIVE_HIGH>;
68 };
69 };
70
71 vcc3v3_sys: regulator-vcc3v3-sys {
72 compatible = "regulator-fixed";
73 regulator-name = "vcc3v3_sys";
74 regulator-always-on;
75 regulator-boot-on;
76 regulator-min-microvolt = <3300000>;
77 regulator-max-microvolt = <3300000>;
78 vin-supply = <&vcc5v0_sys>;
79 };
80
81 vcc5v0_sys: regulator-vcc5v0-sys {
82 compatible = "regulator-fixed";
83 regulator-name = "vcc5v0_sys";
84 regulator-always-on;
85 regulator-boot-on;
86 regulator-min-microvolt = <5000000>;
87 regulator-max-microvolt = <5000000>;
88 vin-supply = <&vdd_usbc>;
89 };
90
91 vcc5v0_usb: regulator-vcc5v0_usb {
92 compatible = "regulator-fixed";
93 enable-active-high;
94 gpio = <&gpio0 RK_PA6 GPIO_ACTIVE_HIGH>;
95 pinctrl-names = "default";
96 pinctrl-0 = <&vcc5v0_usb_host_en>;
97 regulator-name = "vcc5v0_usb";
98 regulator-always-on;
99 regulator-boot-on;
100 regulator-min-microvolt = <5000000>;
101 regulator-max-microvolt = <5000000>;
102 vin-supply = <&vcc5v0_sys>;
103 };
104
105 vdd_usbc: regulator-vdd-usbc {
106 compatible = "regulator-fixed";
107 regulator-name = "vdd_usbc";
108 regulator-always-on;
109 regulator-boot-on;
110 regulator-min-microvolt = <5000000>;
111 regulator-max-microvolt = <5000000>;
112 };
113 };
114
115 &combphy1 {
116 status = "okay";
117 };
118
119 &combphy2 {
120 status = "okay";
121 };
122
123 &cpu0 {
124 cpu-supply = <&vdd_cpu>;
125 };
126
127 &cpu1 {
128 cpu-supply = <&vdd_cpu>;
129 };
130
131 &cpu2 {
132 cpu-supply = <&vdd_cpu>;
133 };
134
135 &cpu3 {
136 cpu-supply = <&vdd_cpu>;
137 };
138
139 &gmac1 {
140 assigned-clocks = <&cru SCLK_GMAC1_RX_TX>, <&cru SCLK_GMAC1>;
141 assigned-clock-parents = <&cru SCLK_GMAC1_RGMII_SPEED>, <&cru CLK_MAC1_2TOP>;
142 assigned-clock-rates = <0>, <125000000>;
143 clock_in_out = "output";
144 phy-mode = "rgmii-id";
145 phy-handle = <&rgmii_phy1>;
146 pinctrl-names = "default";
147 pinctrl-0 = <&gmac1m0_miim
148 &gmac1m0_tx_bus2_level3
149 &gmac1m0_rx_bus2
150 &gmac1m0_rgmii_clk_level2
151 &gmac1m0_rgmii_bus_level3>;
152 status = "okay";
153 };
154
155 &gpu {
156 mali-supply = <&vdd_gpu>;
157 status = "okay";
158 };
159
160 &i2c0 {
161 status = "okay";
162
163 vdd_cpu: regulator@1c {
164 compatible = "tcs,tcs4525";
165 reg = <0x1c>;
166 fcs,suspend-voltage-selector = <1>;
167 regulator-name = "vdd_cpu";
168 regulator-always-on;
169 regulator-boot-on;
170 regulator-min-microvolt = <800000>;
171 regulator-max-microvolt = <1150000>;
172 regulator-ramp-delay = <2300>;
173 vin-supply = <&vcc5v0_sys>;
174
175 regulator-state-mem {
176 regulator-off-in-suspend;
177 };
178 };
179
180 rk809: pmic@20 {
181 compatible = "rockchip,rk809";
182 reg = <0x20>;
183 interrupt-parent = <&gpio0>;
184 interrupts = <RK_PA3 IRQ_TYPE_LEVEL_LOW>;
185 #clock-cells = <1>;
186 pinctrl-names = "default";
187 pinctrl-0 = <&pmic_int>;
188 system-power-controller;
189 vcc1-supply = <&vcc3v3_sys>;
190 vcc2-supply = <&vcc3v3_sys>;
191 vcc3-supply = <&vcc3v3_sys>;
192 vcc4-supply = <&vcc3v3_sys>;
193 vcc5-supply = <&vcc3v3_sys>;
194 vcc6-supply = <&vcc3v3_sys>;
195 vcc7-supply = <&vcc3v3_sys>;
196 vcc8-supply = <&vcc3v3_sys>;
197 vcc9-supply = <&vcc3v3_sys>;
198 wakeup-source;
199
200 regulators {
201 vdd_logic: DCDC_REG1 {
202 regulator-name = "vdd_logic";
203 regulator-always-on;
204 regulator-boot-on;
205 regulator-initial-mode = <0x2>;
206 regulator-min-microvolt = <500000>;
207 regulator-max-microvolt = <1350000>;
208 regulator-ramp-delay = <6001>;
209
210 regulator-state-mem {
211 regulator-off-in-suspend;
212 };
213 };
214
215 vdd_gpu: DCDC_REG2 {
216 regulator-name = "vdd_gpu";
217 regulator-always-on;
218 regulator-initial-mode = <0x2>;
219 regulator-min-microvolt = <500000>;
220 regulator-max-microvolt = <1350000>;
221 regulator-ramp-delay = <6001>;
222
223 regulator-state-mem {
224 regulator-off-in-suspend;
225 };
226 };
227
228 vcc_ddr: DCDC_REG3 {
229 regulator-name = "vcc_ddr";
230 regulator-always-on;
231 regulator-boot-on;
232 regulator-initial-mode = <0x2>;
233
234 regulator-state-mem {
235 regulator-on-in-suspend;
236 };
237 };
238
239 vdd_npu: DCDC_REG4 {
240 regulator-name = "vdd_npu";
241 regulator-initial-mode = <0x2>;
242 regulator-min-microvolt = <500000>;
243 regulator-max-microvolt = <1350000>;
244 regulator-ramp-delay = <6001>;
245
246 regulator-state-mem {
247 regulator-off-in-suspend;
248 };
249 };
250
251 vcc_1v8: DCDC_REG5 {
252 regulator-name = "vcc_1v8";
253 regulator-always-on;
254 regulator-boot-on;
255 regulator-min-microvolt = <1800000>;
256 regulator-max-microvolt = <1800000>;
257
258 regulator-state-mem {
259 regulator-off-in-suspend;
260 };
261 };
262
263 vdda0v9_image: LDO_REG1 {
264 regulator-name = "vdda0v9_image";
265 regulator-min-microvolt = <950000>;
266 regulator-max-microvolt = <950000>;
267
268 regulator-state-mem {
269 regulator-off-in-suspend;
270 };
271 };
272
273 vdda_0v9: LDO_REG2 {
274 regulator-name = "vdda_0v9";
275 regulator-always-on;
276 regulator-boot-on;
277 regulator-min-microvolt = <900000>;
278 regulator-max-microvolt = <900000>;
279
280 regulator-state-mem {
281 regulator-off-in-suspend;
282 };
283 };
284
285 vdda0v9_pmu: LDO_REG3 {
286 regulator-name = "vdda0v9_pmu";
287 regulator-always-on;
288 regulator-boot-on;
289 regulator-min-microvolt = <900000>;
290 regulator-max-microvolt = <900000>;
291
292 regulator-state-mem {
293 regulator-on-in-suspend;
294 regulator-suspend-microvolt = <900000>;
295 };
296 };
297
298 vccio_acodec: LDO_REG4 {
299 regulator-name = "vccio_acodec";
300 regulator-min-microvolt = <3300000>;
301 regulator-max-microvolt = <3300000>;
302
303 regulator-state-mem {
304 regulator-off-in-suspend;
305 };
306 };
307
308 vccio_sd: LDO_REG5 {
309 regulator-name = "vccio_sd";
310 regulator-min-microvolt = <1800000>;
311 regulator-max-microvolt = <3300000>;
312
313 regulator-state-mem {
314 regulator-off-in-suspend;
315 };
316 };
317
318 vcc3v3_pmu: LDO_REG6 {
319 regulator-name = "vcc3v3_pmu";
320 regulator-always-on;
321 regulator-boot-on;
322 regulator-min-microvolt = <3300000>;
323 regulator-max-microvolt = <3300000>;
324
325 regulator-state-mem {
326 regulator-on-in-suspend;
327 regulator-suspend-microvolt = <3300000>;
328 };
329 };
330
331 vcca_1v8: LDO_REG7 {
332 regulator-name = "vcca_1v8";
333 regulator-always-on;
334 regulator-boot-on;
335 regulator-min-microvolt = <1800000>;
336 regulator-max-microvolt = <1800000>;
337
338 regulator-state-mem {
339 regulator-off-in-suspend;
340 };
341 };
342
343 vcca1v8_pmu: LDO_REG8 {
344 regulator-name = "vcca1v8_pmu";
345 regulator-always-on;
346 regulator-boot-on;
347 regulator-min-microvolt = <1800000>;
348 regulator-max-microvolt = <1800000>;
349
350 regulator-state-mem {
351 regulator-on-in-suspend;
352 regulator-suspend-microvolt = <1800000>;
353 };
354 };
355
356 vcca1v8_image: LDO_REG9 {
357 regulator-name = "vcca1v8_image";
358 regulator-min-microvolt = <1800000>;
359 regulator-max-microvolt = <1800000>;
360
361 regulator-state-mem {
362 regulator-off-in-suspend;
363 };
364 };
365
366 vcc_3v3: SWITCH_REG1 {
367 regulator-name = "vcc_3v3";
368 regulator-always-on;
369 regulator-boot-on;
370
371 regulator-state-mem {
372 regulator-off-in-suspend;
373 };
374 };
375
376 vcc3v3_sd: SWITCH_REG2 {
377 regulator-name = "vcc3v3_sd";
378 regulator-always-on;
379 regulator-boot-on;
380
381 regulator-state-mem {
382 regulator-off-in-suspend;
383 };
384 };
385 };
386 };
387 };
388
389 &i2c1 {
390 status = "okay";
391
392 hym8563: rtc@51 {
393 compatible = "haoyu,hym8563";
394 reg = <0x51>;
395 #clock-cells = <0>;
396 clock-output-names = "hym8563";
397 pinctrl-names = "default";
398 pinctrl-0 = <&hym8563_int>;
399 interrupt-parent = <&gpio0>;
400 interrupts = <RK_PD3 IRQ_TYPE_LEVEL_LOW>;
401 wakeup-source;
402 };
403 };
404
405 &mdio1 {
406 rgmii_phy1: ethernet-phy@1 {
407 compatible = "ethernet-phy-ieee802.3-c22";
408 reg = <1>;
409 interrupt-parent = <&gpio4>;
410 interrupts = <RK_PC3 IRQ_TYPE_LEVEL_LOW>;
411 pinctrl-names = "default";
412 pinctrl-0 = <&eth_phy_reset_pin>;
413 reset-assert-us = <20000>;
414 reset-deassert-us = <100000>;
415 reset-gpios = <&gpio4 RK_PC2 GPIO_ACTIVE_LOW>;
416 };
417 };
418
419 &pcie2x1 {
420 pinctrl-names = "default";
421 pinctrl-0 = <&pcie_reset_h>;
422 reset-gpios = <&gpio4 RK_PC6 GPIO_ACTIVE_HIGH>;
423 status = "okay";
424 };
425
426 &pinctrl {
427 gpio-leds {
428 lan_led_pin: lan-led-pin {
429 rockchip,pins = <3 RK_PC2 RK_FUNC_GPIO &pcfg_pull_none>;
430 };
431
432 power_led_pin: power-led-pin {
433 rockchip,pins = <0 RK_PB7 RK_FUNC_GPIO &pcfg_pull_none>;
434 };
435
436 wan_led_pin: wan-led-pin {
437 rockchip,pins = <3 RK_PC3 RK_FUNC_GPIO &pcfg_pull_none>;
438 };
439 };
440
441 gmac {
442 eth_phy_reset_pin: eth-phy-reset-pin {
443 rockchip,pins = <4 RK_PC2 RK_FUNC_GPIO &pcfg_pull_up>;
444 };
445 };
446
447 pcie {
448 pcie_reset_h: pcie-reset-h {
449 rockchip,pins = <4 RK_PC6 RK_FUNC_GPIO &pcfg_pull_down>;
450 };
451 };
452
453 pmic {
454 pmic_int: pmic-int {
455 rockchip,pins = <0 RK_PA3 RK_FUNC_GPIO &pcfg_pull_up>;
456 };
457 };
458
459 rockchip-key {
460 reset_button_pin: reset-button-pin {
461 rockchip,pins = <0 RK_PC2 RK_FUNC_GPIO &pcfg_pull_up>;
462 };
463 };
464
465 rtc {
466 hym8563_int: hym8563-int {
467 rockchip,pins = <0 RK_PD3 RK_FUNC_GPIO &pcfg_pull_up>;
468 };
469 };
470
471 usb {
472 vcc5v0_usb_host_en: vcc5v0-usb-host-en {
473 rockchip,pins = <0 RK_PA6 RK_FUNC_GPIO &pcfg_pull_none>;
474 };
475 };
476 };
477
478 &pmu_io_domains {
479 pmuio1-supply = <&vcc3v3_pmu>;
480 pmuio2-supply = <&vcc3v3_pmu>;
481 vccio1-supply = <&vccio_acodec>;
482 vccio2-supply = <&vcc_1v8>;
483 vccio3-supply = <&vccio_sd>;
484 vccio4-supply = <&vcc_3v3>;
485 vccio5-supply = <&vcc_1v8>;
486 vccio6-supply = <&vcc_3v3>;
487 vccio7-supply = <&vcc_3v3>;
488 status = "okay";
489 };
490
491 &sdhci {
492 bus-width = <8>;
493 max-frequency = <200000000>;
494 mmc-hs200-1_8v;
495 non-removable;
496 pinctrl-names = "default";
497 pinctrl-0 = <&emmc_bus8 &emmc_clk &emmc_cmd &emmc_datastrobe>;
498 status = "okay";
499 };
500
501 &sdmmc0 {
502 bus-width = <4>;
503 cap-mmc-highspeed;
504 cap-sd-highspeed;
505 disable-wp;
506 no-sdio;
507 no-mmc;
508 pinctrl-names = "default";
509 pinctrl-0 = <&sdmmc0_bus4 &sdmmc0_clk &sdmmc0_cmd &sdmmc0_det>;
510 sd-uhs-sdr50;
511 vmmc-supply = <&vcc3v3_sd>;
512 vqmmc-supply = <&vccio_sd>;
513 status = "okay";
514 };
515
516 &tsadc {
517 status = "okay";
518 };
519
520 &uart2 {
521 status = "okay";
522 };
523
524 &usb2phy0 {
525 status = "okay";
526 };
527
528 &usb2phy0_host {
529 phy-supply = <&vcc5v0_usb>;
530 status = "okay";
531 };
532
533 &usb2phy0_otg {
534 status = "okay";
535 };
536
537 &usb_host0_xhci {
538 extcon = <&usb2phy0>;
539 status = "okay";
540 };
541
542 &usb_host1_xhci {
543 status = "okay";
544 };
545
546 &vop {
547 assigned-clocks = <&cru DCLK_VOP0>, <&cru DCLK_VOP1>;
548 assigned-clock-parents = <&pmucru PLL_HPLL>, <&cru PLL_VPLL>;
549 status = "okay";
550 };
551
552 &vop_mmu {
553 status = "okay";
554 };