.. | .. |
---|
3 | 3 | * Copyright (c) 2017 Fuzhou Rockchip Electronics Co., Ltd. |
---|
4 | 4 | */ |
---|
5 | 5 | |
---|
| 6 | +#include "dt-bindings/usb/pd.h" |
---|
6 | 7 | #include "dt-bindings/pwm/pwm.h" |
---|
7 | 8 | #include "dt-bindings/input/input.h" |
---|
8 | 9 | #include "rk3399.dtsi" |
---|
.. | .. |
---|
10 | 11 | |
---|
11 | 12 | / { |
---|
12 | 13 | compatible = "rockchip,rk3399-sapphire", "rockchip,rk3399"; |
---|
| 14 | + |
---|
| 15 | + chosen { |
---|
| 16 | + stdout-path = "serial2:1500000n8"; |
---|
| 17 | + }; |
---|
13 | 18 | |
---|
14 | 19 | adc_keys: adc-keys { |
---|
15 | 20 | compatible = "adc-keys"; |
---|
.. | .. |
---|
55 | 60 | }; |
---|
56 | 61 | }; |
---|
57 | 62 | |
---|
58 | | - backlight: backlight { |
---|
59 | | - compatible = "pwm-backlight"; |
---|
60 | | - brightness-levels = < |
---|
61 | | - 0 1 2 3 4 5 6 7 |
---|
62 | | - 8 9 10 11 12 13 14 15 |
---|
63 | | - 16 17 18 19 20 21 22 23 |
---|
64 | | - 24 25 26 27 28 29 30 31 |
---|
65 | | - 32 33 34 35 36 37 38 39 |
---|
66 | | - 40 41 42 43 44 45 46 47 |
---|
67 | | - 48 49 50 51 52 53 54 55 |
---|
68 | | - 56 57 58 59 60 61 62 63 |
---|
69 | | - 64 65 66 67 68 69 70 71 |
---|
70 | | - 72 73 74 75 76 77 78 79 |
---|
71 | | - 80 81 82 83 84 85 86 87 |
---|
72 | | - 88 89 90 91 92 93 94 95 |
---|
73 | | - 96 97 98 99 100 101 102 103 |
---|
74 | | - 104 105 106 107 108 109 110 111 |
---|
75 | | - 112 113 114 115 116 117 118 119 |
---|
76 | | - 120 121 122 123 124 125 126 127 |
---|
77 | | - 128 129 130 131 132 133 134 135 |
---|
78 | | - 136 137 138 139 140 141 142 143 |
---|
79 | | - 144 145 146 147 148 149 150 151 |
---|
80 | | - 152 153 154 155 156 157 158 159 |
---|
81 | | - 160 161 162 163 164 165 166 167 |
---|
82 | | - 168 169 170 171 172 173 174 175 |
---|
83 | | - 176 177 178 179 180 181 182 183 |
---|
84 | | - 184 185 186 187 188 189 190 191 |
---|
85 | | - 192 193 194 195 196 197 198 199 |
---|
86 | | - 200 201 202 203 204 205 206 207 |
---|
87 | | - 208 209 210 211 212 213 214 215 |
---|
88 | | - 216 217 218 219 220 221 222 223 |
---|
89 | | - 224 225 226 227 228 229 230 231 |
---|
90 | | - 232 233 234 235 236 237 238 239 |
---|
91 | | - 240 241 242 243 244 245 246 247 |
---|
92 | | - 248 249 250 251 252 253 254 255>; |
---|
93 | | - default-brightness-level = <200>; |
---|
94 | | - pwms = <&pwm0 0 25000 0>; |
---|
95 | | - }; |
---|
96 | | - |
---|
97 | 63 | clkin_gmac: external-gmac-clock { |
---|
98 | 64 | compatible = "fixed-clock"; |
---|
99 | 65 | clock-frequency = <125000000>; |
---|
.. | .. |
---|
110 | 76 | regulator-max-microvolt = <12000000>; |
---|
111 | 77 | }; |
---|
112 | 78 | |
---|
113 | | - dp_sound: dp-sound { |
---|
114 | | - status = "disabled"; |
---|
115 | | - compatible = "rockchip,cdndp-sound"; |
---|
116 | | - rockchip,cpu = <&spdif>; |
---|
117 | | - rockchip,codec = <&cdn_dp 1>; |
---|
| 79 | + /* |
---|
| 80 | + * The fan power supply comes from the baseboard. |
---|
| 81 | + * For the standalone Sapphire one option is to connect a wire |
---|
| 82 | + * from R90030 DNP R0805 pin2 to C90002 10uF C0805 pin1 (vcc_sys). |
---|
| 83 | + */ |
---|
| 84 | + fan0: gpio-fan { |
---|
| 85 | + #cooling-cells = <2>; |
---|
| 86 | + compatible = "gpio-fan"; |
---|
| 87 | + gpio-fan,speed-map = <0 0 3000 1>; |
---|
| 88 | + gpios = <&gpio1 RK_PC2 GPIO_ACTIVE_HIGH>; |
---|
| 89 | + status = "okay"; |
---|
| 90 | + }; |
---|
| 91 | + |
---|
| 92 | + keys: gpio-keys { |
---|
| 93 | + compatible = "gpio-keys"; |
---|
| 94 | + autorepeat; |
---|
| 95 | + |
---|
| 96 | + power { |
---|
| 97 | + debounce-interval = <100>; |
---|
| 98 | + gpios = <&gpio0 RK_PA5 GPIO_ACTIVE_LOW>; |
---|
| 99 | + label = "GPIO Power"; |
---|
| 100 | + linux,code = <KEY_POWER>; |
---|
| 101 | + linux,input-type = <1>; |
---|
| 102 | + pinctrl-names = "default"; |
---|
| 103 | + pinctrl-0 = <&pwr_btn>; |
---|
| 104 | + wakeup-source; |
---|
| 105 | + }; |
---|
118 | 106 | }; |
---|
119 | 107 | |
---|
120 | 108 | /* switched by pmic_sleep */ |
---|
.. | .. |
---|
151 | 139 | vin-supply = <&vcc_sys>; |
---|
152 | 140 | }; |
---|
153 | 141 | |
---|
154 | | - vcc_sys: vcc-sys { |
---|
155 | | - compatible = "regulator-fixed"; |
---|
156 | | - regulator-name = "vcc_sys"; |
---|
157 | | - regulator-always-on; |
---|
158 | | - regulator-boot-on; |
---|
159 | | - regulator-min-microvolt = <5000000>; |
---|
160 | | - regulator-max-microvolt = <5000000>; |
---|
161 | | - vin-supply = <&dc_12v>; |
---|
162 | | - }; |
---|
163 | | - |
---|
164 | 142 | vcc5v0_host: vcc5v0-host-regulator { |
---|
165 | 143 | compatible = "regulator-fixed"; |
---|
166 | 144 | enable-active-high; |
---|
.. | .. |
---|
172 | 150 | vin-supply = <&vcc_sys>; |
---|
173 | 151 | }; |
---|
174 | 152 | |
---|
175 | | - vcc5v0_sys: vcc5v0-sys { |
---|
| 153 | + vcc5v0_typec0: vcc5v0-typec0-regulator { |
---|
176 | 154 | compatible = "regulator-fixed"; |
---|
177 | | - regulator-name = "vcc5v0_sys"; |
---|
| 155 | + enable-active-high; |
---|
| 156 | + gpio = <&gpio2 RK_PA0 GPIO_ACTIVE_HIGH>; |
---|
| 157 | + pinctrl-names = "default"; |
---|
| 158 | + pinctrl-0 = <&vcc5v0_typec0_en>; |
---|
| 159 | + regulator-name = "vcc5v0_typec0"; |
---|
| 160 | + vin-supply = <&vcc_sys>; |
---|
| 161 | + }; |
---|
| 162 | + |
---|
| 163 | + vcc_sys: vcc-sys { |
---|
| 164 | + compatible = "regulator-fixed"; |
---|
| 165 | + regulator-name = "vcc_sys"; |
---|
178 | 166 | regulator-always-on; |
---|
179 | 167 | regulator-boot-on; |
---|
180 | 168 | regulator-min-microvolt = <5000000>; |
---|
181 | 169 | regulator-max-microvolt = <5000000>; |
---|
| 170 | + vin-supply = <&dc_12v>; |
---|
182 | 171 | }; |
---|
183 | 172 | |
---|
184 | 173 | vdd_log: vdd-log { |
---|
.. | .. |
---|
191 | 180 | regulator-max-microvolt = <1400000>; |
---|
192 | 181 | vin-supply = <&vcc_sys>; |
---|
193 | 182 | }; |
---|
| 183 | +}; |
---|
| 184 | + |
---|
| 185 | +&cdn_dp { |
---|
| 186 | + status = "okay"; |
---|
| 187 | + phys = <&tcphy0_dp>; |
---|
194 | 188 | }; |
---|
195 | 189 | |
---|
196 | 190 | &cpu_l0 { |
---|
.. | .. |
---|
215 | 209 | |
---|
216 | 210 | &cpu_b1 { |
---|
217 | 211 | cpu-supply = <&vdd_cpu_b>; |
---|
| 212 | +}; |
---|
| 213 | + |
---|
| 214 | +&cpu_thermal { |
---|
| 215 | + trips { |
---|
| 216 | + cpu_hot: cpu_hot { |
---|
| 217 | + hysteresis = <10000>; |
---|
| 218 | + temperature = <55000>; |
---|
| 219 | + type = "active"; |
---|
| 220 | + }; |
---|
| 221 | + }; |
---|
| 222 | + |
---|
| 223 | + cooling-maps { |
---|
| 224 | + map2 { |
---|
| 225 | + cooling-device = |
---|
| 226 | + <&fan0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; |
---|
| 227 | + trip = <&cpu_hot>; |
---|
| 228 | + }; |
---|
| 229 | + }; |
---|
218 | 230 | }; |
---|
219 | 231 | |
---|
220 | 232 | &emmc_phy { |
---|
.. | .. |
---|
264 | 276 | #clock-cells = <1>; |
---|
265 | 277 | clock-output-names = "xin32k", "rk808-clkout2"; |
---|
266 | 278 | pinctrl-names = "default"; |
---|
267 | | - pinctrl-0 = <&pmic_int_l &pmic_dvs2>; |
---|
| 279 | + pinctrl-0 = <&pmic_int_l>; |
---|
268 | 280 | rockchip,system-power-controller; |
---|
269 | 281 | wakeup-source; |
---|
270 | 282 | |
---|
.. | .. |
---|
479 | 491 | i2c-scl-rising-time-ns = <475>; |
---|
480 | 492 | i2c-scl-falling-time-ns = <26>; |
---|
481 | 493 | |
---|
482 | | - fusb0: fusb30x@22 { |
---|
483 | | - compatible = "fairchild,fusb302"; |
---|
| 494 | + usbc0: fusb302@22 { |
---|
| 495 | + compatible = "fcs,fusb302"; |
---|
484 | 496 | reg = <0x22>; |
---|
| 497 | + interrupt-parent = <&gpio1>; |
---|
| 498 | + interrupts = <RK_PA2 IRQ_TYPE_LEVEL_LOW>; |
---|
485 | 499 | pinctrl-names = "default"; |
---|
486 | | - pinctrl-0 = <&fusb0_int>; |
---|
487 | | - int-n-gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>; |
---|
488 | | - vbus-5v-gpios = <&gpio2 0 GPIO_ACTIVE_HIGH>; |
---|
| 500 | + pinctrl-0 = <&usbc0_int>; |
---|
| 501 | + vbus-supply = <&vcc5v0_typec0>; |
---|
489 | 502 | status = "okay"; |
---|
| 503 | + |
---|
| 504 | + ports { |
---|
| 505 | + #address-cells = <1>; |
---|
| 506 | + #size-cells = <0>; |
---|
| 507 | + |
---|
| 508 | + port@0 { |
---|
| 509 | + reg = <0>; |
---|
| 510 | + usbc0_role_sw: endpoint@0 { |
---|
| 511 | + remote-endpoint = <&dwc3_0_role_switch>; |
---|
| 512 | + }; |
---|
| 513 | + }; |
---|
| 514 | + }; |
---|
| 515 | + |
---|
| 516 | + usb_con: connector { |
---|
| 517 | + compatible = "usb-c-connector"; |
---|
| 518 | + label = "USB-C"; |
---|
| 519 | + data-role = "dual"; |
---|
| 520 | + power-role = "dual"; |
---|
| 521 | + try-power-role = "sink"; |
---|
| 522 | + op-sink-microwatt = <1000000>; |
---|
| 523 | + sink-pdos = |
---|
| 524 | + <PDO_FIXED(5000, 1000, PDO_FIXED_USB_COMM)>; |
---|
| 525 | + source-pdos = |
---|
| 526 | + <PDO_FIXED(5000, 3000, PDO_FIXED_USB_COMM)>; |
---|
| 527 | + |
---|
| 528 | + displayport = <&cdn_dp>; |
---|
| 529 | + |
---|
| 530 | + altmodes { |
---|
| 531 | + #address-cells = <1>; |
---|
| 532 | + #size-cells = <0>; |
---|
| 533 | + |
---|
| 534 | + altmode@0 { |
---|
| 535 | + reg = <0>; |
---|
| 536 | + svid = <0xff01>; |
---|
| 537 | + vdo = <0xffffffff>; |
---|
| 538 | + }; |
---|
| 539 | + }; |
---|
| 540 | + |
---|
| 541 | + ports { |
---|
| 542 | + #address-cells = <1>; |
---|
| 543 | + #size-cells = <0>; |
---|
| 544 | + |
---|
| 545 | + port@0 { |
---|
| 546 | + reg = <0>; |
---|
| 547 | + usbc0_orien_sw: endpoint { |
---|
| 548 | + remote-endpoint = <&tcphy0_orientation_switch>; |
---|
| 549 | + }; |
---|
| 550 | + }; |
---|
| 551 | + port@1 { |
---|
| 552 | + reg = <1>; |
---|
| 553 | + dp_mode_sw: endpoint { |
---|
| 554 | + remote-endpoint = <&tcphy_dp_altmode_switch>; |
---|
| 555 | + }; |
---|
| 556 | + }; |
---|
| 557 | + }; |
---|
| 558 | + }; |
---|
490 | 559 | }; |
---|
491 | 560 | }; |
---|
492 | 561 | |
---|
.. | .. |
---|
515 | 584 | }; |
---|
516 | 585 | }; |
---|
517 | 586 | |
---|
| 587 | + fan { |
---|
| 588 | + motor_pwr: motor-pwr { |
---|
| 589 | + rockchip,pins = |
---|
| 590 | + <1 RK_PC2 RK_FUNC_GPIO &pcfg_pull_none>; |
---|
| 591 | + }; |
---|
| 592 | + }; |
---|
| 593 | + |
---|
518 | 594 | pmic { |
---|
519 | 595 | pmic_int_l: pmic-int-l { |
---|
520 | 596 | rockchip,pins = |
---|
521 | 597 | <1 RK_PC5 RK_FUNC_GPIO &pcfg_pull_up>; |
---|
522 | 598 | }; |
---|
523 | 599 | |
---|
524 | | - pmic_dvs2: pmic-dvs2 { |
---|
525 | | - rockchip,pins = |
---|
526 | | - <1 RK_PC2 RK_FUNC_GPIO &pcfg_pull_down>; |
---|
527 | | - }; |
---|
528 | | - |
---|
529 | | - vsel1_gpio: vsel1-gpio { |
---|
| 600 | + vsel1_pin: vsel1-pin { |
---|
530 | 601 | rockchip,pins = <1 RK_PC1 RK_FUNC_GPIO &pcfg_pull_down>; |
---|
531 | 602 | }; |
---|
532 | 603 | |
---|
533 | | - vsel2_gpio: vsel2-gpio { |
---|
| 604 | + vsel2_pin: vsel2-pin { |
---|
534 | 605 | rockchip,pins = <1 RK_PB6 RK_FUNC_GPIO &pcfg_pull_down>; |
---|
535 | 606 | }; |
---|
536 | 607 | }; |
---|
.. | .. |
---|
546 | 617 | vcc5v0_host_en: vcc5v0-host-en { |
---|
547 | 618 | rockchip,pins = |
---|
548 | 619 | <4 RK_PD1 RK_FUNC_GPIO &pcfg_pull_none>; |
---|
| 620 | + }; |
---|
| 621 | + }; |
---|
| 622 | + |
---|
| 623 | + usb-typec { |
---|
| 624 | + usbc0_int: usbc0-int { |
---|
| 625 | + rockchip,pins = <1 RK_PA2 RK_FUNC_GPIO &pcfg_pull_up>; |
---|
| 626 | + }; |
---|
| 627 | + |
---|
| 628 | + vcc5v0_typec0_en: vcc5v0-typec0-en { |
---|
| 629 | + rockchip,pins = |
---|
| 630 | + <2 RK_PA0 RK_FUNC_GPIO &pcfg_pull_none>; |
---|
549 | 631 | }; |
---|
550 | 632 | }; |
---|
551 | 633 | }; |
---|
.. | .. |
---|
570 | 652 | mmc-hs400-1_8v; |
---|
571 | 653 | mmc-hs400-enhanced-strobe; |
---|
572 | 654 | non-removable; |
---|
573 | | - supports-emmc; |
---|
574 | 655 | status = "okay"; |
---|
575 | 656 | }; |
---|
576 | 657 | |
---|
.. | .. |
---|
579 | 660 | bus-width = <4>; |
---|
580 | 661 | cap-mmc-highspeed; |
---|
581 | 662 | cap-sd-highspeed; |
---|
582 | | - supports-sd; |
---|
583 | 663 | clock-frequency = <150000000>; |
---|
584 | 664 | disable-wp; |
---|
585 | | - sd-uhs-sdr104; |
---|
586 | 665 | max-frequency = <150000000>; |
---|
587 | 666 | pinctrl-names = "default"; |
---|
588 | 667 | pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>; |
---|
.. | .. |
---|
592 | 671 | }; |
---|
593 | 672 | |
---|
594 | 673 | &tcphy0 { |
---|
595 | | - extcon = <&fusb0>; |
---|
596 | 674 | status = "okay"; |
---|
| 675 | + svid = <0xff01>; |
---|
| 676 | + orientation-switch; |
---|
| 677 | + |
---|
| 678 | + port { |
---|
| 679 | + #address-cells = <1>; |
---|
| 680 | + #size-cells = <0>; |
---|
| 681 | + tcphy0_orientation_switch: endpoint@0 { |
---|
| 682 | + reg = <0>; |
---|
| 683 | + remote-endpoint = <&usbc0_orien_sw>; |
---|
| 684 | + }; |
---|
| 685 | + tcphy_dp_altmode_switch: endpoint@1 { |
---|
| 686 | + reg = <1>; |
---|
| 687 | + remote-endpoint = <&dp_mode_sw>; |
---|
| 688 | + }; |
---|
| 689 | + }; |
---|
597 | 690 | }; |
---|
598 | 691 | |
---|
599 | 692 | &tcphy1 { |
---|
.. | .. |
---|
610 | 703 | |
---|
611 | 704 | &u2phy0 { |
---|
612 | 705 | status = "okay"; |
---|
613 | | - extcon = <&fusb0>; |
---|
614 | 706 | |
---|
615 | 707 | u2phy0_otg: otg-port { |
---|
616 | 708 | status = "okay"; |
---|
.. | .. |
---|
668 | 760 | &usbdrd_dwc3_0 { |
---|
669 | 761 | status = "okay"; |
---|
670 | 762 | dr_mode = "otg"; |
---|
671 | | - extcon = <&fusb0>; |
---|
| 763 | + usb-role-switch; |
---|
| 764 | + port { |
---|
| 765 | + #address-cells = <1>; |
---|
| 766 | + #size-cells = <0>; |
---|
| 767 | + dwc3_0_role_switch: endpoint@0 { |
---|
| 768 | + reg = <0>; |
---|
| 769 | + remote-endpoint = <&usbc0_role_sw>; |
---|
| 770 | + }; |
---|
| 771 | + }; |
---|
672 | 772 | }; |
---|
673 | 773 | |
---|
674 | 774 | &usbdrd3_1 { |
---|
.. | .. |
---|
694 | 794 | |
---|
695 | 795 | &vopl_mmu { |
---|
696 | 796 | status = "okay"; |
---|
697 | | -}; |
---|
698 | | - |
---|
699 | | -&pinctrl { |
---|
700 | | - fusb30x { |
---|
701 | | - fusb0_int: fusb0-int { |
---|
702 | | - rockchip,pins = <1 RK_PA2 RK_FUNC_GPIO &pcfg_pull_up>; |
---|
703 | | - }; |
---|
704 | | - }; |
---|
705 | | -}; |
---|
| 797 | +}; |
---|