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