1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/*
3 * Copyright (c) 2021 Rockchip Electronics Co., Ltd.
4 *
5 */
6
7/dts-v1/;
8#include <dt-bindings/gpio/gpio.h>
9#include <dt-bindings/leds/common.h>
10#include <dt-bindings/pinctrl/rockchip.h>
11#include <dt-bindings/soc/rockchip,vop2.h>
12#include "rk3568.dtsi"
13
14/ {
15	model = "Rockchip RK3568 EVB1 DDR4 V10 Board";
16	compatible = "rockchip,rk3568-evb1-v10", "rockchip,rk3568";
17
18	aliases {
19		ethernet0 = &gmac0;
20		ethernet1 = &gmac1;
21		mmc0 = &sdmmc0;
22		mmc1 = &sdhci;
23	};
24
25	chosen: chosen {
26		stdout-path = "serial2:1500000n8";
27	};
28
29	dc_12v: dc-12v {
30		compatible = "regulator-fixed";
31		regulator-name = "dc_12v";
32		regulator-always-on;
33		regulator-boot-on;
34		regulator-min-microvolt = <12000000>;
35		regulator-max-microvolt = <12000000>;
36	};
37
38	hdmi-con {
39		compatible = "hdmi-connector";
40		type = "a";
41
42		port {
43			hdmi_con_in: endpoint {
44				remote-endpoint = <&hdmi_out_con>;
45			};
46		};
47	};
48
49	leds {
50		compatible = "gpio-leds";
51
52		led_work: led-0 {
53			gpios = <&gpio0 RK_PC0 GPIO_ACTIVE_HIGH>;
54			function = LED_FUNCTION_HEARTBEAT;
55			color = <LED_COLOR_ID_BLUE>;
56			linux,default-trigger = "heartbeat";
57			pinctrl-names = "default";
58			pinctrl-0 = <&led_work_en>;
59		};
60	};
61
62	rk809-sound {
63		compatible = "simple-audio-card";
64		simple-audio-card,format = "i2s";
65		simple-audio-card,name = "Analog RK809";
66		simple-audio-card,mclk-fs = <256>;
67
68		simple-audio-card,cpu {
69			sound-dai = <&i2s1_8ch>;
70		};
71		simple-audio-card,codec {
72			sound-dai = <&rk809>;
73		};
74	};
75
76	vcc3v3_sys: vcc3v3-sys {
77		compatible = "regulator-fixed";
78		regulator-name = "vcc3v3_sys";
79		regulator-always-on;
80		regulator-boot-on;
81		regulator-min-microvolt = <3300000>;
82		regulator-max-microvolt = <3300000>;
83		vin-supply = <&dc_12v>;
84	};
85
86	vcc5v0_sys: vcc5v0-sys {
87		compatible = "regulator-fixed";
88		regulator-name = "vcc5v0_sys";
89		regulator-always-on;
90		regulator-boot-on;
91		regulator-min-microvolt = <5000000>;
92		regulator-max-microvolt = <5000000>;
93		vin-supply = <&dc_12v>;
94	};
95
96	vcc5v0_usb: vcc5v0-usb {
97		compatible = "regulator-fixed";
98		regulator-name = "vcc5v0_usb";
99		regulator-always-on;
100		regulator-boot-on;
101		regulator-min-microvolt = <5000000>;
102		regulator-max-microvolt = <5000000>;
103		vin-supply = <&dc_12v>;
104	};
105
106	vcc5v0_usb_host: vcc5v0-usb-host {
107		compatible = "regulator-fixed";
108		enable-active-high;
109		gpio = <&gpio0 RK_PA6 GPIO_ACTIVE_HIGH>;
110		pinctrl-names = "default";
111		pinctrl-0 = <&vcc5v0_usb_host_en>;
112		regulator-name = "vcc5v0_usb_host";
113		regulator-min-microvolt = <5000000>;
114		regulator-max-microvolt = <5000000>;
115		vin-supply = <&vcc5v0_usb>;
116	};
117
118	vcc5v0_usb_otg: vcc5v0-usb-otg {
119		compatible = "regulator-fixed";
120		enable-active-high;
121		gpio = <&gpio0 RK_PA5 GPIO_ACTIVE_HIGH>;
122		pinctrl-names = "default";
123		pinctrl-0 = <&vcc5v0_usb_otg_en>;
124		regulator-name = "vcc5v0_usb_otg";
125		regulator-min-microvolt = <5000000>;
126		regulator-max-microvolt = <5000000>;
127		vin-supply = <&vcc5v0_usb>;
128	};
129
130	vcc3v3_lcd0_n: vcc3v3-lcd0-n {
131		compatible = "regulator-fixed";
132		regulator-name = "vcc3v3_lcd0_n";
133		regulator-min-microvolt = <3300000>;
134		regulator-max-microvolt = <3300000>;
135		enable-active-high;
136		gpio = <&gpio0 RK_PC7 GPIO_ACTIVE_HIGH>;
137		vin-supply = <&vcc3v3_sys>;
138		pinctrl-names = "default";
139		pinctrl-0 = <&vcc3v3_lcd0_n_en>;
140
141		regulator-state-mem {
142			regulator-off-in-suspend;
143		};
144	};
145
146	vcc3v3_lcd1_n: vcc3v3-lcd1-n {
147		compatible = "regulator-fixed";
148		regulator-name = "vcc3v3_lcd1_n";
149		regulator-min-microvolt = <3300000>;
150		regulator-max-microvolt = <3300000>;
151		enable-active-high;
152		gpio = <&gpio0 RK_PC5 GPIO_ACTIVE_HIGH>;
153		vin-supply = <&vcc3v3_sys>;
154		pinctrl-names = "default";
155		pinctrl-0 = <&vcc3v3_lcd1_n_en>;
156
157		regulator-state-mem {
158			regulator-off-in-suspend;
159		};
160	};
161};
162
163&combphy0 {
164	status = "okay";
165};
166
167&combphy1 {
168	status = "okay";
169};
170
171&cpu0 {
172	cpu-supply = <&vdd_cpu>;
173};
174
175&cpu1 {
176	cpu-supply = <&vdd_cpu>;
177};
178
179&cpu2 {
180	cpu-supply = <&vdd_cpu>;
181};
182
183&cpu3 {
184	cpu-supply = <&vdd_cpu>;
185};
186
187&gmac0 {
188	assigned-clocks = <&cru SCLK_GMAC0_RX_TX>, <&cru SCLK_GMAC0>;
189	assigned-clock-parents = <&cru SCLK_GMAC0_RGMII_SPEED>;
190	assigned-clock-rates = <0>, <125000000>;
191	clock_in_out = "output";
192	phy-handle = <&rgmii_phy0>;
193	phy-mode = "rgmii-id";
194	pinctrl-names = "default";
195	pinctrl-0 = <&gmac0_miim
196		     &gmac0_tx_bus2
197		     &gmac0_rx_bus2
198		     &gmac0_rgmii_clk
199		     &gmac0_rgmii_bus>;
200	status = "okay";
201};
202
203&gmac1 {
204	assigned-clocks = <&cru SCLK_GMAC1_RX_TX>, <&cru SCLK_GMAC1>;
205	assigned-clock-parents = <&cru SCLK_GMAC1_RGMII_SPEED>;
206	assigned-clock-rates = <0>, <125000000>;
207	clock_in_out = "output";
208	phy-handle = <&rgmii_phy1>;
209	phy-mode = "rgmii-id";
210	pinctrl-names = "default";
211	pinctrl-0 = <&gmac1m1_miim
212		     &gmac1m1_tx_bus2
213		     &gmac1m1_rx_bus2
214		     &gmac1m1_rgmii_clk
215		     &gmac1m1_rgmii_bus>;
216	status = "okay";
217};
218
219&gpu {
220	mali-supply = <&vdd_gpu>;
221	status = "okay";
222};
223
224&hdmi {
225	avdd-0v9-supply = <&vdda0v9_image>;
226	avdd-1v8-supply = <&vcca1v8_image>;
227	status = "okay";
228};
229
230&hdmi_in {
231	hdmi_in_vp0: endpoint {
232		remote-endpoint = <&vp0_out_hdmi>;
233	};
234};
235
236&hdmi_out {
237	hdmi_out_con: endpoint {
238		remote-endpoint = <&hdmi_con_in>;
239	};
240};
241
242&hdmi_sound {
243	status = "okay";
244};
245
246&i2c0 {
247	status = "okay";
248
249	vdd_cpu: regulator@1c {
250		compatible = "tcs,tcs4525";
251		reg = <0x1c>;
252		fcs,suspend-voltage-selector = <1>;
253		regulator-name = "vdd_cpu";
254		regulator-always-on;
255		regulator-boot-on;
256		regulator-min-microvolt = <800000>;
257		regulator-max-microvolt = <1150000>;
258		regulator-ramp-delay = <2300>;
259		vin-supply = <&vcc5v0_sys>;
260
261		regulator-state-mem {
262			regulator-off-in-suspend;
263		};
264	};
265
266	rk809: pmic@20 {
267		compatible = "rockchip,rk809";
268		reg = <0x20>;
269		interrupt-parent = <&gpio0>;
270		interrupts = <RK_PA3 IRQ_TYPE_LEVEL_LOW>;
271		assigned-clocks = <&cru I2S1_MCLKOUT_TX>;
272		assigned-clock-parents = <&cru CLK_I2S1_8CH_TX>;
273		#clock-cells = <1>;
274		clock-names = "mclk";
275		clocks = <&cru I2S1_MCLKOUT_TX>;
276		pinctrl-names = "default";
277		pinctrl-0 = <&pmic_int>, <&i2s1m0_mclk>;
278		rockchip,system-power-controller;
279		#sound-dai-cells = <0>;
280		vcc1-supply = <&vcc3v3_sys>;
281		vcc2-supply = <&vcc3v3_sys>;
282		vcc3-supply = <&vcc3v3_sys>;
283		vcc4-supply = <&vcc3v3_sys>;
284		vcc5-supply = <&vcc3v3_sys>;
285		vcc6-supply = <&vcc3v3_sys>;
286		vcc7-supply = <&vcc3v3_sys>;
287		vcc8-supply = <&vcc3v3_sys>;
288		vcc9-supply = <&vcc3v3_sys>;
289		wakeup-source;
290
291		regulators {
292			vdd_logic: DCDC_REG1 {
293				regulator-name = "vdd_logic";
294				regulator-always-on;
295				regulator-boot-on;
296				regulator-initial-mode = <0x2>;
297				regulator-min-microvolt = <500000>;
298				regulator-max-microvolt = <1350000>;
299				regulator-ramp-delay = <6001>;
300
301				regulator-state-mem {
302					regulator-off-in-suspend;
303				};
304			};
305
306			vdd_gpu: DCDC_REG2 {
307				regulator-name = "vdd_gpu";
308				regulator-always-on;
309				regulator-initial-mode = <0x2>;
310				regulator-min-microvolt = <500000>;
311				regulator-max-microvolt = <1350000>;
312				regulator-ramp-delay = <6001>;
313
314				regulator-state-mem {
315					regulator-off-in-suspend;
316				};
317			};
318
319			vcc_ddr: DCDC_REG3 {
320				regulator-name = "vcc_ddr";
321				regulator-always-on;
322				regulator-boot-on;
323				regulator-initial-mode = <0x2>;
324
325				regulator-state-mem {
326					regulator-on-in-suspend;
327				};
328			};
329
330			vdd_npu: DCDC_REG4 {
331				regulator-name = "vdd_npu";
332				regulator-initial-mode = <0x2>;
333				regulator-min-microvolt = <500000>;
334				regulator-max-microvolt = <1350000>;
335				regulator-ramp-delay = <6001>;
336
337				regulator-state-mem {
338					regulator-off-in-suspend;
339				};
340			};
341
342			vcc_1v8: DCDC_REG5 {
343				regulator-name = "vcc_1v8";
344				regulator-always-on;
345				regulator-boot-on;
346				regulator-min-microvolt = <1800000>;
347				regulator-max-microvolt = <1800000>;
348
349				regulator-state-mem {
350					regulator-off-in-suspend;
351				};
352			};
353
354			vdda0v9_image: LDO_REG1 {
355				regulator-name = "vdda0v9_image";
356				regulator-min-microvolt = <900000>;
357				regulator-max-microvolt = <900000>;
358
359				regulator-state-mem {
360					regulator-off-in-suspend;
361				};
362			};
363
364			vdda_0v9: LDO_REG2 {
365				regulator-name = "vdda_0v9";
366				regulator-always-on;
367				regulator-boot-on;
368				regulator-min-microvolt = <900000>;
369				regulator-max-microvolt = <900000>;
370
371				regulator-state-mem {
372					regulator-off-in-suspend;
373				};
374			};
375
376			vdda0v9_pmu: LDO_REG3 {
377				regulator-name = "vdda0v9_pmu";
378				regulator-always-on;
379				regulator-boot-on;
380				regulator-min-microvolt = <900000>;
381				regulator-max-microvolt = <900000>;
382
383				regulator-state-mem {
384					regulator-on-in-suspend;
385					regulator-suspend-microvolt = <900000>;
386				};
387			};
388
389			vccio_acodec: LDO_REG4 {
390				regulator-name = "vccio_acodec";
391				regulator-always-on;
392				regulator-min-microvolt = <3300000>;
393				regulator-max-microvolt = <3300000>;
394
395				regulator-state-mem {
396					regulator-off-in-suspend;
397				};
398			};
399
400			vccio_sd: LDO_REG5 {
401				regulator-name = "vccio_sd";
402				regulator-min-microvolt = <1800000>;
403				regulator-max-microvolt = <3300000>;
404
405				regulator-state-mem {
406					regulator-off-in-suspend;
407				};
408			};
409
410			vcc3v3_pmu: LDO_REG6 {
411				regulator-name = "vcc3v3_pmu";
412				regulator-always-on;
413				regulator-boot-on;
414				regulator-min-microvolt = <3300000>;
415				regulator-max-microvolt = <3300000>;
416
417				regulator-state-mem {
418					regulator-on-in-suspend;
419					regulator-suspend-microvolt = <3300000>;
420				};
421			};
422
423			vcca_1v8: LDO_REG7 {
424				regulator-name = "vcca_1v8";
425				regulator-always-on;
426				regulator-boot-on;
427				regulator-min-microvolt = <1800000>;
428				regulator-max-microvolt = <1800000>;
429
430				regulator-state-mem {
431					regulator-off-in-suspend;
432				};
433			};
434
435			vcca1v8_pmu: LDO_REG8 {
436				regulator-name = "vcca1v8_pmu";
437				regulator-always-on;
438				regulator-boot-on;
439				regulator-min-microvolt = <1800000>;
440				regulator-max-microvolt = <1800000>;
441
442				regulator-state-mem {
443					regulator-on-in-suspend;
444					regulator-suspend-microvolt = <1800000>;
445				};
446			};
447
448			vcca1v8_image: LDO_REG9 {
449				regulator-name = "vcca1v8_image";
450				regulator-min-microvolt = <1800000>;
451				regulator-max-microvolt = <1800000>;
452
453				regulator-state-mem {
454					regulator-off-in-suspend;
455				};
456			};
457
458			vcc_3v3: SWITCH_REG1 {
459				regulator-name = "vcc_3v3";
460				regulator-always-on;
461				regulator-boot-on;
462
463				regulator-state-mem {
464					regulator-off-in-suspend;
465				};
466			};
467
468			vcc3v3_sd: SWITCH_REG2 {
469				regulator-name = "vcc3v3_sd";
470
471				regulator-state-mem {
472					regulator-off-in-suspend;
473				};
474			};
475		};
476
477		codec {
478			mic-in-differential;
479		};
480	};
481};
482
483&i2c1 {
484	status = "okay";
485
486	touchscreen0: goodix@14 {
487		compatible = "goodix,gt1151";
488		reg = <0x14>;
489		interrupt-parent = <&gpio0>;
490		interrupts = <RK_PB5 IRQ_TYPE_EDGE_FALLING>;
491		AVDD28-supply = <&vcc3v3_lcd0_n>;
492		irq-gpios = <&gpio0 RK_PB5 GPIO_ACTIVE_HIGH>;
493		pinctrl-names = "default";
494		pinctrl-0 = <&touch_int &touch_rst>;
495		reset-gpios = <&gpio0 RK_PB6 GPIO_ACTIVE_HIGH>;
496		VDDIO-supply = <&vcc3v3_lcd0_n>;
497	};
498};
499
500&i2s0_8ch {
501	status = "okay";
502};
503
504&i2s1_8ch {
505	rockchip,trcm-sync-tx-only;
506	status = "okay";
507};
508
509&mdio0 {
510	rgmii_phy0: ethernet-phy@0 {
511		compatible = "ethernet-phy-ieee802.3-c22";
512		reg = <0x0>;
513		reset-assert-us = <20000>;
514		reset-deassert-us = <100000>;
515		reset-gpios = <&gpio2 RK_PD3 GPIO_ACTIVE_LOW>;
516	};
517};
518
519&mdio1 {
520	rgmii_phy1: ethernet-phy@0 {
521		compatible = "ethernet-phy-ieee802.3-c22";
522		reg = <0x0>;
523		reset-assert-us = <20000>;
524		reset-deassert-us = <100000>;
525		reset-gpios = <&gpio2 RK_PD1 GPIO_ACTIVE_LOW>;
526	};
527};
528
529&pinctrl {
530	display {
531		vcc3v3_lcd0_n_en: vcc3v3_lcd0_n_en {
532			rockchip,pins = <0 RK_PC7 0 &pcfg_pull_none>;
533		};
534		vcc3v3_lcd1_n_en: vcc3v3_lcd1_n_en {
535			rockchip,pins = <0 RK_PC5 0 &pcfg_pull_none>;
536		};
537	};
538
539	leds {
540		led_work_en: led_work_en {
541			rockchip,pins = <0 RK_PC0 RK_FUNC_GPIO &pcfg_pull_none>;
542		};
543	};
544
545	pmic {
546		pmic_int: pmic_int {
547			rockchip,pins =
548				<0 RK_PA3 RK_FUNC_GPIO &pcfg_pull_up>;
549		};
550	};
551
552	touchscreen {
553		touch_int: touch_int {
554			rockchip,pins = <0 RK_PB5 RK_FUNC_GPIO &pcfg_pull_up>;
555		};
556		touch_rst: touch_rst {
557			rockchip,pins = <0 RK_PB6 RK_FUNC_GPIO &pcfg_pull_none>;
558		};
559	};
560
561	usb {
562		vcc5v0_usb_host_en: vcc5v0_usb_host_en {
563			rockchip,pins = <0 RK_PA6 RK_FUNC_GPIO &pcfg_pull_none>;
564		};
565		vcc5v0_usb_otg_en: vcc5v0_usb_otg_en {
566			rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_none>;
567		};
568	};
569};
570
571&pmu_io_domains {
572	pmuio1-supply = <&vcc3v3_pmu>;
573	pmuio2-supply = <&vcc3v3_pmu>;
574	vccio1-supply = <&vccio_acodec>;
575	vccio2-supply = <&vcc_1v8>;
576	vccio3-supply = <&vccio_sd>;
577	vccio4-supply = <&vcc_1v8>;
578	vccio5-supply = <&vcc_3v3>;
579	vccio6-supply = <&vcc_1v8>;
580	vccio7-supply = <&vcc_3v3>;
581	status = "okay";
582};
583
584&saradc {
585	vref-supply = <&vcca_1v8>;
586	status = "okay";
587};
588
589&sdhci {
590	bus-width = <8>;
591	max-frequency = <200000000>;
592	non-removable;
593	pinctrl-names = "default";
594	pinctrl-0 = <&emmc_bus8 &emmc_clk &emmc_cmd &emmc_datastrobe>;
595	status = "okay";
596};
597
598&sdmmc0 {
599	bus-width = <4>;
600	cap-sd-highspeed;
601	cd-gpios = <&gpio0 RK_PA4 GPIO_ACTIVE_LOW>;
602	disable-wp;
603	pinctrl-names = "default";
604	pinctrl-0 = <&sdmmc0_bus4 &sdmmc0_clk &sdmmc0_cmd &sdmmc0_det>;
605	sd-uhs-sdr104;
606	vmmc-supply = <&vcc3v3_sd>;
607	vqmmc-supply = <&vccio_sd>;
608	status = "okay";
609};
610
611&tsadc {
612	rockchip,hw-tshut-mode = <1>;
613	rockchip,hw-tshut-polarity = <0>;
614	status = "okay";
615};
616
617&uart2 {
618	status = "okay";
619};
620
621&usb_host0_ehci {
622	status = "okay";
623};
624
625&usb_host0_ohci {
626	status = "okay";
627};
628
629&usb_host0_xhci {
630	extcon = <&usb2phy0>;
631	status = "okay";
632};
633
634&usb_host1_ehci {
635	status = "okay";
636};
637
638&usb_host1_ohci {
639	status = "okay";
640};
641
642&usb_host1_xhci {
643	status = "okay";
644};
645
646&usb2phy0 {
647	status = "okay";
648};
649
650&usb2phy0_host {
651	phy-supply = <&vcc5v0_usb_host>;
652	status = "okay";
653};
654
655&usb2phy0_otg {
656	phy-supply = <&vcc5v0_usb_otg>;
657	status = "okay";
658};
659
660&usb2phy1 {
661	status = "okay";
662};
663
664&usb2phy1_host {
665	phy-supply = <&vcc5v0_usb_host>;
666	status = "okay";
667};
668
669&usb2phy1_otg {
670	phy-supply = <&vcc5v0_usb_host>;
671	status = "okay";
672};
673
674&vop {
675	assigned-clocks = <&cru DCLK_VOP0>, <&cru DCLK_VOP1>;
676	assigned-clock-parents = <&pmucru PLL_HPLL>, <&cru PLL_VPLL>;
677	status = "okay";
678};
679
680&vop_mmu {
681	status = "okay";
682};
683
684&vp0 {
685	vp0_out_hdmi: endpoint@ROCKCHIP_VOP2_EP_HDMI0 {
686		reg = <ROCKCHIP_VOP2_EP_HDMI0>;
687		remote-endpoint = <&hdmi_in_vp0>;
688	};
689};
690