]> git.sur5r.net Git - u-boot/blob - arch/arm/dts/rk3399-puma.dtsi
a04878e223c007c1749e659a70f0be79fa6b281b
[u-boot] / arch / arm / dts / rk3399-puma.dtsi
1 /*
2  * (C) Copyright 2017 Theobroma Systems Design und Consulting GmbH
3  *
4  * SPDX-License-Identifier:     GPL-2.0+        X11
5  */
6
7 #include <dt-bindings/pwm/pwm.h>
8 #include "rk3399.dtsi"
9
10 / {
11         model = "Theobroma Systems RK3399-Q7 SoM";
12         compatible = "tsd,rk3399-q7", "tsd,puma", "rockchip,rk3399";
13
14         config {
15                 u-boot,spl-payload-offset = <0x40000>; /* @ 256KB */
16                 u-boot,mmc-env-offset = <0x4000>;      /* @  16KB */
17                 u-boot,efi-partition-entries-offset = <0x200000>; /* 2MB */
18                 u-boot,boot-led = "module_led";
19         };
20
21         chosen {
22                 stdout-path = "serial0:115200n8";
23                 u-boot,spl-boot-order = &spiflash, &sdhci, &sdmmc;
24         };
25
26         aliases {
27                 spi0 = &spi1;
28                 spi1 = &spi5;
29         };
30
31         leds {
32                 compatible = "gpio-leds";
33                 pinctrl-names = "default";
34                 pinctrl-0 = <&leds_pins_puma>;
35
36                 module_led {
37                         label = "module_led";
38                         gpios = <&gpio2 25 GPIO_ACTIVE_HIGH>;
39                         linux,default-trigger = "heartbeat";
40                 };
41
42                 sd_card_led {
43                         label = "sd_card_led";
44                         gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>;
45                         linux,default-trigger = "mmc0";
46                 };
47         };
48
49         clkin_gmac: external-gmac-clock {
50                 compatible = "fixed-clock";
51                 clock-frequency = <125000000>;
52                 clock-output-names = "clkin_gmac";
53                 #clock-cells = <0>;
54         };
55
56         dw_hdmi_audio: dw-hdmi-audio {
57                 status = "enabled";
58                 compatible = "rockchip,dw-hdmi-audio";
59                 #sound-dai-cells = <0>;
60         };
61
62         hdmi_codec: hdmi-codec {
63                 compatible = "simple-audio-card";
64                 simple-audio-card,format = "i2s";
65                 simple-audio-card,mclk-fs = <256>;
66                 simple-audio-card,name = "HDMI-CODEC";
67
68                 simple-audio-card,cpu {
69                         sound-dai = <&i2s2>;
70                 };
71
72                 simple-audio-card,codec {
73                         sound-dai = <&hdmi>;
74                 };
75         };
76
77         hdmi_sound: hdmi-sound {
78                 status = "disabled";
79                 compatible = "simple-audio-card";
80                 simple-audio-card,format = "i2s";
81                 simple-audio-card,mclk-fs = <256>;
82                 simple-audio-card,name = "rockchip,hdmi";
83
84                 simple-audio-card,cpu {
85                         sound-dai = <&i2s2>;
86                 };
87                 simple-audio-card,codec {
88                         sound-dai = <&hdmi>;
89                 };
90         };
91
92         usbhub_enable: usbhub_enable {
93                 compatible = "regulator-fixed";
94                 regulator-name = "usbhub_enable";
95                 enable-active-low;
96                 gpio = <&gpio4 3 GPIO_ACTIVE_HIGH>;
97                 regulator-always-on;
98                 regulator-boot-on;
99                 regulator-min-microvolt = <3300000>;
100                 regulator-max-microvolt = <3300000>;
101         };
102
103         vccadc_ref: vccadc-ref {
104                 compatible = "regulator-fixed";
105                 regulator-name = "vcc1v8_sys";
106                 regulator-always-on;
107                 regulator-boot-on;
108                 regulator-min-microvolt = <1800000>;
109                 regulator-max-microvolt = <1800000>;
110         };
111
112         vcc3v3_sys: vcc3v3-sys {
113                 compatible = "regulator-fixed";
114                 regulator-name = "vcc3v3_sys";
115                 regulator-always-on;
116                 regulator-boot-on;
117                 regulator-min-microvolt = <3300000>;
118                 regulator-max-microvolt = <3300000>;
119         };
120
121         vcc5v0_otg: vcc5v0-otg-regulator {
122                 compatible = "regulator-fixed";
123                 enable-active-high;
124                 gpio = <&gpio0 2 GPIO_ACTIVE_HIGH>;
125                 pinctrl-names = "default";
126                 pinctrl-0 = <&otg_vbus_drv>;
127                 regulator-name = "vcc5v0_otg";
128                 regulator-always-on;
129         };
130
131         vcc5v0_host: vcc5v0-host-regulator {
132                 compatible = "regulator-fixed";
133                 enable-active-low;
134                 gpio = <&gpio4 3 GPIO_ACTIVE_HIGH>;
135                 pinctrl-names = "default";
136                 pinctrl-0 = <&host_vbus_drv>;
137                 regulator-name = "vcc5v0_host";
138                 regulator-always-on;
139         };
140
141         vcc5v0_sys: vcc5v0-sys {
142                 compatible = "regulator-fixed";
143                 regulator-name = "vcc5v0_sys";
144                 regulator-always-on;
145                 regulator-boot-on;
146                 regulator-min-microvolt = <5000000>;
147                 regulator-max-microvolt = <5000000>;
148         };
149
150         vcc_phy: vcc-phy-regulator {
151                 compatible = "regulator-fixed";
152                 regulator-name = "vcc_phy";
153                 regulator-always-on;
154                 regulator-boot-on;
155         };
156
157         vdd_log: vdd-log {
158                 compatible = "pwm-regulator";
159                 pwms = <&pwm2 0 25000 1>;
160                 regulator-name = "vdd_log";
161                 regulator-min-microvolt = <800000>;
162                 regulator-max-microvolt = <1400000>;
163                 regulator-always-on;
164                 regulator-boot-on;
165
166                 /* for rockchip boot on */
167                 rockchip,pwm_id= <2>;
168                 rockchip,pwm_voltage = <1000000>;
169         };
170 };
171
172 &emmc_phy {
173         status = "okay";
174 };
175
176 &gmac {
177         phy-supply = <&vcc_phy>;
178         phy-mode = "rgmii";
179         clock_in_out = "input";
180         snps,reset-gpio = <&gpio3 16 GPIO_ACTIVE_LOW>;
181         snps,reset-active-low;
182         snps,reset-delays-us = <2 10000 50000>;
183         assigned-clocks = <&cru SCLK_RMII_SRC>;
184         assigned-clock-parents = <&clkin_gmac>;
185         pinctrl-names = "default";
186         pinctrl-0 = <&rgmii_pins>;
187         tx_delay = <0x10>;
188         rx_delay = <0x10>;
189         status = "okay";
190 };
191
192 &hdmi {
193         #address-cells = <1>;
194         #size-cells = <0>;
195         #sound-dai-cells = <0>;
196         status = "okay";
197 };
198
199 &i2c0 {
200         status = "okay";
201         i2c-scl-rising-time-ns = <168>;
202         i2c-scl-falling-time-ns = <4>;
203         clock-frequency = <400000>;
204
205         vdd_gpu: fan535555@60 {
206                 compatible = "fcs,fan53555";
207                 reg = <0x60>;
208                 vsel-gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>;
209                 vin-supply = <&vcc5v0_sys>;
210                 regulator-compatible = "fan53555-reg";
211                 regulator-name = "vdd_gpu";
212                 regulator-min-microvolt = <600000>;
213                 regulator-max-microvolt = <1230000>;
214                 regulator-ramp-delay = <1000>;
215                 fcs,suspend-voltage-selector = <1>;
216                 regulator-always-on;
217                 regulator-boot-on;
218                 regulator-initial-state = <3>;
219                         regulator-state-mem {
220                         regulator-off-in-suspend;
221                 };
222         };
223
224         rk808: pmic@1b {
225                 compatible = "rockchip,rk808";
226                 reg = <0x1b>;
227                 interrupt-parent = <&gpio1>;
228                 interrupts = <22 IRQ_TYPE_LEVEL_LOW>;  // TODO check interrupt?
229                 pinctrl-names = "default";
230                 pinctrl-0 = <&pmic_int_l>;
231                 rockchip,system-power-controller;
232                 wakeup-source;
233                 #clock-cells = <1>;
234                 clock-output-names = "xin32k", "rk808-clkout2";
235
236                 vcc1-supply = <&vcc5v0_sys>;
237                 vcc2-supply = <&vcc5v0_sys>;
238                 vcc3-supply = <&vcc5v0_sys>;
239                 vcc4-supply = <&vcc5v0_sys>;
240                 vcc6-supply = <&vcc5v0_sys>;
241                 vcc7-supply = <&vcc5v0_sys>;
242                 vcc8-supply = <&vcc3v3_sys>;
243                 vcc9-supply = <&vcc5v0_sys>;
244                 vcc10-supply = <&vcc5v0_sys>;
245                 vcc11-supply = <&vcc5v0_sys>;
246                 vcc12-supply = <&vcc3v3_sys>;
247                 vddio-supply = <&vcc1v8_pmu>;
248
249                 regulators {
250                         vdd_center: DCDC_REG1 {
251                                 regulator-always-on;
252                                 regulator-boot-on;
253                                 regulator-min-microvolt = <750000>;
254                                 regulator-max-microvolt = <1350000>;
255                                 regulator-ramp-delay = <6001>;
256                                 regulator-name = "vdd_center";
257                                 regulator-state-mem {
258                                         regulator-off-in-suspend;
259                                 };
260                         };
261
262                         vdd_cpu_l: DCDC_REG2 {
263                                 regulator-always-on;
264                                 regulator-boot-on;
265                                 regulator-min-microvolt = <750000>;
266                                 regulator-max-microvolt = <1350000>;
267                                 regulator-ramp-delay = <6001>;
268                                 regulator-name = "vdd_cpu_l";
269                                 regulator-state-mem {
270                                         regulator-off-in-suspend;
271                                 };
272                         };
273
274                         vcc_ddr: DCDC_REG3 {
275                                 regulator-always-on;
276                                 regulator-boot-on;
277                                 regulator-name = "vcc_ddr";
278                                 regulator-state-mem {
279                                         regulator-on-in-suspend;
280                                 };
281                         };
282
283                         vcc_1v8: DCDC_REG4 {
284                                 regulator-always-on;
285                                 regulator-boot-on;
286                                 regulator-min-microvolt = <1800000>;
287                                 regulator-max-microvolt = <1800000>;
288                                 regulator-name = "vcc_1v8";
289                                 regulator-state-mem {
290                                         regulator-on-in-suspend;
291                                         regulator-suspend-microvolt = <1800000>;
292                                 };
293                         };
294
295                         vcc_ldo1: LDO_REG1 {
296                                 regulator-boot-on;
297                                 regulator-min-microvolt = <1800000>;
298                                 regulator-max-microvolt = <1800000>;
299                                 regulator-name = "vcc_ldo1";
300                                 regulator-state-mem {
301                                         regulator-off-in-suspend;
302                                 };
303                         };
304
305                         vcc1v8_hdmi: LDO_REG2 {
306                                 regulator-always-on;
307                                 regulator-boot-on;
308                                 regulator-min-microvolt = <1800000>;
309                                 regulator-max-microvolt = <1800000>;
310                                 regulator-name = "vcc1v8_hdmi";
311                                 regulator-state-mem {
312                                         regulator-off-in-suspend;
313                                 };
314                         };
315
316                         vcc1v8_pmu: LDO_REG3 {
317                                 regulator-always-on;
318                                 regulator-boot-on;
319                                 regulator-min-microvolt = <1800000>;
320                                 regulator-max-microvolt = <1800000>;
321                                 regulator-name = "vcc1v8_pmu";
322                                 regulator-state-mem {
323                                         regulator-on-in-suspend;
324                                         regulator-suspend-microvolt = <1800000>;
325                                 };
326                         };
327
328                         vcc_sd: LDO_REG4 {
329                                 regulator-always-on;
330                                 regulator-boot-on;
331                                 regulator-min-microvolt = <1800000>;
332                                 regulator-max-microvolt = <3300000>;
333                                 regulator-name = "vcc_sd";
334                                 regulator-state-mem {
335                                         regulator-on-in-suspend;
336                                         regulator-suspend-microvolt = <3300000>;
337                                 };
338                         };
339
340                         vcc_ldo5: LDO_REG5 {
341                                 regulator-boot-on;
342                                 regulator-min-microvolt = <3000000>;
343                                 regulator-max-microvolt = <3000000>;
344                                 regulator-name = "vcc_ldo5";
345                                 regulator-state-mem {
346                                         regulator-off-in-suspend;
347                                 };
348                         };
349
350                         vcc_ldo6: LDO_REG6 {
351                                 regulator-boot-on;
352                                 regulator-min-microvolt = <1500000>;
353                                 regulator-max-microvolt = <1500000>;
354                                 regulator-name = "vcc_ldo6";
355                                 regulator-state-mem {
356                                         regulator-off-in-suspend;
357                                 };
358                         };
359
360                         vcc0v9_hdmi: LDO_REG7 {
361                                 regulator-always-on;
362                                 regulator-boot-on;
363                                 regulator-min-microvolt = <900000>;
364                                 regulator-max-microvolt = <900000>;
365                                 regulator-name = "vcc0v9_hdmi";
366                                 regulator-state-mem {
367                                         regulator-off-in-suspend;
368                                 };
369                         };
370
371                         vcc_efuse: LDO_REG8 {
372                                 regulator-always-on;
373                                 regulator-boot-on;
374                                 regulator-min-microvolt = <1800000>;
375                                 regulator-max-microvolt = <1800000>;
376                                 regulator-name = "vcc_efuse";
377                                 regulator-state-mem {
378                                         regulator-off-in-suspend;
379                                 };
380                         };
381
382                         vcc3v3_s3: SWITCH_REG1 {
383                                 regulator-always-on;
384                                 regulator-boot-on;
385                                 regulator-name = "vcc3v3_s3";
386                                 regulator-state-mem {
387                                         regulator-off-in-suspend;
388                                 };
389                         };
390
391                         vcc3v3_s0: SWITCH_REG2 {
392                                 regulator-always-on;
393                                 regulator-boot-on;
394                                 regulator-name = "vcc3v3_s0";
395                                 regulator-state-mem {
396                                         regulator-off-in-suspend;
397                                 };
398                         };
399                 };
400         };
401 };
402
403 &i2c8 {
404         status = "okay";
405         clock-frequency = <400000>;
406
407         vdd_cpu_b: fan53555@60 {
408                 compatible = "fcs,fan53555";
409                 reg = <0x60>;
410                 vsel-gpios = <&gpio1 4 GPIO_ACTIVE_HIGH>;
411                 vin-supply = <&vcc5v0_sys>;
412                 regulator-compatible = "fan53555-reg";
413                 regulator-name = "vdd_cpu_b";
414                 regulator-min-microvolt = <600000>;
415                 regulator-max-microvolt = <1230000>;
416                 regulator-ramp-delay = <1000>;
417                 fcs,suspend-voltage-selector = <1>;
418                 regulator-always-on;
419                 regulator-boot-on;
420                 regulator-initial-state = <3>;
421                         regulator-state-mem {
422                         regulator-off-in-suspend;
423                 };
424         };
425 };
426
427 &i2s0 {
428         status = "okay";
429         rockchip,i2s-broken-burst-len;
430         rockchip,playback-channels = <8>;
431         rockchip,capture-channels = <8>;
432         #sound-dai-cells = <0>;
433 };
434
435 &i2s2 {
436         #sound-dai-cells = <0>;
437         status = "okay";
438 };
439
440 &io_domains {
441         status = "okay";
442
443         bt656-supply = <&vcc_1v8>;      /* bt656_gpio2ab_ms */
444         audio-supply = <&vcc_1v8>;      /* audio_gpio3d4a_ms */
445         sdmmc-supply = <&vcc_sd>;       /* sdmmc_gpio4b_ms */
446         gpio1830-supply = <&vcc_1v8>;   /* gpio1833_gpio4cd_ms */
447 };
448
449 &pcie0 {
450         assigned-clocks = <&cru SCLK_PCIEPHY_REF>;
451         assigned-clock-parents = <&cru SCLK_PCIEPHY_REF100M>;
452         assigned-clock-rates = <100000000>;
453         ep-gpios = <&gpio4 22 GPIO_ACTIVE_HIGH>;
454         num-lanes = <4>;
455         pinctrl-names = "default";
456         pinctrl-0 = <&pcie_clkreqn>;
457         status = "okay";
458 };
459
460 &pcie_phy {
461                 status = "okay";
462 };
463
464 &pmu_io_domains {
465         status = "okay";
466         pmu1830-supply = <&vcc_1v8>;
467 };
468
469 &pwm0 {
470         status = "okay";
471 };
472
473 &pwm2 {
474         status = "okay";
475 };
476
477 &sdhci {
478         bus-width = <8>;
479         mmc-hs400-1_8v;
480         supports-emmc;
481         non-removable;
482         keep-power-in-suspend;
483         mmc-hs400-enhanced-strobe;
484         status = "okay";
485 };
486
487 &sdmmc {
488         u-boot,dm-pre-reloc;
489         clock-frequency = <150000000>;
490         clock-freq-min-max = <100000 150000000>;
491         supports-sd;
492         bus-width = <4>;
493         cap-mmc-highspeed;
494         cap-sd-highspeed;
495         disable-wp;
496         num-slots = <1>;
497         vqmmc-supply = <&vcc_sd>;
498         pinctrl-names = "default";
499         pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
500         status = "okay";
501 };
502
503 &uart2 {
504         status = "okay";
505 };
506
507 &usb_host0_ehci {
508         status = "okay";
509 };
510
511 &usb_host0_ohci {
512         status = "okay";
513 };
514
515 &dwc3_typec0 {
516         status = "disabled";
517 };
518
519 &usb_host1_ehci {
520         status = "okay";
521 };
522
523 &usb_host1_ohci {
524         status = "okay";
525 };
526
527 &dwc3_typec1 {
528         status = "okay";
529 };
530
531 &vopb {
532         status = "okay";
533 };
534
535 &pinctrl {
536         /* Pins that are not explicitely used by any devices */
537         pinctrl-names = "default";
538         pinctrl-0 = <&puma_pin_hog>;
539         hog {
540                 puma_pin_hog: puma_pin_hog {
541                         rockchip,pins =
542                                 /* We need pull-ups on Q7 buttons */
543                                 <0  4 RK_FUNC_GPIO &pcfg_pull_up>, /* LID_BTN# */
544                                 <0 10 RK_FUNC_GPIO &pcfg_pull_up>, /* BATLOW# */
545                                 <0 11 RK_FUNC_GPIO &pcfg_pull_up>, /* SLP_BTN# */
546                                 <0  9 RK_FUNC_GPIO &pcfg_pull_up>; /* BIOS_DISABLE# */
547                 };
548         };
549
550         pmic {
551                 pmic_int_l: pmic-int-l {
552                         rockchip,pins =
553                                 <1 22 RK_FUNC_GPIO &pcfg_pull_up>;
554                 };
555         };
556
557         leds_pins_puma: led_pins@0 {
558                         rockchip,pins =
559                                 <2 25 RK_FUNC_GPIO &pcfg_pull_none>,
560                                 <1 2 RK_FUNC_GPIO &pcfg_pull_none>;
561         };
562
563         usb2 {
564                 otg_vbus_drv: otg-vbus-drv {
565                         rockchip,pins =
566                                 <0 2 RK_FUNC_GPIO &pcfg_pull_none>;
567                 };
568
569                 host_vbus_drv: host-vbus-drv {
570                         rockchip,pins =
571                                 <0 2 RK_FUNC_GPIO &pcfg_pull_none>;
572                 };
573         };
574
575         i2c8 {
576                 i2c8_xfer_a: i2c8-xfer {
577                         rockchip,pins = <1 21 RK_FUNC_1 &pcfg_pull_up>,
578                                         <1 20 RK_FUNC_1 &pcfg_pull_up>;
579                 };
580         };
581 };
582
583 &i2c1 {
584         status = "okay";
585         clock-frequency = <400000>;
586 };
587 &i2c2 {
588         status = "okay";
589         clock-frequency = <400000>;
590 };
591 &i2c4 {
592         status = "okay";
593         clock-frequency = <400000>;
594 };
595 &i2c6 {
596         status = "okay";
597         clock-frequency = <400000>;
598 };
599
600 &i2c6_xfer {
601         /* Enable pull-ups, the pins would float otherwise. */
602         rockchip,pins =
603                 <2 10 RK_FUNC_2 &pcfg_pull_up>,
604                 <2 9 RK_FUNC_2 &pcfg_pull_up>;
605 };
606
607 &i2c7 {
608         status = "okay";
609         clock-frequency = <400000>;
610
611         rtc_twi: rtc@6f {
612                 compatible = "isil,isl1208";
613                 reg = <0x6f>;
614         };
615         fan: fan@18 {
616                 compatible = "ti,amc6821";
617                 reg = <0x18>;
618                 cooling-min-state = <0>;
619                 cooling-max-state = <9>;
620                 #cooling-cells = <2>;
621         };
622 };
623
624 &uart0 {
625         u-boot,dm-pre-reloc;
626         pinctrl-names = "default";
627         pinctrl-0 = <&uart0_xfer &uart0_cts>;
628         status = "okay";
629 };
630
631
632 &spi1 {
633         u-boot,dm-pre-reloc;
634
635         status = "okay";
636
637         #address-cells = <1>;
638         #size-cells = <0>;
639
640         spiflash: w25q32dw@0 {
641                 u-boot,dm-pre-reloc;
642
643                 compatible = "spi-flash";
644                 reg = <0>;
645                 spi-max-frequency = <49500000>;
646                 spi-cpol;
647                 spi-cpha;
648         };
649 };
650
651 &spi5 {
652         status = "okay";
653 };
654