1 // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
3 * Copyright (c) 2017 Fuzhou Rockchip Electronics Co., Ltd.
7 #include <dt-bindings/input/linux-event-codes.h>
8 #include <dt-bindings/interrupt-controller/irq.h>
9 #include <dt-bindings/pwm/pwm.h>
10 #include <dt-bindings/usb/pd.h>
11 #include "rk3399.dtsi"
12 #include "rk3399-opp.dtsi"
15 model = "Firefly-RK3399 Board";
16 compatible = "firefly,firefly-rk3399", "rockchip,rk3399";
25 stdout-path = "serial2:1500000n8";
28 backlight: backlight {
29 compatible = "pwm-backlight";
30 enable-gpios = <&gpio1 RK_PB5 GPIO_ACTIVE_HIGH>;
31 pwms = <&pwm0 0 25000 0>;
35 16 17 18 19 20 21 22 23
36 24 25 26 27 28 29 30 31
37 32 33 34 35 36 37 38 39
38 40 41 42 43 44 45 46 47
39 48 49 50 51 52 53 54 55
40 56 57 58 59 60 61 62 63
41 64 65 66 67 68 69 70 71
42 72 73 74 75 76 77 78 79
43 80 81 82 83 84 85 86 87
44 88 89 90 91 92 93 94 95
45 96 97 98 99 100 101 102 103
46 104 105 106 107 108 109 110 111
47 112 113 114 115 116 117 118 119
48 120 121 122 123 124 125 126 127
49 128 129 130 131 132 133 134 135
50 136 137 138 139 140 141 142 143
51 144 145 146 147 148 149 150 151
52 152 153 154 155 156 157 158 159
53 160 161 162 163 164 165 166 167
54 168 169 170 171 172 173 174 175
55 176 177 178 179 180 181 182 183
56 184 185 186 187 188 189 190 191
57 192 193 194 195 196 197 198 199
58 200 201 202 203 204 205 206 207
59 208 209 210 211 212 213 214 215
60 216 217 218 219 220 221 222 223
61 224 225 226 227 228 229 230 231
62 232 233 234 235 236 237 238 239
63 240 241 242 243 244 245 246 247
64 248 249 250 251 252 253 254 255>;
65 default-brightness-level = <200>;
68 clkin_gmac: external-gmac-clock {
69 compatible = "fixed-clock";
70 clock-frequency = <125000000>;
71 clock-output-names = "clkin_gmac";
76 compatible = "regulator-fixed";
77 regulator-name = "dc_12v";
80 regulator-min-microvolt = <12000000>;
81 regulator-max-microvolt = <12000000>;
85 compatible = "gpio-keys";
87 pinctrl-names = "default";
88 pinctrl-0 = <&pwrbtn>;
91 debounce-interval = <100>;
92 gpios = <&gpio0 RK_PA5 GPIO_ACTIVE_LOW>;
93 label = "GPIO Key Power";
94 linux,code = <KEY_POWER>;
100 compatible = "gpio-ir-receiver";
101 gpios = <&gpio0 RK_PA6 GPIO_ACTIVE_LOW>;
102 pinctrl-0 = <&ir_int>;
103 pinctrl-names = "default";
107 compatible = "gpio-leds";
108 pinctrl-names = "default";
109 pinctrl-0 = <&work_led_pin>, <&diy_led_pin>;
113 default-state = "on";
114 gpios = <&gpio2 RK_PD3 GPIO_ACTIVE_HIGH>;
119 default-state = "off";
120 gpios = <&gpio0 RK_PB5 GPIO_ACTIVE_HIGH>;
125 compatible = "simple-audio-card";
126 simple-audio-card,name = "rockchip,rt5640-codec";
127 simple-audio-card,format = "i2s";
128 simple-audio-card,mclk-fs = <256>;
129 simple-audio-card,widgets =
130 "Microphone", "Mic Jack",
131 "Headphone", "Headphone Jack";
132 simple-audio-card,routing =
133 "Mic Jack", "MICBIAS1",
135 "Headphone Jack", "HPOL",
136 "Headphone Jack", "HPOR";
138 simple-audio-card,cpu {
142 simple-audio-card,codec {
143 sound-dai = <&rt5640>;
147 sdio_pwrseq: sdio-pwrseq {
148 compatible = "mmc-pwrseq-simple";
150 clock-names = "ext_clock";
151 pinctrl-names = "default";
152 pinctrl-0 = <&wifi_enable_h>;
155 * On the module itself this is one of these (depending
156 * on the actual card populated):
157 * - SDIO_RESET_L_WL_REG_ON
158 * - PDN (power down when low)
160 reset-gpios = <&gpio0 RK_PB2 GPIO_ACTIVE_LOW>;
164 compatible = "audio-graph-card";
170 compatible = "linux,spdif-dit";
171 #sound-dai-cells = <0>;
175 remote-endpoint = <&spdif_p0_0>;
180 /* switched by pmic_sleep */
181 vcc1v8_s3: vcca1v8_s3: vcc1v8-s3 {
182 compatible = "regulator-fixed";
183 regulator-name = "vcc1v8_s3";
186 regulator-min-microvolt = <1800000>;
187 regulator-max-microvolt = <1800000>;
188 vin-supply = <&vcc_1v8>;
191 vcc3v3_pcie: vcc3v3-pcie-regulator {
192 compatible = "regulator-fixed";
194 gpio = <&gpio1 RK_PC1 GPIO_ACTIVE_HIGH>;
195 pinctrl-names = "default";
196 pinctrl-0 = <&pcie_pwr_en>;
197 regulator-name = "vcc3v3_pcie";
200 vin-supply = <&dc_12v>;
203 vcc3v3_sys: vcc3v3-sys {
204 compatible = "regulator-fixed";
205 regulator-name = "vcc3v3_sys";
208 regulator-min-microvolt = <3300000>;
209 regulator-max-microvolt = <3300000>;
210 vin-supply = <&vcc_sys>;
213 /* Actually 3 regulators (host0, 1, 2) controlled by the same gpio */
214 vcc5v0_host: vcc5v0-host-regulator {
215 compatible = "regulator-fixed";
217 gpio = <&gpio1 RK_PA0 GPIO_ACTIVE_HIGH>;
218 pinctrl-names = "default";
219 pinctrl-0 = <&vcc5v0_host_en>;
220 regulator-name = "vcc5v0_host";
222 vin-supply = <&vcc_sys>;
225 vcc5v0_typec: vcc5v0-typec-regulator {
226 compatible = "regulator-fixed";
228 gpio = <&gpio1 RK_PA3 GPIO_ACTIVE_HIGH>;
229 pinctrl-names = "default";
230 pinctrl-0 = <&vcc5v0_typec_en>;
231 regulator-name = "vcc5v0_typec";
233 vin-supply = <&vcc_sys>;
237 compatible = "regulator-fixed";
238 regulator-name = "vcc_sys";
241 regulator-min-microvolt = <5000000>;
242 regulator-max-microvolt = <5000000>;
243 vin-supply = <&dc_12v>;
247 compatible = "pwm-regulator";
248 pwms = <&pwm2 0 25000 1>;
249 pwm-supply = <&vcc_sys>;
250 regulator-name = "vdd_log";
253 regulator-min-microvolt = <430000>;
254 regulator-max-microvolt = <1400000>;
259 cpu-supply = <&vdd_cpu_l>;
263 cpu-supply = <&vdd_cpu_l>;
267 cpu-supply = <&vdd_cpu_l>;
271 cpu-supply = <&vdd_cpu_l>;
275 cpu-supply = <&vdd_cpu_b>;
279 cpu-supply = <&vdd_cpu_b>;
287 assigned-clocks = <&cru SCLK_RMII_SRC>;
288 assigned-clock-parents = <&clkin_gmac>;
289 clock_in_out = "input";
290 phy-supply = <&vcc_lan>;
292 pinctrl-names = "default";
293 pinctrl-0 = <&rgmii_pins>;
294 snps,reset-gpio = <&gpio3 RK_PB7 GPIO_ACTIVE_LOW>;
295 snps,reset-active-low;
296 snps,reset-delays-us = <0 10000 50000>;
303 mali-supply = <&vdd_gpu>;
308 ddc-i2c-bus = <&i2c3>;
309 pinctrl-names = "default";
310 pinctrl-0 = <&hdmi_cec>;
315 clock-frequency = <400000>;
316 i2c-scl-rising-time-ns = <168>;
317 i2c-scl-falling-time-ns = <4>;
321 compatible = "rockchip,rk808";
323 interrupt-parent = <&gpio1>;
324 interrupts = <21 IRQ_TYPE_LEVEL_LOW>;
326 clock-output-names = "xin32k", "rk808-clkout2";
327 pinctrl-names = "default";
328 pinctrl-0 = <&pmic_int_l>;
329 rockchip,system-power-controller;
332 vcc1-supply = <&vcc_sys>;
333 vcc2-supply = <&vcc_sys>;
334 vcc3-supply = <&vcc_sys>;
335 vcc4-supply = <&vcc_sys>;
336 vcc6-supply = <&vcc_sys>;
337 vcc7-supply = <&vcc_sys>;
338 vcc8-supply = <&vcc3v3_sys>;
339 vcc9-supply = <&vcc_sys>;
340 vcc10-supply = <&vcc_sys>;
341 vcc11-supply = <&vcc_sys>;
342 vcc12-supply = <&vcc3v3_sys>;
343 vddio-supply = <&vcc1v8_pmu>;
346 vdd_center: DCDC_REG1 {
347 regulator-name = "vdd_center";
350 regulator-min-microvolt = <750000>;
351 regulator-max-microvolt = <1350000>;
352 regulator-ramp-delay = <6001>;
353 regulator-state-mem {
354 regulator-off-in-suspend;
358 vdd_cpu_l: DCDC_REG2 {
359 regulator-name = "vdd_cpu_l";
362 regulator-min-microvolt = <750000>;
363 regulator-max-microvolt = <1350000>;
364 regulator-ramp-delay = <6001>;
365 regulator-state-mem {
366 regulator-off-in-suspend;
371 regulator-name = "vcc_ddr";
374 regulator-state-mem {
375 regulator-on-in-suspend;
380 regulator-name = "vcc_1v8";
383 regulator-min-microvolt = <1800000>;
384 regulator-max-microvolt = <1800000>;
385 regulator-state-mem {
386 regulator-on-in-suspend;
387 regulator-suspend-microvolt = <1800000>;
391 vcc1v8_dvp: LDO_REG1 {
392 regulator-name = "vcc1v8_dvp";
395 regulator-min-microvolt = <1800000>;
396 regulator-max-microvolt = <1800000>;
397 regulator-state-mem {
398 regulator-off-in-suspend;
402 vcc2v8_dvp: LDO_REG2 {
403 regulator-name = "vcc2v8_dvp";
406 regulator-min-microvolt = <2800000>;
407 regulator-max-microvolt = <2800000>;
408 regulator-state-mem {
409 regulator-off-in-suspend;
413 vcc1v8_pmu: LDO_REG3 {
414 regulator-name = "vcc1v8_pmu";
417 regulator-min-microvolt = <1800000>;
418 regulator-max-microvolt = <1800000>;
419 regulator-state-mem {
420 regulator-on-in-suspend;
421 regulator-suspend-microvolt = <1800000>;
426 regulator-name = "vcc_sdio";
429 regulator-min-microvolt = <1800000>;
430 regulator-max-microvolt = <3000000>;
431 regulator-state-mem {
432 regulator-on-in-suspend;
433 regulator-suspend-microvolt = <3000000>;
437 vcca3v0_codec: LDO_REG5 {
438 regulator-name = "vcca3v0_codec";
441 regulator-min-microvolt = <3000000>;
442 regulator-max-microvolt = <3000000>;
443 regulator-state-mem {
444 regulator-off-in-suspend;
449 regulator-name = "vcc_1v5";
452 regulator-min-microvolt = <1500000>;
453 regulator-max-microvolt = <1500000>;
454 regulator-state-mem {
455 regulator-on-in-suspend;
456 regulator-suspend-microvolt = <1500000>;
460 vcca1v8_codec: LDO_REG7 {
461 regulator-name = "vcca1v8_codec";
464 regulator-min-microvolt = <1800000>;
465 regulator-max-microvolt = <1800000>;
466 regulator-state-mem {
467 regulator-off-in-suspend;
472 regulator-name = "vcc_3v0";
475 regulator-min-microvolt = <3000000>;
476 regulator-max-microvolt = <3000000>;
477 regulator-state-mem {
478 regulator-on-in-suspend;
479 regulator-suspend-microvolt = <3000000>;
483 vcc3v3_s3: vcc_lan: SWITCH_REG1 {
484 regulator-name = "vcc3v3_s3";
487 regulator-state-mem {
488 regulator-off-in-suspend;
492 vcc3v3_s0: SWITCH_REG2 {
493 regulator-name = "vcc3v3_s0";
496 regulator-state-mem {
497 regulator-off-in-suspend;
503 vdd_cpu_b: regulator@40 {
504 compatible = "silergy,syr827";
506 fcs,suspend-voltage-selector = <0>;
507 regulator-name = "vdd_cpu_b";
508 regulator-min-microvolt = <712500>;
509 regulator-max-microvolt = <1500000>;
510 regulator-ramp-delay = <1000>;
513 vin-supply = <&vcc_sys>;
515 regulator-state-mem {
516 regulator-off-in-suspend;
520 vdd_gpu: regulator@41 {
521 compatible = "silergy,syr828";
523 fcs,suspend-voltage-selector = <1>;
524 regulator-name = "vdd_gpu";
525 regulator-min-microvolt = <712500>;
526 regulator-max-microvolt = <1500000>;
527 regulator-ramp-delay = <1000>;
530 vin-supply = <&vcc_sys>;
532 regulator-state-mem {
533 regulator-off-in-suspend;
539 i2c-scl-rising-time-ns = <300>;
540 i2c-scl-falling-time-ns = <15>;
544 compatible = "realtek,rt5640";
546 clocks = <&cru SCLK_I2S_8CH_OUT>;
547 clock-names = "mclk";
548 realtek,in1-differential;
549 #sound-dai-cells = <0>;
550 pinctrl-names = "default";
551 pinctrl-0 = <&rt5640_hpcon>;
556 i2c-scl-rising-time-ns = <450>;
557 i2c-scl-falling-time-ns = <15>;
562 i2c-scl-rising-time-ns = <600>;
563 i2c-scl-falling-time-ns = <20>;
566 fusb0: typec-portc@22 {
567 compatible = "fcs,fusb302";
569 interrupt-parent = <&gpio1>;
570 interrupts = <RK_PA2 IRQ_TYPE_LEVEL_LOW>;
571 pinctrl-names = "default";
572 pinctrl-0 = <&fusb0_int>;
573 vbus-supply = <&vcc5v0_typec>;
577 compatible = "usb-c-connector";
580 op-sink-microwatt = <1000000>;
583 <PDO_FIXED(5000, 2500, PDO_FIXED_USB_COMM)>;
585 <PDO_FIXED(5000, 1400, PDO_FIXED_USB_COMM)>;
586 try-power-role = "sink";
589 #address-cells = <1>;
614 compatible = "invensense,mpu6500";
616 interrupt-parent = <&gpio1>;
617 interrupts = <RK_PC6 IRQ_TYPE_EDGE_RISING>;
622 rockchip,playback-channels = <8>;
623 rockchip,capture-channels = <8>;
628 rockchip,playback-channels = <2>;
629 rockchip,capture-channels = <2>;
640 bt656-supply = <&vcc1v8_dvp>;
641 audio-supply = <&vcca1v8_codec>;
642 sdmmc-supply = <&vcc_sdio>;
643 gpio1830-supply = <&vcc_3v0>;
651 ep-gpios = <&gpio4 RK_PD1 GPIO_ACTIVE_HIGH>;
653 pinctrl-names = "default";
654 pinctrl-0 = <&pcie_clkreqn_cpm>;
659 pmu1830-supply = <&vcc_3v0>;
666 rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_up>;
671 fusb0_int: fusb0-int {
672 rockchip,pins = <1 RK_PA2 RK_FUNC_GPIO &pcfg_pull_up>;
678 rockchip,pins = <0 RK_PA6 RK_FUNC_GPIO &pcfg_pull_none>;
683 lcd_panel_reset: lcd-panel-reset {
684 rockchip,pins = <4 RK_PD6 RK_FUNC_GPIO &pcfg_pull_up>;
689 work_led_pin: work-led-pin {
690 rockchip,pins = <2 RK_PD3 RK_FUNC_GPIO &pcfg_pull_none>;
693 diy_led_pin: diy-led-pin {
694 rockchip,pins = <0 RK_PB5 RK_FUNC_GPIO &pcfg_pull_none>;
699 pcie_pwr_en: pcie-pwr-en {
700 rockchip,pins = <1 RK_PC1 RK_FUNC_GPIO &pcfg_pull_none>;
703 pcie_3g_drv: pcie-3g-drv {
704 rockchip,pins = <0 RK_PA2 RK_FUNC_GPIO &pcfg_pull_up>;
709 pmic_int_l: pmic-int-l {
710 rockchip,pins = <1 RK_PC5 RK_FUNC_GPIO &pcfg_pull_up>;
713 vsel1_pin: vsel1-pin {
714 rockchip,pins = <1 RK_PC2 RK_FUNC_GPIO &pcfg_pull_down>;
717 vsel2_pin: vsel2-pin {
718 rockchip,pins = <1 RK_PB6 RK_FUNC_GPIO &pcfg_pull_down>;
723 rt5640_hpcon: rt5640-hpcon {
724 rockchip,pins = <4 RK_PC5 RK_FUNC_GPIO &pcfg_pull_none>;
729 wifi_enable_h: wifi-enable-h {
730 rockchip,pins = <0 RK_PB2 RK_FUNC_GPIO &pcfg_pull_none>;
735 vcc5v0_typec_en: vcc5v0_typec_en {
736 rockchip,pins = <1 RK_PA3 RK_FUNC_GPIO &pcfg_pull_up>;
741 vcc5v0_host_en: vcc5v0-host-en {
742 rockchip,pins = <1 RK_PA0 RK_FUNC_GPIO &pcfg_pull_none>;
747 wifi_host_wake_l: wifi-host-wake-l {
748 rockchip,pins = <0 RK_PA3 RK_FUNC_GPIO &pcfg_pull_none>;
762 vref-supply = <&vcca1v8_s3>;
767 /* WiFi & BT combo module Ampak AP6356S */
771 keep-power-in-suspend;
772 mmc-pwrseq = <&sdio_pwrseq>;
774 pinctrl-names = "default";
775 pinctrl-0 = <&sdio0_bus4 &sdio0_cmd &sdio0_clk>;
779 vqmmc-supply = <&vcc1v8_s3>; /* IO line */
780 vmmc-supply = <&vcc_sdio>; /* card's power */
782 #address-cells = <1>;
788 compatible = "brcm,bcm4329-fmac";
789 interrupt-parent = <&gpio0>;
790 interrupts = <RK_PA3 IRQ_TYPE_LEVEL_HIGH>;
791 interrupt-names = "host-wake";
792 brcm,drive-strength = <5>;
793 pinctrl-names = "default";
794 pinctrl-0 = <&wifi_host_wake_l>;
802 cd-gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
804 max-frequency = <150000000>;
805 pinctrl-names = "default";
806 pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_bus4>;
813 mmc-hs400-enhanced-strobe;
819 pinctrl-0 = <&spdif_bus_1>;
823 spdif_p0_0: endpoint {
824 remote-endpoint = <&dit_p0_0>;
835 tcphy0_typec_ss: endpoint {
836 remote-endpoint = <&usbc_ss>;
846 /* tshut mode 0:CRU 1:GPIO */
847 rockchip,hw-tshut-mode = <1>;
848 /* tshut polarity 0:LOW 1:HIGH */
849 rockchip,hw-tshut-polarity = <1>;
856 u2phy0_otg: otg-port {
860 u2phy0_host: host-port {
861 phy-supply = <&vcc5v0_host>;
866 u2phy0_typec_hs: endpoint {
867 remote-endpoint = <&usbc_hs>;
875 u2phy1_otg: otg-port {
879 u2phy1_host: host-port {
880 phy-supply = <&vcc5v0_host>;
886 pinctrl-names = "default";
887 pinctrl-0 = <&uart0_xfer &uart0_cts>;