1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/*
3 * Copyright (c) 2024 Rockchip Electronics Co., Ltd.
4 *
5 */
6
7/dts-v1/;
8
9#include <dt-bindings/gpio/gpio.h>
10#include <dt-bindings/input/input.h>
11#include <dt-bindings/leds/common.h>
12#include <dt-bindings/pinctrl/rockchip.h>
13#include "rk3576.dtsi"
14
15/ {
16	model = "Rockchip RK3576 EVB V10 Board";
17	compatible = "rockchip,rk3576-evb1-v10", "rockchip,rk3576";
18
19	aliases {
20		ethernet0 = &gmac0;
21		ethernet1 = &gmac1;
22	};
23
24	chosen: chosen {
25		stdout-path = "serial0:1500000n8";
26	};
27
28	adc_keys: adc-keys {
29		compatible = "adc-keys";
30		io-channels = <&saradc 1>;
31		io-channel-names = "buttons";
32		keyup-threshold-microvolt = <1800000>;
33		poll-interval = <100>;
34
35		button-back {
36			label = "back";
37			linux,code = <KEY_BACK>;
38			press-threshold-microvolt = <1235000>;
39		};
40
41		button-menu {
42			label = "menu";
43			linux,code = <KEY_MENU>;
44			press-threshold-microvolt = <890000>;
45		};
46
47		button-vol-down {
48			label = "volume down";
49			linux,code = <KEY_VOLUMEDOWN>;
50			press-threshold-microvolt = <417000>;
51		};
52
53		button-vol-up {
54			label = "volume up";
55			linux,code = <KEY_VOLUMEUP>;
56			press-threshold-microvolt = <17000>;
57		};
58	};
59
60	leds: leds {
61		compatible = "gpio-leds";
62
63		work_led: led-0 {
64			gpios = <&gpio0 RK_PB4 GPIO_ACTIVE_HIGH>;
65			linux,default-trigger = "heartbeat";
66		};
67	};
68
69	vbus5v0_typec: regulator-vbus5v0-typec {
70		compatible = "regulator-fixed";
71		regulator-name = "vbus5v0_typec";
72		regulator-min-microvolt = <5000000>;
73		regulator-max-microvolt = <5000000>;
74		enable-active-high;
75		gpio = <&gpio0 RK_PD1 GPIO_ACTIVE_HIGH>;
76		vin-supply = <&vcc5v0_device>;
77		pinctrl-names = "default";
78		pinctrl-0 = <&usb_otg0_pwren>;
79	};
80
81	vcc12v_dcin: regulator-vcc12v-dcin {
82		compatible = "regulator-fixed";
83		regulator-name = "vcc12v_dcin";
84		regulator-always-on;
85		regulator-boot-on;
86		regulator-min-microvolt = <12000000>;
87		regulator-max-microvolt = <12000000>;
88	};
89
90	vcc1v2_ufs_vccq_s0: regulator-vcc1v2-ufs-vccq-s0 {
91		compatible = "regulator-fixed";
92		regulator-name = "vcc1v2_ufs_vccq_s0";
93		regulator-boot-on;
94		regulator-always-on;
95		regulator-min-microvolt = <1200000>;
96		regulator-max-microvolt = <1200000>;
97		vin-supply = <&vcc_sys>;
98	};
99
100	vcc1v8_ufs_vccq2_s0: regulator-vcc1v8-ufs-vccq2-s0 {
101		compatible = "regulator-fixed";
102		regulator-name = "vcc1v8_ufs_vccq2_s0";
103		regulator-boot-on;
104		regulator-always-on;
105		regulator-min-microvolt = <1800000>;
106		regulator-max-microvolt = <1800000>;
107		vin-supply = <&vcc_1v8_s3>;
108	};
109
110	vcc3v3_lcd_n: regulator-vcc3v3-lcd0-n {
111		compatible = "regulator-fixed";
112		regulator-name = "vcc3v3_lcd0_n";
113		regulator-boot-on;
114		enable-active-high;
115		gpio = <&gpio0 RK_PC6 GPIO_ACTIVE_HIGH>;
116		vin-supply = <&vcc_3v3_s0>;
117	};
118
119	vcc3v3_pcie0: regulator-vcc3v3-pcie0 {
120		compatible = "regulator-fixed";
121		regulator-name = "vcc3v3_pcie1";
122		regulator-min-microvolt = <3300000>;
123		regulator-max-microvolt = <3300000>;
124		enable-active-high;
125		gpios = <&gpio3 RK_PD4 GPIO_ACTIVE_HIGH>;
126		startup-delay-us = <5000>;
127		vin-supply = <&vcc12v_dcin>;
128	};
129
130	vcc3v3_rtc_s5: regulator-vcc3v3-rtc-s5 {
131		compatible = "regulator-fixed";
132		regulator-name = "vcc3v3_rtc_s5";
133		regulator-boot-on;
134		regulator-always-on;
135		regulator-min-microvolt = <3300000>;
136		regulator-max-microvolt = <3300000>;
137		vin-supply = <&vcc_sys>;
138	};
139
140	vcc5v0_device: regulator-vcc5v0-device {
141		compatible = "regulator-fixed";
142		regulator-name = "vcc5v0_device";
143		regulator-always-on;
144		regulator-boot-on;
145		regulator-min-microvolt = <5000000>;
146		regulator-max-microvolt = <5000000>;
147		vin-supply = <&vcc12v_dcin>;
148	};
149
150	vcc5v0_host: regulator-vcc5v0-host {
151		compatible = "regulator-fixed";
152		regulator-name = "vcc5v0_host";
153		regulator-boot-on;
154		regulator-always-on;
155		regulator-min-microvolt = <5000000>;
156		regulator-max-microvolt = <5000000>;
157		enable-active-high;
158		gpio = <&gpio0 RK_PC7 GPIO_ACTIVE_HIGH>;
159		vin-supply = <&vcc5v0_device>;
160		pinctrl-names = "default";
161		pinctrl-0 = <&usb_host_pwren>;
162	};
163
164	vcc_sys: regulator-vcc5v0-sys {
165		compatible = "regulator-fixed";
166		regulator-name = "vcc_sys";
167		regulator-always-on;
168		regulator-boot-on;
169		regulator-min-microvolt = <5000000>;
170		regulator-max-microvolt = <5000000>;
171		vin-supply = <&vcc12v_dcin>;
172	};
173
174	vcc_1v1_nldo_s3: regulator-vcc-1v1-nldo-s3 {
175		compatible = "regulator-fixed";
176		regulator-name = "vcc_1v1_nldo_s3";
177		regulator-boot-on;
178		regulator-always-on;
179		regulator-min-microvolt = <1100000>;
180		regulator-max-microvolt = <1100000>;
181		vin-supply = <&vcc_sys>;
182	};
183
184	vcc_1v8_s0: regulator-vcc-1v8-s0 {
185		compatible = "regulator-fixed";
186		regulator-name = "vcc_1v8_s0";
187		regulator-boot-on;
188		regulator-always-on;
189		regulator-min-microvolt = <1800000>;
190		regulator-max-microvolt = <1800000>;
191		vin-supply = <&vcc_1v8_s3>;
192	};
193
194	vcc_2v0_pldo_s3: regulator-vcc-2v0-pldo-s3 {
195		compatible = "regulator-fixed";
196		regulator-name = "vcc_2v0_pldo_s3";
197		regulator-boot-on;
198		regulator-always-on;
199		regulator-min-microvolt = <2000000>;
200		regulator-max-microvolt = <2000000>;
201		vin-supply = <&vcc_sys>;
202	};
203
204	vcc_3v3_s0: regulator-vcc-3v3-s0 {
205		compatible = "regulator-fixed";
206		regulator-name = "vcc_3v3_s0";
207		regulator-boot-on;
208		regulator-always-on;
209		regulator-min-microvolt = <3300000>;
210		regulator-max-microvolt = <3300000>;
211		vin-supply = <&vcc_3v3_s3>;
212	};
213
214	vcc_ufs_s0: regulator-vcc-ufs-s0 {
215		compatible = "regulator-fixed";
216		regulator-name = "vcc_ufs_s0";
217		regulator-boot-on;
218		regulator-always-on;
219		regulator-min-microvolt = <3300000>;
220		regulator-max-microvolt = <3300000>;
221		vin-supply = <&vcc_sys>;
222	};
223};
224
225&cpu_l0 {
226	cpu-supply = <&vdd_cpu_lit_s0>;
227};
228
229&cpu_b0 {
230	cpu-supply = <&vdd_cpu_big_s0>;
231};
232
233&combphy1_psu {
234	status = "okay";
235};
236
237&gmac0 {
238	clock_in_out = "output";
239	phy-mode = "rgmii-rxid";
240	phy-handle = <&rgmii_phy0>;
241	pinctrl-names = "default";
242	pinctrl-0 = <&eth0m0_miim
243		     &eth0m0_tx_bus2
244		     &eth0m0_rx_bus2
245		     &eth0m0_rgmii_clk
246		     &eth0m0_rgmii_bus
247		     &ethm0_clk0_25m_out>;
248	snps,reset-gpio = <&gpio2 RK_PB5 GPIO_ACTIVE_LOW>;
249	snps,reset-active-low;
250	snps,reset-delays-us = <0 20000 100000>;
251	tx_delay = <0x21>;
252	status = "okay";
253};
254
255&gmac1 {
256	clock_in_out = "output";
257	phy-handle = <&rgmii_phy1>;
258	phy-mode = "rgmii-rxid";
259	pinctrl-names = "default";
260	pinctrl-0 = <&eth1m0_miim
261		     &eth1m0_tx_bus2
262		     &eth1m0_rx_bus2
263		     &eth1m0_rgmii_clk
264		     &eth1m0_rgmii_bus
265		     &ethm0_clk1_25m_out>;
266	snps,reset-gpio = <&gpio3 RK_PA3 GPIO_ACTIVE_LOW>;
267	snps,reset-active-low;
268	snps,reset-delays-us = <0 20000 100000>;
269	tx_delay = <0x20>;
270	status = "okay";
271};
272
273&i2c1 {
274	status = "okay";
275
276	rk806: pmic@23 {
277		compatible = "rockchip,rk806";
278		reg = <0x23>;
279		interrupt-parent = <&gpio0>;
280		interrupts = <6 IRQ_TYPE_LEVEL_LOW>;
281		gpio-controller;
282		#gpio-cells = <2>;
283		pinctrl-names = "default";
284		pinctrl-0 = <&pmic_pins>, <&rk806_dvs1_null>,
285			    <&rk806_dvs2_null>, <&rk806_dvs3_null>;
286		system-power-controller;
287
288		vcc1-supply = <&vcc_sys>;
289		vcc2-supply = <&vcc_sys>;
290		vcc3-supply = <&vcc_sys>;
291		vcc4-supply = <&vcc_sys>;
292		vcc5-supply = <&vcc_sys>;
293		vcc6-supply = <&vcc_sys>;
294		vcc7-supply = <&vcc_sys>;
295		vcc8-supply = <&vcc_sys>;
296		vcc9-supply = <&vcc_sys>;
297		vcc10-supply = <&vcc_sys>;
298		vcc11-supply = <&vcc_2v0_pldo_s3>;
299		vcc12-supply = <&vcc_sys>;
300		vcc13-supply = <&vcc_1v1_nldo_s3>;
301		vcc14-supply = <&vcc_1v1_nldo_s3>;
302		vcca-supply = <&vcc_sys>;
303
304		rk806_dvs1_null: dvs1-null-pins {
305			pins = "gpio_pwrctrl1";
306			function = "pin_fun0";
307		};
308
309		rk806_dvs2_null: dvs2-null-pins {
310			pins = "gpio_pwrctrl2";
311			function = "pin_fun0";
312		};
313
314		rk806_dvs3_null: dvs3-null-pins {
315			pins = "gpio_pwrctrl3";
316			function = "pin_fun0";
317		};
318
319		rk806_dvs1_slp: dvs1-slp-pins {
320			pins = "gpio_pwrctrl1";
321			function = "pin_fun1";
322		};
323
324		rk806_dvs1_pwrdn: dvs1-pwrdn-pins {
325			pins = "gpio_pwrctrl1";
326			function = "pin_fun2";
327		};
328
329		rk806_dvs1_rst: dvs1-rst-pins {
330			pins = "gpio_pwrctrl1";
331			function = "pin_fun3";
332		};
333
334		rk806_dvs2_slp: dvs2-slp-pins {
335			pins = "gpio_pwrctrl2";
336			function = "pin_fun1";
337		};
338
339		rk806_dvs2_pwrdn: dvs2-pwrdn-pins {
340			pins = "gpio_pwrctrl2";
341			function = "pin_fun2";
342		};
343
344		rk806_dvs2_rst: dvs2-rst-pins {
345			pins = "gpio_pwrctrl2";
346			function = "pin_fun3";
347		};
348
349		rk806_dvs2_dvs: dvs2-dvs-pins {
350			pins = "gpio_pwrctrl2";
351			function = "pin_fun4";
352		};
353
354		rk806_dvs2_gpio: dvs2-gpio-pins {
355			pins = "gpio_pwrctrl2";
356			function = "pin_fun5";
357		};
358
359		rk806_dvs3_slp: dvs3-slp-pins {
360			pins = "gpio_pwrctrl3";
361			function = "pin_fun1";
362		};
363
364		rk806_dvs3_pwrdn: dvs3-pwrdn-pins {
365			pins = "gpio_pwrctrl3";
366			function = "pin_fun2";
367		};
368
369		rk806_dvs3_rst: dvs3-rst-pins {
370			pins = "gpio_pwrctrl3";
371			function = "pin_fun3";
372		};
373
374		rk806_dvs3_dvs: dvs3-dvs-pins {
375			pins = "gpio_pwrctrl3";
376			function = "pin_fun4";
377		};
378
379		rk806_dvs3_gpio: dvs3-gpio-pins {
380			pins = "gpio_pwrctrl3";
381			function = "pin_fun5";
382		};
383
384		regulators {
385			vdd_cpu_big_s0: dcdc-reg1 {
386				regulator-always-on;
387				regulator-boot-on;
388				regulator-min-microvolt = <550000>;
389				regulator-max-microvolt = <950000>;
390				regulator-ramp-delay = <12500>;
391				regulator-name = "vdd_cpu_big_s0";
392				regulator-enable-ramp-delay = <400>;
393
394				regulator-state-mem {
395					regulator-off-in-suspend;
396				};
397			};
398
399			vdd_npu_s0: dcdc-reg2 {
400				regulator-boot-on;
401				regulator-min-microvolt = <550000>;
402				regulator-max-microvolt = <950000>;
403				regulator-ramp-delay = <12500>;
404				regulator-name = "vdd_npu_s0";
405				regulator-enable-ramp-delay = <400>;
406
407				regulator-state-mem {
408					regulator-off-in-suspend;
409				};
410			};
411
412			vdd_cpu_lit_s0: dcdc-reg3 {
413				regulator-always-on;
414				regulator-boot-on;
415				regulator-min-microvolt = <550000>;
416				regulator-max-microvolt = <950000>;
417				regulator-ramp-delay = <12500>;
418				regulator-name = "vdd_cpu_lit_s0";
419
420				regulator-state-mem {
421					regulator-off-in-suspend;
422					regulator-suspend-microvolt = <750000>;
423				};
424			};
425
426			vcc_3v3_s3: dcdc-reg4 {
427				regulator-always-on;
428				regulator-boot-on;
429				regulator-min-microvolt = <3300000>;
430				regulator-max-microvolt = <3300000>;
431				regulator-name = "vcc_3v3_s3";
432
433				regulator-state-mem {
434					regulator-on-in-suspend;
435					regulator-suspend-microvolt = <3300000>;
436				};
437			};
438
439			vdd_gpu_s0: dcdc-reg5 {
440				regulator-boot-on;
441				regulator-min-microvolt = <550000>;
442				regulator-max-microvolt = <900000>;
443				regulator-ramp-delay = <12500>;
444				regulator-name = "vdd_gpu_s0";
445				regulator-enable-ramp-delay = <400>;
446
447				regulator-state-mem {
448					regulator-off-in-suspend;
449					regulator-suspend-microvolt = <850000>;
450				};
451			};
452
453			vddq_ddr_s0: dcdc-reg6 {
454				regulator-always-on;
455				regulator-boot-on;
456				regulator-name = "vddq_ddr_s0";
457
458				regulator-state-mem {
459					regulator-off-in-suspend;
460				};
461			};
462
463			vdd_logic_s0: dcdc-reg7 {
464				regulator-always-on;
465				regulator-boot-on;
466				regulator-min-microvolt = <550000>;
467				regulator-max-microvolt = <800000>;
468				regulator-name = "vdd_logic_s0";
469
470				regulator-state-mem {
471					regulator-off-in-suspend;
472				};
473			};
474
475			vcc_1v8_s3: dcdc-reg8 {
476				regulator-always-on;
477				regulator-boot-on;
478				regulator-min-microvolt = <1800000>;
479				regulator-max-microvolt = <1800000>;
480				regulator-name = "vcc_1v8_s3";
481
482				regulator-state-mem {
483					regulator-on-in-suspend;
484					regulator-suspend-microvolt = <1800000>;
485				};
486			};
487
488			vdd2_ddr_s3: dcdc-reg9 {
489				regulator-always-on;
490				regulator-boot-on;
491				regulator-name = "vdd2_ddr_s3";
492
493				regulator-state-mem {
494					regulator-on-in-suspend;
495				};
496			};
497
498			vdd_ddr_s0: dcdc-reg10 {
499				regulator-always-on;
500				regulator-boot-on;
501				regulator-min-microvolt = <550000>;
502				regulator-max-microvolt = <1200000>;
503				regulator-name = "vdd_ddr_s0";
504
505				regulator-state-mem {
506					regulator-off-in-suspend;
507				};
508			};
509
510			vcca_1v8_s0: pldo-reg1 {
511				regulator-always-on;
512				regulator-boot-on;
513				regulator-min-microvolt = <1800000>;
514				regulator-max-microvolt = <1800000>;
515				regulator-name = "vcca_1v8_s0";
516
517				regulator-state-mem {
518					regulator-off-in-suspend;
519				};
520			};
521
522			vcca1v8_pldo2_s0: pldo-reg2 {
523				regulator-always-on;
524				regulator-boot-on;
525				regulator-min-microvolt = <1800000>;
526				regulator-max-microvolt = <1800000>;
527				regulator-name = "vcca1v8_pldo2_s0";
528
529				regulator-state-mem {
530					regulator-off-in-suspend;
531				};
532			};
533
534			vdda_1v2_s0: pldo-reg3 {
535				regulator-always-on;
536				regulator-boot-on;
537				regulator-min-microvolt = <1200000>;
538				regulator-max-microvolt = <1200000>;
539				regulator-name = "vdda_1v2_s0";
540
541				regulator-state-mem {
542					regulator-off-in-suspend;
543				};
544			};
545
546			vcca_3v3_s0: pldo-reg4 {
547				regulator-always-on;
548				regulator-boot-on;
549				regulator-min-microvolt = <3300000>;
550				regulator-max-microvolt = <3300000>;
551				regulator-name = "vcca_3v3_s0";
552
553				regulator-state-mem {
554					regulator-off-in-suspend;
555				};
556			};
557
558			vccio_sd_s0: pldo-reg5 {
559				regulator-always-on;
560				regulator-boot-on;
561				regulator-min-microvolt = <1800000>;
562				regulator-max-microvolt = <3300000>;
563				regulator-name = "vccio_sd_s0";
564
565				regulator-state-mem {
566					regulator-off-in-suspend;
567				};
568			};
569
570			vcca1v8_pldo6_s3: pldo-reg6 {
571				regulator-always-on;
572				regulator-boot-on;
573				regulator-min-microvolt = <1800000>;
574				regulator-max-microvolt = <1800000>;
575				regulator-name = "vcca1v8_pldo6_s3";
576
577				regulator-state-mem {
578					regulator-on-in-suspend;
579					regulator-suspend-microvolt = <1800000>;
580				};
581			};
582
583			vdd_0v75_s3: nldo-reg1 {
584				regulator-always-on;
585				regulator-boot-on;
586				regulator-min-microvolt = <550000>;
587				regulator-max-microvolt = <750000>;
588				regulator-name = "vdd_0v75_s3";
589
590				regulator-state-mem {
591					regulator-on-in-suspend;
592					regulator-suspend-microvolt = <750000>;
593				};
594			};
595
596			vdda_ddr_pll_s0: nldo-reg2 {
597				regulator-always-on;
598				regulator-boot-on;
599				regulator-min-microvolt = <850000>;
600				regulator-max-microvolt = <850000>;
601				regulator-name = "vdda_ddr_pll_s0";
602
603				regulator-state-mem {
604					regulator-off-in-suspend;
605				};
606			};
607
608			vdda0v75_hdmi_s0: nldo-reg3 {
609				regulator-boot-on;
610				regulator-min-microvolt = <837500>;
611				regulator-max-microvolt = <837500>;
612				regulator-name = "vdda0v75_hdmi_s0";
613
614				regulator-state-mem {
615					regulator-off-in-suspend;
616				};
617			};
618
619			vdda_0v85_s0: nldo-reg4 {
620				regulator-always-on;
621				regulator-boot-on;
622				regulator-min-microvolt = <850000>;
623				regulator-max-microvolt = <850000>;
624				regulator-name = "vdda_0v85_s0";
625
626				regulator-state-mem {
627					regulator-off-in-suspend;
628				};
629			};
630
631			vdda_0v75_s0: nldo-reg5 {
632				regulator-always-on;
633				regulator-boot-on;
634				regulator-min-microvolt = <750000>;
635				regulator-max-microvolt = <750000>;
636				regulator-name = "vdda_0v75_s0";
637
638				regulator-state-mem {
639					regulator-off-in-suspend;
640				};
641			};
642		};
643	};
644};
645
646&mdio0 {
647	rgmii_phy0: phy@1 {
648		compatible = "ethernet-phy-ieee802.3-c22";
649		reg = <0x1>;
650		clocks = <&cru REFCLKO25M_GMAC0_OUT>;
651	};
652};
653
654&mdio1 {
655	rgmii_phy1: phy@1 {
656		compatible = "ethernet-phy-ieee802.3-c22";
657		reg = <0x1>;
658		clocks = <&cru REFCLKO25M_GMAC1_OUT>;
659	};
660};
661
662&pinctrl {
663	usb {
664		usb_host_pwren: usb-host-pwren {
665			rockchip,pins = <0 RK_PC7 RK_FUNC_GPIO &pcfg_pull_none>;
666		};
667
668		usb_otg0_pwren: usb-otg0-pwren {
669			rockchip,pins = <0 RK_PD1 RK_FUNC_GPIO &pcfg_pull_none>;
670		};
671
672		usbc0_int: usbc0-int {
673			rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_up>;
674		};
675	};
676};
677
678&sdmmc {
679	bus-width = <4>;
680	cap-mmc-highspeed;
681	cap-sd-highspeed;
682	disable-wp;
683	max-frequency = <200000000>;
684	no-sdio;
685	no-mmc;
686	sd-uhs-sdr104;
687	vqmmc-supply = <&vccio_sd_s0>;
688	status = "okay";
689};
690
691&saradc {
692	vref-supply = <&vcca_1v8_s0>;
693	status = "okay";
694};
695
696&u2phy0 {
697	status = "okay";
698};
699
700&u2phy0_otg {
701	phy-supply = <&vbus5v0_typec>;
702	status = "okay";
703};
704
705&u2phy1 {
706	status = "okay";
707};
708
709&u2phy1_otg {
710	phy-supply = <&vcc5v0_host>;
711	status = "okay";
712};
713
714&uart0 {
715	status = "okay";
716};
717
718&usbdp_phy {
719	rockchip,dp-lane-mux = <2 3>;
720	status = "okay";
721};
722
723&usb_drd0_dwc3 {
724	dr_mode = "host";
725	status = "okay";
726};
727
728&usb_drd1_dwc3 {
729	dr_mode = "host";
730	status = "okay";
731};
732