d522d3faff2ae1a88b8dc751fb448c5cec0401c3
[firefly-linux-kernel-4.4.55.git] / arch / arm / boot / dts / rk3288-firefly.dtsi
1 /*
2  * Copyright (c) 2014, 2015 FUKAUMI Naoki <naobsd@gmail.com>
3  *
4  * This file is dual-licensed: you can use it either under the terms
5  * of the GPL or the X11 license, at your option. Note that this dual
6  * licensing only applies to this file, and not this project as a
7  * whole.
8  *
9  *  a) This file is free software; you can redistribute it and/or
10  *     modify it under the terms of the GNU General Public License as
11  *     published by the Free Software Foundation; either version 2 of the
12  *     License, or (at your option) any later version.
13  *
14  *     This file is distributed in the hope that it will be useful,
15  *     but WITHOUT ANY WARRANTY; without even the implied warranty of
16  *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  *     GNU General Public License for more details.
18  *
19  * Or, alternatively,
20  *
21  *  b) Permission is hereby granted, free of charge, to any person
22  *     obtaining a copy of this software and associated documentation
23  *     files (the "Software"), to deal in the Software without
24  *     restriction, including without limitation the rights to use,
25  *     copy, modify, merge, publish, distribute, sublicense, and/or
26  *     sell copies of the Software, and to permit persons to whom the
27  *     Software is furnished to do so, subject to the following
28  *     conditions:
29  *
30  *     The above copyright notice and this permission notice shall be
31  *     included in all copies or substantial portions of the Software.
32  *
33  *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
34  *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
35  *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
36  *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
37  *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
38  *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
39  *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
40  *     OTHER DEALINGS IN THE SOFTWARE.
41  */
42
43 #include "rk3288.dtsi"
44
45 / {
46         memory {
47                 device_type = "memory";
48                 reg = <0 0x80000000>;
49         };
50
51         dovdd_1v8: dovdd-1v8-regulator {
52                 compatible = "regulator-fixed";
53                 regulator-name = "dovdd_1v8";
54                 regulator-min-microvolt = <1800000>;
55                 regulator-max-microvolt = <1800000>;
56                 vin-supply = <&vcc28_dvp>;
57         };
58
59         ext_gmac: external-gmac-clock {
60                 compatible = "fixed-clock";
61                 #clock-cells = <0>;
62                 clock-frequency = <125000000>;
63                 clock-output-names = "ext_gmac";
64         };
65
66         io_domains: io-domains {
67                 compatible = "rockchip,rk3288-io-voltage-domain";
68                 rockchip,grf = <&grf>;
69
70                 audio-supply = <&vcca_33>;
71                 bb-supply = <&vcc_io>;
72                 dvp-supply = <&dovdd_1v8>;
73                 flash0-supply = <&vcc_flash>;
74                 flash1-supply = <&vcc_lan>;
75                 gpio30-supply = <&vcc_io>;
76                 gpio1830-supply = <&vcc_io>;
77                 lcdc-supply = <&vcc_io>;
78                 sdcard-supply = <&vccio_sd>;
79                 wifi-supply = <&vccio_wl>;
80         };
81
82         ir: ir-receiver {
83                 compatible = "gpio-ir-receiver";
84                 pinctrl-names = "default";
85                 pinctrl-0 = <&ir_int>;
86         };
87
88         keys: gpio-keys {
89                 compatible = "gpio-keys";
90                 #address-cells = <1>;
91                 #size-cells = <0>;
92
93                 button@0 {
94                         gpio-key,wakeup = <1>;
95                         gpios = <&gpio0 5 GPIO_ACTIVE_LOW>;
96                         label = "GPIO Power";
97                         linux,code = <116>;
98                         pinctrl-names = "default";
99                         pinctrl-0 = <&pwr_key>;
100                 };
101         };
102
103         leds {
104                 compatible = "gpio-leds";
105
106                 work {
107                         gpios = <&gpio8 1 GPIO_ACTIVE_LOW>;
108                         label = "firefly:blue:user";
109                         linux,default-trigger = "rc-feedback";
110                         pinctrl-names = "default";
111                         pinctrl-0 = <&work_led>;
112                 };
113
114                 power {
115                         gpios = <&gpio8 2 GPIO_ACTIVE_LOW>;
116                         label = "firefly:green:power";
117                         linux,default-trigger = "default-on";
118                         pinctrl-names = "default";
119                         pinctrl-0 = <&power_led>;
120                 };
121         };
122
123         sdio_pwrseq: sdio-pwrseq {
124                 compatible = "mmc-pwrseq-simple";
125                 clocks = <&hym8563>;
126                 clock-names = "ext_clock";
127                 pinctrl-names = "default";
128                 pinctrl-0 = <&wifi_enable_h>;
129
130                 /*
131                  * On the module itself this is one of these (depending
132                  * on the actual card populated):
133                  * - SDIO_RESET_L_WL_REG_ON
134                  * - PDN (power down when low)
135                  */
136                 reset-gpios = <&gpio4 28 GPIO_ACTIVE_LOW>;
137         };
138
139         vbat_wl: vcc_sys: vsys-regulator {
140                 compatible = "regulator-fixed";
141                 regulator-name = "vcc_sys";
142                 regulator-min-microvolt = <5000000>;
143                 regulator-max-microvolt = <5000000>;
144                 regulator-always-on;
145                 regulator-boot-on;
146         };
147
148         vcc_sd: sdmmc-regulator {
149                 compatible = "regulator-fixed";
150                 gpio = <&gpio7 11 GPIO_ACTIVE_LOW>;
151                 pinctrl-names = "default";
152                 pinctrl-0 = <&sdmmc_pwr>;
153                 regulator-name = "vcc_sd";
154                 regulator-min-microvolt = <3300000>;
155                 regulator-max-microvolt = <3300000>;
156                 startup-delay-us = <100000>;
157                 vin-supply = <&vcc_io>;
158         };
159
160         vcc_flash: flash-regulator {
161                 compatible = "regulator-fixed";
162                 regulator-name = "vcc_flash";
163                 regulator-min-microvolt = <1800000>;
164                 regulator-max-microvolt = <1800000>;
165                 vin-supply = <&vcc_io>;
166         };
167
168         vcc_5v: usb-regulator {
169                 compatible = "regulator-fixed";
170                 regulator-name = "vcc_5v";
171                 regulator-min-microvolt = <5000000>;
172                 regulator-max-microvolt = <5000000>;
173                 regulator-always-on;
174                 regulator-boot-on;
175                 vin-supply = <&vcc_sys>;
176         };
177
178         vcc_host_5v: usb-host-regulator {
179                 compatible = "regulator-fixed";
180                 enable-active-high;
181                 gpio = <&gpio0 14 GPIO_ACTIVE_HIGH>;
182                 pinctrl-names = "default";
183                 pinctrl-0 = <&host_vbus_drv>;
184                 regulator-name = "vcc_host_5v";
185                 regulator-min-microvolt = <5000000>;
186                 regulator-max-microvolt = <5000000>;
187                 regulator-always-on;
188                 vin-supply = <&vcc_5v>;
189         };
190
191         vcc_otg_5v: usb-otg-regulator {
192                 compatible = "regulator-fixed";
193                 enable-active-high;
194                 gpio = <&gpio0 12 GPIO_ACTIVE_HIGH>;
195                 pinctrl-names = "default";
196                 pinctrl-0 = <&otg_vbus_drv>;
197                 regulator-name = "vcc_otg_5v";
198                 regulator-min-microvolt = <5000000>;
199                 regulator-max-microvolt = <5000000>;
200                 regulator-always-on;
201                 vin-supply = <&vcc_5v>;
202         };
203
204         /*
205          * A TT8142 creates both dovdd_1v8 and vcc28_dvp, controlled
206          * by the dvp_pwr pin.
207          */
208         vcc28_dvp: vcc28-dvp-regulator {
209                 compatible = "regulator-fixed";
210                 enable-active-high;
211                 gpio = <&gpio0 11 GPIO_ACTIVE_HIGH>;
212                 pinctrl-names = "default";
213                 pinctrl-0 = <&dvp_pwr>;
214                 regulator-name = "vcc28_dvp";
215                 regulator-min-microvolt = <2800000>;
216                 regulator-max-microvolt = <2800000>;
217                 regulator-always-on;
218                 vin-supply = <&vcc_io>;
219         };
220
221         wireless-bluetooth {
222                 compatible = "bluetooth-platdata";
223                 uart_rts_gpios = <&gpio4 19 GPIO_ACTIVE_LOW>;
224                 pinctrl-names = "default", "rts_gpio";
225                 pinctrl-0 = <&uart0_rts>;
226                 pinctrl-1 = <&uart0_gpios>;
227                 BT,reset_gpio    = <&gpio4 29 GPIO_ACTIVE_HIGH>;
228                 BT,wake_gpio     = <&gpio4 26 GPIO_ACTIVE_HIGH>;
229                 BT,wake_host_irq = <&gpio4 31 GPIO_ACTIVE_HIGH>;
230                 status = "okay";
231         };
232
233         wireless-wlan {
234                 compatible = "wlan-platdata";
235                 rockchip,grf = <&grf>;
236                 wifi_chip_type = "ap6335";
237                 sdio_vref = <1800>;
238                 WIFI,host_wake_irq = <&gpio4 30 GPIO_ACTIVE_HIGH>;
239                 status = "okay";
240         };
241 };
242
243 &cpu0 {
244         cpu0-supply = <&vdd_cpu>;
245 };
246
247 &emmc {
248         bus-width = <8>;
249         cap-mmc-highspeed;
250         disable-wp;
251         non-removable;
252         num-slots = <1>;
253         pinctrl-names = "default";
254         pinctrl-0 = <&emmc_clk>, <&emmc_cmd>, <&emmc_pwr>, <&emmc_bus8>;
255         vmmc-supply = <&vcc_io>;
256         vqmmc-supply = <&vcc_flash>;
257         status = "okay";
258 };
259
260 &gmac {
261         assigned-clocks = <&cru SCLK_MAC>;
262         assigned-clock-parents = <&ext_gmac>;
263         clock_in_out = "input";
264         pinctrl-names = "default";
265         pinctrl-0 = <&rgmii_pins>, <&phy_rst>, <&phy_pmeb>, <&phy_int>;
266         phy-supply = <&vcc_lan>;
267         phy-mode = "rgmii";
268         snps,reset-active-low;
269         snps,reset-delays-us = <0 10000 1000000>;
270         snps,reset-gpio = <&gpio4 8 GPIO_ACTIVE_LOW>;
271         tx_delay = <0x30>;
272         rx_delay = <0x10>;
273         status = "ok";
274 };
275
276 &hdmi {
277         ddc-i2c-bus = <&i2c5>;
278         status = "okay";
279 };
280
281 &i2c0 {
282         clock-frequency = <400000>;
283         status = "okay";
284
285         vdd_cpu: syr827@40 {
286                 compatible = "silergy,syr827";
287                 fcs,suspend-voltage-selector = <1>;
288                 reg = <0x40>;
289                 regulator-name = "vdd_cpu";
290                 regulator-min-microvolt = <850000>;
291                 regulator-max-microvolt = <1350000>;
292                 regulator-always-on;
293                 regulator-boot-on;
294                 regulator-enable-ramp-delay = <300>;
295                 regulator-ramp-delay = <8000>;
296                 vin-supply = <&vcc_sys>;
297         };
298
299         vdd_gpu: syr828@41 {
300                 compatible = "silergy,syr828";
301                 fcs,suspend-voltage-selector = <1>;
302                 reg = <0x41>;
303                 regulator-name = "vdd_gpu";
304                 regulator-min-microvolt = <850000>;
305                 regulator-max-microvolt = <1350000>;
306                 regulator-always-on;
307                 vin-supply = <&vcc_sys>;
308         };
309
310         hym8563: hym8563@51 {
311                 compatible = "haoyu,hym8563";
312                 reg = <0x51>;
313                 #clock-cells = <0>;
314                 clock-frequency = <32768>;
315                 clock-output-names = "xin32k";
316                 interrupt-parent = <&gpio7>;
317                 interrupts = <4 IRQ_TYPE_EDGE_FALLING>;
318                 pinctrl-names = "default";
319                 pinctrl-0 = <&rtc_int>;
320         };
321
322         act8846: act8846@5a {
323                 compatible = "active-semi,act8846";
324                 reg = <0x5a>;
325                 pinctrl-names = "default";
326                 pinctrl-0 = <&pmic_vsel>, <&pwr_hold>;
327                 system-power-controller;
328
329                 vp1-supply = <&vcc_sys>;
330                 vp2-supply = <&vcc_sys>;
331                 vp3-supply = <&vcc_sys>;
332                 vp4-supply = <&vcc_sys>;
333                 inl1-supply = <&vcc_sys>;
334                 inl2-supply = <&vcc_sys>;
335                 inl3-supply = <&vcc_20>;
336
337                 regulators {
338                         vcc_ddr: REG1 {
339                                 regulator-name = "vcc_ddr";
340                                 regulator-min-microvolt = <1200000>;
341                                 regulator-max-microvolt = <1200000>;
342                                 regulator-always-on;
343                         };
344
345                         vcc_io: REG2 {
346                                 regulator-name = "vcc_io";
347                                 regulator-min-microvolt = <3300000>;
348                                 regulator-max-microvolt = <3300000>;
349                                 regulator-always-on;
350                         };
351
352                         vdd_log: REG3 {
353                                 regulator-name = "vdd_log";
354                                 regulator-min-microvolt = <1100000>;
355                                 regulator-max-microvolt = <1100000>;
356                                 regulator-always-on;
357                         };
358
359                         vcc_20: REG4 {
360                                 regulator-name = "vcc_20";
361                                 regulator-min-microvolt = <2000000>;
362                                 regulator-max-microvolt = <2000000>;
363                                 regulator-always-on;
364                         };
365
366                         vccio_sd: REG5 {
367                                 regulator-name = "vccio_sd";
368                                 regulator-min-microvolt = <3300000>;
369                                 regulator-max-microvolt = <3300000>;
370                                 regulator-always-on;
371                         };
372
373                         vdd10_lcd: REG6 {
374                                 regulator-name = "vdd10_lcd";
375                                 regulator-min-microvolt = <1000000>;
376                                 regulator-max-microvolt = <1000000>;
377                                 regulator-always-on;
378                         };
379
380                         vcca_18: REG7 {
381                                 regulator-name = "vcca_18";
382                                 regulator-min-microvolt = <1800000>;
383                                 regulator-max-microvolt = <1800000>;
384                         };
385
386                         vcca_33: REG8 {
387                                 regulator-name = "vcca_33";
388                                 regulator-min-microvolt = <3300000>;
389                                 regulator-max-microvolt = <3300000>;
390                                 regulator-always-on;
391                         };
392
393                         vcc_lan: REG9 {
394                                 regulator-name = "vcc_lan";
395                                 regulator-min-microvolt = <3300000>;
396                                 regulator-max-microvolt = <3300000>;
397                         };
398
399                         vdd_10: REG10 {
400                                 regulator-name = "vdd_10";
401                                 regulator-min-microvolt = <1000000>;
402                                 regulator-max-microvolt = <1000000>;
403                                 regulator-always-on;
404                         };
405
406                         vccio_wl: vcc_18: REG11 {
407                                 regulator-name = "vcc_18";
408                                 regulator-min-microvolt = <1800000>;
409                                 regulator-max-microvolt = <1800000>;
410                                 regulator-always-on;
411                         };
412
413                         vcc18_lcd: REG12 {
414                                 regulator-name = "vcc18_lcd";
415                                 regulator-min-microvolt = <1800000>;
416                                 regulator-max-microvolt = <1800000>;
417                                 regulator-always-on;
418                         };
419                 };
420         };
421 };
422
423 &i2c1 {
424         status = "okay";
425 };
426
427 &i2c2 {
428         status = "okay";
429 };
430
431 &i2c4 {
432         status = "okay";
433 };
434
435 &i2c5 {
436         status = "okay";
437 };
438
439 &pinctrl {
440         pcfg_output_high: pcfg-output-high {
441                 output-high;
442         };
443
444         pcfg_output_low: pcfg-output-low {
445                 output-low;
446         };
447
448         pcfg_pull_none_drv_8ma: pcfg-pull-none-drv-8ma {
449                 drive-strength = <8>;
450         };
451
452         pcfg_pull_up_drv_8ma: pcfg-pull-up-drv-8ma {
453                 bias-pull-up;
454                 drive-strength = <8>;
455         };
456
457         act8846 {
458                 pwr_hold: pwr-hold {
459                         rockchip,pins = <0 1 RK_FUNC_GPIO &pcfg_output_high>;
460                 };
461         };
462
463         dvp {
464                 dvp_pwr: dvp-pwr {
465                         rockchip,pins = <0 11 RK_FUNC_GPIO &pcfg_pull_none>;
466                 };
467         };
468
469         gmac {
470                 phy_int: phy-int {
471                         rockchip,pins = <0 9 RK_FUNC_GPIO &pcfg_pull_up>;
472                 };
473
474                 phy_pmeb: phy-pmeb {
475                         rockchip,pins = <0 8 RK_FUNC_GPIO &pcfg_pull_up>;
476                 };
477
478                 phy_rst: phy-rst {
479                         rockchip,pins = <4 8 RK_FUNC_GPIO &pcfg_output_high>;
480                 };
481         };
482
483         hym8563 {
484                 rtc_int: rtc-int {
485                         rockchip,pins = <7 4 RK_FUNC_GPIO &pcfg_pull_up>;
486                 };
487         };
488
489         keys {
490                 pwr_key: pwr-key {
491                         rockchip,pins = <0 5 RK_FUNC_GPIO &pcfg_pull_up>;
492                 };
493         };
494
495         leds {
496                 power_led: power-led {
497                         rockchip,pins = <8 2 RK_FUNC_GPIO &pcfg_pull_none>;
498                 };
499
500                 work_led: work-led {
501                         rockchip,pins = <8 1 RK_FUNC_GPIO &pcfg_pull_none>;
502                 };
503         };
504
505         sdio-pwrseq {
506                 wifi_enable_h: wifi-enable-h {
507                         rockchip,pins = <4 28 RK_FUNC_GPIO &pcfg_pull_none>;
508                 };
509         };
510
511         sdmmc {
512                 /*
513                  * Default drive strength isn't enough to achieve even
514                  * high-speed mode on firefly board so bump up to 8ma.
515                  */
516                 sdmmc_bus4: sdmmc-bus4 {
517                         rockchip,pins = <6 16 RK_FUNC_1 &pcfg_pull_up_drv_8ma>,
518                                         <6 17 RK_FUNC_1 &pcfg_pull_up_drv_8ma>,
519                                         <6 18 RK_FUNC_1 &pcfg_pull_up_drv_8ma>,
520                                         <6 19 RK_FUNC_1 &pcfg_pull_up_drv_8ma>;
521                 };
522
523                 sdmmc_clk: sdmmc-clk {
524                         rockchip,pins = <6 20 RK_FUNC_1 &pcfg_pull_none_drv_8ma>;
525                 };
526
527                 sdmmc_cmd: sdmmc-cmd {
528                         rockchip,pins = <6 21 RK_FUNC_1 &pcfg_pull_up_drv_8ma>;
529                 };
530
531                 sdmmc_pwr: sdmmc-pwr {
532                         rockchip,pins = <7 11 RK_FUNC_GPIO &pcfg_pull_none>;
533                 };
534         };
535
536         usb_host {
537                 host_vbus_drv: host-vbus-drv {
538                         rockchip,pins = <0 14 RK_FUNC_GPIO &pcfg_pull_none>;
539                 };
540
541                 usbhub_rst: usbhub-rst {
542                         rockchip,pins = <8 3 RK_FUNC_GPIO &pcfg_output_high>;
543                 };
544         };
545
546         usb_otg {
547                 otg_vbus_drv: otg-vbus-drv {
548                         rockchip,pins = <0 12 RK_FUNC_GPIO &pcfg_pull_none>;
549                 };
550         };
551
552         wireless-bluetooth {
553                 uart0_gpios: uart0-gpios {
554                         rockchip,pins = <4 19 RK_FUNC_GPIO &pcfg_pull_none>;
555                 };
556         };
557 };
558
559 &saradc {
560         vref-supply = <&vcc_18>;
561         status = "okay";
562 };
563
564 &sdio0 {
565         clock-frequency = <50000000>;
566         clock-freq-min-max = <200000 50000000>;
567
568         bus-width = <4>;
569         cap-sd-highspeed;
570         cap-sdio-irq;
571         disable-wp;
572         keep-power-in-suspend;
573         mmc-pwrseq = <&sdio_pwrseq>;
574         non-removable;
575         num-slots = <1>;
576         pinctrl-names = "default";
577         pinctrl-0 = <&sdio0_bus4 &sdio0_cmd &sdio0_clk &sdio0_int>;
578         sd-uhs-sdr104;
579         supports-sdio;
580         vmmc-supply = <&vbat_wl>;
581         vqmmc-supply = <&vccio_wl>;
582         status = "okay";
583 };
584
585 &sdmmc {
586         bus-width = <4>;
587         cap-mmc-highspeed;
588         cap-sd-highspeed;
589         card-detect-delay = <200>;
590         disable-wp;
591         num-slots = <1>;
592         pinctrl-names = "default";
593         pinctrl-0 = <&sdmmc_clk>, <&sdmmc_cmd>, <&sdmmc_cd>, <&sdmmc_bus4>;
594         supports-sd;
595         vmmc-supply = <&vcc_sd>;
596         vqmmc-supply = <&vccio_sd>;
597         status = "okay";
598 };
599
600 &spi0 {
601         pinctrl-names = "default";
602         pinctrl-0 = <&spi0_clk>, <&spi0_cs0>, <&spi0_tx>, <&spi0_rx>, <&spi0_cs1>;
603         status = "okay";
604 };
605
606 &tsadc {
607         rockchip,hw-tshut-mode = <0>;
608         rockchip,hw-tshut-polarity = <0>;
609         status = "okay";
610 };
611
612 &uart0 {
613         pinctrl-names = "default";
614         pinctrl-0 = <&uart0_xfer>, <&uart0_cts>;
615         status = "okay";
616 };
617
618 &uart1 {
619         status = "okay";
620 };
621
622 &uart2 {
623         status = "okay";
624 };
625
626 &uart3 {
627         status = "okay";
628 };
629
630 &usbphy {
631         status = "okay";
632 };
633
634 &usb_host1 {
635         pinctrl-names = "default";
636         pinctrl-0 = <&usbhub_rst>;
637         status = "okay";
638 };
639
640 &usb_otg {
641         status = "okay";
642 };
643
644 &vopb {
645         status = "okay";
646 };
647
648 &vopb_mmu {
649         status = "okay";
650 };
651
652 &vopl {
653         status = "okay";
654 };
655
656 &vopl_mmu {
657         status = "okay";
658 };
659
660 &vpu {
661         status = "okay";
662 };
663
664 &wdt {
665         status = "okay";
666 };