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