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