forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-03 2f7c68cb55ecb7331f2381deb497c27155f32faf
kernel/arch/arm64/boot/dts/rockchip/rk3399-sapphire.dtsi
....@@ -3,6 +3,7 @@
33 * Copyright (c) 2017 Fuzhou Rockchip Electronics Co., Ltd.
44 */
55
6
+#include "dt-bindings/usb/pd.h"
67 #include "dt-bindings/pwm/pwm.h"
78 #include "dt-bindings/input/input.h"
89 #include "rk3399.dtsi"
....@@ -10,6 +11,10 @@
1011
1112 / {
1213 compatible = "rockchip,rk3399-sapphire", "rockchip,rk3399";
14
+
15
+ chosen {
16
+ stdout-path = "serial2:1500000n8";
17
+ };
1318
1419 adc_keys: adc-keys {
1520 compatible = "adc-keys";
....@@ -55,45 +60,6 @@
5560 };
5661 };
5762
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
-
9763 clkin_gmac: external-gmac-clock {
9864 compatible = "fixed-clock";
9965 clock-frequency = <125000000>;
....@@ -110,11 +76,33 @@
11076 regulator-max-microvolt = <12000000>;
11177 };
11278
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
+ };
118106 };
119107
120108 /* switched by pmic_sleep */
....@@ -151,16 +139,6 @@
151139 vin-supply = <&vcc_sys>;
152140 };
153141
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
-
164142 vcc5v0_host: vcc5v0-host-regulator {
165143 compatible = "regulator-fixed";
166144 enable-active-high;
....@@ -172,13 +150,24 @@
172150 vin-supply = <&vcc_sys>;
173151 };
174152
175
- vcc5v0_sys: vcc5v0-sys {
153
+ vcc5v0_typec0: vcc5v0-typec0-regulator {
176154 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";
178166 regulator-always-on;
179167 regulator-boot-on;
180168 regulator-min-microvolt = <5000000>;
181169 regulator-max-microvolt = <5000000>;
170
+ vin-supply = <&dc_12v>;
182171 };
183172
184173 vdd_log: vdd-log {
....@@ -191,6 +180,11 @@
191180 regulator-max-microvolt = <1400000>;
192181 vin-supply = <&vcc_sys>;
193182 };
183
+};
184
+
185
+&cdn_dp {
186
+ status = "okay";
187
+ phys = <&tcphy0_dp>;
194188 };
195189
196190 &cpu_l0 {
....@@ -215,6 +209,24 @@
215209
216210 &cpu_b1 {
217211 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
+ };
218230 };
219231
220232 &emmc_phy {
....@@ -264,7 +276,7 @@
264276 #clock-cells = <1>;
265277 clock-output-names = "xin32k", "rk808-clkout2";
266278 pinctrl-names = "default";
267
- pinctrl-0 = <&pmic_int_l &pmic_dvs2>;
279
+ pinctrl-0 = <&pmic_int_l>;
268280 rockchip,system-power-controller;
269281 wakeup-source;
270282
....@@ -479,14 +491,71 @@
479491 i2c-scl-rising-time-ns = <475>;
480492 i2c-scl-falling-time-ns = <26>;
481493
482
- fusb0: fusb30x@22 {
483
- compatible = "fairchild,fusb302";
494
+ usbc0: fusb302@22 {
495
+ compatible = "fcs,fusb302";
484496 reg = <0x22>;
497
+ interrupt-parent = <&gpio1>;
498
+ interrupts = <RK_PA2 IRQ_TYPE_LEVEL_LOW>;
485499 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>;
489502 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
+ };
490559 };
491560 };
492561
....@@ -515,22 +584,24 @@
515584 };
516585 };
517586
587
+ fan {
588
+ motor_pwr: motor-pwr {
589
+ rockchip,pins =
590
+ <1 RK_PC2 RK_FUNC_GPIO &pcfg_pull_none>;
591
+ };
592
+ };
593
+
518594 pmic {
519595 pmic_int_l: pmic-int-l {
520596 rockchip,pins =
521597 <1 RK_PC5 RK_FUNC_GPIO &pcfg_pull_up>;
522598 };
523599
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 {
530601 rockchip,pins = <1 RK_PC1 RK_FUNC_GPIO &pcfg_pull_down>;
531602 };
532603
533
- vsel2_gpio: vsel2-gpio {
604
+ vsel2_pin: vsel2-pin {
534605 rockchip,pins = <1 RK_PB6 RK_FUNC_GPIO &pcfg_pull_down>;
535606 };
536607 };
....@@ -546,6 +617,17 @@
546617 vcc5v0_host_en: vcc5v0-host-en {
547618 rockchip,pins =
548619 <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>;
549631 };
550632 };
551633 };
....@@ -570,7 +652,6 @@
570652 mmc-hs400-1_8v;
571653 mmc-hs400-enhanced-strobe;
572654 non-removable;
573
- supports-emmc;
574655 status = "okay";
575656 };
576657
....@@ -579,10 +660,8 @@
579660 bus-width = <4>;
580661 cap-mmc-highspeed;
581662 cap-sd-highspeed;
582
- supports-sd;
583663 clock-frequency = <150000000>;
584664 disable-wp;
585
- sd-uhs-sdr104;
586665 max-frequency = <150000000>;
587666 pinctrl-names = "default";
588667 pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
....@@ -592,8 +671,22 @@
592671 };
593672
594673 &tcphy0 {
595
- extcon = <&fusb0>;
596674 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
+ };
597690 };
598691
599692 &tcphy1 {
....@@ -610,7 +703,6 @@
610703
611704 &u2phy0 {
612705 status = "okay";
613
- extcon = <&fusb0>;
614706
615707 u2phy0_otg: otg-port {
616708 status = "okay";
....@@ -668,7 +760,15 @@
668760 &usbdrd_dwc3_0 {
669761 status = "okay";
670762 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
+ };
672772 };
673773
674774 &usbdrd3_1 {
....@@ -694,12 +794,4 @@
694794
695795 &vopl_mmu {
696796 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
+};