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/pwm/pwm.h>
9 #include <dt-bindings/usb/pd.h>
10 #include "rk3399.dtsi"
11 #include "rk3399-opp.dtsi"
14 model = "Firefly-RK3399 Board";
15 compatible = "firefly,firefly-rk3399", "rockchip,rk3399";
24 stdout-path = "serial2:1500000n8";
27 backlight: backlight {
28 compatible = "pwm-backlight";
29 enable-gpios = <&gpio1 RK_PB5 GPIO_ACTIVE_HIGH>;
30 pwms = <&pwm0 0 25000 0>;
34 16 17 18 19 20 21 22 23
35 24 25 26 27 28 29 30 31
36 32 33 34 35 36 37 38 39
37 40 41 42 43 44 45 46 47
38 48 49 50 51 52 53 54 55
39 56 57 58 59 60 61 62 63
40 64 65 66 67 68 69 70 71
41 72 73 74 75 76 77 78 79
42 80 81 82 83 84 85 86 87
43 88 89 90 91 92 93 94 95
44 96 97 98 99 100 101 102 103
45 104 105 106 107 108 109 110 111
46 112 113 114 115 116 117 118 119
47 120 121 122 123 124 125 126 127
48 128 129 130 131 132 133 134 135
49 136 137 138 139 140 141 142 143
50 144 145 146 147 148 149 150 151
51 152 153 154 155 156 157 158 159
52 160 161 162 163 164 165 166 167
53 168 169 170 171 172 173 174 175
54 176 177 178 179 180 181 182 183
55 184 185 186 187 188 189 190 191
56 192 193 194 195 196 197 198 199
57 200 201 202 203 204 205 206 207
58 208 209 210 211 212 213 214 215
59 216 217 218 219 220 221 222 223
60 224 225 226 227 228 229 230 231
61 232 233 234 235 236 237 238 239
62 240 241 242 243 244 245 246 247
63 248 249 250 251 252 253 254 255>;
64 default-brightness-level = <200>;
67 clkin_gmac: external-gmac-clock {
68 compatible = "fixed-clock";
69 clock-frequency = <125000000>;
70 clock-output-names = "clkin_gmac";
75 compatible = "regulator-fixed";
76 regulator-name = "dc_12v";
79 regulator-min-microvolt = <12000000>;
80 regulator-max-microvolt = <12000000>;
84 compatible = "gpio-keys";
86 pinctrl-names = "default";
87 pinctrl-0 = <&pwrbtn>;
90 debounce-interval = <100>;
91 gpios = <&gpio0 RK_PA5 GPIO_ACTIVE_LOW>;
92 label = "GPIO Key Power";
93 linux,code = <KEY_POWER>;
99 compatible = "gpio-ir-receiver";
100 gpios = <&gpio0 RK_PA6 GPIO_ACTIVE_LOW>;
101 pinctrl-0 = <&ir_int>;
102 pinctrl-names = "default";
106 compatible = "gpio-leds";
107 pinctrl-names = "default";
108 pinctrl-0 = <&work_led_pin>, <&diy_led_pin>;
112 default-state = "on";
113 gpios = <&gpio2 RK_PD3 GPIO_ACTIVE_HIGH>;
118 default-state = "off";
119 gpios = <&gpio0 RK_PB5 GPIO_ACTIVE_HIGH>;
124 compatible = "simple-audio-card";
125 simple-audio-card,name = "rockchip,rt5640-codec";
126 simple-audio-card,format = "i2s";
127 simple-audio-card,mclk-fs = <256>;
128 simple-audio-card,widgets =
129 "Microphone", "Mic Jack",
130 "Headphone", "Headphone Jack";
131 simple-audio-card,routing =
132 "Mic Jack", "MICBIAS1",
134 "Headphone Jack", "HPOL",
135 "Headphone Jack", "HPOR";
137 simple-audio-card,cpu {
141 simple-audio-card,codec {
142 sound-dai = <&rt5640>;
146 sdio_pwrseq: sdio-pwrseq {
147 compatible = "mmc-pwrseq-simple";
149 clock-names = "ext_clock";
150 pinctrl-names = "default";
151 pinctrl-0 = <&wifi_enable_h>;
154 * On the module itself this is one of these (depending
155 * on the actual card populated):
156 * - SDIO_RESET_L_WL_REG_ON
157 * - PDN (power down when low)
159 reset-gpios = <&gpio0 RK_PB2 GPIO_ACTIVE_LOW>;
163 compatible = "audio-graph-card";
169 compatible = "linux,spdif-dit";
170 #sound-dai-cells = <0>;
174 remote-endpoint = <&spdif_p0_0>;
179 /* switched by pmic_sleep */
180 vcc1v8_s3: vcca1v8_s3: vcc1v8-s3 {
181 compatible = "regulator-fixed";
182 regulator-name = "vcc1v8_s3";
185 regulator-min-microvolt = <1800000>;
186 regulator-max-microvolt = <1800000>;
187 vin-supply = <&vcc_1v8>;
190 vcc3v3_pcie: vcc3v3-pcie-regulator {
191 compatible = "regulator-fixed";
193 gpio = <&gpio1 RK_PC1 GPIO_ACTIVE_HIGH>;
194 pinctrl-names = "default";
195 pinctrl-0 = <&pcie_pwr_en>;
196 regulator-name = "vcc3v3_pcie";
199 vin-supply = <&dc_12v>;
202 vcc3v3_sys: vcc3v3-sys {
203 compatible = "regulator-fixed";
204 regulator-name = "vcc3v3_sys";
207 regulator-min-microvolt = <3300000>;
208 regulator-max-microvolt = <3300000>;
209 vin-supply = <&vcc_sys>;
212 /* Actually 3 regulators (host0, 1, 2) controlled by the same gpio */
213 vcc5v0_host: vcc5v0-host-regulator {
214 compatible = "regulator-fixed";
216 gpio = <&gpio1 RK_PA0 GPIO_ACTIVE_HIGH>;
217 pinctrl-names = "default";
218 pinctrl-0 = <&vcc5v0_host_en>;
219 regulator-name = "vcc5v0_host";
221 vin-supply = <&vcc_sys>;
224 vcc5v0_typec: vcc5v0-typec-regulator {
225 compatible = "regulator-fixed";
227 gpio = <&gpio1 RK_PA3 GPIO_ACTIVE_HIGH>;
228 pinctrl-names = "default";
229 pinctrl-0 = <&vcc5v0_typec_en>;
230 regulator-name = "vcc5v0_typec";
232 vin-supply = <&vcc_sys>;
236 compatible = "regulator-fixed";
237 regulator-name = "vcc_sys";
240 regulator-min-microvolt = <5000000>;
241 regulator-max-microvolt = <5000000>;
242 vin-supply = <&dc_12v>;
246 compatible = "pwm-regulator";
247 pwms = <&pwm2 0 25000 1>;
248 regulator-name = "vdd_log";
251 regulator-min-microvolt = <430000>;
252 regulator-max-microvolt = <1400000>;
253 vin-supply = <&vcc_sys>;
258 cpu-supply = <&vdd_cpu_l>;
262 cpu-supply = <&vdd_cpu_l>;
266 cpu-supply = <&vdd_cpu_l>;
270 cpu-supply = <&vdd_cpu_l>;
274 cpu-supply = <&vdd_cpu_b>;
278 cpu-supply = <&vdd_cpu_b>;
286 assigned-clocks = <&cru SCLK_RMII_SRC>;
287 assigned-clock-parents = <&clkin_gmac>;
288 clock_in_out = "input";
289 phy-supply = <&vcc_lan>;
291 pinctrl-names = "default";
292 pinctrl-0 = <&rgmii_pins>;
293 snps,reset-gpio = <&gpio3 RK_PB7 GPIO_ACTIVE_LOW>;
294 snps,reset-active-low;
295 snps,reset-delays-us = <0 10000 50000>;
302 ddc-i2c-bus = <&i2c3>;
303 pinctrl-names = "default";
304 pinctrl-0 = <&hdmi_cec>;
309 clock-frequency = <400000>;
310 i2c-scl-rising-time-ns = <168>;
311 i2c-scl-falling-time-ns = <4>;
315 compatible = "rockchip,rk808";
317 interrupt-parent = <&gpio1>;
318 interrupts = <21 IRQ_TYPE_LEVEL_LOW>;
320 clock-output-names = "xin32k", "rk808-clkout2";
321 pinctrl-names = "default";
322 pinctrl-0 = <&pmic_int_l>;
323 rockchip,system-power-controller;
326 vcc1-supply = <&vcc_sys>;
327 vcc2-supply = <&vcc_sys>;
328 vcc3-supply = <&vcc_sys>;
329 vcc4-supply = <&vcc_sys>;
330 vcc6-supply = <&vcc_sys>;
331 vcc7-supply = <&vcc_sys>;
332 vcc8-supply = <&vcc3v3_sys>;
333 vcc9-supply = <&vcc_sys>;
334 vcc10-supply = <&vcc_sys>;
335 vcc11-supply = <&vcc_sys>;
336 vcc12-supply = <&vcc3v3_sys>;
337 vddio-supply = <&vcc1v8_pmu>;
340 vdd_center: DCDC_REG1 {
341 regulator-name = "vdd_center";
344 regulator-min-microvolt = <750000>;
345 regulator-max-microvolt = <1350000>;
346 regulator-ramp-delay = <6001>;
347 regulator-state-mem {
348 regulator-off-in-suspend;
352 vdd_cpu_l: DCDC_REG2 {
353 regulator-name = "vdd_cpu_l";
356 regulator-min-microvolt = <750000>;
357 regulator-max-microvolt = <1350000>;
358 regulator-ramp-delay = <6001>;
359 regulator-state-mem {
360 regulator-off-in-suspend;
365 regulator-name = "vcc_ddr";
368 regulator-state-mem {
369 regulator-on-in-suspend;
374 regulator-name = "vcc_1v8";
377 regulator-min-microvolt = <1800000>;
378 regulator-max-microvolt = <1800000>;
379 regulator-state-mem {
380 regulator-on-in-suspend;
381 regulator-suspend-microvolt = <1800000>;
385 vcc1v8_dvp: LDO_REG1 {
386 regulator-name = "vcc1v8_dvp";
389 regulator-min-microvolt = <1800000>;
390 regulator-max-microvolt = <1800000>;
391 regulator-state-mem {
392 regulator-off-in-suspend;
396 vcc2v8_dvp: LDO_REG2 {
397 regulator-name = "vcc2v8_dvp";
400 regulator-min-microvolt = <2800000>;
401 regulator-max-microvolt = <2800000>;
402 regulator-state-mem {
403 regulator-off-in-suspend;
407 vcc1v8_pmu: LDO_REG3 {
408 regulator-name = "vcc1v8_pmu";
411 regulator-min-microvolt = <1800000>;
412 regulator-max-microvolt = <1800000>;
413 regulator-state-mem {
414 regulator-on-in-suspend;
415 regulator-suspend-microvolt = <1800000>;
420 regulator-name = "vcc_sdio";
423 regulator-min-microvolt = <1800000>;
424 regulator-max-microvolt = <3000000>;
425 regulator-state-mem {
426 regulator-on-in-suspend;
427 regulator-suspend-microvolt = <3000000>;
431 vcca3v0_codec: LDO_REG5 {
432 regulator-name = "vcca3v0_codec";
435 regulator-min-microvolt = <3000000>;
436 regulator-max-microvolt = <3000000>;
437 regulator-state-mem {
438 regulator-off-in-suspend;
443 regulator-name = "vcc_1v5";
446 regulator-min-microvolt = <1500000>;
447 regulator-max-microvolt = <1500000>;
448 regulator-state-mem {
449 regulator-on-in-suspend;
450 regulator-suspend-microvolt = <1500000>;
454 vcca1v8_codec: LDO_REG7 {
455 regulator-name = "vcca1v8_codec";
458 regulator-min-microvolt = <1800000>;
459 regulator-max-microvolt = <1800000>;
460 regulator-state-mem {
461 regulator-off-in-suspend;
466 regulator-name = "vcc_3v0";
469 regulator-min-microvolt = <3000000>;
470 regulator-max-microvolt = <3000000>;
471 regulator-state-mem {
472 regulator-on-in-suspend;
473 regulator-suspend-microvolt = <3000000>;
477 vcc3v3_s3: vcc_lan: SWITCH_REG1 {
478 regulator-name = "vcc3v3_s3";
481 regulator-state-mem {
482 regulator-off-in-suspend;
486 vcc3v3_s0: SWITCH_REG2 {
487 regulator-name = "vcc3v3_s0";
490 regulator-state-mem {
491 regulator-off-in-suspend;
497 vdd_cpu_b: regulator@40 {
498 compatible = "silergy,syr827";
500 fcs,suspend-voltage-selector = <0>;
501 regulator-name = "vdd_cpu_b";
502 regulator-min-microvolt = <712500>;
503 regulator-max-microvolt = <1500000>;
504 regulator-ramp-delay = <1000>;
507 vin-supply = <&vcc_sys>;
509 regulator-state-mem {
510 regulator-off-in-suspend;
514 vdd_gpu: regulator@41 {
515 compatible = "silergy,syr828";
517 fcs,suspend-voltage-selector = <1>;
518 regulator-name = "vdd_gpu";
519 regulator-min-microvolt = <712500>;
520 regulator-max-microvolt = <1500000>;
521 regulator-ramp-delay = <1000>;
524 vin-supply = <&vcc_sys>;
526 regulator-state-mem {
527 regulator-off-in-suspend;
533 i2c-scl-rising-time-ns = <300>;
534 i2c-scl-falling-time-ns = <15>;
538 compatible = "realtek,rt5640";
540 clocks = <&cru SCLK_I2S_8CH_OUT>;
541 clock-names = "mclk";
542 realtek,in1-differential;
543 #sound-dai-cells = <0>;
544 pinctrl-names = "default";
545 pinctrl-0 = <&rt5640_hpcon>;
550 i2c-scl-rising-time-ns = <450>;
551 i2c-scl-falling-time-ns = <15>;
556 i2c-scl-rising-time-ns = <600>;
557 i2c-scl-falling-time-ns = <20>;
560 fusb0: typec-portc@22 {
561 compatible = "fcs,fusb302";
563 interrupt-parent = <&gpio1>;
564 interrupts = <RK_PA2 IRQ_TYPE_LEVEL_LOW>;
565 pinctrl-names = "default";
566 pinctrl-0 = <&fusb0_int>;
567 vbus-supply = <&vcc5v0_typec>;
571 compatible = "usb-c-connector";
574 op-sink-microwatt = <1000000>;
577 <PDO_FIXED(5000, 2500, PDO_FIXED_USB_COMM)>;
579 <PDO_FIXED(5000, 1400, PDO_FIXED_USB_COMM)>;
580 try-power-role = "sink";
583 #address-cells = <1>;
608 compatible = "invensense,mpu6500";
610 interrupt-parent = <&gpio1>;
611 interrupts = <RK_PC6 IRQ_TYPE_EDGE_RISING>;
616 rockchip,playback-channels = <8>;
617 rockchip,capture-channels = <8>;
622 rockchip,playback-channels = <2>;
623 rockchip,capture-channels = <2>;
634 bt656-supply = <&vcc1v8_dvp>;
635 audio-supply = <&vcca1v8_codec>;
636 sdmmc-supply = <&vcc_sdio>;
637 gpio1830-supply = <&vcc_3v0>;
645 ep-gpios = <&gpio4 RK_PD1 GPIO_ACTIVE_HIGH>;
647 pinctrl-names = "default";
648 pinctrl-0 = <&pcie_clkreqn_cpm>;
653 pmu1830-supply = <&vcc_3v0>;
660 rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_up>;
665 fusb0_int: fusb0-int {
666 rockchip,pins = <1 RK_PA2 RK_FUNC_GPIO &pcfg_pull_up>;
672 rockchip,pins = <0 RK_PA6 RK_FUNC_GPIO &pcfg_pull_none>;
677 lcd_panel_reset: lcd-panel-reset {
678 rockchip,pins = <4 RK_PD6 RK_FUNC_GPIO &pcfg_pull_up>;
683 work_led_pin: work-led-pin {
684 rockchip,pins = <2 RK_PD3 RK_FUNC_GPIO &pcfg_pull_none>;
687 diy_led_pin: diy-led-pin {
688 rockchip,pins = <0 RK_PB5 RK_FUNC_GPIO &pcfg_pull_none>;
693 pcie_pwr_en: pcie-pwr-en {
694 rockchip,pins = <1 RK_PC1 RK_FUNC_GPIO &pcfg_pull_none>;
697 pcie_3g_drv: pcie-3g-drv {
698 rockchip,pins = <0 RK_PA2 RK_FUNC_GPIO &pcfg_pull_up>;
703 pmic_int_l: pmic-int-l {
704 rockchip,pins = <1 RK_PC5 RK_FUNC_GPIO &pcfg_pull_up>;
707 vsel1_pin: vsel1-pin {
708 rockchip,pins = <1 RK_PC2 RK_FUNC_GPIO &pcfg_pull_down>;
711 vsel2_pin: vsel2-pin {
712 rockchip,pins = <1 RK_PB6 RK_FUNC_GPIO &pcfg_pull_down>;
717 rt5640_hpcon: rt5640-hpcon {
718 rockchip,pins = <4 RK_PC5 RK_FUNC_GPIO &pcfg_pull_none>;
723 wifi_enable_h: wifi-enable-h {
724 rockchip,pins = <0 RK_PB2 RK_FUNC_GPIO &pcfg_pull_none>;
729 vcc5v0_typec_en: vcc5v0_typec_en {
730 rockchip,pins = <1 RK_PA3 RK_FUNC_GPIO &pcfg_pull_up>;
735 vcc5v0_host_en: vcc5v0-host-en {
736 rockchip,pins = <1 RK_PA0 RK_FUNC_GPIO &pcfg_pull_none>;
741 wifi_host_wake_l: wifi-host-wake-l {
742 rockchip,pins = <0 RK_PA3 RK_FUNC_GPIO &pcfg_pull_none>;
756 vref-supply = <&vcca1v8_s3>;
761 /* WiFi & BT combo module Ampak AP6356S */
765 keep-power-in-suspend;
766 mmc-pwrseq = <&sdio_pwrseq>;
768 pinctrl-names = "default";
769 pinctrl-0 = <&sdio0_bus4 &sdio0_cmd &sdio0_clk>;
773 vqmmc-supply = &vcc1v8_s3; /* IO line */
774 vmmc-supply = &vcc_sdio; /* card's power */
776 #address-cells = <1>;
782 compatible = "brcm,bcm4329-fmac";
783 interrupt-parent = <&gpio0>;
784 interrupts = <RK_PA3 GPIO_ACTIVE_HIGH>;
785 interrupt-names = "host-wake";
786 brcm,drive-strength = <5>;
787 pinctrl-names = "default";
788 pinctrl-0 = <&wifi_host_wake_l>;
796 cd-gpios = <&gpio0 7 GPIO_ACTIVE_LOW>;
798 max-frequency = <150000000>;
799 pinctrl-names = "default";
800 pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_bus4>;
807 mmc-hs400-enhanced-strobe;
813 pinctrl-0 = <&spdif_bus_1>;
817 spdif_p0_0: endpoint {
818 remote-endpoint = <&dit_p0_0>;
829 tcphy0_typec_ss: endpoint {
830 remote-endpoint = <&usbc_ss>;
840 /* tshut mode 0:CRU 1:GPIO */
841 rockchip,hw-tshut-mode = <1>;
842 /* tshut polarity 0:LOW 1:HIGH */
843 rockchip,hw-tshut-polarity = <1>;
850 u2phy0_otg: otg-port {
854 u2phy0_host: host-port {
855 phy-supply = <&vcc5v0_host>;
860 u2phy0_typec_hs: endpoint {
861 remote-endpoint = <&usbc_hs>;
869 u2phy1_otg: otg-port {
873 u2phy1_host: host-port {
874 phy-supply = <&vcc5v0_host>;
880 pinctrl-names = "default";
881 pinctrl-0 = <&uart0_xfer &uart0_cts>;