xref: /linux/arch/arm64/boot/dts/rockchip/rk3582-radxa-e52c.dts (revision 6f17ab9a63e670bd62a287f95e3982f99eafd77e)
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/*
3 * Copyright (c) 2024 Radxa Computer (Shenzhen) Co., Ltd.
4 */
5
6/dts-v1/;
7
8#include <dt-bindings/gpio/gpio.h>
9#include <dt-bindings/input/input.h>
10#include <dt-bindings/leds/common.h>
11#include <dt-bindings/pinctrl/rockchip.h>
12#include <dt-bindings/pwm/pwm.h>
13#include "rk3588s.dtsi"
14
15/ {
16	model = "Radxa E52C";
17	compatible = "radxa,e52c", "rockchip,rk3582", "rockchip,rk3588s";
18
19	aliases {
20		mmc0 = &sdhci;
21		mmc1 = &sdmmc;
22	};
23
24	chosen {
25		stdout-path = "serial2:1500000n8";
26	};
27
28	keys-0 {
29		compatible = "adc-keys";
30		io-channels = <&saradc 0>;
31		io-channel-names = "buttons";
32		keyup-threshold-microvolt = <18000>;
33		poll-interval = <100>;
34
35		button-0 {
36			label = "Maskrom";
37			linux,code = <KEY_VENDOR>;
38			press-threshold-microvolt = <0>;
39		};
40	};
41
42	keys-1 {
43		compatible = "gpio-keys";
44		pinctrl-names = "default";
45		pinctrl-0 = <&btn_0>;
46
47		button-1 {
48			label = "User";
49			gpios = <&gpio4 RK_PB3 GPIO_ACTIVE_LOW>;
50			linux,code = <BTN_0>;
51			wakeup-source;
52		};
53	};
54
55	leds-0 {
56		compatible = "gpio-leds";
57		pinctrl-names = "default";
58		pinctrl-0 = <&led_0>;
59
60		led-0 {
61			color = <LED_COLOR_ID_GREEN>;
62			default-state = "on";
63			function = LED_FUNCTION_STATUS;
64			gpios = <&gpio3 RK_PC4 GPIO_ACTIVE_HIGH>;
65			linux,default-trigger = "heartbeat";
66		};
67	};
68
69	leds-1 {
70		compatible = "pwm-leds";
71
72		led-1 {
73			color = <LED_COLOR_ID_GREEN>;
74			default-state = "on";
75			function = LED_FUNCTION_LAN;
76			linux,default-trigger = "netdev";
77			pwms = <&pwm14 0 1000000 PWM_POLARITY_INVERTED>;
78			max-brightness = <255>;
79		};
80
81		led-2 {
82			color = <LED_COLOR_ID_GREEN>;
83			default-state = "on";
84			function = LED_FUNCTION_WAN;
85			linux,default-trigger = "netdev";
86			pwms = <&pwm11 0 1000000 PWM_POLARITY_INVERTED>;
87			max-brightness = <255>;
88		};
89	};
90
91	vcc_1v1_nldo_s3: regulator-1v1 {
92		compatible = "regulator-fixed";
93		regulator-name = "vcc_1v1_nldo_s3";
94		regulator-always-on;
95		regulator-boot-on;
96		regulator-min-microvolt = <1100000>;
97		regulator-max-microvolt = <1100000>;
98		vin-supply = <&vcc_sysin>;
99	};
100
101	vcc_3v3_pmu: regulator-3v3-0 {
102		compatible = "regulator-fixed";
103		regulator-name = "vcc_3v3_pmu";
104		regulator-always-on;
105		regulator-boot-on;
106		regulator-min-microvolt = <3300000>;
107		regulator-max-microvolt = <3300000>;
108		vin-supply = <&vcc_3v3_s3>;
109	};
110
111	vcc_3v3_s0: regulator-3v3-1 {
112		compatible = "regulator-fixed";
113		regulator-name = "vcc_3v3_s0";
114		regulator-always-on;
115		regulator-boot-on;
116		regulator-min-microvolt = <3300000>;
117		regulator-max-microvolt = <3300000>;
118		vin-supply = <&vcc_3v3_s3>;
119	};
120
121	vcca: regulator-4v0 {
122		compatible = "regulator-fixed";
123		regulator-name = "vcca";
124		regulator-always-on;
125		regulator-boot-on;
126		regulator-min-microvolt = <4000000>;
127		regulator-max-microvolt = <4000000>;
128		vin-supply = <&vcc_sysin>;
129	};
130
131	vcc5v0_usb_otg0: regulator-5v0-0 {
132		compatible = "regulator-fixed";
133		enable-active-high;
134		gpio = <&gpio0 RK_PD4 GPIO_ACTIVE_HIGH>;
135		pinctrl-names = "default";
136		pinctrl-0 = <&usb_otg_pwren_h>;
137		regulator-name = "vcc5v0_usb_otg0";
138		regulator-min-microvolt = <5000000>;
139		regulator-max-microvolt = <5000000>;
140		vin-supply = <&vcc_sysin>;
141	};
142
143	vcc_5v0: regulator-5v0-1 {
144		compatible = "regulator-fixed";
145		enable-active-high;
146		gpio = <&gpio4 RK_PA3 GPIO_ACTIVE_HIGH>;
147		pinctrl-names = "default";
148		pinctrl-0 = <&vcc_5v0_pwren_h>;
149		regulator-name = "vcc_5v0";
150		regulator-min-microvolt = <5000000>;
151		regulator-max-microvolt = <5000000>;
152		vin-supply = <&vcc_sysin>;
153	};
154
155	vcc_sysin: regulator-5v0-2 {
156		compatible = "regulator-fixed";
157		regulator-name = "vcc_sysin";
158		regulator-always-on;
159		regulator-boot-on;
160		regulator-min-microvolt = <5000000>;
161		regulator-max-microvolt = <5000000>;
162	};
163};
164
165&combphy0_ps {
166	status = "okay";
167};
168
169&combphy2_psu {
170	status = "okay";
171};
172
173/*
174 * In the Rockchip RK3582 SoC, some CPU cores end up disabled
175 * and unused because they're marked in the efuses as defective.
176 * The disabling in the DT is performed by the boot loader.
177 */
178&cpu_b0 {
179	cpu-supply = <&vdd_cpu_big0_s0>;
180};
181
182&cpu_b1 {
183	cpu-supply = <&vdd_cpu_big0_s0>;
184};
185
186&cpu_b2 {
187	cpu-supply = <&vdd_cpu_big1_s0>;
188};
189
190&cpu_b3 {
191	cpu-supply = <&vdd_cpu_big1_s0>;
192};
193
194&cpu_l0 {
195	cpu-supply = <&vdd_cpu_lit_s0>;
196};
197
198&cpu_l1 {
199	cpu-supply = <&vdd_cpu_lit_s0>;
200};
201
202&cpu_l2 {
203	cpu-supply = <&vdd_cpu_lit_s0>;
204};
205
206&cpu_l3 {
207	cpu-supply = <&vdd_cpu_lit_s0>;
208};
209
210&i2c0 {
211	pinctrl-names = "default";
212	pinctrl-0 = <&i2c0m2_xfer>;
213	status = "okay";
214
215	vdd_cpu_big0_s0: regulator@42 {
216		compatible = "rockchip,rk8602";
217		reg = <0x42>;
218		fcs,suspend-voltage-selector = <1>;
219		regulator-name = "vdd_cpu_big0_s0";
220		regulator-always-on;
221		regulator-boot-on;
222		regulator-min-microvolt = <550000>;
223		regulator-max-microvolt = <1050000>;
224		regulator-ramp-delay = <2300>;
225		vin-supply = <&vcc_sysin>;
226
227		regulator-state-mem {
228			regulator-off-in-suspend;
229		};
230	};
231
232	vdd_cpu_big1_s0: regulator@43 {
233		compatible = "rockchip,rk8603", "rockchip,rk8602";
234		reg = <0x43>;
235		fcs,suspend-voltage-selector = <1>;
236		regulator-name = "vdd_cpu_big1_s0";
237		regulator-always-on;
238		regulator-boot-on;
239		regulator-min-microvolt = <550000>;
240		regulator-max-microvolt = <1050000>;
241		regulator-ramp-delay = <2300>;
242		vin-supply = <&vcc_sysin>;
243
244		regulator-state-mem {
245			regulator-off-in-suspend;
246		};
247	};
248
249	eeprom@50 {
250		compatible = "belling,bl24c16a", "atmel,24c16";
251		reg = <0x50>;
252		pagesize = <16>;
253		read-only;
254		vcc-supply = <&vcc_3v3_pmu>;
255	};
256};
257
258&i2c2 {
259	status = "okay";
260
261	vdd_npu_s0: regulator@42 {
262		compatible = "rockchip,rk8602";
263		reg = <0x42>;
264		fcs,suspend-voltage-selector = <1>;
265		regulator-name = "vdd_npu_s0";
266		regulator-always-on;
267		regulator-boot-on;
268		regulator-min-microvolt = <550000>;
269		regulator-max-microvolt = <950000>;
270		regulator-ramp-delay = <2300>;
271		vin-supply = <&vcc_sysin>;
272
273		regulator-state-mem {
274			regulator-off-in-suspend;
275		};
276	};
277};
278
279&i2c5 {
280	pinctrl-names = "default";
281	pinctrl-0 = <&i2c5m2_xfer>;
282	status = "okay";
283
284	rtc@51 {
285		compatible = "haoyu,hym8563";
286		reg = <0x51>;
287		#clock-cells = <0>;
288		clock-output-names = "rtcic_32kout";
289		interrupt-parent = <&gpio0>;
290		interrupts = <RK_PB0 IRQ_TYPE_LEVEL_LOW>;
291		pinctrl-names = "default";
292		pinctrl-0 = <&rtc_int_l>;
293		wakeup-source;
294	};
295};
296
297&pcie2x1l1 {
298	pinctrl-names = "default";
299	pinctrl-0 = <&pcie20x1_1_perstn_m1>;
300	reset-gpios = <&gpio4 RK_PA2 GPIO_ACTIVE_HIGH>;
301	vpcie3v3-supply = <&vcc_3v3_s3>;
302	status = "okay";
303};
304
305&pcie2x1l2 {
306	pinctrl-names = "default";
307	pinctrl-0 = <&pcie20x1_2_perstn_m0>;
308	reset-gpios = <&gpio3 RK_PD1 GPIO_ACTIVE_HIGH>;
309	vpcie3v3-supply = <&vcc_3v3_s3>;
310	status = "okay";
311};
312
313&pinctrl {
314	keys {
315		btn_0: button-0 {
316			rockchip,pins = <4 RK_PB3 RK_FUNC_GPIO &pcfg_pull_none>;
317		};
318	};
319
320	leds {
321		led_0: led-0 {
322			rockchip,pins = <3 RK_PC4 RK_FUNC_GPIO &pcfg_pull_none>;
323		};
324	};
325
326	pcie {
327		pcie20x1_1_perstn_m1: pcie-1 {
328			rockchip,pins = <4 RK_PA2 RK_FUNC_GPIO &pcfg_pull_none>;
329		};
330
331		pcie20x1_2_perstn_m0: pcie-2 {
332			rockchip,pins = <3 RK_PD1 RK_FUNC_GPIO &pcfg_pull_none>;
333		};
334	};
335
336	regulators {
337		vcc_5v0_pwren_h: regulator-5v0-1 {
338			rockchip,pins = <4 RK_PA3 RK_FUNC_GPIO &pcfg_pull_none>;
339		};
340	};
341
342	rtc {
343		rtc_int_l: rtc-0 {
344			rockchip,pins = <0 RK_PB0 RK_FUNC_GPIO &pcfg_pull_none>;
345		};
346	};
347
348	usb {
349		usb_otg_pwren_h: regulator-5v0-0 {
350			rockchip,pins = <0 RK_PD4 RK_FUNC_GPIO &pcfg_pull_none>;
351		};
352	};
353};
354
355&pwm11 {
356	pinctrl-names = "default";
357	pinctrl-0 = <&pwm11m1_pins>;
358	status = "okay";
359};
360
361&pwm14 {
362	pinctrl-names = "default";
363	pinctrl-0 = <&pwm14m1_pins>;
364	status = "okay";
365};
366
367&saradc {
368	vref-supply = <&vcca_1v8_s0>;
369	status = "okay";
370};
371
372&sdhci {
373	bus-width = <8>;
374	cap-mmc-highspeed;
375	mmc-hs400-1_8v;
376	mmc-hs400-enhanced-strobe;
377	no-sd;
378	no-sdio;
379	non-removable;
380	vmmc-supply = <&vcc_3v3_s0>;
381	vqmmc-supply = <&vcc_1v8_s3>;
382	status = "okay";
383};
384
385&sdmmc {
386	bus-width = <4>;
387	cap-mmc-highspeed;
388	cap-sd-highspeed;
389	cd-gpios = <&gpio0 RK_PA4 GPIO_ACTIVE_LOW>;
390	disable-wp;
391	no-sdio;
392	sd-uhs-sdr104;
393	vmmc-supply = <&vcc_3v3_s3>;
394	vqmmc-supply = <&vccio_sd_s0>;
395	status = "okay";
396};
397
398&spi2 {
399	status = "okay";
400	assigned-clocks = <&cru CLK_SPI2>;
401	assigned-clock-rates = <200000000>;
402	num-cs = <1>;
403	pinctrl-names = "default";
404	pinctrl-0 = <&spi2m2_cs0 &spi2m2_pins>;
405
406	pmic@0 {
407		compatible = "rockchip,rk806";
408		reg = <0>;
409		gpio-controller;
410		#gpio-cells = <2>;
411		interrupt-parent = <&gpio0>;
412		interrupts = <7 IRQ_TYPE_LEVEL_LOW>;
413		pinctrl-names = "default";
414		pinctrl-0 = <&pmic_pins>, <&rk806_dvs1_null>,
415			    <&rk806_dvs2_null>, <&rk806_dvs3_null>;
416		spi-max-frequency = <1000000>;
417		system-power-controller;
418
419		vcc1-supply = <&vcc_sysin>;
420		vcc2-supply = <&vcc_sysin>;
421		vcc3-supply = <&vcc_sysin>;
422		vcc4-supply = <&vcc_sysin>;
423		vcc5-supply = <&vcc_sysin>;
424		vcc6-supply = <&vcc_sysin>;
425		vcc7-supply = <&vcc_sysin>;
426		vcc8-supply = <&vcc_sysin>;
427		vcc9-supply = <&vcc_sysin>;
428		vcc10-supply = <&vcc_sysin>;
429		vcc11-supply = <&vcc_2v0_pldo_s3>;
430		vcc12-supply = <&vcc_sysin>;
431		vcc13-supply = <&vcc_1v1_nldo_s3>;
432		vcc14-supply = <&vcc_1v1_nldo_s3>;
433		vcca-supply = <&vcca>;
434
435		rk806_dvs1_null: dvs1-null-pins {
436			pins = "gpio_pwrctrl1";
437			function = "pin_fun0";
438		};
439
440		rk806_dvs2_null: dvs2-null-pins {
441			pins = "gpio_pwrctrl2";
442			function = "pin_fun0";
443		};
444
445		rk806_dvs3_null: dvs3-null-pins {
446			pins = "gpio_pwrctrl3";
447			function = "pin_fun0";
448		};
449
450		regulators {
451			vdd_gpu_s0: dcdc-reg1 {
452				regulator-name = "vdd_gpu_s0";
453				regulator-boot-on;
454				regulator-min-microvolt = <550000>;
455				regulator-max-microvolt = <950000>;
456				regulator-ramp-delay = <12500>;
457				regulator-enable-ramp-delay = <400>;
458
459				regulator-state-mem {
460					regulator-off-in-suspend;
461				};
462			};
463
464			vdd_cpu_lit_s0: dcdc-reg2 {
465				regulator-name = "vdd_cpu_lit_s0";
466				regulator-always-on;
467				regulator-boot-on;
468				regulator-min-microvolt = <550000>;
469				regulator-max-microvolt = <950000>;
470				regulator-ramp-delay = <12500>;
471
472				regulator-state-mem {
473					regulator-off-in-suspend;
474				};
475			};
476
477			vdd_logic_s0: dcdc-reg3 {
478				regulator-name = "vdd_logic_s0";
479				regulator-always-on;
480				regulator-boot-on;
481				regulator-min-microvolt = <675000>;
482				regulator-max-microvolt = <750000>;
483				regulator-ramp-delay = <12500>;
484
485				regulator-state-mem {
486					regulator-on-in-suspend;
487					regulator-suspend-microvolt = <750000>;
488				};
489			};
490
491			vdd_vdenc_s0: dcdc-reg4 {
492				regulator-name = "vdd_vdenc_s0";
493				regulator-always-on;
494				regulator-boot-on;
495				regulator-min-microvolt = <550000>;
496				regulator-max-microvolt = <950000>;
497				regulator-ramp-delay = <12500>;
498
499				regulator-state-mem {
500					regulator-off-in-suspend;
501				};
502			};
503
504			vdd_ddr_s0: dcdc-reg5 {
505				regulator-name = "vdd_ddr_s0";
506				regulator-always-on;
507				regulator-boot-on;
508				regulator-min-microvolt = <675000>;
509				regulator-max-microvolt = <900000>;
510				regulator-ramp-delay = <12500>;
511
512				regulator-state-mem {
513					regulator-off-in-suspend;
514					regulator-suspend-microvolt = <850000>;
515				};
516			};
517
518			vdd2_ddr_s3: dcdc-reg6 {
519				regulator-name = "vdd2_ddr_s3";
520				regulator-always-on;
521				regulator-boot-on;
522
523				regulator-state-mem {
524					regulator-on-in-suspend;
525				};
526			};
527
528			vcc_2v0_pldo_s3: dcdc-reg7 {
529				regulator-name = "vcc_2v0_pldo_s3";
530				regulator-always-on;
531				regulator-boot-on;
532				regulator-min-microvolt = <2000000>;
533				regulator-max-microvolt = <2000000>;
534
535				regulator-state-mem {
536					regulator-on-in-suspend;
537					regulator-suspend-microvolt = <2000000>;
538				};
539			};
540
541			vcc_3v3_s3: dcdc-reg8 {
542				regulator-name = "vcc_3v3_s3";
543				regulator-always-on;
544				regulator-boot-on;
545				regulator-min-microvolt = <3300000>;
546				regulator-max-microvolt = <3300000>;
547
548				regulator-state-mem {
549					regulator-on-in-suspend;
550					regulator-suspend-microvolt = <3300000>;
551				};
552			};
553
554			vddq_ddr_s0: dcdc-reg9 {
555				regulator-name = "vddq_ddr_s0";
556				regulator-always-on;
557				regulator-boot-on;
558
559				regulator-state-mem {
560					regulator-off-in-suspend;
561				};
562			};
563
564			vcc_1v8_s3: dcdc-reg10 {
565				regulator-name = "vcc_1v8_s3";
566				regulator-always-on;
567				regulator-boot-on;
568				regulator-min-microvolt = <1800000>;
569				regulator-max-microvolt = <1800000>;
570
571				regulator-state-mem {
572					regulator-on-in-suspend;
573					regulator-suspend-microvolt = <1800000>;
574				};
575			};
576
577			vcc_1v8_s0: pldo-reg1 {
578				regulator-name = "vcc_1v8_s0";
579				regulator-always-on;
580				regulator-boot-on;
581				regulator-min-microvolt = <1800000>;
582				regulator-max-microvolt = <1800000>;
583
584				regulator-state-mem {
585					regulator-on-in-suspend;
586					regulator-suspend-microvolt = <1800000>;
587				};
588			};
589
590			vcca_1v8_s0: pldo-reg2 {
591				regulator-name = "vcca_1v8_s0";
592				regulator-always-on;
593				regulator-boot-on;
594				regulator-min-microvolt = <1800000>;
595				regulator-max-microvolt = <1800000>;
596
597				regulator-state-mem {
598					regulator-on-in-suspend;
599					regulator-suspend-microvolt = <1800000>;
600				};
601			};
602
603			vdda_1v2_s0: pldo-reg3 {
604				regulator-name = "vdda_1v2_s0";
605				regulator-always-on;
606				regulator-boot-on;
607				regulator-min-microvolt = <1200000>;
608				regulator-max-microvolt = <1200000>;
609
610				regulator-state-mem {
611					regulator-off-in-suspend;
612				};
613			};
614
615			vcca_3v3_s0: pldo-reg4 {
616				regulator-name = "vcca_3v3_s0";
617				regulator-always-on;
618				regulator-boot-on;
619				regulator-min-microvolt = <3300000>;
620				regulator-max-microvolt = <3300000>;
621
622				regulator-state-mem {
623					regulator-on-in-suspend;
624					regulator-suspend-microvolt = <3300000>;
625				};
626			};
627
628			vccio_sd_s0: pldo-reg5 {
629				regulator-name = "vccio_sd_s0";
630				regulator-always-on;
631				regulator-boot-on;
632				regulator-min-microvolt = <1800000>;
633				regulator-max-microvolt = <3300000>;
634
635				regulator-state-mem {
636					regulator-off-in-suspend;
637				};
638			};
639
640			pldo6_s3: pldo-reg6 {
641				regulator-name = "pldo6_s3";
642				regulator-always-on;
643				regulator-boot-on;
644				regulator-min-microvolt = <1800000>;
645				regulator-max-microvolt = <1800000>;
646
647				regulator-state-mem {
648					regulator-on-in-suspend;
649					regulator-suspend-microvolt = <1800000>;
650				};
651			};
652
653			vdd_0v75_s3: nldo-reg1 {
654				regulator-name = "vdd_0v75_s3";
655				regulator-always-on;
656				regulator-boot-on;
657				regulator-min-microvolt = <750000>;
658				regulator-max-microvolt = <750000>;
659
660				regulator-state-mem {
661					regulator-on-in-suspend;
662					regulator-suspend-microvolt = <750000>;
663				};
664			};
665
666			vdda_ddr_pll_s0: nldo-reg2 {
667				regulator-name = "vdda_ddr_pll_s0";
668				regulator-always-on;
669				regulator-boot-on;
670				regulator-min-microvolt = <850000>;
671				regulator-max-microvolt = <850000>;
672
673				regulator-state-mem {
674					regulator-on-in-suspend;
675					regulator-suspend-microvolt = <850000>;
676				};
677			};
678
679			vdda_0v75_s0: nldo-reg3 {
680				regulator-name = "vdda_0v75_s0";
681				regulator-always-on;
682				regulator-boot-on;
683				regulator-min-microvolt = <750000>;
684				regulator-max-microvolt = <750000>;
685
686				regulator-state-mem {
687					regulator-on-in-suspend;
688					regulator-suspend-microvolt = <750000>;
689				};
690			};
691
692			vdda_0v85_s0: nldo-reg4 {
693				regulator-name = "vdda_0v85_s0";
694				regulator-always-on;
695				regulator-boot-on;
696				regulator-min-microvolt = <850000>;
697				regulator-max-microvolt = <850000>;
698
699				regulator-state-mem {
700					regulator-off-in-suspend;
701				};
702			};
703
704			vdd_0v75_s0: nldo-reg5 {
705				regulator-name = "vdd_0v75_s0";
706				regulator-always-on;
707				regulator-boot-on;
708				regulator-min-microvolt = <750000>;
709				regulator-max-microvolt = <750000>;
710
711				regulator-state-mem {
712					regulator-off-in-suspend;
713				};
714			};
715		};
716	};
717};
718
719&tsadc {
720	status = "okay";
721};
722
723&u2phy0 {
724	status = "okay";
725};
726
727&u2phy0_otg {
728	phy-supply = <&vcc5v0_usb_otg0>;
729	status = "okay";
730};
731
732&uart2 {
733	pinctrl-0 = <&uart2m0_xfer>;
734	status = "okay";
735};
736
737&usb_host0_xhci {
738	dr_mode = "host";
739	status = "okay";
740};
741
742&usbdp_phy0 {
743	status = "okay";
744};
745