GNU Linux-libre 6.1.90-gnu
[releases.git] / arch / arm64 / boot / dts / rockchip / rk3566-soquartz.dtsi
1 // SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2
3 /dts-v1/;
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/pinctrl/rockchip.h>
7 #include "rk3566.dtsi"
8
9 / {
10         model = "Pine64 RK3566 SoQuartz SOM";
11         compatible = "pine64,soquartz", "rockchip,rk3566";
12
13         aliases {
14                 ethernet0 = &gmac1;
15                 mmc0 = &sdmmc0;
16                 mmc1 = &sdhci;
17                 mmc2 = &sdmmc1;
18         };
19
20         chosen: chosen {
21                 stdout-path = "serial2:1500000n8";
22         };
23
24         gmac1_clkin: external-gmac1-clock {
25                 compatible = "fixed-clock";
26                 clock-frequency = <125000000>;
27                 clock-output-names = "gmac1_clkin";
28                 #clock-cells = <0>;
29         };
30
31         leds {
32                 compatible = "gpio-leds";
33
34                 led_diy: led-diy {
35                         label = "diy-led";
36                         default-state = "on";
37                         gpios = <&gpio0 RK_PC1 GPIO_ACTIVE_LOW>;
38                         linux,default-trigger = "heartbeat";
39                         pinctrl-names = "default";
40                         pinctrl-0 = <&diy_led_enable_h>;
41                         retain-state-suspended;
42                         status = "disabled";
43                 };
44
45                 led_work: led-work {
46                         label = "work-led";
47                         default-state = "off";
48                         gpios = <&gpio0 RK_PC0 GPIO_ACTIVE_LOW>;
49                         pinctrl-names = "default";
50                         pinctrl-0 = <&work_led_enable_h>;
51                         retain-state-suspended;
52                         status = "disabled";
53                 };
54         };
55
56         sdio_pwrseq: sdio-pwrseq {
57                 status = "okay";
58                 compatible = "mmc-pwrseq-simple";
59                 clocks = <&rk809 1>;
60                 clock-names = "ext_clock";
61                 pinctrl-names = "default";
62                 pinctrl-0 = <&wifi_enable_h>;
63                 reset-gpios = <&gpio2 RK_PC2 GPIO_ACTIVE_LOW>;
64         };
65
66         vbus: vbus-regulator {
67                 compatible = "regulator-fixed";
68                 regulator-name = "vbus";
69                 regulator-always-on;
70                 regulator-boot-on;
71                 regulator-min-microvolt = <5000000>;
72                 regulator-max-microvolt = <5000000>;
73         };
74
75         /* sourced from vbus, vbus is provided by the carrier board */
76         vcc5v0_sys: vcc5v0-sys-regulator {
77                 compatible = "regulator-fixed";
78                 regulator-name = "vcc5v0_sys";
79                 regulator-always-on;
80                 regulator-boot-on;
81                 regulator-min-microvolt = <5000000>;
82                 regulator-max-microvolt = <5000000>;
83                 vin-supply = <&vbus>;
84         };
85
86         vcc3v3_sys: vcc3v3-sys-regulator {
87                 compatible = "regulator-fixed";
88                 regulator-name = "vcc3v3_sys";
89                 regulator-always-on;
90                 regulator-boot-on;
91                 regulator-min-microvolt = <3300000>;
92                 regulator-max-microvolt = <3300000>;
93                 vin-supply = <&vcc5v0_sys>;
94         };
95 };
96
97 &cpu0 {
98         cpu-supply = <&vdd_cpu>;
99 };
100
101 &cpu1 {
102         cpu-supply = <&vdd_cpu>;
103 };
104
105 &cpu2 {
106         cpu-supply = <&vdd_cpu>;
107 };
108
109 &cpu3 {
110         cpu-supply = <&vdd_cpu>;
111 };
112
113 &gmac1 {
114         assigned-clocks = <&cru SCLK_GMAC1_RX_TX>, <&cru SCLK_GMAC1_RGMII_SPEED>, <&cru SCLK_GMAC1>;
115         assigned-clock-parents = <&cru SCLK_GMAC1_RGMII_SPEED>, <&cru SCLK_GMAC1>, <&gmac1_clkin>;
116         clock_in_out = "input";
117         phy-supply = <&vcc_3v3>;
118         phy-mode = "rgmii";
119         pinctrl-names = "default";
120         pinctrl-0 = <&gmac1m0_miim
121                      &gmac1m0_tx_bus2
122                      &gmac1m0_rx_bus2
123                      &gmac1m0_rgmii_clk
124                      &gmac1m0_clkinout
125                      &gmac1m0_rgmii_bus>;
126         snps,reset-gpio = <&gpio0 RK_PC3 GPIO_ACTIVE_LOW>;
127         snps,reset-active-low;
128         /* Reset time is 20ms, 100ms for rtl8211f, also works well here */
129         snps,reset-delays-us = <0 20000 100000>;
130         tx_delay = <0x30>;
131         rx_delay = <0x10>;
132         phy-handle = <&rgmii_phy1>;
133         status = "disabled";
134 };
135
136 &gpio0 {
137         nextrst-hog {
138                 gpio-hog;
139                 /*
140                  * GPIO_ACTIVE_LOW + output-low here means that the pin is set
141                  * to high, because output-low decides the value pre-inversion.
142                  */
143                 gpios = <RK_PA5 GPIO_ACTIVE_LOW>;
144                 line-name = "nEXTRST";
145                 output-low;
146         };
147 };
148
149 &gpu {
150         mali-supply = <&vdd_gpu>;
151         status = "okay";
152 };
153
154 &i2c0 {
155         status = "okay";
156
157         vdd_cpu: regulator@1c {
158                 compatible = "tcs,tcs4525";
159                 reg = <0x1c>;
160                 fcs,suspend-voltage-selector = <1>;
161                 regulator-name = "vdd_cpu";
162                 regulator-min-microvolt = <800000>;
163                 regulator-max-microvolt = <1150000>;
164                 regulator-ramp-delay = <2300>;
165                 regulator-always-on;
166                 regulator-boot-on;
167                 vin-supply = <&vcc5v0_sys>;
168
169                 regulator-state-mem {
170                         regulator-off-in-suspend;
171                 };
172         };
173
174         rk809: pmic@20 {
175                 compatible = "rockchip,rk809";
176                 reg = <0x20>;
177                 interrupt-parent = <&gpio0>;
178                 interrupts = <RK_PA3 IRQ_TYPE_LEVEL_LOW>;
179                 #clock-cells = <1>;
180                 clock-output-names = "rk808-clkout1", "rk808-clkout2";
181                 pinctrl-names = "default";
182                 pinctrl-0 = <&pmic_int_l>;
183                 rockchip,system-power-controller;
184                 wakeup-source;
185
186                 vcc1-supply = <&vcc3v3_sys>;
187                 vcc2-supply = <&vcc3v3_sys>;
188                 vcc3-supply = <&vcc3v3_sys>;
189                 vcc4-supply = <&vcc3v3_sys>;
190                 vcc5-supply = <&vcc3v3_sys>;
191                 vcc6-supply = <&vcc3v3_sys>;
192                 vcc7-supply = <&vcc3v3_sys>;
193                 vcc8-supply = <&vcc3v3_sys>;
194                 vcc9-supply = <&vcc3v3_sys>;
195
196                 regulators {
197                         vdd_logic: DCDC_REG1 {
198                                 regulator-name = "vdd_logic";
199                                 regulator-always-on;
200                                 regulator-boot-on;
201                                 regulator-min-microvolt = <500000>;
202                                 regulator-max-microvolt = <1350000>;
203                                 regulator-init-microvolt = <900000>;
204                                 regulator-ramp-delay = <6001>;
205                                 regulator-initial-mode = <0x2>;
206                                 regulator-state-mem {
207                                         regulator-on-in-suspend;
208                                         regulator-suspend-microvolt = <900000>;
209                                 };
210                         };
211
212                         vdd_gpu: DCDC_REG2 {
213                                 regulator-name = "vdd_gpu";
214                                 regulator-always-on;
215                                 regulator-boot-on;
216                                 regulator-min-microvolt = <500000>;
217                                 regulator-max-microvolt = <1350000>;
218                                 regulator-init-microvolt = <900000>;
219                                 regulator-ramp-delay = <6001>;
220                                 regulator-initial-mode = <0x2>;
221                                         regulator-state-mem {
222                                         regulator-off-in-suspend;
223                                 };
224                         };
225
226                         vcc_ddr: DCDC_REG3 {
227                                 regulator-always-on;
228                                 regulator-boot-on;
229                                 regulator-initial-mode = <0x2>;
230                                 regulator-name = "vcc_ddr";
231                                 regulator-state-mem {
232                                         regulator-on-in-suspend;
233                                 };
234                         };
235
236                         vdd_npu: DCDC_REG4 {
237                                 regulator-always-on;
238                                 regulator-boot-on;
239                                 regulator-min-microvolt = <500000>;
240                                 regulator-max-microvolt = <1350000>;
241                                 regulator-init-microvolt = <900000>;
242                                 regulator-initial-mode = <0x2>;
243                                 regulator-name = "vdd_npu";
244                                 regulator-state-mem {
245                                         regulator-off-in-suspend;
246                                 };
247                         };
248
249                         vcc_1v8: DCDC_REG5 {
250                                 regulator-name = "vcc_1v8";
251                                 regulator-always-on;
252                                 regulator-boot-on;
253                                 regulator-min-microvolt = <1800000>;
254                                 regulator-max-microvolt = <1800000>;
255                                 regulator-state-mem {
256                                         regulator-on-in-suspend;
257                                         regulator-suspend-microvolt = <1800000>;
258                                 };
259                         };
260
261                         vdda0v9_image: LDO_REG1 {
262                                 regulator-always-on;
263                                 regulator-boot-on;
264                                 regulator-min-microvolt = <900000>;
265                                 regulator-max-microvolt = <900000>;
266                                 regulator-name = "vdda0v9_image";
267                                 regulator-state-mem {
268                                         regulator-on-in-suspend;
269                                         regulator-suspend-microvolt = <900000>;
270                                 };
271                         };
272
273                         vdda_0v9: LDO_REG2 {
274                                 regulator-always-on;
275                                 regulator-boot-on;
276                                 regulator-min-microvolt = <900000>;
277                                 regulator-max-microvolt = <900000>;
278                                 regulator-name = "vdda_0v9";
279                                 regulator-state-mem {
280                                         regulator-off-in-suspend;
281                                 };
282                         };
283
284                         vdda0v9_pmu: LDO_REG3 {
285                                 regulator-always-on;
286                                 regulator-boot-on;
287                                 regulator-min-microvolt = <900000>;
288                                 regulator-max-microvolt = <900000>;
289                                 regulator-name = "vdda0v9_pmu";
290                                 regulator-state-mem {
291                                         regulator-on-in-suspend;
292                                         regulator-suspend-microvolt = <900000>;
293                                 };
294                         };
295
296                         vccio_acodec: LDO_REG4 {
297                                 regulator-always-on;
298                                 regulator-boot-on;
299                                 regulator-min-microvolt = <3300000>;
300                                 regulator-max-microvolt = <3300000>;
301                                 regulator-name = "vccio_acodec";
302                                 regulator-state-mem {
303                                         regulator-off-in-suspend;
304                                 };
305                         };
306
307                         vccio_sd: LDO_REG5 {
308                                 regulator-always-on;
309                                 regulator-boot-on;
310                                 regulator-min-microvolt = <1800000>;
311                                 regulator-max-microvolt = <3300000>;
312                                 regulator-name = "vccio_sd";
313                                 regulator-state-mem {
314                                         regulator-off-in-suspend;
315                                 };
316                         };
317
318                         vcc3v3_pmu: LDO_REG6 {
319                                 regulator-always-on;
320                                 regulator-boot-on;
321                                 regulator-min-microvolt = <3300000>;
322                                 regulator-max-microvolt = <3300000>;
323                                 regulator-name = "vcc3v3_pmu";
324                                 regulator-state-mem {
325                                         regulator-on-in-suspend;
326                                         regulator-suspend-microvolt = <3300000>;
327                                 };
328                         };
329
330                         vcca_1v8: LDO_REG7 {
331                                 regulator-always-on;
332                                 regulator-boot-on;
333                                 regulator-min-microvolt = <1800000>;
334                                 regulator-max-microvolt = <1800000>;
335                                 regulator-name = "vcca_1v8";
336                                 regulator-state-mem {
337                                         regulator-off-in-suspend;
338                                 };
339                         };
340
341                         vcca1v8_pmu: LDO_REG8 {
342                                 regulator-always-on;
343                                 regulator-boot-on;
344                                 regulator-min-microvolt = <1800000>;
345                                 regulator-max-microvolt = <1800000>;
346                                 regulator-name = "vcca1v8_pmu";
347                                 regulator-state-mem {
348                                         regulator-off-in-suspend;
349                                 };
350                         };
351
352                         vcca1v8_image: LDO_REG9 {
353                                 regulator-always-on;
354                                 regulator-boot-on;
355                                 regulator-min-microvolt = <1800000>;
356                                 regulator-max-microvolt = <1800000>;
357                                 regulator-name = "vcca1v8_image";
358                                 regulator-state-mem {
359                                         regulator-off-in-suspend;
360                                 };
361                         };
362
363                         vcc_3v3: SWITCH_REG1 {
364                                 regulator-name = "vcc_3v3";
365                                 regulator-state-mem {
366                                         regulator-off-in-suspend;
367                                 };
368                         };
369
370                         vcc3v3_sd: SWITCH_REG2 {
371                                 regulator-name = "vcc3v3_sd";
372                                 status = "disabled";
373                                 regulator-state-mem {
374                                         regulator-on-in-suspend;
375                                 };
376                         };
377
378                 };
379         };
380 };
381
382 /*
383  * i2c1 is exposed on CM1 / Module1A
384  * pin 80 - i2c1_scl_m0, pullup to vcc3v3_pmu
385  * pin 82 - i2c1_sda_m0, pullup to vcc3v3_pmu
386  */
387 &i2c1 {
388         status = "disabled";
389 };
390
391 /*
392  * i2c2 is exposed on CM1 / Module1A
393  * pin 56 - i2c2_scl_m1, pullup to vcc_3v3, shared with i2s1_8ch
394  * pin 58 - i2c2_sda_m1, pullup to vcc_3v3
395  */
396 &i2c2 {
397         pinctrl-names = "default";
398         pinctrl-0 = <&i2c2m1_xfer>;
399         status = "disabled";
400 };
401
402 /*
403  * i2c3 is exposed on CM1 / Module1A
404  * pin 35 - i2c3_scl_m0, pullup to vcc_3v3
405  * pin 36 - i2c3_sda_m0, pullup to vcc_3v3
406  */
407 &i2c3 {
408         status = "disabled";
409 };
410
411 /*
412  * i2c4 is exposed on CM2 / Module1B
413  * pin 45 - i2c4_scl_m1
414  * pin 47 - i2c4_sda_m1
415  */
416 &i2c4 {
417         pinctrl-names = "default";
418         pinctrl-0 = <&i2c4m1_xfer>;
419         status = "disabled";
420 };
421
422 /*
423  * i2s1_8ch is exposed on CM1 / Module1A
424  * pin 24 - i2s1_sdi1_m1
425  * pin 25 - i2s1_sdo0_m1
426  * pin 26 - i2s1_lrck_tx_m1
427  * pin 27 - i2s1_sdi0_m1
428  * pin 29 - i2s1_sdi3_m1
429  * pin 30 - i2s1_sdi2_m1
430  * pin 40 - i2s1_sdo1_m1, shared with spi3
431  * pin 41 - i2s1_sdo2_m1
432  * pin 49 - i2s1_sclk_tx_m1
433  * pin 50 - i2s1_mclk_m1
434  * pin 56 - i2s1_sdo3_m1, shared with i2c2
435  */
436 &i2s1_8ch {
437         pinctrl-names = "default";
438         pinctrl-0 = <&i2s1m1_sclktx &i2s1m1_sclkrx
439                      &i2s1m1_lrcktx &i2s1m1_lrckrx
440                      &i2s1m1_sdi0   &i2s1m1_sdi1
441                      &i2s1m1_sdi2   &i2s1m1_sdi3
442                      &i2s1m1_sdo0   &i2s1m1_sdo1
443                      &i2s1m1_sdo2   &i2s1m1_sdo3>;
444         status = "disabled";
445 };
446
447 &mdio1 {
448         rgmii_phy1: ethernet-phy@0 {
449                 compatible = "ethernet-phy-ieee802.3-c22";
450                 reg = <0>;
451                 status = "disabled";
452         };
453 };
454
455 &pinctrl {
456         bt {
457                 bt_enable_h: bt-enable-h {
458                         rockchip,pins = <2 RK_PB7 RK_FUNC_GPIO &pcfg_pull_none>;
459                 };
460
461                 bt_host_wake_l: bt-host-wake-l {
462                         rockchip,pins = <2 RK_PC0 RK_FUNC_GPIO &pcfg_pull_down>;
463                 };
464
465                 bt_wake_l: bt-wake-l {
466                         rockchip,pins = <2 RK_PC1 RK_FUNC_GPIO &pcfg_pull_none>;
467                 };
468         };
469
470         leds {
471                 work_led_enable_h: work-led-enable-h {
472                         rockchip,pins = <0 RK_PC0 RK_FUNC_GPIO &pcfg_pull_none>;
473                 };
474
475                 diy_led_enable_h: diy-led-enable-h {
476                         rockchip,pins = <0 RK_PC1 RK_FUNC_GPIO &pcfg_pull_none>;
477                 };
478         };
479
480         pmic {
481                 pmic_int_l: pmic-int-l {
482                         rockchip,pins = <0 RK_PA3 RK_FUNC_GPIO &pcfg_pull_up>;
483                 };
484         };
485
486         sdio-pwrseq {
487                 wifi_enable_h: wifi-enable-h {
488                         rockchip,pins = <2 RK_PC2 RK_FUNC_GPIO &pcfg_pull_none>;
489                 };
490         };
491 };
492
493 &pmu_io_domains {
494         pmuio1-supply = <&vcc3v3_pmu>;
495         pmuio2-supply = <&vcc3v3_pmu>;
496         vccio1-supply = <&vcc_3v3>;
497         vccio2-supply = <&vcc_1v8>;
498         vccio3-supply = <&vccio_sd>;
499         vccio4-supply = <&vcc_1v8>;
500         vccio5-supply = <&vcc_3v3>;
501         vccio6-supply = <&vcc_3v3>;
502         vccio7-supply = <&vcc_3v3>;
503         status = "okay";
504 };
505
506 /*
507  * saradc is exposed on CM1 / Module1A
508  * pin 94 - saradc_vin3
509  * pin 96 - saradc_vin2
510  */
511 &saradc {
512         vref-supply = <&vcca_1v8>;
513         status = "disabled";
514 };
515
516 &sdhci {
517         bus-width = <8>;
518         mmc-hs200-1_8v;
519         non-removable;
520         vmmc-supply = <&vcc_3v3>;
521         vqmmc-supply = <&vcc_1v8>;
522         status = "okay";
523 };
524
525 &sdmmc0 {
526         broken-cd;
527         bus-width = <4>;
528         cap-sd-highspeed;
529         disable-wp;
530         pinctrl-names = "default";
531         pinctrl-0 = <&sdmmc0_bus4 &sdmmc0_clk &sdmmc0_cmd &sdmmc0_det>;
532         vqmmc-supply = <&vccio_sd>;
533         status = "disabled";
534 };
535
536 &sdmmc1 {
537         bus-width = <4>;
538         cap-sd-highspeed;
539         cap-sdio-irq;
540         keep-power-in-suspend;
541         mmc-pwrseq = <&sdio_pwrseq>;
542         non-removable;
543         pinctrl-names = "default";
544         pinctrl-0 = <&sdmmc1_bus4 &sdmmc1_cmd &sdmmc1_clk>;
545         sd-uhs-sdr50;
546         vmmc-supply = <&vcc3v3_sys>;
547         vqmmc-supply = <&vcc_1v8>;
548         status = "okay";
549 };
550
551 /*
552  * spi3 is exposed on CM1 / Module1A
553  * pin 37 - spi3_cs1_m0
554  * pin 38 - spi3_clk_m0
555  * pin 39 - spi3_cs0_m0
556  * pin 40 - spi3_miso_m0, shared with i2s1_8ch
557  * pin 44 - spi3_mosi_m0
558  */
559 &spi3 {
560         status = "disabled";
561 };
562
563 &tsadc {
564         status = "okay";
565 };
566
567 &uart1 {
568         pinctrl-names = "default";
569         pinctrl-0 = <&uart1m0_xfer &uart1m0_ctsn &uart1m0_rtsn>;
570         uart-has-rtscts;
571         status = "okay";
572
573         bluetooth {
574                 compatible = "brcm,bcm43438-bt";
575                 clocks = <&rk809 1>;
576                 clock-names = "lpo";
577                 device-wakeup-gpios = <&gpio2 RK_PC1 GPIO_ACTIVE_HIGH>;
578                 host-wakeup-gpios = <&gpio2 RK_PC0 GPIO_ACTIVE_HIGH>;
579                 shutdown-gpios = <&gpio2 RK_PB7 GPIO_ACTIVE_HIGH>;
580                 pinctrl-names = "default";
581                 pinctrl-0 = <&bt_host_wake_l &bt_wake_l &bt_enable_h>;
582                 vbat-supply = <&vcc3v3_sys>;
583                 vddio-supply = <&vcca1v8_pmu>;
584         };
585 };
586
587 /*
588  * uart2 is exposed on CM1 / Module1A
589  * pin 51 - uart2_rx_m0
590  * pin 55 - uart2_tx_m0
591  */
592 &uart2 {
593         status = "disabled";
594 };
595
596 /*
597  * uart7 is exposed on CM1 / Module1A
598  * pin 46 - uart7_tx_m2
599  * pin 47 - uart7_rx_m2
600  */
601 &uart7 {
602         pinctrl-names = "default";
603         pinctrl-0 = <&uart7m2_xfer>;
604         status = "disabled";
605 };
606
607 /* dwc3_otg is the only usb port available */
608 &usb2phy0 {
609         status = "disabled";
610 };
611
612 &usb2phy0_otg {
613         status = "disabled";
614 };
615
616 &usb_host0_xhci {
617         status = "disabled";
618 };