xref: /linux/arch/arm64/boot/dts/rockchip/rk3588-orangepi-5.dtsi (revision 4f9786035f9e519db41375818e1d0b5f20da2f10)
1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/*
3 * Copyright (c) 2023 Ondřej Jirman <megi@xff.cz>
4 */
5
6/dts-v1/;
7
8#include <dt-bindings/gpio/gpio.h>
9#include <dt-bindings/leds/common.h>
10#include <dt-bindings/input/input.h>
11#include <dt-bindings/pinctrl/rockchip.h>
12#include <dt-bindings/usb/pd.h>
13#include "rk3588.dtsi"
14
15/ {
16	aliases {
17		mmc0 = &sdhci;
18		mmc1 = &sdmmc;
19	};
20
21	chosen {
22		stdout-path = "serial2:1500000n8";
23	};
24
25	adc-keys-0 {
26		compatible = "adc-keys";
27		io-channels = <&saradc 0>;
28		io-channel-names = "buttons";
29		keyup-threshold-microvolt = <1800000>;
30		poll-interval = <100>;
31
32		button-maskrom {
33			label = "Mask Rom";
34			linux,code = <KEY_SETUP>;
35			press-threshold-microvolt = <2000>;
36		};
37	};
38
39	recovery_button: adc-keys-1 {
40		compatible = "adc-keys";
41		io-channels = <&saradc 1>;
42		io-channel-names = "buttons";
43		keyup-threshold-microvolt = <1800000>;
44		poll-interval = <100>;
45		status = "disabled";
46
47		button-recovery {
48			label = "Recovery";
49			linux,code = <KEY_VENDOR>;
50			press-threshold-microvolt = <2000>;
51		};
52	};
53
54	speaker_amp: speaker-audio-amplifier {
55		compatible = "simple-audio-amplifier";
56		sound-name-prefix = "Speaker Amp";
57		status = "disabled";
58	};
59
60	headphone_amp: headphones-audio-amplifier {
61		compatible = "simple-audio-amplifier";
62		sound-name-prefix = "Headphones Amp";
63	};
64
65	gpio-leds {
66		compatible = "gpio-leds";
67
68		led_blue_gpio: led {
69			color = <LED_COLOR_ID_BLUE>;
70			function = LED_FUNCTION_INDICATOR;
71			function-enumerator = <1>;
72			status = "disabled";
73		};
74	};
75
76	fan: pwm-fan {
77		compatible = "pwm-fan";
78		cooling-levels = <0 70 75 80 100>;
79		fan-supply = <&vcc5v0_sys>;
80		#cooling-cells = <2>;
81	};
82
83	pwm-leds {
84		compatible = "pwm-leds";
85
86		led_blue_pwm: led-1 {
87			color = <LED_COLOR_ID_BLUE>;
88			function = LED_FUNCTION_STATUS;
89			linux,default-trigger = "heartbeat";
90			max-brightness = <255>;
91			status = "disabled";
92		};
93
94		led_green_pwm: led-2 {
95			color = <LED_COLOR_ID_GREEN>;
96			function = LED_FUNCTION_INDICATOR;
97			function-enumerator = <2>;
98			max-brightness = <255>;
99		};
100	};
101
102	rfkill {
103		compatible = "rfkill-gpio";
104		label = "rfkill-pcie-wlan";
105		radio-type = "wlan";
106		shutdown-gpios = <&gpio0 RK_PC4 GPIO_ACTIVE_HIGH>;
107	};
108
109	analog_sound: sound {
110		compatible = "simple-audio-card";
111		simple-audio-card,name = "Analog";
112		simple-audio-card,format = "i2s";
113		simple-audio-card,mclk-fs = <256>;
114		simple-audio-card,bitclock-master = <&daicpu>;
115		simple-audio-card,frame-master = <&daicpu>;
116		/*TODO: SARADC_IN3 is used as MIC detection / key input */
117
118		daicpu: simple-audio-card,cpu {
119			sound-dai = <&i2s0_8ch>;
120			system-clock-frequency = <12288000>;
121		};
122
123		daicodec: simple-audio-card,codec {
124			sound-dai = <&es8388>;
125			system-clock-frequency = <12288000>;
126		};
127	};
128
129	vcc3v3_pcie30: regulator-vcc3v3-pcie30 {
130		compatible = "regulator-fixed";
131		enable-active-high;
132		gpios = <&gpio2 RK_PB6 GPIO_ACTIVE_HIGH>;
133		regulator-name = "vcc3v3_pcie30";
134		regulator-min-microvolt = <3300000>;
135		regulator-max-microvolt = <3300000>;
136		startup-delay-us = <5000>;
137		vin-supply = <&vcc5v0_sys>;
138	};
139
140	vcc3v3_pcie_eth: regulator-vcc3v3-pcie-eth {
141		compatible = "regulator-fixed";
142		regulator-name = "vcc3v3_pcie_eth";
143		regulator-min-microvolt = <3300000>;
144		regulator-max-microvolt = <3300000>;
145		startup-delay-us = <50000>;
146		vin-supply = <&vcc_3v3_s3>;
147	};
148
149	vcc3v3_wf: regulator-vcc3v3-wf {
150		compatible = "regulator-fixed";
151		enable-active-high;
152		gpios = <&gpio2 RK_PC5 GPIO_ACTIVE_HIGH>;
153		regulator-name = "vcc3v3_wf";
154		regulator-min-microvolt = <3300000>;
155		regulator-max-microvolt = <3300000>;
156		startup-delay-us = <50000>;
157		vin-supply = <&vcc5v0_sys>;
158		status = "disabled";
159	};
160
161	vcc5v0_sys: regulator-vcc5v0-sys {
162		compatible = "regulator-fixed";
163		regulator-name = "vcc5v0_sys";
164		regulator-always-on;
165		regulator-boot-on;
166		regulator-min-microvolt = <5000000>;
167		regulator-max-microvolt = <5000000>;
168	};
169
170	vcc5v0_usb20: regulator-vcc5v0-usb20 {
171		compatible = "regulator-fixed";
172		enable-active-high;
173		regulator-name = "vcc5v0_usb20";
174		regulator-min-microvolt = <5000000>;
175		regulator-max-microvolt = <5000000>;
176		vin-supply = <&vcc5v0_sys>;
177	};
178};
179
180&combphy2_psu {
181	status = "okay";
182};
183
184&cpu_b0 {
185	cpu-supply = <&vdd_cpu_big0_s0>;
186};
187
188&cpu_b1 {
189	cpu-supply = <&vdd_cpu_big0_s0>;
190};
191
192&cpu_b2 {
193	cpu-supply = <&vdd_cpu_big1_s0>;
194};
195
196&cpu_b3 {
197	cpu-supply = <&vdd_cpu_big1_s0>;
198};
199
200&cpu_l0 {
201	cpu-supply = <&vdd_cpu_lit_s0>;
202};
203
204&cpu_l1 {
205	cpu-supply = <&vdd_cpu_lit_s0>;
206};
207
208&cpu_l2 {
209	cpu-supply = <&vdd_cpu_lit_s0>;
210};
211
212&cpu_l3 {
213	cpu-supply = <&vdd_cpu_lit_s0>;
214};
215
216&gpu {
217	mali-supply = <&vdd_gpu_s0>;
218	status = "okay";
219};
220
221&i2c0 {
222	pinctrl-names = "default";
223	pinctrl-0 = <&i2c0m2_xfer>;
224	status = "okay";
225
226	vdd_cpu_big0_s0: regulator@42 {
227		compatible = "rockchip,rk8602";
228		reg = <0x42>;
229		fcs,suspend-voltage-selector = <1>;
230		regulator-name = "vdd_cpu_big0_s0";
231		regulator-always-on;
232		regulator-boot-on;
233		regulator-min-microvolt = <550000>;
234		regulator-max-microvolt = <1050000>;
235		regulator-ramp-delay = <2300>;
236		vin-supply = <&vcc5v0_sys>;
237
238		regulator-state-mem {
239			regulator-off-in-suspend;
240		};
241	};
242
243	vdd_cpu_big1_s0: regulator@43 {
244		compatible = "rockchip,rk8603", "rockchip,rk8602";
245		reg = <0x43>;
246		fcs,suspend-voltage-selector = <1>;
247		regulator-name = "vdd_cpu_big1_s0";
248		regulator-always-on;
249		regulator-boot-on;
250		regulator-min-microvolt = <550000>;
251		regulator-max-microvolt = <1050000>;
252		regulator-ramp-delay = <2300>;
253		vin-supply = <&vcc5v0_sys>;
254
255		regulator-state-mem {
256			regulator-off-in-suspend;
257		};
258	};
259};
260
261&i2c6 {
262	clock-frequency = <400000>;
263	status = "okay";
264
265	hym8563: rtc@51 {
266		compatible = "haoyu,hym8563";
267		reg = <0x51>;
268		#clock-cells = <0>;
269		clock-output-names = "hym8563";
270		wakeup-source;
271	};
272};
273
274&i2c7 {
275	status = "okay";
276
277	/* PLDO2 vcca 1.8V, BUCK8 gated by PLDO2 being enabled */
278	es8388: audio-codec@11 {
279		compatible = "everest,es8388", "everest,es8328";
280		reg = <0x11>;
281		clocks = <&cru I2S0_8CH_MCLKOUT>;
282		AVDD-supply = <&vcc_3v3_s0>;
283		DVDD-supply = <&vcc_1v8_s0>;
284		HPVDD-supply = <&vcc_3v3_s0>;
285		PVDD-supply = <&vcc_1v8_s0>;
286		assigned-clocks = <&cru I2S0_8CH_MCLKOUT>;
287		assigned-clock-rates = <12288000>;
288		#sound-dai-cells = <0>;
289	};
290};
291
292&i2s0_8ch {
293	pinctrl-names = "default";
294	pinctrl-0 = <&i2s0_lrck
295		     &i2s0_mclk
296		     &i2s0_sclk
297		     &i2s0_sdi0
298		     &i2s0_sdo0>;
299	status = "okay";
300};
301
302&i2s2_2ch {
303	pinctrl-names = "default";
304	pinctrl-0 = <&i2s2m0_lrck
305		     &i2s2m0_sclk
306		     &i2s2m0_sdi
307		     &i2s2m0_sdo>;
308	status = "okay";
309};
310
311&package_thermal {
312	polling-delay = <1000>;
313
314	cooling-maps {
315		map0 {
316			trip = <&package_fan0>;
317			cooling-device = <&fan THERMAL_NO_LIMIT 1>;
318		};
319
320		map1 {
321			trip = <&package_fan1>;
322			cooling-device = <&fan 2 THERMAL_NO_LIMIT>;
323		};
324	};
325
326	trips {
327		package_fan0: package-fan0 {
328			temperature = <55000>;
329			hysteresis = <2000>;
330			type = "active";
331		};
332
333		package_fan1: package-fan1 {
334			temperature = <65000>;
335			hysteresis = <2000>;
336			type = "active";
337		};
338	};
339};
340
341&pcie30phy {
342	status = "okay";
343};
344
345&pcie3x4 {
346	reset-gpios = <&gpio4 RK_PB6 GPIO_ACTIVE_HIGH>;
347	vpcie3v3-supply = <&vcc3v3_pcie30>;
348	status = "okay";
349};
350
351&pd_gpu {
352	domain-supply = <&vdd_gpu_s0>;
353};
354
355&saradc {
356	vref-supply = <&vcc_1v8_s0>;
357	status = "okay";
358};
359
360&sdhci {
361	bus-width = <8>;
362	no-sdio;
363	no-sd;
364	non-removable;
365	max-frequency = <200000000>;
366	mmc-hs400-1_8v;
367	mmc-hs400-enhanced-strobe;
368	status = "okay";
369};
370
371&sdmmc {
372	bus-width = <4>;
373	cap-sd-highspeed;
374	cd-gpios = <&gpio0 RK_PA4 GPIO_ACTIVE_LOW>;
375	disable-wp;
376	max-frequency = <150000000>;
377	no-sdio;
378	no-mmc;
379	sd-uhs-sdr104;
380	vmmc-supply = <&vcc_3v3_s3>;
381	vqmmc-supply = <&vccio_sd_s0>;
382	status = "okay";
383};
384
385&sfc {
386	status = "okay";
387
388	spi_flash: flash@0 {
389		compatible = "jedec,spi-nor";
390		reg = <0x0>;
391		spi-max-frequency = <100000000>;
392		spi-rx-bus-width = <4>;
393		spi-tx-bus-width = <1>;
394	};
395};
396
397&spi2 {
398	assigned-clocks = <&cru CLK_SPI2>;
399	assigned-clock-rates = <200000000>;
400	num-cs = <1>;
401	pinctrl-names = "default";
402	pinctrl-0 = <&spi2m2_cs0 &spi2m2_pins>;
403	status = "okay";
404
405	pmic@0 {
406		compatible = "rockchip,rk806";
407		reg = <0x0>;
408		interrupt-parent = <&gpio0>;
409		interrupts = <7 IRQ_TYPE_LEVEL_LOW>;
410		pinctrl-names = "default";
411		pinctrl-0 = <&pmic_pins>, <&rk806_dvs1_null>,
412			    <&rk806_dvs2_null>, <&rk806_dvs3_null>;
413		spi-max-frequency = <1000000>;
414		system-power-controller;
415
416		vcc1-supply = <&vcc5v0_sys>;
417		vcc2-supply = <&vcc5v0_sys>;
418		vcc3-supply = <&vcc5v0_sys>;
419		vcc4-supply = <&vcc5v0_sys>;
420		vcc5-supply = <&vcc5v0_sys>;
421		vcc6-supply = <&vcc5v0_sys>;
422		vcc7-supply = <&vcc5v0_sys>;
423		vcc8-supply = <&vcc5v0_sys>;
424		vcc9-supply = <&vcc5v0_sys>;
425		vcc10-supply = <&vcc5v0_sys>;
426		vcc11-supply = <&vcc_2v0_pldo_s3>;
427		vcc12-supply = <&vcc5v0_sys>;
428		vcc13-supply = <&vdd2_ddr_s3>;
429		vcc14-supply = <&vdd2_ddr_s3>;
430		vcca-supply = <&vcc5v0_sys>;
431
432		gpio-controller;
433		#gpio-cells = <2>;
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-enable-ramp-delay = <400>;
455				regulator-min-microvolt = <550000>;
456				regulator-max-microvolt = <950000>;
457				regulator-ramp-delay = <12500>;
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_log_s0: dcdc-reg3 {
478				regulator-name = "vdd_log_s0";
479				regulator-always-on;
480				regulator-boot-on;
481				regulator-min-microvolt = <675000>;
482				regulator-max-microvolt = <825000>;
483				regulator-ramp-delay = <12500>;
484
485				regulator-state-mem {
486					regulator-off-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 = <825000>;
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 = "vdd_2v0_pldo_s3";
530				regulator-always-on;
531				regulator-boot-on;
532				regulator-min-microvolt = <2000000>;
533				regulator-max-microvolt = <2000000>;
534				regulator-ramp-delay = <12500>;
535
536				regulator-state-mem {
537					regulator-on-in-suspend;
538					regulator-suspend-microvolt = <2000000>;
539				};
540			};
541
542			vcc_3v3_s3: dcdc-reg8 {
543				regulator-name = "vcc_3v3_s3";
544				regulator-always-on;
545				regulator-boot-on;
546				regulator-min-microvolt = <3300000>;
547				regulator-max-microvolt = <3300000>;
548
549				regulator-state-mem {
550					regulator-on-in-suspend;
551					regulator-suspend-microvolt = <3300000>;
552				};
553			};
554
555			vddq_ddr_s0: dcdc-reg9 {
556				regulator-name = "vddq_ddr_s0";
557				regulator-always-on;
558				regulator-boot-on;
559
560				regulator-state-mem {
561					regulator-off-in-suspend;
562				};
563			};
564
565			vcc_1v8_s3: dcdc-reg10 {
566				regulator-name = "vcc_1v8_s3";
567				regulator-always-on;
568				regulator-boot-on;
569				regulator-min-microvolt = <1800000>;
570				regulator-max-microvolt = <1800000>;
571
572				regulator-state-mem {
573					regulator-on-in-suspend;
574					regulator-suspend-microvolt = <1800000>;
575				};
576			};
577
578			avcc_1v8_s0: pldo-reg1 {
579				regulator-name = "avcc_1v8_s0";
580				regulator-always-on;
581				regulator-boot-on;
582				regulator-min-microvolt = <1800000>;
583				regulator-max-microvolt = <1800000>;
584
585				regulator-state-mem {
586					regulator-off-in-suspend;
587					regulator-suspend-microvolt = <1800000>;
588				};
589			};
590
591			/* shorted to avcc_1v8_s0 on the board */
592			vcc_1v8_s0: pldo-reg2 {
593				regulator-name = "vcc_1v8_s0";
594				regulator-always-on;
595				regulator-boot-on;
596				regulator-min-microvolt = <1800000>;
597				regulator-max-microvolt = <1800000>;
598
599				regulator-state-mem {
600					regulator-off-in-suspend;
601					regulator-suspend-microvolt = <1800000>;
602				};
603			};
604
605			avdd_1v2_s0: pldo-reg3 {
606				regulator-name = "avdd_1v2_s0";
607				regulator-always-on;
608				regulator-boot-on;
609				regulator-min-microvolt = <1200000>;
610				regulator-max-microvolt = <1200000>;
611
612				regulator-state-mem {
613					regulator-off-in-suspend;
614				};
615			};
616
617			vcc_3v3_s0: pldo-reg4 {
618				regulator-name = "vcc_3v3_s0";
619				regulator-always-on;
620				regulator-boot-on;
621				regulator-min-microvolt = <3300000>;
622				regulator-max-microvolt = <3300000>;
623				regulator-ramp-delay = <12500>;
624
625				regulator-state-mem {
626					regulator-off-in-suspend;
627				};
628			};
629
630			vccio_sd_s0: pldo-reg5 {
631				regulator-name = "vccio_sd_s0";
632				regulator-always-on;
633				regulator-boot-on;
634				regulator-min-microvolt = <1800000>;
635				regulator-max-microvolt = <3300000>;
636				regulator-ramp-delay = <12500>;
637
638				regulator-state-mem {
639					regulator-off-in-suspend;
640				};
641			};
642
643			pldo6_s3: pldo-reg6 {
644				regulator-name = "pldo6_s3";
645				regulator-always-on;
646				regulator-boot-on;
647				regulator-min-microvolt = <1800000>;
648				regulator-max-microvolt = <1800000>;
649
650				regulator-state-mem {
651					regulator-on-in-suspend;
652					regulator-suspend-microvolt = <1800000>;
653				};
654			};
655
656			vdd_0v75_s3: nldo-reg1 {
657				regulator-name = "vdd_0v75_s3";
658				regulator-always-on;
659				regulator-boot-on;
660				regulator-min-microvolt = <750000>;
661				regulator-max-microvolt = <750000>;
662
663				regulator-state-mem {
664					regulator-on-in-suspend;
665					regulator-suspend-microvolt = <750000>;
666				};
667			};
668
669			vdd_ddr_pll_s0: nldo-reg2 {
670				regulator-name = "vdd_ddr_pll_s0";
671				regulator-always-on;
672				regulator-boot-on;
673				regulator-min-microvolt = <850000>;
674				regulator-max-microvolt = <850000>;
675
676				regulator-state-mem {
677					regulator-off-in-suspend;
678					regulator-suspend-microvolt = <850000>;
679				};
680			};
681
682			avdd_0v75_s0: nldo-reg3 {
683				regulator-name = "avdd_0v75_s0";
684				regulator-always-on;
685				regulator-boot-on;
686				/*
687				 * The schematic mentions that actual setting
688				 * should be 0.8375V. RK3588 datasheet specifies
689				 * maximum as 0.825V. So we set datasheet max
690				 * here.
691				 */
692				regulator-min-microvolt = <825000>;
693				regulator-max-microvolt = <825000>;
694
695				regulator-state-mem {
696					regulator-off-in-suspend;
697				};
698			};
699
700			vdd_0v85_s0: nldo-reg4 {
701				regulator-name = "vdd_0v85_s0";
702				regulator-always-on;
703				regulator-boot-on;
704				regulator-min-microvolt = <850000>;
705				regulator-max-microvolt = <850000>;
706
707				regulator-state-mem {
708					regulator-off-in-suspend;
709				};
710			};
711
712			vdd_0v75_s0: nldo-reg5 {
713				regulator-name = "vdd_0v75_s0";
714				regulator-always-on;
715				regulator-boot-on;
716				regulator-min-microvolt = <750000>;
717				regulator-max-microvolt = <750000>;
718
719				regulator-state-mem {
720					regulator-off-in-suspend;
721				};
722			};
723		};
724	};
725};
726
727&tsadc {
728	status = "okay";
729};
730
731&u2phy0 {
732	status = "okay";
733};
734
735&u2phy0_otg {
736	status = "okay";
737};
738
739&u2phy1 {
740	status = "okay";
741};
742
743&u2phy1_otg {
744	status = "okay";
745};
746
747&u2phy2 {
748	status = "okay";
749};
750
751&u2phy3 {
752	status = "okay";
753};
754
755&u2phy2_host {
756	phy-supply = <&vcc5v0_usb20>;
757	status = "okay";
758};
759
760&u2phy3_host {
761	phy-supply = <&vcc5v0_usb20>;
762	status = "okay";
763};
764
765&uart2 {
766	pinctrl-0 = <&uart2m0_xfer>;
767	status = "okay";
768};
769
770&usbdp_phy0 {
771	status = "okay";
772};
773
774&usbdp_phy1 {
775	status = "okay";
776};
777
778&usb_host0_ehci {
779	status = "okay";
780};
781
782&usb_host0_ohci {
783	status = "okay";
784};
785
786&usb_host0_xhci {
787	status = "okay";
788};
789
790&usb_host1_ehci {
791	status = "okay";
792};
793
794&usb_host1_ohci {
795	status = "okay";
796};
797
798&usb_host1_xhci {
799	dr_mode = "host";
800	status = "okay";
801};
802
803&vop_mmu {
804	status = "okay";
805};
806
807&vop {
808	status = "okay";
809};
810