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         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         vbat_wl: vcc_sys: vsys-regulator {
124                 compatible = "regulator-fixed";
125                 regulator-name = "vcc_sys";
126                 regulator-min-microvolt = <5000000>;
127                 regulator-max-microvolt = <5000000>;
128                 regulator-always-on;
129                 regulator-boot-on;
130         };
131
132         vcc_sd: sdmmc-regulator {
133                 compatible = "regulator-fixed";
134                 gpio = <&gpio7 11 GPIO_ACTIVE_LOW>;
135                 pinctrl-names = "default";
136                 pinctrl-0 = <&sdmmc_pwr>;
137                 regulator-name = "vcc_sd";
138                 regulator-min-microvolt = <3300000>;
139                 regulator-max-microvolt = <3300000>;
140                 startup-delay-us = <100000>;
141                 vin-supply = <&vcc_io>;
142         };
143
144         vcc_flash: flash-regulator {
145                 compatible = "regulator-fixed";
146                 regulator-name = "vcc_flash";
147                 regulator-min-microvolt = <1800000>;
148                 regulator-max-microvolt = <1800000>;
149                 vin-supply = <&vcc_io>;
150         };
151
152         vcc_5v: usb-regulator {
153                 compatible = "regulator-fixed";
154                 regulator-name = "vcc_5v";
155                 regulator-min-microvolt = <5000000>;
156                 regulator-max-microvolt = <5000000>;
157                 regulator-always-on;
158                 regulator-boot-on;
159                 vin-supply = <&vcc_sys>;
160         };
161
162         vcc_host_5v: usb-host-regulator {
163                 compatible = "regulator-fixed";
164                 enable-active-high;
165                 gpio = <&gpio0 14 GPIO_ACTIVE_HIGH>;
166                 pinctrl-names = "default";
167                 pinctrl-0 = <&host_vbus_drv>;
168                 regulator-name = "vcc_host_5v";
169                 regulator-min-microvolt = <5000000>;
170                 regulator-max-microvolt = <5000000>;
171                 regulator-always-on;
172                 vin-supply = <&vcc_5v>;
173         };
174
175         vcc_otg_5v: usb-otg-regulator {
176                 compatible = "regulator-fixed";
177                 enable-active-high;
178                 gpio = <&gpio0 12 GPIO_ACTIVE_HIGH>;
179                 pinctrl-names = "default";
180                 pinctrl-0 = <&otg_vbus_drv>;
181                 regulator-name = "vcc_otg_5v";
182                 regulator-min-microvolt = <5000000>;
183                 regulator-max-microvolt = <5000000>;
184                 regulator-always-on;
185                 vin-supply = <&vcc_5v>;
186         };
187
188         /*
189          * A TT8142 creates both dovdd_1v8 and vcc28_dvp, controlled
190          * by the dvp_pwr pin.
191          */
192         vcc28_dvp: vcc28-dvp-regulator {
193                 compatible = "regulator-fixed";
194                 enable-active-high;
195                 gpio = <&gpio0 11 GPIO_ACTIVE_HIGH>;
196                 pinctrl-names = "default";
197                 pinctrl-0 = <&dvp_pwr>;
198                 regulator-name = "vcc28_dvp";
199                 regulator-min-microvolt = <2800000>;
200                 regulator-max-microvolt = <2800000>;
201                 regulator-always-on;
202                 vin-supply = <&vcc_io>;
203         };
204 };
205
206 &cpu0 {
207         cpu0-supply = <&vdd_cpu>;
208 };
209
210 &emmc {
211         bus-width = <8>;
212         cap-mmc-highspeed;
213         disable-wp;
214         non-removable;
215         num-slots = <1>;
216         pinctrl-names = "default";
217         pinctrl-0 = <&emmc_clk>, <&emmc_cmd>, <&emmc_pwr>, <&emmc_bus8>;
218         vmmc-supply = <&vcc_io>;
219         vqmmc-supply = <&vcc_flash>;
220         status = "okay";
221 };
222
223 &gmac {
224         assigned-clocks = <&cru SCLK_MAC>;
225         assigned-clock-parents = <&ext_gmac>;
226         clock_in_out = "input";
227         pinctrl-names = "default";
228         pinctrl-0 = <&rgmii_pins>, <&phy_rst>, <&phy_pmeb>, <&phy_int>;
229         phy-supply = <&vcc_lan>;
230         phy-mode = "rgmii";
231         snps,reset-active-low;
232         snps,reset-delays-us = <0 10000 1000000>;
233         snps,reset-gpio = <&gpio4 8 GPIO_ACTIVE_LOW>;
234         tx_delay = <0x30>;
235         rx_delay = <0x10>;
236         status = "ok";
237 };
238
239 &hdmi {
240         ddc-i2c-bus = <&i2c5>;
241         status = "okay";
242 };
243
244 &i2c0 {
245         clock-frequency = <400000>;
246         status = "okay";
247
248         vdd_cpu: syr827@40 {
249                 compatible = "silergy,syr827";
250                 fcs,suspend-voltage-selector = <1>;
251                 reg = <0x40>;
252                 regulator-name = "vdd_cpu";
253                 regulator-min-microvolt = <850000>;
254                 regulator-max-microvolt = <1350000>;
255                 regulator-always-on;
256                 regulator-boot-on;
257                 regulator-enable-ramp-delay = <300>;
258                 regulator-ramp-delay = <8000>;
259                 vin-supply = <&vcc_sys>;
260         };
261
262         vdd_gpu: syr828@41 {
263                 compatible = "silergy,syr828";
264                 fcs,suspend-voltage-selector = <1>;
265                 reg = <0x41>;
266                 regulator-name = "vdd_gpu";
267                 regulator-min-microvolt = <850000>;
268                 regulator-max-microvolt = <1350000>;
269                 regulator-always-on;
270                 vin-supply = <&vcc_sys>;
271         };
272
273         hym8563: hym8563@51 {
274                 compatible = "haoyu,hym8563";
275                 reg = <0x51>;
276                 #clock-cells = <0>;
277                 clock-frequency = <32768>;
278                 clock-output-names = "xin32k";
279                 interrupt-parent = <&gpio7>;
280                 interrupts = <4 IRQ_TYPE_EDGE_FALLING>;
281                 pinctrl-names = "default";
282                 pinctrl-0 = <&rtc_int>;
283         };
284
285         act8846: act8846@5a {
286                 compatible = "active-semi,act8846";
287                 reg = <0x5a>;
288                 pinctrl-names = "default";
289                 pinctrl-0 = <&pmic_vsel>, <&pwr_hold>;
290                 system-power-controller;
291
292                 vp1-supply = <&vcc_sys>;
293                 vp2-supply = <&vcc_sys>;
294                 vp3-supply = <&vcc_sys>;
295                 vp4-supply = <&vcc_sys>;
296                 inl1-supply = <&vcc_sys>;
297                 inl2-supply = <&vcc_sys>;
298                 inl3-supply = <&vcc_20>;
299
300                 regulators {
301                         vcc_ddr: REG1 {
302                                 regulator-name = "vcc_ddr";
303                                 regulator-min-microvolt = <1200000>;
304                                 regulator-max-microvolt = <1200000>;
305                                 regulator-always-on;
306                         };
307
308                         vcc_io: REG2 {
309                                 regulator-name = "vcc_io";
310                                 regulator-min-microvolt = <3300000>;
311                                 regulator-max-microvolt = <3300000>;
312                                 regulator-always-on;
313                         };
314
315                         vdd_log: REG3 {
316                                 regulator-name = "vdd_log";
317                                 regulator-min-microvolt = <1100000>;
318                                 regulator-max-microvolt = <1100000>;
319                                 regulator-always-on;
320                         };
321
322                         vcc_20: REG4 {
323                                 regulator-name = "vcc_20";
324                                 regulator-min-microvolt = <2000000>;
325                                 regulator-max-microvolt = <2000000>;
326                                 regulator-always-on;
327                         };
328
329                         vccio_sd: REG5 {
330                                 regulator-name = "vccio_sd";
331                                 regulator-min-microvolt = <3300000>;
332                                 regulator-max-microvolt = <3300000>;
333                                 regulator-always-on;
334                         };
335
336                         vdd10_lcd: REG6 {
337                                 regulator-name = "vdd10_lcd";
338                                 regulator-min-microvolt = <1000000>;
339                                 regulator-max-microvolt = <1000000>;
340                                 regulator-always-on;
341                         };
342
343                         vcca_18: REG7 {
344                                 regulator-name = "vcca_18";
345                                 regulator-min-microvolt = <1800000>;
346                                 regulator-max-microvolt = <1800000>;
347                         };
348
349                         vcca_33: REG8 {
350                                 regulator-name = "vcca_33";
351                                 regulator-min-microvolt = <3300000>;
352                                 regulator-max-microvolt = <3300000>;
353                         };
354
355                         vcc_lan: REG9 {
356                                 regulator-name = "vcc_lan";
357                                 regulator-min-microvolt = <3300000>;
358                                 regulator-max-microvolt = <3300000>;
359                         };
360
361                         vdd_10: REG10 {
362                                 regulator-name = "vdd_10";
363                                 regulator-min-microvolt = <1000000>;
364                                 regulator-max-microvolt = <1000000>;
365                                 regulator-always-on;
366                         };
367
368                         vccio_wl: vcc_18: REG11 {
369                                 regulator-name = "vcc_18";
370                                 regulator-min-microvolt = <1800000>;
371                                 regulator-max-microvolt = <1800000>;
372                                 regulator-always-on;
373                         };
374
375                         vcc18_lcd: REG12 {
376                                 regulator-name = "vcc18_lcd";
377                                 regulator-min-microvolt = <1800000>;
378                                 regulator-max-microvolt = <1800000>;
379                                 regulator-always-on;
380                         };
381                 };
382         };
383 };
384
385 &i2c1 {
386         status = "okay";
387 };
388
389 &i2c2 {
390         status = "okay";
391 };
392
393 &i2c4 {
394         status = "okay";
395 };
396
397 &i2c5 {
398         status = "okay";
399 };
400
401 &pinctrl {
402         pcfg_output_high: pcfg-output-high {
403                 output-high;
404         };
405
406         pcfg_output_low: pcfg-output-low {
407                 output-low;
408         };
409
410         act8846 {
411                 pwr_hold: pwr-hold {
412                         rockchip,pins = <0 1 RK_FUNC_GPIO &pcfg_output_high>;
413                 };
414         };
415
416         dvp {
417                 dvp_pwr: dvp-pwr {
418                         rockchip,pins = <0 11 RK_FUNC_GPIO &pcfg_pull_none>;
419                 };
420         };
421
422         gmac {
423                 phy_int: phy-int {
424                         rockchip,pins = <0 9 RK_FUNC_GPIO &pcfg_pull_up>;
425                 };
426
427                 phy_pmeb: phy-pmeb {
428                         rockchip,pins = <0 8 RK_FUNC_GPIO &pcfg_pull_up>;
429                 };
430
431                 phy_rst: phy-rst {
432                         rockchip,pins = <4 8 RK_FUNC_GPIO &pcfg_output_high>;
433                 };
434         };
435
436         hym8563 {
437                 rtc_int: rtc-int {
438                         rockchip,pins = <7 4 RK_FUNC_GPIO &pcfg_pull_up>;
439                 };
440         };
441
442         keys {
443                 pwr_key: pwr-key {
444                         rockchip,pins = <0 5 RK_FUNC_GPIO &pcfg_pull_up>;
445                 };
446         };
447
448         leds {
449                 power_led: power-led {
450                         rockchip,pins = <8 2 RK_FUNC_GPIO &pcfg_pull_none>;
451                 };
452
453                 work_led: work-led {
454                         rockchip,pins = <8 1 RK_FUNC_GPIO &pcfg_pull_none>;
455                 };
456         };
457
458         sdmmc {
459                 sdmmc_pwr: sdmmc-pwr {
460                         rockchip,pins = <7 11 RK_FUNC_GPIO &pcfg_pull_none>;
461                 };
462         };
463
464         usb_host {
465                 host_vbus_drv: host-vbus-drv {
466                         rockchip,pins = <0 14 RK_FUNC_GPIO &pcfg_pull_none>;
467                 };
468
469                 usbhub_rst: usbhub-rst {
470                         rockchip,pins = <8 3 RK_FUNC_GPIO &pcfg_output_high>;
471                 };
472         };
473
474         usb_otg {
475                 otg_vbus_drv: otg-vbus-drv {
476                         rockchip,pins = <0 12 RK_FUNC_GPIO &pcfg_pull_none>;
477                 };
478         };
479 };
480
481 &saradc {
482         vref-supply = <&vcc_18>;
483         status = "okay";
484 };
485
486 &sdio0 {
487         bus-width = <4>;
488         disable-wp;
489         non-removable;
490         num-slots = <1>;
491         pinctrl-names = "default";
492         pinctrl-0 = <&sdio0_bus4>, <&sdio0_cmd>, <&sdio0_clk>;
493         vmmc-supply = <&vbat_wl>;
494         vqmmc-supply = <&vccio_wl>;
495         status = "okay";
496 };
497
498 &sdmmc {
499         bus-width = <4>;
500         cap-mmc-highspeed;
501         cap-sd-highspeed;
502         card-detect-delay = <200>;
503         disable-wp;
504         num-slots = <1>;
505         pinctrl-names = "default";
506         pinctrl-0 = <&sdmmc_clk>, <&sdmmc_cmd>, <&sdmmc_cd>, <&sdmmc_bus4>;
507         vmmc-supply = <&vcc_sd>;
508         vqmmc-supply = <&vccio_sd>;
509         status = "okay";
510 };
511
512 &spi0 {
513         pinctrl-names = "default";
514         pinctrl-0 = <&spi0_clk>, <&spi0_cs0>, <&spi0_tx>, <&spi0_rx>, <&spi0_cs1>;
515         status = "okay";
516 };
517
518 &tsadc {
519         rockchip,hw-tshut-mode = <0>;
520         rockchip,hw-tshut-polarity = <0>;
521         status = "okay";
522 };
523
524 &uart0 {
525         pinctrl-names = "default";
526         pinctrl-0 = <&uart0_xfer>, <&uart0_cts>, <&uart0_rts>;
527         status = "okay";
528 };
529
530 &uart1 {
531         status = "okay";
532 };
533
534 &uart2 {
535         status = "okay";
536 };
537
538 &uart3 {
539         status = "okay";
540 };
541
542 &usbphy {
543         status = "okay";
544 };
545
546 &usb_host1 {
547         pinctrl-names = "default";
548         pinctrl-0 = <&usbhub_rst>;
549         status = "okay";
550 };
551
552 &usb_otg {
553         status = "okay";
554 };
555
556 &vopb {
557         status = "okay";
558 };
559
560 &vopb_mmu {
561         status = "okay";
562 };
563
564 &vopl {
565         status = "okay";
566 };
567
568 &vopl_mmu {
569         status = "okay";
570 };
571
572 &wdt {
573         status = "okay";
574 };