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