Merge branch 'linux-linaro-lsk-v4.4-android' of git://git.linaro.org/kernel/linux...
[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         ir: ir-receiver {
67                 compatible = "gpio-ir-receiver";
68                 pinctrl-names = "default";
69                 pinctrl-0 = <&ir_int>;
70         };
71
72         keys: gpio-keys {
73                 compatible = "gpio-keys";
74                 #address-cells = <1>;
75                 #size-cells = <0>;
76
77                 button@0 {
78                         gpio-key,wakeup = <1>;
79                         gpios = <&gpio0 5 GPIO_ACTIVE_LOW>;
80                         label = "GPIO Power";
81                         linux,code = <116>;
82                         pinctrl-names = "default";
83                         pinctrl-0 = <&pwr_key>;
84                 };
85         };
86
87         leds {
88                 compatible = "gpio-leds";
89
90                 work {
91                         gpios = <&gpio8 1 GPIO_ACTIVE_LOW>;
92                         label = "firefly:blue:user";
93                         linux,default-trigger = "rc-feedback";
94                         pinctrl-names = "default";
95                         pinctrl-0 = <&work_led>;
96                 };
97
98                 power {
99                         gpios = <&gpio8 2 GPIO_ACTIVE_LOW>;
100                         label = "firefly:green:power";
101                         linux,default-trigger = "default-on";
102                         pinctrl-names = "default";
103                         pinctrl-0 = <&power_led>;
104                 };
105         };
106
107         sdio_pwrseq: sdio-pwrseq {
108                 compatible = "mmc-pwrseq-simple";
109                 clocks = <&hym8563>;
110                 clock-names = "ext_clock";
111                 pinctrl-names = "default";
112                 pinctrl-0 = <&wifi_enable_h>;
113
114                 /*
115                  * On the module itself this is one of these (depending
116                  * on the actual card populated):
117                  * - SDIO_RESET_L_WL_REG_ON
118                  * - PDN (power down when low)
119                  */
120                 reset-gpios = <&gpio4 28 GPIO_ACTIVE_LOW>;
121         };
122
123         sound {
124                 compatible = "simple-audio-card";
125                 simple-audio-card,name = "SPDIF";
126                 simple-audio-card,dai-link@1 {
127                         cpu { sound-dai = <&spdif>; };
128                         codec { sound-dai = <&spdif_out>; };
129                 };
130         };
131
132         spdif_out: spdif-out {
133                 compatible = "linux,spdif-dit";
134                 #sound-dai-cells = <0>;
135         };
136
137         vbat_wl: vcc_sys: vsys-regulator {
138                 compatible = "regulator-fixed";
139                 regulator-name = "vcc_sys";
140                 regulator-min-microvolt = <5000000>;
141                 regulator-max-microvolt = <5000000>;
142                 regulator-always-on;
143                 regulator-boot-on;
144         };
145
146         vcc_sd: sdmmc-regulator {
147                 compatible = "regulator-fixed";
148                 gpio = <&gpio7 11 GPIO_ACTIVE_LOW>;
149                 pinctrl-names = "default";
150                 pinctrl-0 = <&sdmmc_pwr>;
151                 regulator-name = "vcc_sd";
152                 regulator-min-microvolt = <3300000>;
153                 regulator-max-microvolt = <3300000>;
154                 startup-delay-us = <100000>;
155                 vin-supply = <&vcc_io>;
156         };
157
158         vcc_flash: flash-regulator {
159                 compatible = "regulator-fixed";
160                 regulator-name = "vcc_flash";
161                 regulator-min-microvolt = <1800000>;
162                 regulator-max-microvolt = <1800000>;
163                 vin-supply = <&vcc_io>;
164         };
165
166         vcc_5v: usb-regulator {
167                 compatible = "regulator-fixed";
168                 regulator-name = "vcc_5v";
169                 regulator-min-microvolt = <5000000>;
170                 regulator-max-microvolt = <5000000>;
171                 regulator-always-on;
172                 regulator-boot-on;
173                 vin-supply = <&vcc_sys>;
174         };
175
176         vcc_host_5v: usb-host-regulator {
177                 compatible = "regulator-fixed";
178                 enable-active-high;
179                 gpio = <&gpio0 14 GPIO_ACTIVE_HIGH>;
180                 pinctrl-names = "default";
181                 pinctrl-0 = <&host_vbus_drv>;
182                 regulator-name = "vcc_host_5v";
183                 regulator-min-microvolt = <5000000>;
184                 regulator-max-microvolt = <5000000>;
185                 regulator-always-on;
186                 vin-supply = <&vcc_5v>;
187         };
188
189         vcc_otg_5v: usb-otg-regulator {
190                 compatible = "regulator-fixed";
191                 enable-active-high;
192                 gpio = <&gpio0 12 GPIO_ACTIVE_HIGH>;
193                 pinctrl-names = "default";
194                 pinctrl-0 = <&otg_vbus_drv>;
195                 regulator-name = "vcc_otg_5v";
196                 regulator-min-microvolt = <5000000>;
197                 regulator-max-microvolt = <5000000>;
198                 regulator-always-on;
199                 vin-supply = <&vcc_5v>;
200         };
201
202         /*
203          * A TT8142 creates both dovdd_1v8 and vcc28_dvp, controlled
204          * by the dvp_pwr pin.
205          */
206         vcc28_dvp: vcc28-dvp-regulator {
207                 compatible = "regulator-fixed";
208                 enable-active-high;
209                 gpio = <&gpio0 11 GPIO_ACTIVE_HIGH>;
210                 pinctrl-names = "default";
211                 pinctrl-0 = <&dvp_pwr>;
212                 regulator-name = "vcc28_dvp";
213                 regulator-min-microvolt = <2800000>;
214                 regulator-max-microvolt = <2800000>;
215                 regulator-always-on;
216                 vin-supply = <&vcc_io>;
217         };
218
219         wireless-bluetooth {
220                 compatible = "bluetooth-platdata";
221                 uart_rts_gpios = <&gpio4 19 GPIO_ACTIVE_LOW>;
222                 pinctrl-names = "default", "rts_gpio";
223                 pinctrl-0 = <&uart0_rts>;
224                 pinctrl-1 = <&uart0_gpios>;
225                 BT,reset_gpio    = <&gpio4 29 GPIO_ACTIVE_HIGH>;
226                 BT,wake_gpio     = <&gpio4 26 GPIO_ACTIVE_HIGH>;
227                 BT,wake_host_irq = <&gpio4 31 GPIO_ACTIVE_HIGH>;
228                 status = "okay";
229         };
230
231         wireless-wlan {
232                 compatible = "wlan-platdata";
233                 rockchip,grf = <&grf>;
234                 wifi_chip_type = "ap6335";
235                 sdio_vref = <1800>;
236                 WIFI,host_wake_irq = <&gpio4 30 GPIO_ACTIVE_HIGH>;
237                 status = "okay";
238         };
239 };
240
241 &cpu0 {
242         cpu0-supply = <&vdd_cpu>;
243 };
244
245 &emmc {
246         bus-width = <8>;
247         cap-mmc-highspeed;
248         disable-wp;
249         non-removable;
250         num-slots = <1>;
251         pinctrl-names = "default";
252         pinctrl-0 = <&emmc_clk>, <&emmc_cmd>, <&emmc_pwr>, <&emmc_bus8>;
253         vmmc-supply = <&vcc_io>;
254         vqmmc-supply = <&vcc_flash>;
255         status = "okay";
256 };
257
258 &gmac {
259         assigned-clocks = <&cru SCLK_MAC>;
260         assigned-clock-parents = <&ext_gmac>;
261         clock_in_out = "input";
262         pinctrl-names = "default";
263         pinctrl-0 = <&rgmii_pins>, <&phy_rst>, <&phy_pmeb>, <&phy_int>;
264         phy-supply = <&vcc_lan>;
265         phy-mode = "rgmii";
266         snps,reset-active-low;
267         snps,reset-delays-us = <0 10000 1000000>;
268         snps,reset-gpio = <&gpio4 8 GPIO_ACTIVE_LOW>;
269         tx_delay = <0x30>;
270         rx_delay = <0x10>;
271         status = "ok";
272 };
273
274 &gpu {
275         mali-supply = <&vdd_gpu>;
276         status = "okay";
277 };
278
279 &hdmi {
280         ddc-i2c-bus = <&i2c5>;
281         status = "okay";
282 };
283
284 &hevc_service {
285         status = "okay";
286 };
287
288 &i2c0 {
289         clock-frequency = <400000>;
290         status = "okay";
291
292         vdd_cpu: syr827@40 {
293                 compatible = "silergy,syr827";
294                 fcs,suspend-voltage-selector = <1>;
295                 reg = <0x40>;
296                 regulator-name = "vdd_cpu";
297                 regulator-min-microvolt = <850000>;
298                 regulator-max-microvolt = <1350000>;
299                 regulator-always-on;
300                 regulator-boot-on;
301                 regulator-enable-ramp-delay = <300>;
302                 regulator-ramp-delay = <8000>;
303                 vin-supply = <&vcc_sys>;
304         };
305
306         vdd_gpu: syr828@41 {
307                 compatible = "silergy,syr828";
308                 fcs,suspend-voltage-selector = <1>;
309                 reg = <0x41>;
310                 regulator-name = "vdd_gpu";
311                 regulator-min-microvolt = <850000>;
312                 regulator-max-microvolt = <1350000>;
313                 regulator-always-on;
314                 regulator-ramp-delay = <6000>;
315                 vin-supply = <&vcc_sys>;
316         };
317
318         hym8563: hym8563@51 {
319                 compatible = "haoyu,hym8563";
320                 reg = <0x51>;
321                 #clock-cells = <0>;
322                 clock-frequency = <32768>;
323                 clock-output-names = "xin32k";
324                 interrupt-parent = <&gpio7>;
325                 interrupts = <4 IRQ_TYPE_EDGE_FALLING>;
326                 pinctrl-names = "default";
327                 pinctrl-0 = <&rtc_int>;
328         };
329
330         act8846: act8846@5a {
331                 compatible = "active-semi,act8846";
332                 reg = <0x5a>;
333                 pinctrl-names = "default";
334                 pinctrl-0 = <&pmic_vsel>, <&pwr_hold>;
335                 system-power-controller;
336
337                 vp1-supply = <&vcc_sys>;
338                 vp2-supply = <&vcc_sys>;
339                 vp3-supply = <&vcc_sys>;
340                 vp4-supply = <&vcc_sys>;
341                 inl1-supply = <&vcc_sys>;
342                 inl2-supply = <&vcc_sys>;
343                 inl3-supply = <&vcc_20>;
344
345                 regulators {
346                         vcc_ddr: REG1 {
347                                 regulator-name = "vcc_ddr";
348                                 regulator-min-microvolt = <1200000>;
349                                 regulator-max-microvolt = <1200000>;
350                                 regulator-always-on;
351                         };
352
353                         vcc_io: REG2 {
354                                 regulator-name = "vcc_io";
355                                 regulator-min-microvolt = <3300000>;
356                                 regulator-max-microvolt = <3300000>;
357                                 regulator-always-on;
358                         };
359
360                         vdd_log: REG3 {
361                                 regulator-name = "vdd_log";
362                                 regulator-min-microvolt = <1100000>;
363                                 regulator-max-microvolt = <1100000>;
364                                 regulator-always-on;
365                         };
366
367                         vcc_20: REG4 {
368                                 regulator-name = "vcc_20";
369                                 regulator-min-microvolt = <2000000>;
370                                 regulator-max-microvolt = <2000000>;
371                                 regulator-always-on;
372                         };
373
374                         vccio_sd: REG5 {
375                                 regulator-name = "vccio_sd";
376                                 regulator-min-microvolt = <3300000>;
377                                 regulator-max-microvolt = <3300000>;
378                                 regulator-always-on;
379                         };
380
381                         vdd10_lcd: REG6 {
382                                 regulator-name = "vdd10_lcd";
383                                 regulator-min-microvolt = <1000000>;
384                                 regulator-max-microvolt = <1000000>;
385                                 regulator-always-on;
386                         };
387
388                         vcca_18: REG7 {
389                                 regulator-name = "vcca_18";
390                                 regulator-min-microvolt = <1800000>;
391                                 regulator-max-microvolt = <1800000>;
392                         };
393
394                         vcca_33: REG8 {
395                                 regulator-name = "vcca_33";
396                                 regulator-min-microvolt = <3300000>;
397                                 regulator-max-microvolt = <3300000>;
398                                 regulator-always-on;
399                         };
400
401                         vcc_lan: REG9 {
402                                 regulator-name = "vcc_lan";
403                                 regulator-min-microvolt = <3300000>;
404                                 regulator-max-microvolt = <3300000>;
405                         };
406
407                         vdd_10: REG10 {
408                                 regulator-name = "vdd_10";
409                                 regulator-min-microvolt = <1000000>;
410                                 regulator-max-microvolt = <1000000>;
411                                 regulator-always-on;
412                         };
413
414                         vccio_wl: vcc_18: REG11 {
415                                 regulator-name = "vcc_18";
416                                 regulator-min-microvolt = <1800000>;
417                                 regulator-max-microvolt = <1800000>;
418                                 regulator-always-on;
419                         };
420
421                         vcc18_lcd: REG12 {
422                                 regulator-name = "vcc18_lcd";
423                                 regulator-min-microvolt = <1800000>;
424                                 regulator-max-microvolt = <1800000>;
425                                 regulator-always-on;
426                         };
427                 };
428         };
429 };
430
431 &i2c1 {
432         status = "okay";
433 };
434
435 &i2c2 {
436         status = "okay";
437 };
438
439 &i2c4 {
440         status = "okay";
441 };
442
443 &i2c5 {
444         status = "okay";
445 };
446
447 &io_domains {
448         status = "okay";
449
450         audio-supply = <&vcca_33>;
451         bb-supply = <&vcc_io>;
452         dvp-supply = <&dovdd_1v8>;
453         flash0-supply = <&vcc_flash>;
454         flash1-supply = <&vcc_lan>;
455         gpio30-supply = <&vcc_io>;
456         gpio1830-supply = <&vcc_io>;
457         lcdc-supply = <&vcc_io>;
458         sdcard-supply = <&vccio_sd>;
459         wifi-supply = <&vccio_wl>;
460 };
461
462 &rga {
463         status = "okay";
464 };
465
466 &pinctrl {
467         pcfg_output_high: pcfg-output-high {
468                 output-high;
469         };
470
471         pcfg_output_low: pcfg-output-low {
472                 output-low;
473         };
474
475         pcfg_pull_none_drv_8ma: pcfg-pull-none-drv-8ma {
476                 drive-strength = <8>;
477         };
478
479         pcfg_pull_up_drv_8ma: pcfg-pull-up-drv-8ma {
480                 bias-pull-up;
481                 drive-strength = <8>;
482         };
483
484         act8846 {
485                 pwr_hold: pwr-hold {
486                         rockchip,pins = <0 1 RK_FUNC_GPIO &pcfg_output_high>;
487                 };
488         };
489
490         dvp {
491                 dvp_pwr: dvp-pwr {
492                         rockchip,pins = <0 11 RK_FUNC_GPIO &pcfg_pull_none>;
493                 };
494         };
495
496         gmac {
497                 phy_int: phy-int {
498                         rockchip,pins = <0 9 RK_FUNC_GPIO &pcfg_pull_up>;
499                 };
500
501                 phy_pmeb: phy-pmeb {
502                         rockchip,pins = <0 8 RK_FUNC_GPIO &pcfg_pull_up>;
503                 };
504
505                 phy_rst: phy-rst {
506                         rockchip,pins = <4 8 RK_FUNC_GPIO &pcfg_output_high>;
507                 };
508         };
509
510         hym8563 {
511                 rtc_int: rtc-int {
512                         rockchip,pins = <7 4 RK_FUNC_GPIO &pcfg_pull_up>;
513                 };
514         };
515
516         keys {
517                 pwr_key: pwr-key {
518                         rockchip,pins = <0 5 RK_FUNC_GPIO &pcfg_pull_up>;
519                 };
520         };
521
522         leds {
523                 power_led: power-led {
524                         rockchip,pins = <8 2 RK_FUNC_GPIO &pcfg_pull_none>;
525                 };
526
527                 work_led: work-led {
528                         rockchip,pins = <8 1 RK_FUNC_GPIO &pcfg_pull_none>;
529                 };
530         };
531
532         sdio-pwrseq {
533                 wifi_enable_h: wifi-enable-h {
534                         rockchip,pins = <4 28 RK_FUNC_GPIO &pcfg_pull_none>;
535                 };
536         };
537
538         sdmmc {
539                 /*
540                  * Default drive strength isn't enough to achieve even
541                  * high-speed mode on firefly board so bump up to 8ma.
542                  */
543                 sdmmc_bus4: sdmmc-bus4 {
544                         rockchip,pins = <6 16 RK_FUNC_1 &pcfg_pull_up_drv_8ma>,
545                                         <6 17 RK_FUNC_1 &pcfg_pull_up_drv_8ma>,
546                                         <6 18 RK_FUNC_1 &pcfg_pull_up_drv_8ma>,
547                                         <6 19 RK_FUNC_1 &pcfg_pull_up_drv_8ma>;
548                 };
549
550                 sdmmc_clk: sdmmc-clk {
551                         rockchip,pins = <6 20 RK_FUNC_1 &pcfg_pull_none_drv_8ma>;
552                 };
553
554                 sdmmc_cmd: sdmmc-cmd {
555                         rockchip,pins = <6 21 RK_FUNC_1 &pcfg_pull_up_drv_8ma>;
556                 };
557
558                 sdmmc_pwr: sdmmc-pwr {
559                         rockchip,pins = <7 11 RK_FUNC_GPIO &pcfg_pull_none>;
560                 };
561         };
562
563         usb_host {
564                 host_vbus_drv: host-vbus-drv {
565                         rockchip,pins = <0 14 RK_FUNC_GPIO &pcfg_pull_none>;
566                 };
567
568                 usbhub_rst: usbhub-rst {
569                         rockchip,pins = <8 3 RK_FUNC_GPIO &pcfg_output_high>;
570                 };
571         };
572
573         usb_otg {
574                 otg_vbus_drv: otg-vbus-drv {
575                         rockchip,pins = <0 12 RK_FUNC_GPIO &pcfg_pull_none>;
576                 };
577         };
578
579         wireless-bluetooth {
580                 uart0_gpios: uart0-gpios {
581                         rockchip,pins = <4 19 RK_FUNC_GPIO &pcfg_pull_none>;
582                 };
583         };
584 };
585
586 &saradc {
587         vref-supply = <&vcc_18>;
588         status = "okay";
589 };
590
591 &sdio0 {
592         clock-frequency = <50000000>;
593         clock-freq-min-max = <200000 50000000>;
594
595         bus-width = <4>;
596         cap-sd-highspeed;
597         cap-sdio-irq;
598         disable-wp;
599         keep-power-in-suspend;
600         mmc-pwrseq = <&sdio_pwrseq>;
601         non-removable;
602         num-slots = <1>;
603         pinctrl-names = "default";
604         pinctrl-0 = <&sdio0_bus4 &sdio0_cmd &sdio0_clk &sdio0_int>;
605         sd-uhs-sdr104;
606         supports-sdio;
607         vmmc-supply = <&vbat_wl>;
608         vqmmc-supply = <&vccio_wl>;
609         status = "okay";
610 };
611
612 &sdmmc {
613         bus-width = <4>;
614         cap-mmc-highspeed;
615         cap-sd-highspeed;
616         card-detect-delay = <200>;
617         disable-wp;
618         num-slots = <1>;
619         pinctrl-names = "default";
620         pinctrl-0 = <&sdmmc_clk>, <&sdmmc_cmd>, <&sdmmc_cd>, <&sdmmc_bus4>;
621         supports-sd;
622         vmmc-supply = <&vcc_sd>;
623         vqmmc-supply = <&vccio_sd>;
624         status = "okay";
625 };
626
627 &spdif {
628         status = "okay";
629 };
630
631 &spi0 {
632         pinctrl-names = "default";
633         pinctrl-0 = <&spi0_clk>, <&spi0_cs0>, <&spi0_tx>, <&spi0_rx>, <&spi0_cs1>;
634         status = "okay";
635 };
636
637 &tsadc {
638         rockchip,hw-tshut-mode = <0>;
639         rockchip,hw-tshut-polarity = <0>;
640         status = "okay";
641 };
642
643 &uart0 {
644         pinctrl-names = "default";
645         pinctrl-0 = <&uart0_xfer>, <&uart0_cts>;
646         status = "okay";
647 };
648
649 &uart1 {
650         status = "okay";
651 };
652
653 &uart2 {
654         status = "okay";
655 };
656
657 &uart3 {
658         status = "okay";
659 };
660
661 &usbphy {
662         status = "okay";
663 };
664
665 &usb_host1 {
666         pinctrl-names = "default";
667         pinctrl-0 = <&usbhub_rst>;
668         status = "okay";
669 };
670
671 &usb_otg {
672         status = "okay";
673 };
674
675 &vopb {
676         status = "okay";
677 };
678
679 &vopb_mmu {
680         status = "okay";
681 };
682
683 &vopl {
684         status = "okay";
685 };
686
687 &vopl_mmu {
688         status = "okay";
689 };
690
691 &vpu_service {
692         status = "okay";
693 };
694
695 &wdt {
696         status = "okay";
697 };