1 // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
3 * Copyright (c) 2023 Ondřej Jirman <megi@xff.cz>
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"
16 model = "Xunlong Orange Pi 5 Plus";
17 compatible = "xunlong,orangepi-5-plus", "rockchip,rk3588";
26 stdout-path = "serial2:1500000n8";
30 compatible = "adc-keys";
31 io-channels = <&saradc 0>;
32 io-channel-names = "buttons";
33 keyup-threshold-microvolt = <1800000>;
34 poll-interval = <100>;
38 linux,code = <KEY_SETUP>;
39 press-threshold-microvolt = <2000>;
44 compatible = "adc-keys";
45 io-channels = <&saradc 1>;
46 io-channel-names = "buttons";
47 keyup-threshold-microvolt = <1800000>;
48 poll-interval = <100>;
52 linux,code = <KEY_VENDOR>;
53 press-threshold-microvolt = <2000>;
57 speaker_amp: speaker-audio-amplifier {
58 compatible = "simple-audio-amplifier";
59 enable-gpios = <&gpio3 RK_PC0 GPIO_ACTIVE_HIGH>;
60 sound-name-prefix = "Speaker Amp";
63 headphone_amp: headphones-audio-amplifier {
64 compatible = "simple-audio-amplifier";
65 enable-gpios = <&gpio3 RK_PA7 GPIO_ACTIVE_HIGH>;
66 sound-name-prefix = "Headphones Amp";
70 compatible = "gpio-ir-receiver";
71 gpios = <&gpio4 RK_PB3 GPIO_ACTIVE_LOW>;
72 pinctrl-names = "default";
73 pinctrl-0 = <&ir_receiver_pin>;
77 compatible = "gpio-leds";
78 pinctrl-names = "default";
79 pinctrl-0 = <&blue_led_pin>;
82 color = <LED_COLOR_ID_BLUE>;
83 function = LED_FUNCTION_INDICATOR;
84 function-enumerator = <1>;
85 gpios = <&gpio3 RK_PA6 GPIO_ACTIVE_HIGH>;
90 compatible = "pwm-fan";
91 cooling-levels = <0 70 75 80 100>;
92 fan-supply = <&vcc5v0_sys>;
93 pwms = <&pwm3 0 50000 0>;
98 compatible = "pwm-leds";
101 color = <LED_COLOR_ID_GREEN>;
102 function = LED_FUNCTION_INDICATOR;
103 function-enumerator = <2>;
104 max-brightness = <255>;
105 pwms = <&pwm2 0 25000 0>;
110 compatible = "simple-audio-card";
111 pinctrl-names = "default";
112 pinctrl-0 = <&hp_detect>;
113 simple-audio-card,name = "Analog";
114 simple-audio-card,aux-devs = <&speaker_amp>, <&headphone_amp>;
115 simple-audio-card,format = "i2s";
116 simple-audio-card,mclk-fs = <256>;
117 simple-audio-card,hp-det-gpio = <&gpio1 RK_PD3 GPIO_ACTIVE_LOW>;
118 simple-audio-card,bitclock-master = <&daicpu>;
119 simple-audio-card,frame-master = <&daicpu>;
120 /*TODO: SARADC_IN3 is used as MIC detection / key input */
122 simple-audio-card,widgets =
123 "Microphone", "Onboard Microphone",
124 "Microphone", "Microphone Jack",
125 "Speaker", "Speaker",
126 "Headphone", "Headphones";
128 simple-audio-card,routing =
129 "Headphones", "LOUT1",
130 "Headphones", "ROUT1",
134 "Headphones", "Headphones Amp OUTL",
135 "Headphones", "Headphones Amp OUTR",
136 "Headphones Amp INL", "LOUT1",
137 "Headphones Amp INR", "ROUT1",
139 "Speaker", "Speaker Amp OUTL",
140 "Speaker", "Speaker Amp OUTR",
141 "Speaker Amp INL", "LOUT2",
142 "Speaker Amp INR", "ROUT2",
144 /* single ended signal to LINPUT1 */
145 "LINPUT1", "Microphone Jack",
146 "RINPUT1", "Microphone Jack",
147 /* differential signal */
148 "LINPUT2", "Onboard Microphone",
149 "RINPUT2", "Onboard Microphone";
151 daicpu: simple-audio-card,cpu {
152 sound-dai = <&i2s0_8ch>;
153 system-clock-frequency = <12288000>;
156 daicodec: simple-audio-card,codec {
157 sound-dai = <&es8388>;
158 system-clock-frequency = <12288000>;
162 vcc3v3_pcie30: vcc3v3-pcie30-regulator {
163 compatible = "regulator-fixed";
165 gpios = <&gpio2 RK_PB6 GPIO_ACTIVE_HIGH>;
166 regulator-name = "vcc3v3_pcie30";
167 regulator-min-microvolt = <3300000>;
168 regulator-max-microvolt = <3300000>;
169 startup-delay-us = <5000>;
170 vin-supply = <&vcc5v0_sys>;
173 vcc3v3_pcie_eth: vcc3v3-pcie-eth-regulator {
174 compatible = "regulator-fixed";
175 gpios = <&gpio3 RK_PB4 GPIO_ACTIVE_LOW>;
176 regulator-name = "vcc3v3_pcie_eth";
177 regulator-min-microvolt = <3300000>;
178 regulator-max-microvolt = <3300000>;
179 startup-delay-us = <50000>;
180 vin-supply = <&vcc5v0_sys>;
183 vcc3v3_wf: vcc3v3-wf-regulator {
184 compatible = "regulator-fixed";
186 gpios = <&gpio2 RK_PC5 GPIO_ACTIVE_HIGH>;
187 regulator-name = "vcc3v3_wf";
188 regulator-min-microvolt = <3300000>;
189 regulator-max-microvolt = <3300000>;
190 startup-delay-us = <50000>;
191 vin-supply = <&vcc5v0_sys>;
194 vcc5v0_sys: vcc5v0-sys-regulator {
195 compatible = "regulator-fixed";
196 regulator-name = "vcc5v0_sys";
199 regulator-min-microvolt = <5000000>;
200 regulator-max-microvolt = <5000000>;
203 vcc5v0_usb20: vcc5v0-usb20-regulator {
204 compatible = "regulator-fixed";
206 gpio = <&gpio3 RK_PB7 GPIO_ACTIVE_HIGH>;
207 pinctrl-names = "default";
208 pinctrl-0 = <&vcc5v0_usb20_en>;
209 regulator-name = "vcc5v0_usb20";
210 regulator-min-microvolt = <5000000>;
211 regulator-max-microvolt = <5000000>;
212 vin-supply = <&vcc5v0_sys>;
229 cpu-supply = <&vdd_cpu_big0_s0>;
233 cpu-supply = <&vdd_cpu_big0_s0>;
237 cpu-supply = <&vdd_cpu_big1_s0>;
241 cpu-supply = <&vdd_cpu_big1_s0>;
245 cpu-supply = <&vdd_cpu_lit_s0>;
249 cpu-supply = <&vdd_cpu_lit_s0>;
253 cpu-supply = <&vdd_cpu_lit_s0>;
257 cpu-supply = <&vdd_cpu_lit_s0>;
261 pinctrl-names = "default";
262 pinctrl-0 = <&i2c0m2_xfer>;
265 vdd_cpu_big0_s0: regulator@42 {
266 compatible = "rockchip,rk8602";
268 fcs,suspend-voltage-selector = <1>;
269 regulator-name = "vdd_cpu_big0_s0";
272 regulator-min-microvolt = <550000>;
273 regulator-max-microvolt = <1050000>;
274 regulator-ramp-delay = <2300>;
275 vin-supply = <&vcc5v0_sys>;
277 regulator-state-mem {
278 regulator-off-in-suspend;
282 vdd_cpu_big1_s0: regulator@43 {
283 compatible = "rockchip,rk8603", "rockchip,rk8602";
285 fcs,suspend-voltage-selector = <1>;
286 regulator-name = "vdd_cpu_big1_s0";
289 regulator-min-microvolt = <550000>;
290 regulator-max-microvolt = <1050000>;
291 regulator-ramp-delay = <2300>;
292 vin-supply = <&vcc5v0_sys>;
294 regulator-state-mem {
295 regulator-off-in-suspend;
301 clock-frequency = <400000>;
305 compatible = "haoyu,hym8563";
307 interrupt-parent = <&gpio0>;
308 interrupts = <RK_PB0 IRQ_TYPE_LEVEL_LOW>;
310 clock-output-names = "hym8563";
311 pinctrl-names = "default";
312 pinctrl-0 = <&hym8563_int>;
320 /* PLDO2 vcca 1.8V, BUCK8 gated by PLDO2 being enabled */
321 es8388: audio-codec@11 {
322 compatible = "everest,es8388";
324 clocks = <&cru I2S0_8CH_MCLKOUT>;
325 clock-names = "mclk";
326 AVDD-supply = <&vcc_1v8_s0>;
327 DVDD-supply = <&vcc_1v8_s0>;
328 HPVDD-supply = <&vcc_3v3_s0>;
329 PVDD-supply = <&vcc_3v3_s0>;
330 assigned-clocks = <&cru I2S0_8CH_MCLKOUT>;
331 assigned-clock-rates = <12288000>;
332 #sound-dai-cells = <0>;
337 pinctrl-names = "default";
338 pinctrl-0 = <&i2s0_lrck
347 pinctrl-names = "default";
348 pinctrl-0 = <&i2s2m0_lrck
355 /* phy1 - M.KEY socket */
357 reset-gpios = <&gpio4 RK_PA5 GPIO_ACTIVE_HIGH>;
358 vpcie3v3-supply = <&vcc3v3_wf>;
362 /* phy2 - right ethernet port */
364 reset-gpios = <&gpio3 RK_PB3 GPIO_ACTIVE_HIGH>;
365 vpcie3v3-supply = <&vcc3v3_pcie_eth>;
369 /* phy0 - left ethernet port */
371 reset-gpios = <&gpio4 RK_PA2 GPIO_ACTIVE_HIGH>;
372 vpcie3v3-supply = <&vcc3v3_pcie_eth>;
381 reset-gpios = <&gpio4 RK_PB6 GPIO_ACTIVE_HIGH>;
382 vpcie3v3-supply = <&vcc3v3_pcie30>;
388 hym8563_int: hym8563-int {
389 rockchip,pins = <0 RK_PB0 RK_FUNC_GPIO &pcfg_pull_none>;
394 blue_led_pin: blue-led {
395 rockchip,pins = <3 RK_PA6 RK_FUNC_GPIO &pcfg_pull_up>;
400 ir_receiver_pin: ir-receiver-pin {
401 rockchip,pins = <4 RK_PB3 RK_FUNC_GPIO &pcfg_pull_none>;
406 hp_detect: hp-detect {
407 rockchip,pins = <1 RK_PD3 RK_FUNC_GPIO &pcfg_pull_none>;
412 vcc5v0_usb20_en: vcc5v0-usb20-en {
413 rockchip,pins = <3 RK_PB7 RK_FUNC_GPIO &pcfg_pull_none>;
419 pinctrl-0 = <&pwm2m1_pins>;
420 pinctrl-names = "default";
425 pinctrl-0 = <&pwm3m1_pins>;
430 vref-supply = <&vcc_1v8_s0>;
439 max-frequency = <200000000>;
441 mmc-hs400-enhanced-strobe;
448 cd-gpios = <&gpio0 RK_PA4 GPIO_ACTIVE_LOW>;
450 max-frequency = <150000000>;
454 vmmc-supply = <&vcc_3v3_s3>;
455 vqmmc-supply = <&vccio_sd_s0>;
460 pinctrl-names = "default";
461 pinctrl-0 = <&fspim1_pins>;
465 compatible = "jedec,spi-nor";
467 spi-max-frequency = <100000000>;
468 spi-rx-bus-width = <4>;
469 spi-tx-bus-width = <1>;
474 assigned-clocks = <&cru CLK_SPI2>;
475 assigned-clock-rates = <200000000>;
477 pinctrl-names = "default";
478 pinctrl-0 = <&spi2m2_cs0 &spi2m2_pins>;
482 compatible = "rockchip,rk806";
484 interrupt-parent = <&gpio0>;
485 interrupts = <7 IRQ_TYPE_LEVEL_LOW>;
486 pinctrl-names = "default";
487 pinctrl-0 = <&pmic_pins>, <&rk806_dvs1_null>,
488 <&rk806_dvs2_null>, <&rk806_dvs3_null>;
489 spi-max-frequency = <1000000>;
491 vcc1-supply = <&vcc5v0_sys>;
492 vcc2-supply = <&vcc5v0_sys>;
493 vcc3-supply = <&vcc5v0_sys>;
494 vcc4-supply = <&vcc5v0_sys>;
495 vcc5-supply = <&vcc5v0_sys>;
496 vcc6-supply = <&vcc5v0_sys>;
497 vcc7-supply = <&vcc5v0_sys>;
498 vcc8-supply = <&vcc5v0_sys>;
499 vcc9-supply = <&vcc5v0_sys>;
500 vcc10-supply = <&vcc5v0_sys>;
501 vcc11-supply = <&vcc_2v0_pldo_s3>;
502 vcc12-supply = <&vcc5v0_sys>;
503 vcc13-supply = <&vdd2_ddr_s3>;
504 vcc14-supply = <&vdd2_ddr_s3>;
505 vcca-supply = <&vcc5v0_sys>;
510 rk806_dvs1_null: dvs1-null-pins {
511 pins = "gpio_pwrctrl2";
512 function = "pin_fun0";
515 rk806_dvs2_null: dvs2-null-pins {
516 pins = "gpio_pwrctrl2";
517 function = "pin_fun0";
520 rk806_dvs3_null: dvs3-null-pins {
521 pins = "gpio_pwrctrl3";
522 function = "pin_fun0";
526 vdd_gpu_s0: dcdc-reg1 {
527 regulator-name = "vdd_gpu_s0";
529 regulator-enable-ramp-delay = <400>;
530 regulator-min-microvolt = <550000>;
531 regulator-max-microvolt = <950000>;
532 regulator-ramp-delay = <12500>;
534 regulator-state-mem {
535 regulator-off-in-suspend;
539 vdd_cpu_lit_s0: dcdc-reg2 {
540 regulator-name = "vdd_cpu_lit_s0";
543 regulator-min-microvolt = <550000>;
544 regulator-max-microvolt = <950000>;
545 regulator-ramp-delay = <12500>;
547 regulator-state-mem {
548 regulator-off-in-suspend;
552 vdd_log_s0: dcdc-reg3 {
553 regulator-name = "vdd_log_s0";
556 regulator-min-microvolt = <675000>;
557 regulator-max-microvolt = <825000>;
558 regulator-ramp-delay = <12500>;
560 regulator-state-mem {
561 regulator-off-in-suspend;
562 regulator-suspend-microvolt = <750000>;
566 vdd_vdenc_s0: dcdc-reg4 {
567 regulator-name = "vdd_vdenc_s0";
570 regulator-min-microvolt = <550000>;
571 regulator-max-microvolt = <825000>;
572 regulator-ramp-delay = <12500>;
574 regulator-state-mem {
575 regulator-off-in-suspend;
579 vdd_ddr_s0: dcdc-reg5 {
580 regulator-name = "vdd_ddr_s0";
583 regulator-min-microvolt = <675000>;
584 regulator-max-microvolt = <900000>;
585 regulator-ramp-delay = <12500>;
587 regulator-state-mem {
588 regulator-off-in-suspend;
589 regulator-suspend-microvolt = <850000>;
593 vdd2_ddr_s3: dcdc-reg6 {
594 regulator-name = "vdd2_ddr_s3";
598 regulator-state-mem {
599 regulator-on-in-suspend;
603 vcc_2v0_pldo_s3: dcdc-reg7 {
604 regulator-name = "vdd_2v0_pldo_s3";
607 regulator-min-microvolt = <2000000>;
608 regulator-max-microvolt = <2000000>;
609 regulator-ramp-delay = <12500>;
611 regulator-state-mem {
612 regulator-on-in-suspend;
613 regulator-suspend-microvolt = <2000000>;
617 vcc_3v3_s3: dcdc-reg8 {
618 regulator-name = "vcc_3v3_s3";
621 regulator-min-microvolt = <3300000>;
622 regulator-max-microvolt = <3300000>;
624 regulator-state-mem {
625 regulator-on-in-suspend;
626 regulator-suspend-microvolt = <3300000>;
630 vddq_ddr_s0: dcdc-reg9 {
631 regulator-name = "vddq_ddr_s0";
635 regulator-state-mem {
636 regulator-off-in-suspend;
640 vcc_1v8_s3: dcdc-reg10 {
641 regulator-name = "vcc_1v8_s3";
644 regulator-min-microvolt = <1800000>;
645 regulator-max-microvolt = <1800000>;
647 regulator-state-mem {
648 regulator-on-in-suspend;
649 regulator-suspend-microvolt = <1800000>;
653 avcc_1v8_s0: pldo-reg1 {
654 regulator-name = "avcc_1v8_s0";
657 regulator-min-microvolt = <1800000>;
658 regulator-max-microvolt = <1800000>;
660 regulator-state-mem {
661 regulator-off-in-suspend;
662 regulator-suspend-microvolt = <1800000>;
666 /* shorted to avcc_1v8_s0 on the board */
667 vcc_1v8_s0: pldo-reg2 {
668 regulator-name = "vcc_1v8_s0";
671 regulator-min-microvolt = <1800000>;
672 regulator-max-microvolt = <1800000>;
674 regulator-state-mem {
675 regulator-off-in-suspend;
676 regulator-suspend-microvolt = <1800000>;
680 avdd_1v2_s0: pldo-reg3 {
681 regulator-name = "avdd_1v2_s0";
684 regulator-min-microvolt = <1200000>;
685 regulator-max-microvolt = <1200000>;
687 regulator-state-mem {
688 regulator-off-in-suspend;
692 vcc_3v3_s0: pldo-reg4 {
693 regulator-name = "vcc_3v3_s0";
696 regulator-min-microvolt = <3300000>;
697 regulator-max-microvolt = <3300000>;
698 regulator-ramp-delay = <12500>;
700 regulator-state-mem {
701 regulator-off-in-suspend;
705 vccio_sd_s0: pldo-reg5 {
706 regulator-name = "vccio_sd_s0";
709 regulator-min-microvolt = <1800000>;
710 regulator-max-microvolt = <3300000>;
711 regulator-ramp-delay = <12500>;
713 regulator-state-mem {
714 regulator-off-in-suspend;
718 pldo6_s3: pldo-reg6 {
719 regulator-name = "pldo6_s3";
722 regulator-min-microvolt = <1800000>;
723 regulator-max-microvolt = <1800000>;
725 regulator-state-mem {
726 regulator-on-in-suspend;
727 regulator-suspend-microvolt = <1800000>;
731 vdd_0v75_s3: nldo-reg1 {
732 regulator-name = "vdd_0v75_s3";
735 regulator-min-microvolt = <750000>;
736 regulator-max-microvolt = <750000>;
738 regulator-state-mem {
739 regulator-on-in-suspend;
740 regulator-suspend-microvolt = <750000>;
744 vdd_ddr_pll_s0: nldo-reg2 {
745 regulator-name = "vdd_ddr_pll_s0";
748 regulator-min-microvolt = <850000>;
749 regulator-max-microvolt = <850000>;
751 regulator-state-mem {
752 regulator-off-in-suspend;
753 regulator-suspend-microvolt = <850000>;
757 avdd_0v75_s0: nldo-reg3 {
758 regulator-name = "avdd_0v75_s0";
762 * The schematic mentions that actual setting
763 * should be 0.8375V. RK3588 datasheet specifies
764 * maximum as 0.825V. So we set datasheet max
767 regulator-min-microvolt = <825000>;
768 regulator-max-microvolt = <825000>;
770 regulator-state-mem {
771 regulator-off-in-suspend;
775 vdd_0v85_s0: nldo-reg4 {
776 regulator-name = "vdd_0v85_s0";
779 regulator-min-microvolt = <850000>;
780 regulator-max-microvolt = <850000>;
782 regulator-state-mem {
783 regulator-off-in-suspend;
787 vdd_0v75_s0: nldo-reg5 {
788 regulator-name = "vdd_0v75_s0";
791 regulator-min-microvolt = <750000>;
792 regulator-max-microvolt = <750000>;
794 regulator-state-mem {
795 regulator-off-in-suspend;
815 phy-supply = <&vcc5v0_usb20>;
820 phy-supply = <&vcc5v0_usb20>;
825 pinctrl-0 = <&uart2m0_xfer>;
830 pinctrl-0 = <&uart9m0_xfer>;