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