Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid
[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         sdio_pwrseq: sdio-pwrseq {
29                 compatible = "mmc-pwrseq-simple";
30                 clocks = <&rk808 1>;
31                 clock-names = "ext_clock";
32                 pinctrl-names = "default";
33                 pinctrl-0 = <&wifi_enable_h>;
34                 reset-gpios = <&gpio0 RK_PB2 GPIO_ACTIVE_LOW>;
35         };
36
37         vcc12v_dcin: dc-12v {
38                 compatible = "regulator-fixed";
39                 regulator-name = "vcc12v_dcin";
40                 regulator-always-on;
41                 regulator-boot-on;
42                 regulator-min-microvolt = <12000000>;
43                 regulator-max-microvolt = <12000000>;
44         };
45
46         vcc5v0_sys: vcc-sys {
47                 compatible = "regulator-fixed";
48                 regulator-name = "vcc5v0_sys";
49                 regulator-always-on;
50                 regulator-boot-on;
51                 regulator-min-microvolt = <5000000>;
52                 regulator-max-microvolt = <5000000>;
53                 vin-supply = <&vcc12v_dcin>;
54         };
55
56         vcc3v3_pcie: vcc3v3-pcie-regulator {
57                 compatible = "regulator-fixed";
58                 enable-active-high;
59                 gpio = <&gpio2 RK_PD2 GPIO_ACTIVE_HIGH>;
60                 pinctrl-names = "default";
61                 pinctrl-0 = <&pcie_pwr_en>;
62                 regulator-name = "vcc3v3_pcie";
63                 regulator-always-on;
64                 regulator-boot-on;
65                 vin-supply = <&vcc5v0_sys>;
66         };
67
68         vcc3v3_sys: vcc3v3-sys {
69                 compatible = "regulator-fixed";
70                 regulator-name = "vcc3v3_sys";
71                 regulator-always-on;
72                 regulator-boot-on;
73                 regulator-min-microvolt = <3300000>;
74                 regulator-max-microvolt = <3300000>;
75                 vin-supply = <&vcc5v0_sys>;
76         };
77
78         vcc5v0_host: vcc5v0-host-regulator {
79                 compatible = "regulator-fixed";
80                 enable-active-high;
81                 gpio = <&gpio4 RK_PD1 GPIO_ACTIVE_HIGH>;
82                 pinctrl-names = "default";
83                 pinctrl-0 = <&vcc5v0_host_en>;
84                 regulator-name = "vcc5v0_host";
85                 regulator-always-on;
86                 vin-supply = <&vcc5v0_sys>;
87         };
88
89         vcc5v0_typec: vcc5v0-typec-regulator {
90                 compatible = "regulator-fixed";
91                 enable-active-high;
92                 gpio = <&gpio1 RK_PA3 GPIO_ACTIVE_HIGH>;
93                 pinctrl-names = "default";
94                 pinctrl-0 = <&vcc5v0_typec_en>;
95                 regulator-name = "vcc5v0_typec";
96                 regulator-always-on;
97                 vin-supply = <&vcc5v0_sys>;
98         };
99
100         vcc_lan: vcc3v3-phy-regulator {
101                 compatible = "regulator-fixed";
102                 regulator-name = "vcc_lan";
103                 regulator-always-on;
104                 regulator-boot-on;
105                 regulator-min-microvolt = <3300000>;
106                 regulator-max-microvolt = <3300000>;
107
108                 regulator-state-mem {
109                         regulator-off-in-suspend;
110                 };
111         };
112
113         vdd_log: vdd-log {
114                 compatible = "pwm-regulator";
115                 pwms = <&pwm2 0 25000 1>;
116                 regulator-name = "vdd_log";
117                 regulator-always-on;
118                 regulator-boot-on;
119                 regulator-min-microvolt = <800000>;
120                 regulator-max-microvolt = <1400000>;
121                 vin-supply = <&vcc5v0_sys>;
122         };
123 };
124
125 &cpu_l0 {
126         cpu-supply = <&vdd_cpu_l>;
127 };
128
129 &cpu_l1 {
130         cpu-supply = <&vdd_cpu_l>;
131 };
132
133 &cpu_l2 {
134         cpu-supply = <&vdd_cpu_l>;
135 };
136
137 &cpu_l3 {
138         cpu-supply = <&vdd_cpu_l>;
139 };
140
141 &cpu_b0 {
142         cpu-supply = <&vdd_cpu_b>;
143 };
144
145 &cpu_b1 {
146         cpu-supply = <&vdd_cpu_b>;
147 };
148
149 &emmc_phy {
150         status = "okay";
151 };
152
153 &gmac {
154         assigned-clocks = <&cru SCLK_RMII_SRC>;
155         assigned-clock-parents = <&clkin_gmac>;
156         clock_in_out = "input";
157         phy-supply = <&vcc_lan>;
158         phy-mode = "rgmii";
159         pinctrl-names = "default";
160         pinctrl-0 = <&rgmii_pins>;
161         snps,reset-gpio = <&gpio3 RK_PB7 GPIO_ACTIVE_LOW>;
162         snps,reset-active-low;
163         snps,reset-delays-us = <0 10000 50000>;
164         tx_delay = <0x28>;
165         rx_delay = <0x11>;
166         status = "okay";
167 };
168
169 &gpu {
170         mali-supply = <&vdd_gpu>;
171         status = "okay";
172 };
173
174 &hdmi {
175         ddc-i2c-bus = <&i2c3>;
176         pinctrl-names = "default";
177         pinctrl-0 = <&hdmi_cec>;
178         status = "okay";
179 };
180
181 &hdmi_sound {
182         status = "okay";
183 };
184
185 &i2c0 {
186         clock-frequency = <400000>;
187         i2c-scl-rising-time-ns = <168>;
188         i2c-scl-falling-time-ns = <4>;
189         status = "okay";
190
191         rk808: pmic@1b {
192                 compatible = "rockchip,rk808";
193                 reg = <0x1b>;
194                 interrupt-parent = <&gpio1>;
195                 interrupts = <21 IRQ_TYPE_LEVEL_LOW>;
196                 #clock-cells = <1>;
197                 clock-output-names = "xin32k", "rk808-clkout2";
198                 pinctrl-names = "default";
199                 pinctrl-0 = <&pmic_int_l>;
200                 rockchip,system-power-controller;
201                 wakeup-source;
202
203                 vcc1-supply = <&vcc5v0_sys>;
204                 vcc2-supply = <&vcc5v0_sys>;
205                 vcc3-supply = <&vcc5v0_sys>;
206                 vcc4-supply = <&vcc5v0_sys>;
207                 vcc6-supply = <&vcc5v0_sys>;
208                 vcc7-supply = <&vcc5v0_sys>;
209                 vcc8-supply = <&vcc3v3_sys>;
210                 vcc9-supply = <&vcc5v0_sys>;
211                 vcc10-supply = <&vcc5v0_sys>;
212                 vcc11-supply = <&vcc5v0_sys>;
213                 vcc12-supply = <&vcc3v3_sys>;
214                 vddio-supply = <&vcc_1v8>;
215
216                 regulators {
217                         vdd_center: DCDC_REG1 {
218                                 regulator-name = "vdd_center";
219                                 regulator-always-on;
220                                 regulator-boot-on;
221                                 regulator-min-microvolt = <750000>;
222                                 regulator-max-microvolt = <1350000>;
223                                 regulator-ramp-delay = <6001>;
224                                 regulator-state-mem {
225                                         regulator-off-in-suspend;
226                                 };
227                         };
228
229                         vdd_cpu_l: DCDC_REG2 {
230                                 regulator-name = "vdd_cpu_l";
231                                 regulator-always-on;
232                                 regulator-boot-on;
233                                 regulator-min-microvolt = <750000>;
234                                 regulator-max-microvolt = <1350000>;
235                                 regulator-ramp-delay = <6001>;
236                                 regulator-state-mem {
237                                         regulator-off-in-suspend;
238                                 };
239                         };
240
241                         vcc_ddr: DCDC_REG3 {
242                                 regulator-name = "vcc_ddr";
243                                 regulator-always-on;
244                                 regulator-boot-on;
245                                 regulator-state-mem {
246                                         regulator-on-in-suspend;
247                                 };
248                         };
249
250                         vcc_1v8: DCDC_REG4 {
251                                 regulator-name = "vcc_1v8";
252                                 regulator-always-on;
253                                 regulator-boot-on;
254                                 regulator-min-microvolt = <1800000>;
255                                 regulator-max-microvolt = <1800000>;
256                                 regulator-state-mem {
257                                         regulator-on-in-suspend;
258                                         regulator-suspend-microvolt = <1800000>;
259                                 };
260                         };
261
262                         vcc1v8_codec: LDO_REG1 {
263                                 regulator-name = "vcc1v8_codec";
264                                 regulator-always-on;
265                                 regulator-boot-on;
266                                 regulator-min-microvolt = <1800000>;
267                                 regulator-max-microvolt = <1800000>;
268                                 regulator-state-mem {
269                                         regulator-off-in-suspend;
270                                 };
271                         };
272
273                         vcc1v8_hdmi: LDO_REG2 {
274                                 regulator-name = "vcc1v8_hdmi";
275                                 regulator-always-on;
276                                 regulator-boot-on;
277                                 regulator-min-microvolt = <1800000>;
278                                 regulator-max-microvolt = <1800000>;
279                                 regulator-state-mem {
280                                         regulator-off-in-suspend;
281                                 };
282                         };
283
284                         vcca_1v8: LDO_REG3 {
285                                 regulator-name = "vcca_1v8";
286                                 regulator-always-on;
287                                 regulator-boot-on;
288                                 regulator-min-microvolt = <1800000>;
289                                 regulator-max-microvolt = <1800000>;
290                                 regulator-state-mem {
291                                         regulator-on-in-suspend;
292                                         regulator-suspend-microvolt = <1800000>;
293                                 };
294                         };
295
296                         vcc_sdio: LDO_REG4 {
297                                 regulator-name = "vcc_sdio";
298                                 regulator-always-on;
299                                 regulator-boot-on;
300                                 regulator-min-microvolt = <3000000>;
301                                 regulator-max-microvolt = <3000000>;
302                                 regulator-state-mem {
303                                         regulator-on-in-suspend;
304                                         regulator-suspend-microvolt = <3000000>;
305                                 };
306                         };
307
308                         vcca3v0_codec: LDO_REG5 {
309                                 regulator-name = "vcca3v0_codec";
310                                 regulator-always-on;
311                                 regulator-boot-on;
312                                 regulator-min-microvolt = <3000000>;
313                                 regulator-max-microvolt = <3000000>;
314                                 regulator-state-mem {
315                                         regulator-off-in-suspend;
316                                 };
317                         };
318
319                         vcc_1v5: LDO_REG6 {
320                                 regulator-name = "vcc_1v5";
321                                 regulator-always-on;
322                                 regulator-boot-on;
323                                 regulator-min-microvolt = <1500000>;
324                                 regulator-max-microvolt = <1500000>;
325                                 regulator-state-mem {
326                                         regulator-on-in-suspend;
327                                         regulator-suspend-microvolt = <1500000>;
328                                 };
329                         };
330
331                         vcc0v9_hdmi: LDO_REG7 {
332                                 regulator-name = "vcc0v9_hdmi";
333                                 regulator-always-on;
334                                 regulator-boot-on;
335                                 regulator-min-microvolt = <900000>;
336                                 regulator-max-microvolt = <900000>;
337                                 regulator-state-mem {
338                                         regulator-off-in-suspend;
339                                 };
340                         };
341
342                         vcc_3v0: LDO_REG8 {
343                                 regulator-name = "vcc_3v0";
344                                 regulator-always-on;
345                                 regulator-boot-on;
346                                 regulator-min-microvolt = <3000000>;
347                                 regulator-max-microvolt = <3000000>;
348                                 regulator-state-mem {
349                                         regulator-on-in-suspend;
350                                         regulator-suspend-microvolt = <3000000>;
351                                 };
352                         };
353
354                         vcc_cam: SWITCH_REG1 {
355                                 regulator-name = "vcc_cam";
356                                 regulator-always-on;
357                                 regulator-boot-on;
358                                 regulator-min-microvolt = <3300000>;
359                                 regulator-max-microvolt = <3300000>;
360                                 regulator-state-mem {
361                                         regulator-off-in-suspend;
362                                 };
363                         };
364
365                         vcc_mipi: SWITCH_REG2 {
366                                 regulator-name = "vcc_mipi";
367                                 regulator-always-on;
368                                 regulator-boot-on;
369                                 regulator-min-microvolt = <3300000>;
370                                 regulator-max-microvolt = <3300000>;
371                                 regulator-state-mem {
372                                         regulator-off-in-suspend;
373                                 };
374                         };
375                 };
376         };
377
378         vdd_cpu_b: regulator@40 {
379                 compatible = "silergy,syr827";
380                 reg = <0x40>;
381                 fcs,suspend-voltage-selector = <1>;
382                 pinctrl-names = "default";
383                 pinctrl-0 = <&vsel1_gpio>;
384                 regulator-name = "vdd_cpu_b";
385                 regulator-min-microvolt = <712500>;
386                 regulator-max-microvolt = <1500000>;
387                 regulator-ramp-delay = <1000>;
388                 regulator-always-on;
389                 regulator-boot-on;
390                 vin-supply = <&vcc5v0_sys>;
391
392                 regulator-state-mem {
393                         regulator-off-in-suspend;
394                 };
395         };
396
397         vdd_gpu: regulator@41 {
398                 compatible = "silergy,syr828";
399                 reg = <0x41>;
400                 fcs,suspend-voltage-selector = <1>;
401                 pinctrl-names = "default";
402                 pinctrl-0 = <&vsel2_gpio>;
403                 regulator-name = "vdd_gpu";
404                 regulator-min-microvolt = <712500>;
405                 regulator-max-microvolt = <1500000>;
406                 regulator-ramp-delay = <1000>;
407                 regulator-always-on;
408                 regulator-boot-on;
409                 vin-supply = <&vcc5v0_sys>;
410
411                 regulator-state-mem {
412                         regulator-off-in-suspend;
413                 };
414         };
415 };
416
417 &i2c1 {
418         i2c-scl-rising-time-ns = <300>;
419         i2c-scl-falling-time-ns = <15>;
420         status = "okay";
421 };
422
423 &i2c3 {
424         i2c-scl-rising-time-ns = <450>;
425         i2c-scl-falling-time-ns = <15>;
426         status = "okay";
427 };
428
429 &i2c4 {
430         i2c-scl-rising-time-ns = <600>;
431         i2c-scl-falling-time-ns = <20>;
432         status = "okay";
433 };
434
435 &i2s0 {
436         rockchip,playback-channels = <8>;
437         rockchip,capture-channels = <8>;
438         status = "okay";
439 };
440
441 &i2s1 {
442         rockchip,playback-channels = <2>;
443         rockchip,capture-channels = <2>;
444         status = "okay";
445 };
446
447 &i2s2 {
448         status = "okay";
449 };
450
451 &io_domains {
452         status = "okay";
453
454         bt656-supply = <&vcc_3v0>;
455         audio-supply = <&vcc_3v0>;
456         sdmmc-supply = <&vcc_sdio>;
457         gpio1830-supply = <&vcc_3v0>;
458 };
459
460 &pmu_io_domains {
461         status = "okay";
462
463         pmu1830-supply = <&vcc_3v0>;
464 };
465
466 &pinctrl {
467         bt {
468                 bt_enable_h: bt-enable-h {
469                         rockchip,pins = <0 RK_PB1 RK_FUNC_GPIO &pcfg_pull_none>;
470                 };
471
472                 bt_host_wake_l: bt-host-wake-l {
473                         rockchip,pins = <0 RK_PA4 RK_FUNC_GPIO &pcfg_pull_none>;
474                 };
475
476                 bt_wake_l: bt-wake-l {
477                         rockchip,pins = <2 RK_PD3 RK_FUNC_GPIO &pcfg_pull_none>;
478                 };
479         };
480
481         pcie {
482                 pcie_pwr_en: pcie-pwr-en {
483                         rockchip,pins = <2 RK_PD2 RK_FUNC_GPIO &pcfg_pull_none>;
484                 };
485         };
486
487         sdio0 {
488                 sdio0_bus4: sdio0-bus4 {
489                         rockchip,pins =
490                                 <2 20 RK_FUNC_1 &pcfg_pull_up_20ma>,
491                                 <2 21 RK_FUNC_1 &pcfg_pull_up_20ma>,
492                                 <2 22 RK_FUNC_1 &pcfg_pull_up_20ma>,
493                                 <2 23 RK_FUNC_1 &pcfg_pull_up_20ma>;
494                 };
495
496                 sdio0_cmd: sdio0-cmd {
497                         rockchip,pins =
498                                 <2 24 RK_FUNC_1 &pcfg_pull_up_20ma>;
499                 };
500
501                 sdio0_clk: sdio0-clk {
502                         rockchip,pins =
503                                 <2 25 RK_FUNC_1 &pcfg_pull_none_20ma>;
504                 };
505         };
506
507         pmic {
508                 pmic_int_l: pmic-int-l {
509                         rockchip,pins = <1 RK_PC5 RK_FUNC_GPIO &pcfg_pull_up>;
510                 };
511
512                 vsel1_gpio: vsel1-gpio {
513                         rockchip,pins = <1 RK_PC1 RK_FUNC_GPIO &pcfg_pull_down>;
514                 };
515
516                 vsel2_gpio: vsel2-gpio {
517                         rockchip,pins = <1 RK_PB6 RK_FUNC_GPIO &pcfg_pull_down>;
518                 };
519         };
520
521         usb-typec {
522                 vcc5v0_typec_en: vcc5v0-typec-en {
523                         rockchip,pins = <1 RK_PA3 RK_FUNC_GPIO &pcfg_pull_up>;
524                 };
525         };
526
527         usb2 {
528                 vcc5v0_host_en: vcc5v0-host-en {
529                         rockchip,pins = <4 RK_PD1 RK_FUNC_GPIO &pcfg_pull_none>;
530                 };
531         };
532
533         wifi {
534                 wifi_enable_h: wifi-enable-h {
535                         rockchip,pins =
536                                 <0 RK_PB2 RK_FUNC_GPIO &pcfg_pull_none>;
537                 };
538
539                 wifi_host_wake_l: wifi-host-wake-l {
540                         rockchip,pins = <0 RK_PA3 RK_FUNC_GPIO &pcfg_pull_none>;
541                 };
542         };
543 };
544
545 &pwm2 {
546         status = "okay";
547 };
548
549 &saradc {
550         status = "okay";
551
552         vref-supply = <&vcc_1v8>;
553 };
554
555 &sdio0 {
556         #address-cells = <1>;
557         #size-cells = <0>;
558         bus-width = <4>;
559         clock-frequency = <50000000>;
560         cap-sdio-irq;
561         cap-sd-highspeed;
562         keep-power-in-suspend;
563         mmc-pwrseq = <&sdio_pwrseq>;
564         non-removable;
565         pinctrl-names = "default";
566         pinctrl-0 = <&sdio0_bus4 &sdio0_cmd &sdio0_clk>;
567         sd-uhs-sdr104;
568         status = "okay";
569
570         brcmf: wifi@1 {
571                 compatible = "brcm,bcm4329-fmac";
572                 reg = <1>;
573                 interrupt-parent = <&gpio0>;
574                 interrupts = <RK_PA3 GPIO_ACTIVE_HIGH>;
575                 interrupt-names = "host-wake";
576                 pinctrl-names = "default";
577                 pinctrl-0 = <&wifi_host_wake_l>;
578         };
579 };
580
581 &sdmmc {
582         bus-width = <4>;
583         cap-mmc-highspeed;
584         cap-sd-highspeed;
585         cd-gpios = <&gpio0 RK_PA7 GPIO_ACTIVE_LOW>;
586         disable-wp;
587         max-frequency = <150000000>;
588         pinctrl-names = "default";
589         pinctrl-0 = <&sdmmc_clk &sdmmc_cd &sdmmc_cmd &sdmmc_bus4>;
590         status = "okay";
591 };
592
593 &sdhci {
594         bus-width = <8>;
595         mmc-hs400-1_8v;
596         mmc-hs400-enhanced-strobe;
597         non-removable;
598         status = "okay";
599 };
600
601 &tcphy0 {
602         status = "okay";
603 };
604
605 &tcphy1 {
606         status = "okay";
607 };
608
609 &tsadc {
610         status = "okay";
611
612         /* tshut mode 0:CRU 1:GPIO */
613         rockchip,hw-tshut-mode = <1>;
614         /* tshut polarity 0:LOW 1:HIGH */
615         rockchip,hw-tshut-polarity = <1>;
616 };
617
618 &u2phy0 {
619         status = "okay";
620
621         u2phy0_otg: otg-port {
622                 status = "okay";
623         };
624
625         u2phy0_host: host-port {
626                 phy-supply = <&vcc5v0_host>;
627                 status = "okay";
628         };
629 };
630
631 &u2phy1 {
632         status = "okay";
633
634         u2phy1_otg: otg-port {
635                 status = "okay";
636         };
637
638         u2phy1_host: host-port {
639                 phy-supply = <&vcc5v0_host>;
640                 status = "okay";
641         };
642 };
643
644 &uart0 {
645         pinctrl-names = "default";
646         pinctrl-0 = <&uart0_xfer &uart0_cts &uart0_rts>;
647         status = "okay";
648
649         bluetooth {
650                 compatible = "brcm,bcm43438-bt";
651                 clocks = <&rk808 1>;
652                 clock-names = "ext_clock";
653                 device-wakeup-gpios = <&gpio2 RK_PD3 GPIO_ACTIVE_HIGH>;
654                 host-wakeup-gpios = <&gpio0 RK_PA4 GPIO_ACTIVE_HIGH>;
655                 shutdown-gpios = <&gpio0 RK_PB1 GPIO_ACTIVE_HIGH>;
656                 pinctrl-names = "default";
657                 pinctrl-0 = <&bt_host_wake_l &bt_wake_l &bt_enable_h>;
658         };
659 };
660
661 &uart2 {
662         status = "okay";
663 };
664
665 &usb_host0_ehci {
666         status = "okay";
667 };
668
669 &usb_host0_ohci {
670         status = "okay";
671 };
672
673 &usb_host1_ehci {
674         status = "okay";
675 };
676
677 &usb_host1_ohci {
678         status = "okay";
679 };
680
681 &usbdrd3_0 {
682         status = "okay";
683 };
684
685 &usbdrd_dwc3_0 {
686         status = "okay";
687         dr_mode = "otg";
688 };
689
690 &usbdrd3_1 {
691         status = "okay";
692 };
693
694 &usbdrd_dwc3_1 {
695         status = "okay";
696         dr_mode = "host";
697 };
698
699 &vopb {
700         status = "okay";
701 };
702
703 &vopb_mmu {
704         status = "okay";
705 };
706
707 &vopl {
708         status = "okay";
709 };
710
711 &vopl_mmu {
712         status = "okay";
713 };