Merge tag 'arm-soc/for-4.20/devicetree' of https://github.com/Broadcom/stblinux into...
[sfrench/cifs-2.6.git] / arch / arm64 / boot / dts / rockchip / rk3399-sapphire.dtsi
1 // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2 /*
3  * Copyright (c) 2017 Fuzhou Rockchip Electronics Co., Ltd.
4  */
5
6 #include "dt-bindings/pwm/pwm.h"
7 #include "dt-bindings/input/input.h"
8 #include "rk3399.dtsi"
9 #include "rk3399-opp.dtsi"
10
11 / {
12         compatible = "rockchip,rk3399-sapphire", "rockchip,rk3399";
13
14         backlight: backlight {
15                 compatible = "pwm-backlight";
16                 brightness-levels = <
17                           0   1   2   3   4   5   6   7
18                           8   9  10  11  12  13  14  15
19                          16  17  18  19  20  21  22  23
20                          24  25  26  27  28  29  30  31
21                          32  33  34  35  36  37  38  39
22                          40  41  42  43  44  45  46  47
23                          48  49  50  51  52  53  54  55
24                          56  57  58  59  60  61  62  63
25                          64  65  66  67  68  69  70  71
26                          72  73  74  75  76  77  78  79
27                          80  81  82  83  84  85  86  87
28                          88  89  90  91  92  93  94  95
29                          96  97  98  99 100 101 102 103
30                         104 105 106 107 108 109 110 111
31                         112 113 114 115 116 117 118 119
32                         120 121 122 123 124 125 126 127
33                         128 129 130 131 132 133 134 135
34                         136 137 138 139 140 141 142 143
35                         144 145 146 147 148 149 150 151
36                         152 153 154 155 156 157 158 159
37                         160 161 162 163 164 165 166 167
38                         168 169 170 171 172 173 174 175
39                         176 177 178 179 180 181 182 183
40                         184 185 186 187 188 189 190 191
41                         192 193 194 195 196 197 198 199
42                         200 201 202 203 204 205 206 207
43                         208 209 210 211 212 213 214 215
44                         216 217 218 219 220 221 222 223
45                         224 225 226 227 228 229 230 231
46                         232 233 234 235 236 237 238 239
47                         240 241 242 243 244 245 246 247
48                         248 249 250 251 252 253 254 255>;
49                 default-brightness-level = <200>;
50                 pwms = <&pwm0 0 25000 0>;
51         };
52
53         clkin_gmac: external-gmac-clock {
54                 compatible = "fixed-clock";
55                 clock-frequency = <125000000>;
56                 clock-output-names = "clkin_gmac";
57                 #clock-cells = <0>;
58         };
59
60         dc_12v: dc-12v {
61                 compatible = "regulator-fixed";
62                 regulator-name = "dc_12v";
63                 regulator-always-on;
64                 regulator-boot-on;
65                 regulator-min-microvolt = <12000000>;
66                 regulator-max-microvolt = <12000000>;
67         };
68
69         keys: gpio-keys {
70                 compatible = "gpio-keys";
71                 autorepeat;
72
73                 power {
74                         debounce-interval = <100>;
75                         gpios = <&gpio0 RK_PA5 GPIO_ACTIVE_LOW>;
76                         label = "GPIO Power";
77                         linux,code = <KEY_POWER>;
78                         linux,input-type = <1>;
79                         pinctrl-names = "default";
80                         pinctrl-0 = <&pwr_btn>;
81                         wakeup-source;
82                 };
83         };
84
85         /* switched by pmic_sleep */
86         vcc1v8_s3: vcca1v8_s3: vcc1v8-s3 {
87                 compatible = "regulator-fixed";
88                 regulator-name = "vcc1v8_s3";
89                 regulator-always-on;
90                 regulator-boot-on;
91                 regulator-min-microvolt = <1800000>;
92                 regulator-max-microvolt = <1800000>;
93                 vin-supply = <&vcc_1v8>;
94         };
95
96         vcc3v3_sys: vcc3v3-sys {
97                 compatible = "regulator-fixed";
98                 regulator-name = "vcc3v3_sys";
99                 regulator-always-on;
100                 regulator-boot-on;
101                 regulator-min-microvolt = <3300000>;
102                 regulator-max-microvolt = <3300000>;
103                 vin-supply = <&vcc_sys>;
104         };
105
106         vcc5v0_host: vcc5v0-host-regulator {
107                 compatible = "regulator-fixed";
108                 enable-active-high;
109                 gpio = <&gpio4 RK_PD1 GPIO_ACTIVE_HIGH>;
110                 pinctrl-names = "default";
111                 pinctrl-0 = <&vcc5v0_host_en>;
112                 regulator-name = "vcc5v0_host";
113                 regulator-always-on;
114                 vin-supply = <&vcc_sys>;
115         };
116
117         vcc5v0_typec0: vcc5v0-typec0-regulator {
118                 compatible = "regulator-fixed";
119                 enable-active-high;
120                 gpio = <&gpio2 RK_PA0 GPIO_ACTIVE_HIGH>;
121                 pinctrl-names = "default";
122                 pinctrl-0 = <&vcc5v0_typec0_en>;
123                 regulator-name = "vcc5v0_typec0";
124                 vin-supply = <&vcc_sys>;
125         };
126
127         vcc_sys: vcc-sys {
128                 compatible = "regulator-fixed";
129                 regulator-name = "vcc_sys";
130                 regulator-always-on;
131                 regulator-boot-on;
132                 regulator-min-microvolt = <5000000>;
133                 regulator-max-microvolt = <5000000>;
134                 vin-supply = <&dc_12v>;
135         };
136
137         vdd_log: vdd-log {
138                 compatible = "pwm-regulator";
139                 pwms = <&pwm2 0 25000 1>;
140                 regulator-name = "vdd_log";
141                 regulator-always-on;
142                 regulator-boot-on;
143                 regulator-min-microvolt = <800000>;
144                 regulator-max-microvolt = <1400000>;
145                 vin-supply = <&vcc_sys>;
146         };
147 };
148
149 &cpu_l0 {
150         cpu-supply = <&vdd_cpu_l>;
151 };
152
153 &cpu_l1 {
154         cpu-supply = <&vdd_cpu_l>;
155 };
156
157 &cpu_l2 {
158         cpu-supply = <&vdd_cpu_l>;
159 };
160
161 &cpu_l3 {
162         cpu-supply = <&vdd_cpu_l>;
163 };
164
165 &cpu_b0 {
166         cpu-supply = <&vdd_cpu_b>;
167 };
168
169 &cpu_b1 {
170         cpu-supply = <&vdd_cpu_b>;
171 };
172
173 &emmc_phy {
174         status = "okay";
175 };
176
177 &gmac {
178         assigned-clocks = <&cru SCLK_RMII_SRC>;
179         assigned-clock-parents = <&clkin_gmac>;
180         clock_in_out = "input";
181         phy-supply = <&vcc_lan>;
182         phy-mode = "rgmii";
183         pinctrl-names = "default";
184         pinctrl-0 = <&rgmii_pins>;
185         snps,reset-gpio = <&gpio3 RK_PB7 GPIO_ACTIVE_LOW>;
186         snps,reset-active-low;
187         snps,reset-delays-us = <0 10000 50000>;
188         tx_delay = <0x28>;
189         rx_delay = <0x11>;
190         status = "okay";
191 };
192
193 &gpu {
194         mali-supply = <&vdd_gpu>;
195         status = "okay";
196 };
197
198 &hdmi {
199         ddc-i2c-bus = <&i2c3>;
200         status = "okay";
201 };
202
203 &hdmi_sound {
204         status = "okay";
205 };
206
207 &i2c0 {
208         clock-frequency = <400000>;
209         i2c-scl-rising-time-ns = <168>;
210         i2c-scl-falling-time-ns = <4>;
211         status = "okay";
212
213         rk808: pmic@1b {
214                 compatible = "rockchip,rk808";
215                 reg = <0x1b>;
216                 interrupt-parent = <&gpio1>;
217                 interrupts = <21 IRQ_TYPE_LEVEL_LOW>;
218                 #clock-cells = <1>;
219                 clock-output-names = "xin32k", "rk808-clkout2";
220                 pinctrl-names = "default";
221                 pinctrl-0 = <&pmic_int_l>;
222                 rockchip,system-power-controller;
223                 wakeup-source;
224
225                 vcc1-supply = <&vcc_sys>;
226                 vcc2-supply = <&vcc_sys>;
227                 vcc3-supply = <&vcc_sys>;
228                 vcc4-supply = <&vcc_sys>;
229                 vcc6-supply = <&vcc_sys>;
230                 vcc7-supply = <&vcc_sys>;
231                 vcc8-supply = <&vcc3v3_sys>;
232                 vcc9-supply = <&vcc_sys>;
233                 vcc10-supply = <&vcc_sys>;
234                 vcc11-supply = <&vcc_sys>;
235                 vcc12-supply = <&vcc3v3_sys>;
236                 vddio-supply = <&vcc1v8_pmu>;
237
238                 regulators {
239                         vdd_center: DCDC_REG1 {
240                                 regulator-name = "vdd_center";
241                                 regulator-always-on;
242                                 regulator-boot-on;
243                                 regulator-min-microvolt = <750000>;
244                                 regulator-max-microvolt = <1350000>;
245                                 regulator-ramp-delay = <6001>;
246                                 regulator-state-mem {
247                                         regulator-off-in-suspend;
248                                 };
249                         };
250
251                         vdd_cpu_l: DCDC_REG2 {
252                                 regulator-name = "vdd_cpu_l";
253                                 regulator-always-on;
254                                 regulator-boot-on;
255                                 regulator-min-microvolt = <750000>;
256                                 regulator-max-microvolt = <1350000>;
257                                 regulator-ramp-delay = <6001>;
258                                 regulator-state-mem {
259                                         regulator-off-in-suspend;
260                                 };
261                         };
262
263                         vcc_ddr: DCDC_REG3 {
264                                 regulator-name = "vcc_ddr";
265                                 regulator-always-on;
266                                 regulator-boot-on;
267                                 regulator-state-mem {
268                                         regulator-on-in-suspend;
269                                 };
270                         };
271
272                         vcc_1v8: DCDC_REG4 {
273                                 regulator-name = "vcc_1v8";
274                                 regulator-always-on;
275                                 regulator-boot-on;
276                                 regulator-min-microvolt = <1800000>;
277                                 regulator-max-microvolt = <1800000>;
278                                 regulator-state-mem {
279                                         regulator-on-in-suspend;
280                                         regulator-suspend-microvolt = <1800000>;
281                                 };
282                         };
283
284                         vcc1v8_dvp: LDO_REG1 {
285                                 regulator-name = "vcc1v8_dvp";
286                                 regulator-always-on;
287                                 regulator-boot-on;
288                                 regulator-min-microvolt = <1800000>;
289                                 regulator-max-microvolt = <1800000>;
290                                 regulator-state-mem {
291                                         regulator-off-in-suspend;
292                                 };
293                         };
294
295                         vcc3v0_tp: LDO_REG2 {
296                                 regulator-name = "vcc3v0_tp";
297                                 regulator-always-on;
298                                 regulator-boot-on;
299                                 regulator-min-microvolt = <3000000>;
300                                 regulator-max-microvolt = <3000000>;
301                                 regulator-state-mem {
302                                         regulator-off-in-suspend;
303                                 };
304                         };
305
306                         vcc1v8_pmu: LDO_REG3 {
307                                 regulator-name = "vcc1v8_pmu";
308                                 regulator-always-on;
309                                 regulator-boot-on;
310                                 regulator-min-microvolt = <1800000>;
311                                 regulator-max-microvolt = <1800000>;
312                                 regulator-state-mem {
313                                         regulator-on-in-suspend;
314                                         regulator-suspend-microvolt = <1800000>;
315                                 };
316                         };
317
318                         vcc_sdio: LDO_REG4 {
319                                 regulator-name = "vcc_sdio";
320                                 regulator-always-on;
321                                 regulator-boot-on;
322                                 regulator-min-microvolt = <1800000>;
323                                 regulator-max-microvolt = <3000000>;
324                                 regulator-state-mem {
325                                         regulator-on-in-suspend;
326                                         regulator-suspend-microvolt = <3000000>;
327                                 };
328                         };
329
330                         vcca3v0_codec: LDO_REG5 {
331                                 regulator-name = "vcca3v0_codec";
332                                 regulator-always-on;
333                                 regulator-boot-on;
334                                 regulator-min-microvolt = <3000000>;
335                                 regulator-max-microvolt = <3000000>;
336                                 regulator-state-mem {
337                                         regulator-off-in-suspend;
338                                 };
339                         };
340
341                         vcc_1v5: LDO_REG6 {
342                                 regulator-name = "vcc_1v5";
343                                 regulator-always-on;
344                                 regulator-boot-on;
345                                 regulator-min-microvolt = <1500000>;
346                                 regulator-max-microvolt = <1500000>;
347                                 regulator-state-mem {
348                                         regulator-on-in-suspend;
349                                         regulator-suspend-microvolt = <1500000>;
350                                 };
351                         };
352
353                         vcca1v8_codec: LDO_REG7 {
354                                 regulator-name = "vcca1v8_codec";
355                                 regulator-always-on;
356                                 regulator-boot-on;
357                                 regulator-min-microvolt = <1800000>;
358                                 regulator-max-microvolt = <1800000>;
359                                 regulator-state-mem {
360                                         regulator-off-in-suspend;
361                                 };
362                         };
363
364                         vcc_3v0: LDO_REG8 {
365                                 regulator-name = "vcc_3v0";
366                                 regulator-always-on;
367                                 regulator-boot-on;
368                                 regulator-min-microvolt = <3000000>;
369                                 regulator-max-microvolt = <3000000>;
370                                 regulator-state-mem {
371                                         regulator-on-in-suspend;
372                                         regulator-suspend-microvolt = <3000000>;
373                                 };
374                         };
375
376                         vcc3v3_s3: vcc_lan: SWITCH_REG1 {
377                                 regulator-name = "vcc3v3_s3";
378                                 regulator-always-on;
379                                 regulator-boot-on;
380                                 regulator-state-mem {
381                                         regulator-off-in-suspend;
382                                 };
383                         };
384
385                         vcc3v3_s0: SWITCH_REG2 {
386                                 regulator-name = "vcc3v3_s0";
387                                 regulator-always-on;
388                                 regulator-boot-on;
389                                 regulator-state-mem {
390                                         regulator-off-in-suspend;
391                                 };
392                         };
393                 };
394         };
395
396         vdd_cpu_b: regulator@40 {
397                 compatible = "silergy,syr827";
398                 reg = <0x40>;
399                 fcs,suspend-voltage-selector = <1>;
400                 regulator-name = "vdd_cpu_b";
401                 regulator-min-microvolt = <712500>;
402                 regulator-max-microvolt = <1500000>;
403                 regulator-ramp-delay = <1000>;
404                 regulator-always-on;
405                 regulator-boot-on;
406                 vin-supply = <&vcc_sys>;
407
408                 regulator-state-mem {
409                         regulator-off-in-suspend;
410                 };
411         };
412
413         vdd_gpu: regulator@41 {
414                 compatible = "silergy,syr828";
415                 reg = <0x41>;
416                 fcs,suspend-voltage-selector = <1>;
417                 regulator-name = "vdd_gpu";
418                 regulator-min-microvolt = <712500>;
419                 regulator-max-microvolt = <1500000>;
420                 regulator-ramp-delay = <1000>;
421                 regulator-always-on;
422                 regulator-boot-on;
423                 vin-supply = <&vcc_sys>;
424
425                 regulator-state-mem {
426                         regulator-off-in-suspend;
427                 };
428         };
429 };
430
431 &i2c3 {
432         i2c-scl-rising-time-ns = <450>;
433         i2c-scl-falling-time-ns = <15>;
434         status = "okay";
435 };
436
437 &i2s2 {
438         status = "okay";
439 };
440
441 &io_domains {
442         status = "okay";
443
444         bt656-supply = <&vcc_3v0>;
445         audio-supply = <&vcca1v8_codec>;
446         sdmmc-supply = <&vcc_sdio>;
447         gpio1830-supply = <&vcc_3v0>;
448 };
449
450 &pmu_io_domains {
451         pmu1830-supply = <&vcc_3v0>;
452         status = "okay";
453 };
454
455 &pinctrl {
456         buttons {
457                 pwr_btn: pwr-btn {
458                         rockchip,pins = <0 RK_PA5 RK_FUNC_GPIO &pcfg_pull_up>;
459                 };
460         };
461
462         pmic {
463                 pmic_int_l: pmic-int-l {
464                         rockchip,pins =
465                                 <1 RK_PC5 RK_FUNC_GPIO &pcfg_pull_up>;
466                 };
467
468                 vsel1_gpio: vsel1-gpio {
469                         rockchip,pins = <1 RK_PC1 RK_FUNC_GPIO &pcfg_pull_down>;
470                 };
471
472                 vsel2_gpio: vsel2-gpio {
473                         rockchip,pins = <1 RK_PB6 RK_FUNC_GPIO &pcfg_pull_down>;
474                 };
475         };
476
477         usb2 {
478                 vcc5v0_host_en: vcc5v0-host-en {
479                         rockchip,pins =
480                                 <4 RK_PD1 RK_FUNC_GPIO &pcfg_pull_none>;
481                 };
482                 vcc5v0_typec0_en: vcc5v0-typec0-en {
483                         rockchip,pins =
484                                 <2 RK_PA0 RK_FUNC_GPIO &pcfg_pull_none>;
485                 };
486         };
487 };
488
489 &pwm0 {
490         status = "okay";
491 };
492
493 &pwm2 {
494         status = "okay";
495 };
496
497 &saradc {
498         vref-supply = <&vcca1v8_s3>;
499         status = "okay";
500 };
501
502 &sdhci {
503         bus-width = <8>;
504         mmc-hs400-1_8v;
505         mmc-hs400-enhanced-strobe;
506         non-removable;
507         status = "okay";
508 };
509
510 &sdmmc {
511         bus-width = <4>;
512         cap-mmc-highspeed;
513         cap-sd-highspeed;
514         clock-frequency = <150000000>;
515         disable-wp;
516         max-frequency = <150000000>;
517         pinctrl-names = "default";
518         pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
519         vqmmc-supply = <&vcc_sdio>;
520         status = "okay";
521 };
522
523 &tcphy0 {
524         status = "okay";
525 };
526
527 &tcphy1 {
528         status = "okay";
529 };
530
531 &tsadc {
532         /* tshut mode 0:CRU 1:GPIO */
533         rockchip,hw-tshut-mode = <1>;
534         /* tshut polarity 0:LOW 1:HIGH */
535         rockchip,hw-tshut-polarity = <1>;
536         status = "okay";
537 };
538
539 &u2phy0 {
540         status = "okay";
541
542         u2phy0_otg: otg-port {
543                 phy-supply = <&vcc5v0_typec0>;
544                 status = "okay";
545         };
546
547         u2phy0_host: host-port {
548                 phy-supply = <&vcc5v0_host>;
549                 status = "okay";
550         };
551 };
552
553 &u2phy1 {
554         status = "okay";
555
556         u2phy1_otg: otg-port {
557                 status = "okay";
558         };
559
560         u2phy1_host: host-port {
561                 phy-supply = <&vcc5v0_host>;
562                 status = "okay";
563         };
564 };
565
566 &uart0 {
567         pinctrl-names = "default";
568         pinctrl-0 = <&uart0_xfer &uart0_cts>;
569         status = "okay";
570 };
571
572 &uart2 {
573         status = "okay";
574 };
575
576 &usb_host0_ehci {
577         status = "okay";
578 };
579
580 &usb_host0_ohci {
581         status = "okay";
582 };
583
584 &usb_host1_ehci {
585         status = "okay";
586 };
587
588 &usb_host1_ohci {
589         status = "okay";
590 };
591
592 &usbdrd3_0 {
593         status = "okay";
594 };
595
596 &usbdrd_dwc3_0 {
597         status = "okay";
598         dr_mode = "otg";
599 };
600
601 &usbdrd3_1 {
602         status = "okay";
603 };
604
605 &usbdrd_dwc3_1 {
606         status = "okay";
607         dr_mode = "host";
608 };
609
610 &vopb {
611         status = "okay";
612 };
613
614 &vopb_mmu {
615         status = "okay";
616 };
617
618 &vopl {
619         status = "okay";
620 };
621
622 &vopl_mmu {
623         status = "okay";
624 };