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";
25 stdout-path = "serial2:1500000n8";
29 compatible = "adc-keys";
30 io-channels = <&saradc 0>;
31 io-channel-names = "buttons";
32 keyup-threshold-microvolt = <1800000>;
33 poll-interval = <100>;
37 linux,code = <KEY_SETUP>;
38 press-threshold-microvolt = <2000>;
43 compatible = "adc-keys";
44 io-channels = <&saradc 1>;
45 io-channel-names = "buttons";
46 keyup-threshold-microvolt = <1800000>;
47 poll-interval = <100>;
51 linux,code = <KEY_VENDOR>;
52 press-threshold-microvolt = <2000>;
56 speaker_amp: speaker-audio-amplifier {
57 compatible = "simple-audio-amplifier";
58 enable-gpios = <&gpio3 RK_PC0 GPIO_ACTIVE_HIGH>;
59 sound-name-prefix = "Speaker Amp";
62 headphone_amp: headphones-audio-amplifier {
63 compatible = "simple-audio-amplifier";
64 enable-gpios = <&gpio3 RK_PA7 GPIO_ACTIVE_HIGH>;
65 sound-name-prefix = "Headphones Amp";
69 compatible = "gpio-ir-receiver";
70 gpios = <&gpio4 RK_PB3 GPIO_ACTIVE_LOW>;
71 pinctrl-names = "default";
72 pinctrl-0 = <&ir_receiver_pin>;
76 compatible = "gpio-leds";
77 pinctrl-names = "default";
78 pinctrl-0 = <&blue_led_pin>;
81 color = <LED_COLOR_ID_BLUE>;
82 function = LED_FUNCTION_INDICATOR;
83 function-enumerator = <1>;
84 gpios = <&gpio3 RK_PA6 GPIO_ACTIVE_HIGH>;
89 compatible = "pwm-fan";
90 cooling-levels = <0 70 75 80 100>;
91 fan-supply = <&vcc5v0_sys>;
92 pwms = <&pwm3 0 50000 0>;
97 compatible = "pwm-leds";
100 color = <LED_COLOR_ID_GREEN>;
101 function = LED_FUNCTION_INDICATOR;
102 function-enumerator = <2>;
103 max-brightness = <255>;
104 pwms = <&pwm2 0 25000 0>;
109 compatible = "simple-audio-card";
110 pinctrl-names = "default";
111 pinctrl-0 = <&hp_detect>;
112 simple-audio-card,name = "Analog";
113 simple-audio-card,aux-devs = <&speaker_amp>, <&headphone_amp>;
114 simple-audio-card,format = "i2s";
115 simple-audio-card,mclk-fs = <256>;
116 simple-audio-card,hp-det-gpio = <&gpio1 RK_PD3 GPIO_ACTIVE_LOW>;
117 simple-audio-card,bitclock-master = <&daicpu>;
118 simple-audio-card,frame-master = <&daicpu>;
119 /*TODO: SARADC_IN3 is used as MIC detection / key input */
121 simple-audio-card,widgets =
122 "Microphone", "Onboard Microphone",
123 "Microphone", "Microphone Jack",
124 "Speaker", "Speaker",
125 "Headphone", "Headphones";
127 simple-audio-card,routing =
128 "Headphones", "LOUT1",
129 "Headphones", "ROUT1",
133 "Headphones", "Headphones Amp OUTL",
134 "Headphones", "Headphones Amp OUTR",
135 "Headphones Amp INL", "LOUT1",
136 "Headphones Amp INR", "ROUT1",
138 "Speaker", "Speaker Amp OUTL",
139 "Speaker", "Speaker Amp OUTR",
140 "Speaker Amp INL", "LOUT2",
141 "Speaker Amp INR", "ROUT2",
143 /* single ended signal to LINPUT1 */
144 "LINPUT1", "Microphone Jack",
145 "RINPUT1", "Microphone Jack",
146 /* differential signal */
147 "LINPUT2", "Onboard Microphone",
148 "RINPUT2", "Onboard Microphone";
150 daicpu: simple-audio-card,cpu {
151 sound-dai = <&i2s0_8ch>;
152 system-clock-frequency = <12288000>;
155 daicodec: simple-audio-card,codec {
156 sound-dai = <&es8388>;
157 system-clock-frequency = <12288000>;
161 vcc3v3_pcie30: vcc3v3-pcie30-regulator {
162 compatible = "regulator-fixed";
164 gpios = <&gpio2 RK_PB6 GPIO_ACTIVE_HIGH>;
165 regulator-name = "vcc3v3_pcie30";
166 regulator-min-microvolt = <3300000>;
167 regulator-max-microvolt = <3300000>;
168 startup-delay-us = <5000>;
169 vin-supply = <&vcc5v0_sys>;
172 vcc3v3_pcie_eth: vcc3v3-pcie-eth-regulator {
173 compatible = "regulator-fixed";
174 gpios = <&gpio3 RK_PB4 GPIO_ACTIVE_LOW>;
175 regulator-name = "vcc3v3_pcie_eth";
176 regulator-min-microvolt = <3300000>;
177 regulator-max-microvolt = <3300000>;
178 startup-delay-us = <50000>;
179 vin-supply = <&vcc5v0_sys>;
182 vcc3v3_wf: vcc3v3-wf-regulator {
183 compatible = "regulator-fixed";
185 gpios = <&gpio2 RK_PC5 GPIO_ACTIVE_HIGH>;
186 regulator-name = "vcc3v3_wf";
187 regulator-min-microvolt = <3300000>;
188 regulator-max-microvolt = <3300000>;
189 startup-delay-us = <50000>;
190 vin-supply = <&vcc5v0_sys>;
193 vcc5v0_sys: vcc5v0-sys-regulator {
194 compatible = "regulator-fixed";
195 regulator-name = "vcc5v0_sys";
198 regulator-min-microvolt = <5000000>;
199 regulator-max-microvolt = <5000000>;
202 vcc5v0_usb20: vcc5v0-usb20-regulator {
203 compatible = "regulator-fixed";
205 gpio = <&gpio3 RK_PB7 GPIO_ACTIVE_HIGH>;
206 pinctrl-names = "default";
207 pinctrl-0 = <&vcc5v0_usb20_en>;
208 regulator-name = "vcc5v0_usb20";
209 regulator-min-microvolt = <5000000>;
210 regulator-max-microvolt = <5000000>;
211 vin-supply = <&vcc5v0_sys>;
228 cpu-supply = <&vdd_cpu_big0_s0>;
232 cpu-supply = <&vdd_cpu_big0_s0>;
236 cpu-supply = <&vdd_cpu_big1_s0>;
240 cpu-supply = <&vdd_cpu_big1_s0>;
244 cpu-supply = <&vdd_cpu_lit_s0>;
248 cpu-supply = <&vdd_cpu_lit_s0>;
252 cpu-supply = <&vdd_cpu_lit_s0>;
256 cpu-supply = <&vdd_cpu_lit_s0>;
260 pinctrl-names = "default";
261 pinctrl-0 = <&i2c0m2_xfer>;
264 vdd_cpu_big0_s0: regulator@42 {
265 compatible = "rockchip,rk8602";
267 fcs,suspend-voltage-selector = <1>;
268 regulator-name = "vdd_cpu_big0_s0";
271 regulator-min-microvolt = <550000>;
272 regulator-max-microvolt = <1050000>;
273 regulator-ramp-delay = <2300>;
274 vin-supply = <&vcc5v0_sys>;
276 regulator-state-mem {
277 regulator-off-in-suspend;
281 vdd_cpu_big1_s0: regulator@43 {
282 compatible = "rockchip,rk8603", "rockchip,rk8602";
284 fcs,suspend-voltage-selector = <1>;
285 regulator-name = "vdd_cpu_big1_s0";
288 regulator-min-microvolt = <550000>;
289 regulator-max-microvolt = <1050000>;
290 regulator-ramp-delay = <2300>;
291 vin-supply = <&vcc5v0_sys>;
293 regulator-state-mem {
294 regulator-off-in-suspend;
300 clock-frequency = <400000>;
304 compatible = "haoyu,hym8563";
306 interrupt-parent = <&gpio0>;
307 interrupts = <RK_PB0 IRQ_TYPE_LEVEL_LOW>;
309 clock-output-names = "hym8563";
310 pinctrl-names = "default";
311 pinctrl-0 = <&hym8563_int>;
319 /* PLDO2 vcca 1.8V, BUCK8 gated by PLDO2 being enabled */
320 es8388: audio-codec@11 {
321 compatible = "everest,es8388";
323 clocks = <&cru I2S0_8CH_MCLKOUT>;
324 clock-names = "mclk";
325 AVDD-supply = <&vcc_1v8_s0>;
326 DVDD-supply = <&vcc_1v8_s0>;
327 HPVDD-supply = <&vcc_3v3_s0>;
328 PVDD-supply = <&vcc_3v3_s0>;
329 assigned-clocks = <&cru I2S0_8CH_MCLKOUT>;
330 assigned-clock-rates = <12288000>;
331 #sound-dai-cells = <0>;
336 pinctrl-names = "default";
337 pinctrl-0 = <&i2s0_lrck
346 pinctrl-names = "default";
347 pinctrl-0 = <&i2s2m0_lrck
354 /* phy1 - M.KEY socket */
356 reset-gpios = <&gpio4 RK_PA5 GPIO_ACTIVE_HIGH>;
357 vpcie3v3-supply = <&vcc3v3_wf>;
361 /* phy2 - right ethernet port */
363 reset-gpios = <&gpio3 RK_PB3 GPIO_ACTIVE_HIGH>;
364 vpcie3v3-supply = <&vcc3v3_pcie_eth>;
368 /* phy0 - left ethernet port */
370 reset-gpios = <&gpio4 RK_PA2 GPIO_ACTIVE_HIGH>;
371 vpcie3v3-supply = <&vcc3v3_pcie_eth>;
380 reset-gpios = <&gpio4 RK_PB6 GPIO_ACTIVE_HIGH>;
381 vpcie3v3-supply = <&vcc3v3_pcie30>;
387 hym8563_int: hym8563-int {
388 rockchip,pins = <0 RK_PB0 RK_FUNC_GPIO &pcfg_pull_none>;
393 blue_led_pin: blue-led {
394 rockchip,pins = <3 RK_PA6 RK_FUNC_GPIO &pcfg_pull_up>;
399 ir_receiver_pin: ir-receiver-pin {
400 rockchip,pins = <4 RK_PB3 RK_FUNC_GPIO &pcfg_pull_none>;
405 hp_detect: hp-detect {
406 rockchip,pins = <1 RK_PD3 RK_FUNC_GPIO &pcfg_pull_none>;
411 vcc5v0_usb20_en: vcc5v0-usb20-en {
412 rockchip,pins = <3 RK_PB7 RK_FUNC_GPIO &pcfg_pull_none>;
418 pinctrl-0 = <&pwm2m1_pins>;
419 pinctrl-names = "default";
424 pinctrl-0 = <&pwm3m1_pins>;
429 vref-supply = <&vcc_1v8_s0>;
438 max-frequency = <200000000>;
440 mmc-hs400-enhanced-strobe;
448 max-frequency = <150000000>;
452 vmmc-supply = <&vcc_3v3_s3>;
453 vqmmc-supply = <&vccio_sd_s0>;
458 pinctrl-names = "default";
459 pinctrl-0 = <&fspim1_pins>;
463 compatible = "jedec,spi-nor";
465 spi-max-frequency = <100000000>;
466 spi-rx-bus-width = <4>;
467 spi-tx-bus-width = <1>;
472 assigned-clocks = <&cru CLK_SPI2>;
473 assigned-clock-rates = <200000000>;
475 pinctrl-names = "default";
476 pinctrl-0 = <&spi2m2_cs0 &spi2m2_pins>;
480 compatible = "rockchip,rk806";
482 interrupt-parent = <&gpio0>;
483 interrupts = <7 IRQ_TYPE_LEVEL_LOW>;
484 pinctrl-names = "default";
485 pinctrl-0 = <&pmic_pins>, <&rk806_dvs1_null>,
486 <&rk806_dvs2_null>, <&rk806_dvs3_null>;
487 spi-max-frequency = <1000000>;
489 vcc1-supply = <&vcc5v0_sys>;
490 vcc2-supply = <&vcc5v0_sys>;
491 vcc3-supply = <&vcc5v0_sys>;
492 vcc4-supply = <&vcc5v0_sys>;
493 vcc5-supply = <&vcc5v0_sys>;
494 vcc6-supply = <&vcc5v0_sys>;
495 vcc7-supply = <&vcc5v0_sys>;
496 vcc8-supply = <&vcc5v0_sys>;
497 vcc9-supply = <&vcc5v0_sys>;
498 vcc10-supply = <&vcc5v0_sys>;
499 vcc11-supply = <&vcc_2v0_pldo_s3>;
500 vcc12-supply = <&vcc5v0_sys>;
501 vcc13-supply = <&vdd2_ddr_s3>;
502 vcc14-supply = <&vdd2_ddr_s3>;
503 vcca-supply = <&vcc5v0_sys>;
508 rk806_dvs1_null: dvs1-null-pins {
509 pins = "gpio_pwrctrl2";
510 function = "pin_fun0";
513 rk806_dvs2_null: dvs2-null-pins {
514 pins = "gpio_pwrctrl2";
515 function = "pin_fun0";
518 rk806_dvs3_null: dvs3-null-pins {
519 pins = "gpio_pwrctrl3";
520 function = "pin_fun0";
524 vdd_gpu_s0: dcdc-reg1 {
525 regulator-name = "vdd_gpu_s0";
527 regulator-enable-ramp-delay = <400>;
528 regulator-min-microvolt = <550000>;
529 regulator-max-microvolt = <950000>;
530 regulator-ramp-delay = <12500>;
532 regulator-state-mem {
533 regulator-off-in-suspend;
537 vdd_cpu_lit_s0: dcdc-reg2 {
538 regulator-name = "vdd_cpu_lit_s0";
541 regulator-min-microvolt = <550000>;
542 regulator-max-microvolt = <950000>;
543 regulator-ramp-delay = <12500>;
545 regulator-state-mem {
546 regulator-off-in-suspend;
550 vdd_log_s0: dcdc-reg3 {
551 regulator-name = "vdd_log_s0";
554 regulator-min-microvolt = <675000>;
555 regulator-max-microvolt = <825000>;
556 regulator-ramp-delay = <12500>;
558 regulator-state-mem {
559 regulator-off-in-suspend;
560 regulator-suspend-microvolt = <750000>;
564 vdd_vdenc_s0: dcdc-reg4 {
565 regulator-name = "vdd_vdenc_s0";
568 regulator-min-microvolt = <550000>;
569 regulator-max-microvolt = <825000>;
570 regulator-ramp-delay = <12500>;
572 regulator-state-mem {
573 regulator-off-in-suspend;
577 vdd_ddr_s0: dcdc-reg5 {
578 regulator-name = "vdd_ddr_s0";
581 regulator-min-microvolt = <675000>;
582 regulator-max-microvolt = <900000>;
583 regulator-ramp-delay = <12500>;
585 regulator-state-mem {
586 regulator-off-in-suspend;
587 regulator-suspend-microvolt = <850000>;
591 vdd2_ddr_s3: dcdc-reg6 {
592 regulator-name = "vdd2_ddr_s3";
596 regulator-state-mem {
597 regulator-on-in-suspend;
601 vcc_2v0_pldo_s3: dcdc-reg7 {
602 regulator-name = "vdd_2v0_pldo_s3";
605 regulator-min-microvolt = <2000000>;
606 regulator-max-microvolt = <2000000>;
607 regulator-ramp-delay = <12500>;
609 regulator-state-mem {
610 regulator-on-in-suspend;
611 regulator-suspend-microvolt = <2000000>;
615 vcc_3v3_s3: dcdc-reg8 {
616 regulator-name = "vcc_3v3_s3";
619 regulator-min-microvolt = <3300000>;
620 regulator-max-microvolt = <3300000>;
622 regulator-state-mem {
623 regulator-on-in-suspend;
624 regulator-suspend-microvolt = <3300000>;
628 vddq_ddr_s0: dcdc-reg9 {
629 regulator-name = "vddq_ddr_s0";
633 regulator-state-mem {
634 regulator-off-in-suspend;
638 vcc_1v8_s3: dcdc-reg10 {
639 regulator-name = "vcc_1v8_s3";
642 regulator-min-microvolt = <1800000>;
643 regulator-max-microvolt = <1800000>;
645 regulator-state-mem {
646 regulator-on-in-suspend;
647 regulator-suspend-microvolt = <1800000>;
651 avcc_1v8_s0: pldo-reg1 {
652 regulator-name = "avcc_1v8_s0";
655 regulator-min-microvolt = <1800000>;
656 regulator-max-microvolt = <1800000>;
658 regulator-state-mem {
659 regulator-off-in-suspend;
660 regulator-suspend-microvolt = <1800000>;
664 /* shorted to avcc_1v8_s0 on the board */
665 vcc_1v8_s0: pldo-reg2 {
666 regulator-name = "vcc_1v8_s0";
669 regulator-min-microvolt = <1800000>;
670 regulator-max-microvolt = <1800000>;
672 regulator-state-mem {
673 regulator-off-in-suspend;
674 regulator-suspend-microvolt = <1800000>;
678 avdd_1v2_s0: pldo-reg3 {
679 regulator-name = "avdd_1v2_s0";
682 regulator-min-microvolt = <1200000>;
683 regulator-max-microvolt = <1200000>;
685 regulator-state-mem {
686 regulator-off-in-suspend;
690 vcc_3v3_s0: pldo-reg4 {
691 regulator-name = "vcc_3v3_s0";
694 regulator-min-microvolt = <3300000>;
695 regulator-max-microvolt = <3300000>;
696 regulator-ramp-delay = <12500>;
698 regulator-state-mem {
699 regulator-off-in-suspend;
703 vccio_sd_s0: pldo-reg5 {
704 regulator-name = "vccio_sd_s0";
707 regulator-min-microvolt = <1800000>;
708 regulator-max-microvolt = <3300000>;
709 regulator-ramp-delay = <12500>;
711 regulator-state-mem {
712 regulator-off-in-suspend;
716 pldo6_s3: pldo-reg6 {
717 regulator-name = "pldo6_s3";
720 regulator-min-microvolt = <1800000>;
721 regulator-max-microvolt = <1800000>;
723 regulator-state-mem {
724 regulator-on-in-suspend;
725 regulator-suspend-microvolt = <1800000>;
729 vdd_0v75_s3: nldo-reg1 {
730 regulator-name = "vdd_0v75_s3";
733 regulator-min-microvolt = <750000>;
734 regulator-max-microvolt = <750000>;
736 regulator-state-mem {
737 regulator-on-in-suspend;
738 regulator-suspend-microvolt = <750000>;
742 vdd_ddr_pll_s0: nldo-reg2 {
743 regulator-name = "vdd_ddr_pll_s0";
746 regulator-min-microvolt = <850000>;
747 regulator-max-microvolt = <850000>;
749 regulator-state-mem {
750 regulator-off-in-suspend;
751 regulator-suspend-microvolt = <850000>;
755 avdd_0v75_s0: nldo-reg3 {
756 regulator-name = "avdd_0v75_s0";
760 * The schematic mentions that actual setting
761 * should be 0.8375V. RK3588 datasheet specifies
762 * maximum as 0.825V. So we set datasheet max
765 regulator-min-microvolt = <825000>;
766 regulator-max-microvolt = <825000>;
768 regulator-state-mem {
769 regulator-off-in-suspend;
773 vdd_0v85_s0: nldo-reg4 {
774 regulator-name = "vdd_0v85_s0";
777 regulator-min-microvolt = <850000>;
778 regulator-max-microvolt = <850000>;
780 regulator-state-mem {
781 regulator-off-in-suspend;
785 vdd_0v75_s0: nldo-reg5 {
786 regulator-name = "vdd_0v75_s0";
789 regulator-min-microvolt = <750000>;
790 regulator-max-microvolt = <750000>;
792 regulator-state-mem {
793 regulator-off-in-suspend;
813 phy-supply = <&vcc5v0_usb20>;
818 phy-supply = <&vcc5v0_usb20>;
823 pinctrl-0 = <&uart2m0_xfer>;
828 pinctrl-0 = <&uart9m0_xfer>;