xref: /freebsd/sys/contrib/device-tree/src/arm64/rockchip/rk3588-orangepi-5.dtsi (revision 833e5d42ab135b0238e61c5b3c19b8619677cbfa)
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	vmmc-supply = <&vcc_3v3_s3>;
369	vqmmc-supply = <&vcc_1v8_s3>;
370	status = "okay";
371};
372
373&sdmmc {
374	bus-width = <4>;
375	cap-sd-highspeed;
376	cd-gpios = <&gpio0 RK_PA4 GPIO_ACTIVE_LOW>;
377	disable-wp;
378	max-frequency = <150000000>;
379	no-sdio;
380	no-mmc;
381	sd-uhs-sdr104;
382	vmmc-supply = <&vcc_3v3_s3>;
383	vqmmc-supply = <&vccio_sd_s0>;
384	status = "okay";
385};
386
387&sfc {
388	status = "okay";
389
390	spi_flash: flash@0 {
391		compatible = "jedec,spi-nor";
392		reg = <0x0>;
393		spi-max-frequency = <100000000>;
394		spi-rx-bus-width = <4>;
395		spi-tx-bus-width = <1>;
396	};
397};
398
399&spi2 {
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	status = "okay";
406
407	pmic@0 {
408		compatible = "rockchip,rk806";
409		reg = <0x0>;
410		interrupt-parent = <&gpio0>;
411		interrupts = <7 IRQ_TYPE_LEVEL_LOW>;
412		pinctrl-names = "default";
413		pinctrl-0 = <&pmic_pins>, <&rk806_dvs1_null>,
414			    <&rk806_dvs2_null>, <&rk806_dvs3_null>;
415		spi-max-frequency = <1000000>;
416		system-power-controller;
417
418		vcc1-supply = <&vcc5v0_sys>;
419		vcc2-supply = <&vcc5v0_sys>;
420		vcc3-supply = <&vcc5v0_sys>;
421		vcc4-supply = <&vcc5v0_sys>;
422		vcc5-supply = <&vcc5v0_sys>;
423		vcc6-supply = <&vcc5v0_sys>;
424		vcc7-supply = <&vcc5v0_sys>;
425		vcc8-supply = <&vcc5v0_sys>;
426		vcc9-supply = <&vcc5v0_sys>;
427		vcc10-supply = <&vcc5v0_sys>;
428		vcc11-supply = <&vcc_2v0_pldo_s3>;
429		vcc12-supply = <&vcc5v0_sys>;
430		vcc13-supply = <&vdd2_ddr_s3>;
431		vcc14-supply = <&vdd2_ddr_s3>;
432		vcca-supply = <&vcc5v0_sys>;
433
434		gpio-controller;
435		#gpio-cells = <2>;
436
437		rk806_dvs1_null: dvs1-null-pins {
438			pins = "gpio_pwrctrl1";
439			function = "pin_fun0";
440		};
441
442		rk806_dvs2_null: dvs2-null-pins {
443			pins = "gpio_pwrctrl2";
444			function = "pin_fun0";
445		};
446
447		rk806_dvs3_null: dvs3-null-pins {
448			pins = "gpio_pwrctrl3";
449			function = "pin_fun0";
450		};
451
452		regulators {
453			vdd_gpu_s0: dcdc-reg1 {
454				regulator-name = "vdd_gpu_s0";
455				regulator-boot-on;
456				regulator-enable-ramp-delay = <400>;
457				regulator-min-microvolt = <550000>;
458				regulator-max-microvolt = <950000>;
459				regulator-ramp-delay = <12500>;
460
461				regulator-state-mem {
462					regulator-off-in-suspend;
463				};
464			};
465
466			vdd_cpu_lit_s0: dcdc-reg2 {
467				regulator-name = "vdd_cpu_lit_s0";
468				regulator-always-on;
469				regulator-boot-on;
470				regulator-min-microvolt = <550000>;
471				regulator-max-microvolt = <950000>;
472				regulator-ramp-delay = <12500>;
473
474				regulator-state-mem {
475					regulator-off-in-suspend;
476				};
477			};
478
479			vdd_log_s0: dcdc-reg3 {
480				regulator-name = "vdd_log_s0";
481				regulator-always-on;
482				regulator-boot-on;
483				regulator-min-microvolt = <675000>;
484				regulator-max-microvolt = <825000>;
485				regulator-ramp-delay = <12500>;
486
487				regulator-state-mem {
488					regulator-off-in-suspend;
489					regulator-suspend-microvolt = <750000>;
490				};
491			};
492
493			vdd_vdenc_s0: dcdc-reg4 {
494				regulator-name = "vdd_vdenc_s0";
495				regulator-always-on;
496				regulator-boot-on;
497				regulator-min-microvolt = <550000>;
498				regulator-max-microvolt = <825000>;
499				regulator-ramp-delay = <12500>;
500
501				regulator-state-mem {
502					regulator-off-in-suspend;
503				};
504			};
505
506			vdd_ddr_s0: dcdc-reg5 {
507				regulator-name = "vdd_ddr_s0";
508				regulator-always-on;
509				regulator-boot-on;
510				regulator-min-microvolt = <675000>;
511				regulator-max-microvolt = <900000>;
512				regulator-ramp-delay = <12500>;
513
514				regulator-state-mem {
515					regulator-off-in-suspend;
516					regulator-suspend-microvolt = <850000>;
517				};
518			};
519
520			vdd2_ddr_s3: dcdc-reg6 {
521				regulator-name = "vdd2_ddr_s3";
522				regulator-always-on;
523				regulator-boot-on;
524
525				regulator-state-mem {
526					regulator-on-in-suspend;
527				};
528			};
529
530			vcc_2v0_pldo_s3: dcdc-reg7 {
531				regulator-name = "vdd_2v0_pldo_s3";
532				regulator-always-on;
533				regulator-boot-on;
534				regulator-min-microvolt = <2000000>;
535				regulator-max-microvolt = <2000000>;
536				regulator-ramp-delay = <12500>;
537
538				regulator-state-mem {
539					regulator-on-in-suspend;
540					regulator-suspend-microvolt = <2000000>;
541				};
542			};
543
544			vcc_3v3_s3: dcdc-reg8 {
545				regulator-name = "vcc_3v3_s3";
546				regulator-always-on;
547				regulator-boot-on;
548				regulator-min-microvolt = <3300000>;
549				regulator-max-microvolt = <3300000>;
550
551				regulator-state-mem {
552					regulator-on-in-suspend;
553					regulator-suspend-microvolt = <3300000>;
554				};
555			};
556
557			vddq_ddr_s0: dcdc-reg9 {
558				regulator-name = "vddq_ddr_s0";
559				regulator-always-on;
560				regulator-boot-on;
561
562				regulator-state-mem {
563					regulator-off-in-suspend;
564				};
565			};
566
567			vcc_1v8_s3: dcdc-reg10 {
568				regulator-name = "vcc_1v8_s3";
569				regulator-always-on;
570				regulator-boot-on;
571				regulator-min-microvolt = <1800000>;
572				regulator-max-microvolt = <1800000>;
573
574				regulator-state-mem {
575					regulator-on-in-suspend;
576					regulator-suspend-microvolt = <1800000>;
577				};
578			};
579
580			avcc_1v8_s0: pldo-reg1 {
581				regulator-name = "avcc_1v8_s0";
582				regulator-always-on;
583				regulator-boot-on;
584				regulator-min-microvolt = <1800000>;
585				regulator-max-microvolt = <1800000>;
586
587				regulator-state-mem {
588					regulator-off-in-suspend;
589					regulator-suspend-microvolt = <1800000>;
590				};
591			};
592
593			/* shorted to avcc_1v8_s0 on the board */
594			vcc_1v8_s0: pldo-reg2 {
595				regulator-name = "vcc_1v8_s0";
596				regulator-always-on;
597				regulator-boot-on;
598				regulator-min-microvolt = <1800000>;
599				regulator-max-microvolt = <1800000>;
600
601				regulator-state-mem {
602					regulator-off-in-suspend;
603					regulator-suspend-microvolt = <1800000>;
604				};
605			};
606
607			avdd_1v2_s0: pldo-reg3 {
608				regulator-name = "avdd_1v2_s0";
609				regulator-always-on;
610				regulator-boot-on;
611				regulator-min-microvolt = <1200000>;
612				regulator-max-microvolt = <1200000>;
613
614				regulator-state-mem {
615					regulator-off-in-suspend;
616				};
617			};
618
619			vcc_3v3_s0: pldo-reg4 {
620				regulator-name = "vcc_3v3_s0";
621				regulator-always-on;
622				regulator-boot-on;
623				regulator-min-microvolt = <3300000>;
624				regulator-max-microvolt = <3300000>;
625				regulator-ramp-delay = <12500>;
626
627				regulator-state-mem {
628					regulator-off-in-suspend;
629				};
630			};
631
632			vccio_sd_s0: pldo-reg5 {
633				regulator-name = "vccio_sd_s0";
634				regulator-always-on;
635				regulator-boot-on;
636				regulator-min-microvolt = <1800000>;
637				regulator-max-microvolt = <3300000>;
638				regulator-ramp-delay = <12500>;
639
640				regulator-state-mem {
641					regulator-off-in-suspend;
642				};
643			};
644
645			pldo6_s3: pldo-reg6 {
646				regulator-name = "pldo6_s3";
647				regulator-always-on;
648				regulator-boot-on;
649				regulator-min-microvolt = <1800000>;
650				regulator-max-microvolt = <1800000>;
651
652				regulator-state-mem {
653					regulator-on-in-suspend;
654					regulator-suspend-microvolt = <1800000>;
655				};
656			};
657
658			vdd_0v75_s3: nldo-reg1 {
659				regulator-name = "vdd_0v75_s3";
660				regulator-always-on;
661				regulator-boot-on;
662				regulator-min-microvolt = <750000>;
663				regulator-max-microvolt = <750000>;
664
665				regulator-state-mem {
666					regulator-on-in-suspend;
667					regulator-suspend-microvolt = <750000>;
668				};
669			};
670
671			vdd_ddr_pll_s0: nldo-reg2 {
672				regulator-name = "vdd_ddr_pll_s0";
673				regulator-always-on;
674				regulator-boot-on;
675				regulator-min-microvolt = <850000>;
676				regulator-max-microvolt = <850000>;
677
678				regulator-state-mem {
679					regulator-off-in-suspend;
680					regulator-suspend-microvolt = <850000>;
681				};
682			};
683
684			avdd_0v75_s0: nldo-reg3 {
685				regulator-name = "avdd_0v75_s0";
686				regulator-always-on;
687				regulator-boot-on;
688				/*
689				 * The schematic mentions that actual setting
690				 * should be 0.8375V. RK3588 datasheet specifies
691				 * maximum as 0.825V. So we set datasheet max
692				 * here.
693				 */
694				regulator-min-microvolt = <825000>;
695				regulator-max-microvolt = <825000>;
696
697				regulator-state-mem {
698					regulator-off-in-suspend;
699				};
700			};
701
702			vdd_0v85_s0: nldo-reg4 {
703				regulator-name = "vdd_0v85_s0";
704				regulator-always-on;
705				regulator-boot-on;
706				regulator-min-microvolt = <850000>;
707				regulator-max-microvolt = <850000>;
708
709				regulator-state-mem {
710					regulator-off-in-suspend;
711				};
712			};
713
714			vdd_0v75_s0: nldo-reg5 {
715				regulator-name = "vdd_0v75_s0";
716				regulator-always-on;
717				regulator-boot-on;
718				regulator-min-microvolt = <750000>;
719				regulator-max-microvolt = <750000>;
720
721				regulator-state-mem {
722					regulator-off-in-suspend;
723				};
724			};
725		};
726	};
727};
728
729&tsadc {
730	status = "okay";
731};
732
733&u2phy0 {
734	status = "okay";
735};
736
737&u2phy0_otg {
738	status = "okay";
739};
740
741&u2phy1 {
742	status = "okay";
743};
744
745&u2phy1_otg {
746	status = "okay";
747};
748
749&u2phy2 {
750	status = "okay";
751};
752
753&u2phy3 {
754	status = "okay";
755};
756
757&u2phy2_host {
758	phy-supply = <&vcc5v0_usb20>;
759	status = "okay";
760};
761
762&u2phy3_host {
763	phy-supply = <&vcc5v0_usb20>;
764	status = "okay";
765};
766
767&uart2 {
768	pinctrl-0 = <&uart2m0_xfer>;
769	status = "okay";
770};
771
772&usbdp_phy0 {
773	status = "okay";
774};
775
776&usbdp_phy1 {
777	status = "okay";
778};
779
780&usb_host0_ehci {
781	status = "okay";
782};
783
784&usb_host0_ohci {
785	status = "okay";
786};
787
788&usb_host0_xhci {
789	status = "okay";
790};
791
792&usb_host1_ehci {
793	status = "okay";
794};
795
796&usb_host1_ohci {
797	status = "okay";
798};
799
800&usb_host1_xhci {
801	dr_mode = "host";
802	status = "okay";
803};
804
805&vop_mmu {
806	status = "okay";
807};
808
809&vop {
810	status = "okay";
811};
812