Merge tag 'armsoc-dt' of git://git.kernel.org/pub/scm/linux/kernel/git/soc/soc
[linux-2.6-microblaze.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         ddc-i2c-bus = <&i2c3>;
167         pinctrl-names = "default";
168         pinctrl-0 = <&hdmi_cec>;
169         status = "okay";
170 };
171
172 &i2c0 {
173         clock-frequency = <400000>;
174         i2c-scl-rising-time-ns = <168>;
175         i2c-scl-falling-time-ns = <4>;
176         status = "okay";
177
178         rk808: pmic@1b {
179                 compatible = "rockchip,rk808";
180                 reg = <0x1b>;
181                 interrupt-parent = <&gpio1>;
182                 interrupts = <21 IRQ_TYPE_LEVEL_LOW>;
183                 #clock-cells = <1>;
184                 clock-output-names = "xin32k", "rk808-clkout2";
185                 pinctrl-names = "default";
186                 pinctrl-0 = <&pmic_int_l>;
187                 rockchip,system-power-controller;
188                 wakeup-source;
189
190                 vcc1-supply = <&vcc5v0_sys>;
191                 vcc2-supply = <&vcc5v0_sys>;
192                 vcc3-supply = <&vcc5v0_sys>;
193                 vcc4-supply = <&vcc5v0_sys>;
194                 vcc6-supply = <&vcc5v0_sys>;
195                 vcc7-supply = <&vcc5v0_sys>;
196                 vcc8-supply = <&vcc3v3_sys>;
197                 vcc9-supply = <&vcc5v0_sys>;
198                 vcc10-supply = <&vcc5v0_sys>;
199                 vcc11-supply = <&vcc5v0_sys>;
200                 vcc12-supply = <&vcc3v3_sys>;
201                 vddio-supply = <&vcc_1v8>;
202
203                 regulators {
204                         vdd_center: DCDC_REG1 {
205                                 regulator-name = "vdd_center";
206                                 regulator-always-on;
207                                 regulator-boot-on;
208                                 regulator-min-microvolt = <750000>;
209                                 regulator-max-microvolt = <1350000>;
210                                 regulator-ramp-delay = <6001>;
211                                 regulator-state-mem {
212                                         regulator-off-in-suspend;
213                                 };
214                         };
215
216                         vdd_cpu_l: DCDC_REG2 {
217                                 regulator-name = "vdd_cpu_l";
218                                 regulator-always-on;
219                                 regulator-boot-on;
220                                 regulator-min-microvolt = <750000>;
221                                 regulator-max-microvolt = <1350000>;
222                                 regulator-ramp-delay = <6001>;
223                                 regulator-state-mem {
224                                         regulator-off-in-suspend;
225                                 };
226                         };
227
228                         vcc_ddr: DCDC_REG3 {
229                                 regulator-name = "vcc_ddr";
230                                 regulator-always-on;
231                                 regulator-boot-on;
232                                 regulator-state-mem {
233                                         regulator-on-in-suspend;
234                                 };
235                         };
236
237                         vcc_1v8: DCDC_REG4 {
238                                 regulator-name = "vcc_1v8";
239                                 regulator-always-on;
240                                 regulator-boot-on;
241                                 regulator-min-microvolt = <1800000>;
242                                 regulator-max-microvolt = <1800000>;
243                                 regulator-state-mem {
244                                         regulator-on-in-suspend;
245                                         regulator-suspend-microvolt = <1800000>;
246                                 };
247                         };
248
249                         vcc1v8_codec: LDO_REG1 {
250                                 regulator-name = "vcc1v8_codec";
251                                 regulator-always-on;
252                                 regulator-boot-on;
253                                 regulator-min-microvolt = <1800000>;
254                                 regulator-max-microvolt = <1800000>;
255                                 regulator-state-mem {
256                                         regulator-off-in-suspend;
257                                 };
258                         };
259
260                         vcc1v8_hdmi: LDO_REG2 {
261                                 regulator-name = "vcc1v8_hdmi";
262                                 regulator-always-on;
263                                 regulator-boot-on;
264                                 regulator-min-microvolt = <1800000>;
265                                 regulator-max-microvolt = <1800000>;
266                                 regulator-state-mem {
267                                         regulator-off-in-suspend;
268                                 };
269                         };
270
271                         vcca_1v8: LDO_REG3 {
272                                 regulator-name = "vcca_1v8";
273                                 regulator-always-on;
274                                 regulator-boot-on;
275                                 regulator-min-microvolt = <1800000>;
276                                 regulator-max-microvolt = <1800000>;
277                                 regulator-state-mem {
278                                         regulator-on-in-suspend;
279                                         regulator-suspend-microvolt = <1800000>;
280                                 };
281                         };
282
283                         vcc_sdio: LDO_REG4 {
284                                 regulator-name = "vcc_sdio";
285                                 regulator-always-on;
286                                 regulator-boot-on;
287                                 regulator-min-microvolt = <3000000>;
288                                 regulator-max-microvolt = <3000000>;
289                                 regulator-state-mem {
290                                         regulator-on-in-suspend;
291                                         regulator-suspend-microvolt = <3000000>;
292                                 };
293                         };
294
295                         vcca3v0_codec: LDO_REG5 {
296                                 regulator-name = "vcca3v0_codec";
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                         vcc_1v5: LDO_REG6 {
307                                 regulator-name = "vcc_1v5";
308                                 regulator-always-on;
309                                 regulator-boot-on;
310                                 regulator-min-microvolt = <1500000>;
311                                 regulator-max-microvolt = <1500000>;
312                                 regulator-state-mem {
313                                         regulator-on-in-suspend;
314                                         regulator-suspend-microvolt = <1500000>;
315                                 };
316                         };
317
318                         vcc0v9_hdmi: LDO_REG7 {
319                                 regulator-name = "vcc0v9_hdmi";
320                                 regulator-always-on;
321                                 regulator-boot-on;
322                                 regulator-min-microvolt = <900000>;
323                                 regulator-max-microvolt = <900000>;
324                                 regulator-state-mem {
325                                         regulator-off-in-suspend;
326                                 };
327                         };
328
329                         vcc_3v0: LDO_REG8 {
330                                 regulator-name = "vcc_3v0";
331                                 regulator-always-on;
332                                 regulator-boot-on;
333                                 regulator-min-microvolt = <3000000>;
334                                 regulator-max-microvolt = <3000000>;
335                                 regulator-state-mem {
336                                         regulator-on-in-suspend;
337                                         regulator-suspend-microvolt = <3000000>;
338                                 };
339                         };
340
341                         vcc_cam: SWITCH_REG1 {
342                                 regulator-name = "vcc_cam";
343                                 regulator-always-on;
344                                 regulator-boot-on;
345                                 regulator-min-microvolt = <3300000>;
346                                 regulator-max-microvolt = <3300000>;
347                                 regulator-state-mem {
348                                         regulator-off-in-suspend;
349                                 };
350                         };
351
352                         vcc_mipi: SWITCH_REG2 {
353                                 regulator-name = "vcc_mipi";
354                                 regulator-always-on;
355                                 regulator-boot-on;
356                                 regulator-min-microvolt = <3300000>;
357                                 regulator-max-microvolt = <3300000>;
358                                 regulator-state-mem {
359                                         regulator-off-in-suspend;
360                                 };
361                         };
362                 };
363         };
364
365         vdd_cpu_b: regulator@40 {
366                 compatible = "silergy,syr827";
367                 reg = <0x40>;
368                 fcs,suspend-voltage-selector = <1>;
369                 pinctrl-names = "default";
370                 pinctrl-0 = <&vsel1_gpio>;
371                 regulator-name = "vdd_cpu_b";
372                 regulator-min-microvolt = <712500>;
373                 regulator-max-microvolt = <1500000>;
374                 regulator-ramp-delay = <1000>;
375                 regulator-always-on;
376                 regulator-boot-on;
377                 vin-supply = <&vcc5v0_sys>;
378
379                 regulator-state-mem {
380                         regulator-off-in-suspend;
381                 };
382         };
383
384         vdd_gpu: regulator@41 {
385                 compatible = "silergy,syr828";
386                 reg = <0x41>;
387                 fcs,suspend-voltage-selector = <1>;
388                 pinctrl-names = "default";
389                 pinctrl-0 = <&vsel2_gpio>;
390                 regulator-name = "vdd_gpu";
391                 regulator-min-microvolt = <712500>;
392                 regulator-max-microvolt = <1500000>;
393                 regulator-ramp-delay = <1000>;
394                 regulator-always-on;
395                 regulator-boot-on;
396                 vin-supply = <&vcc5v0_sys>;
397
398                 regulator-state-mem {
399                         regulator-off-in-suspend;
400                 };
401         };
402 };
403
404 &i2c1 {
405         i2c-scl-rising-time-ns = <300>;
406         i2c-scl-falling-time-ns = <15>;
407         status = "okay";
408 };
409
410 &i2c3 {
411         i2c-scl-rising-time-ns = <450>;
412         i2c-scl-falling-time-ns = <15>;
413         status = "okay";
414 };
415
416 &i2c4 {
417         i2c-scl-rising-time-ns = <600>;
418         i2c-scl-falling-time-ns = <20>;
419         status = "okay";
420 };
421
422 &i2s0 {
423         rockchip,playback-channels = <8>;
424         rockchip,capture-channels = <8>;
425         status = "okay";
426 };
427
428 &i2s1 {
429         rockchip,playback-channels = <2>;
430         rockchip,capture-channels = <2>;
431         status = "okay";
432 };
433
434 &i2s2 {
435         status = "okay";
436 };
437
438 &io_domains {
439         status = "okay";
440
441         bt656-supply = <&vcc_3v0>;
442         audio-supply = <&vcc_3v0>;
443         sdmmc-supply = <&vcc_sdio>;
444         gpio1830-supply = <&vcc_3v0>;
445 };
446
447 &pmu_io_domains {
448         status = "okay";
449
450         pmu1830-supply = <&vcc_3v0>;
451 };
452
453 &pinctrl {
454         pcie {
455                 pcie_pwr_en: pcie-pwr-en {
456                         rockchip,pins = <2 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>;
457                 };
458         };
459
460         pmic {
461                 pmic_int_l: pmic-int-l {
462                         rockchip,pins = <1 RK_PC5 RK_FUNC_GPIO &pcfg_pull_up>;
463                 };
464
465                 vsel1_gpio: vsel1-gpio {
466                         rockchip,pins = <1 RK_PC1 RK_FUNC_GPIO &pcfg_pull_down>;
467                 };
468
469                 vsel2_gpio: vsel2-gpio {
470                         rockchip,pins = <1 RK_PB6 RK_FUNC_GPIO &pcfg_pull_down>;
471                 };
472         };
473
474         usb-typec {
475                 vcc5v0_typec_en: vcc5v0-typec-en {
476                         rockchip,pins = <1 RK_PA3 RK_FUNC_GPIO &pcfg_pull_up>;
477                 };
478         };
479
480         usb2 {
481                 vcc5v0_host_en: vcc5v0-host-en {
482                         rockchip,pins = <4 RK_PD1 RK_FUNC_GPIO &pcfg_pull_none>;
483                 };
484         };
485 };
486
487 &pwm2 {
488         status = "okay";
489 };
490
491 &saradc {
492         status = "okay";
493
494         vref-supply = <&vcc_1v8>;
495 };
496
497 &sdmmc {
498         bus-width = <4>;
499         cap-mmc-highspeed;
500         cap-sd-highspeed;
501         cd-gpios = <&gpio0 RK_PA7 GPIO_ACTIVE_LOW>;
502         disable-wp;
503         max-frequency = <150000000>;
504         pinctrl-names = "default";
505         pinctrl-0 = <&sdmmc_clk &sdmmc_cd &sdmmc_cmd &sdmmc_bus4>;
506         status = "okay";
507 };
508
509 &sdhci {
510         bus-width = <8>;
511         mmc-hs400-1_8v;
512         mmc-hs400-enhanced-strobe;
513         non-removable;
514         status = "okay";
515 };
516
517 &tcphy0 {
518         status = "okay";
519 };
520
521 &tcphy1 {
522         status = "okay";
523 };
524
525 &tsadc {
526         status = "okay";
527
528         /* tshut mode 0:CRU 1:GPIO */
529         rockchip,hw-tshut-mode = <1>;
530         /* tshut polarity 0:LOW 1:HIGH */
531         rockchip,hw-tshut-polarity = <1>;
532 };
533
534 &u2phy0 {
535         status = "okay";
536
537         u2phy0_otg: otg-port {
538                 status = "okay";
539         };
540
541         u2phy0_host: host-port {
542                 phy-supply = <&vcc5v0_host>;
543                 status = "okay";
544         };
545 };
546
547 &u2phy1 {
548         status = "okay";
549
550         u2phy1_otg: otg-port {
551                 status = "okay";
552         };
553
554         u2phy1_host: host-port {
555                 phy-supply = <&vcc5v0_host>;
556                 status = "okay";
557         };
558 };
559
560 &uart2 {
561         status = "okay";
562 };
563
564 &usb_host0_ehci {
565         status = "okay";
566 };
567
568 &usb_host0_ohci {
569         status = "okay";
570 };
571
572 &usb_host1_ehci {
573         status = "okay";
574 };
575
576 &usb_host1_ohci {
577         status = "okay";
578 };
579
580 &usbdrd3_0 {
581         status = "okay";
582 };
583
584 &usbdrd_dwc3_0 {
585         status = "okay";
586         dr_mode = "otg";
587 };
588
589 &usbdrd3_1 {
590         status = "okay";
591 };
592
593 &usbdrd_dwc3_1 {
594         status = "okay";
595         dr_mode = "host";
596 };
597
598 &vopb {
599         status = "okay";
600 };
601
602 &vopb_mmu {
603         status = "okay";
604 };
605
606 &vopl {
607         status = "okay";
608 };
609
610 &vopl_mmu {
611         status = "okay";
612 };