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