UPSTREAM: ARM: dts: rockchip: add interrupt for Wake-on-Lan on RK3288
[firefly-linux-kernel-4.4.55.git] / arch / arm / boot / dts / rk3288-evb.dtsi
1 /*
2  * This file is dual-licensed: you can use it either under the terms
3  * of the GPL or the X11 license, at your option. Note that this dual
4  * licensing only applies to this file, and not this project as a
5  * whole.
6  *
7  *  a) This file is free software; you can redistribute it and/or
8  *     modify it under the terms of the GNU General Public License as
9  *     published by the Free Software Foundation; either version 2 of the
10  *     License, or (at your option) any later version.
11  *
12  *     This file is distributed in the hope that it will be useful,
13  *     but WITHOUT ANY WARRANTY; without even the implied warranty of
14  *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  *     GNU General Public License for more details.
16  *
17  * Or, alternatively,
18  *
19  *  b) Permission is hereby granted, free of charge, to any person
20  *     obtaining a copy of this software and associated documentation
21  *     files (the "Software"), to deal in the Software without
22  *     restriction, including without limitation the rights to use,
23  *     copy, modify, merge, publish, distribute, sublicense, and/or
24  *     sell copies of the Software, and to permit persons to whom the
25  *     Software is furnished to do so, subject to the following
26  *     conditions:
27  *
28  *     The above copyright notice and this permission notice shall be
29  *     included in all copies or substantial portions of the Software.
30  *
31  *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
32  *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
33  *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
34  *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
35  *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
36  *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
37  *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
38  *     OTHER DEALINGS IN THE SOFTWARE.
39  */
40
41 #include <dt-bindings/pwm/pwm.h>
42 #include "rk3288.dtsi"
43
44 / {
45         memory {
46                 device_type = "memory";
47                 reg = <0x0 0x80000000>;
48         };
49
50         backlight: backlight {
51                 compatible = "pwm-backlight";
52                 brightness-levels = <
53                           0   1   2   3   4   5   6   7
54                           8   9  10  11  12  13  14  15
55                          16  17  18  19  20  21  22  23
56                          24  25  26  27  28  29  30  31
57                          32  33  34  35  36  37  38  39
58                          40  41  42  43  44  45  46  47
59                          48  49  50  51  52  53  54  55
60                          56  57  58  59  60  61  62  63
61                          64  65  66  67  68  69  70  71
62                          72  73  74  75  76  77  78  79
63                          80  81  82  83  84  85  86  87
64                          88  89  90  91  92  93  94  95
65                          96  97  98  99 100 101 102 103
66                         104 105 106 107 108 109 110 111
67                         112 113 114 115 116 117 118 119
68                         120 121 122 123 124 125 126 127
69                         128 129 130 131 132 133 134 135
70                         136 137 138 139 140 141 142 143
71                         144 145 146 147 148 149 150 151
72                         152 153 154 155 156 157 158 159
73                         160 161 162 163 164 165 166 167
74                         168 169 170 171 172 173 174 175
75                         176 177 178 179 180 181 182 183
76                         184 185 186 187 188 189 190 191
77                         192 193 194 195 196 197 198 199
78                         200 201 202 203 204 205 206 207
79                         208 209 210 211 212 213 214 215
80                         216 217 218 219 220 221 222 223
81                         224 225 226 227 228 229 230 231
82                         232 233 234 235 236 237 238 239
83                         240 241 242 243 244 245 246 247
84                         248 249 250 251 252 253 254 255>;
85                 default-brightness-level = <128>;
86                 enable-gpios = <&gpio7 2 GPIO_ACTIVE_HIGH>;
87                 pinctrl-names = "default";
88                 pinctrl-0 = <&bl_en>;
89                 pwms = <&pwm0 0 1000000 PWM_POLARITY_INVERTED>;
90         };
91
92         panel: panel {
93                 compatible ="lg,lp079qx1-sp0v", "simple-panel";
94                 backlight = <&backlight>;
95                 enable-gpios = <&gpio7 4 GPIO_ACTIVE_HIGH>;
96                 pinctrl-0 = <&lcd_cs>;
97                 ports {
98                         panel_in: port {
99                                 panel_in_edp: endpoint {
100                                         remote-endpoint = <&edp_out_panel>;
101                                 };
102                         };
103                 };
104         };
105
106         sound {
107                 compatible = "simple-audio-card";
108                 simple-audio-card,format = "i2s";
109                 simple-audio-card,name = "rockchip,rt5640-codec";
110                 simple-audio-card,mclk-fs = <512>;
111                 simple-audio-card,widgets =
112                         "Microphone", "Microphone Jack",
113                         "Headphone", "Headphone Jack";
114                 simple-audio-card,routing =
115                         "MIC1", "Microphone Jack",
116                         "MIC2", "Microphone Jack",
117                         "Microphone Jack", "micbias1",
118                         "Headphone Jack", "HPOL",
119                         "Headphone Jack", "HPOR";
120
121                 simple-audio-card,dai-link@0 {
122                         format = "i2s";
123                         cpu {
124                                 sound-dai = <&i2s>;
125                         };
126
127                         codec {
128                                 sound-dai = <&rt5640>;
129                         };
130                 };
131
132                 simple-audio-card,dai-link@1 {
133                         format = "i2s";
134                         cpu {
135                                 sound-dai = <&i2s>;
136                         };
137
138                         codec {
139                                 sound-dai = <&hdmi>;
140                         };
141                 };
142         };
143
144         lvds_panel: lvds_panel {
145                 compatible ="auo,b101ew05","simple-panel";
146                 backlight = <&backlight>;
147                 enable-gpios = <&gpio7 4 GPIO_ACTIVE_HIGH>;
148                 pinctrl-0 = <&lcd_cs>;
149                 status = "disabled";
150         };
151
152         ext_gmac: external-gmac-clock {
153                 compatible = "fixed-clock";
154                 clock-frequency = <125000000>;
155                 clock-output-names = "ext_gmac";
156                 #clock-cells = <0>;
157         };
158
159         gpio-keys {
160                 compatible = "gpio-keys";
161                 #address-cells = <1>;
162                 #size-cells = <0>;
163                 autorepeat;
164
165                 pinctrl-names = "default";
166                 pinctrl-0 = <&pwrbtn>;
167
168                 button@0 {
169                         gpios = <&gpio0 5 GPIO_ACTIVE_LOW>;
170                         linux,code = <116>;
171                         label = "GPIO Key Power";
172                         linux,input-type = <1>;
173                         gpio-key,wakeup = <1>;
174                         debounce-interval = <100>;
175                 };
176         };
177
178         /* This turns on USB vbus for both host0 (ehci) and host1 (dwc2) */
179         vcc_host: vcc-host-regulator {
180                 compatible = "regulator-fixed";
181                 enable-active-high;
182                 gpio = <&gpio0 14 GPIO_ACTIVE_HIGH>;
183                 pinctrl-names = "default";
184                 pinctrl-0 = <&host_vbus_drv>;
185                 regulator-name = "vcc_host";
186                 regulator-always-on;
187                 regulator-boot-on;
188         };
189
190         vcc_phy: vcc-phy-regulator {
191                 compatible = "regulator-fixed";
192                 enable-active-high;
193                 gpio = <&gpio0 6 GPIO_ACTIVE_HIGH>;
194                 pinctrl-names = "default";
195                 pinctrl-0 = <&eth_phy_pwr>;
196                 regulator-name = "vcc_phy";
197                 regulator-min-microvolt = <3300000>;
198                 regulator-max-microvolt = <3300000>;
199                 regulator-always-on;
200                 regulator-boot-on;
201         };
202
203         vcc_sys: vsys-regulator {
204                 compatible = "regulator-fixed";
205                 regulator-name = "vcc_sys";
206                 regulator-min-microvolt = <5000000>;
207                 regulator-max-microvolt = <5000000>;
208                 regulator-always-on;
209                 regulator-boot-on;
210         };
211
212         /* This switch DIO3222 HOST_DP_HOST to host2 (dwc2) */
213         vcc_3g: vcc-3g-regulator {
214                 compatible = "regulator-fixed";
215                 enable-active-high;
216                 gpio = <&gpio7 8 GPIO_ACTIVE_HIGH>;
217                 pinctrl-names = "default";
218                 pinctrl-0 = <&pwr_3g>;
219                 regulator-name = "vcc_3g";
220         };
221
222         /*
223          * NOTE: vcc_sd isn't hooked up on v1.0 boards where power comes from
224          * vcc_io directly.  Those boards won't be able to power cycle SD cards
225          * but it shouldn't hurt to toggle this pin there anyway.
226          */
227         vcc_sd: sdmmc-regulator {
228                 compatible = "regulator-fixed";
229                 pinctrl-names = "default";
230                 pinctrl-0 = <&sdmmc_pwr>;
231                 regulator-name = "vcc_sd";
232                 regulator-min-microvolt = <3300000>;
233                 regulator-max-microvolt = <3300000>;
234                 startup-delay-us = <100000>;
235                 vin-supply = <&vcc_io>;
236         };
237
238         wireless-bluetooth {
239                 compatible = "bluetooth-platdata";
240                 uart_rts_gpios = <&gpio4 19 GPIO_ACTIVE_LOW>;
241                 pinctrl-names = "default", "rts_gpio";
242                 pinctrl-0 = <&uart0_rts>;
243                 pinctrl-1 = <&uart0_gpios>;
244                 BT,reset_gpio    = <&gpio4 29 GPIO_ACTIVE_HIGH>;
245                 BT,wake_gpio     = <&gpio4 26 GPIO_ACTIVE_HIGH>;
246                 BT,wake_host_irq = <&gpio4 31 GPIO_ACTIVE_HIGH>;
247                 status = "okay";
248         };
249
250         wireless-wlan {
251                 compatible = "wlan-platdata";
252                 rockchip,grf = <&grf>;
253                 wifi_chip_type = "ap6335";
254                 sdio_vref = <1800>;
255                 WIFI,host_wake_irq = <&gpio4 30 GPIO_ACTIVE_HIGH>;
256                 status = "okay";
257         };
258 };
259
260 &emmc {
261         bus-width = <8>;
262         cap-mmc-highspeed;
263         disable-wp;
264         non-removable;
265         num-slots = <1>;
266         pinctrl-names = "default";
267         pinctrl-0 = <&emmc_clk &emmc_cmd &emmc_pwr &emmc_bus8>;
268         status = "okay";
269 };
270
271 &gmac {
272         phy-supply = <&vcc_phy>;
273         phy-mode = "rgmii";
274         clock_in_out = "input";
275         snps,reset-gpio = <&gpio4 7 0>;
276         snps,reset-active-low;
277         snps,reset-delays-us = <0 10000 1000000>;
278         assigned-clocks = <&cru SCLK_MAC>;
279         assigned-clock-parents = <&ext_gmac>;
280         pinctrl-names = "default";
281         pinctrl-0 = <&rgmii_pins>;
282         tx_delay = <0x30>;
283         rx_delay = <0x10>;
284         status = "ok";
285 };
286
287 &hdmi {
288         #address-cells = <1>;
289         #size-cells = <0>;
290         #sound-dai-cells = <0>;
291         ddc-i2c-bus = <&i2c5>;
292         status = "okay";
293
294         /* Don't use vopl for HDMI */
295         ports {
296                 hdmi_in: port {
297                         /delete-node/ endpoint@1;
298                 };
299         };
300 };
301
302 &sdmmc {
303         supports-sd;
304         bus-width = <4>;
305         cap-mmc-highspeed;
306         sd-uhs-sdr12;
307         sd-uhs-sdr25;
308         sd-uhs-sdr50;
309         sd-uhs-sdr104;
310         cap-sd-highspeed;
311         card-detect-delay = <200>;
312         disable-wp;                     /* wp not hooked up */
313         num-slots = <1>;
314         pinctrl-names = "default";
315         pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
316         status = "okay";
317         vmmc-supply = <&vcc_sd>;
318         vqmmc-supply = <&vccio_sd>;
319         supports-sd;
320 };
321
322 &gmac {
323         phy-supply = <&vcc_phy>;
324         phy-mode = "rgmii";
325         clock_in_out = "input";
326         snps,reset-gpio = <&gpio4 7 0>;
327         snps,reset-active-low;
328         snps,reset-delays-us = <0 10000 1000000>;
329         assigned-clocks = <&cru SCLK_MAC>;
330         assigned-clock-parents = <&ext_gmac>;
331         pinctrl-names = "default";
332         pinctrl-0 = <&rgmii_pins>;
333         tx_delay = <0x30>;
334         rx_delay = <0x10>;
335         status = "okay";
336 };
337
338 &edp_phy {
339         status = "okay";
340 };
341
342 &edp {
343         force-hpd;
344         status = "okay";
345
346         ports {
347                 /* Don't use vopb for eDP */
348                 edp_in: port@0 {
349                         /delete-node/ endpoint@0;
350                 };
351
352                 edp_out: port@1 {
353                         reg = <1>;
354                         #address-cells = <1>;
355                         #size-cells = <0>;
356                         edp_out_panel: endpoint {
357                                 reg = <0>;
358                                 remote-endpoint = <&panel_in_edp>;
359                         };
360                 };
361         };
362 };
363
364 &hevc_service {
365         status = "okay";
366 };
367
368 &i2c0 {
369         status = "okay";
370 };
371
372 &i2c2 {
373         status = "okay";
374
375         rt5640: rt5640@1c {
376                 #sound-dai-cells = <0>;
377                 compatible = "realtek,rt5640";
378                 reg = <0x1c>;
379                 clocks = <&cru SCLK_I2S0_OUT>;
380                 clock-names = "mclk";
381                 interrupt-parent = <&gpio6>;
382                 interrupts = <7 IRQ_TYPE_EDGE_FALLING>;
383         };
384 };
385
386 &i2c5 {
387         status = "okay";
388 };
389
390 &i2s {
391         #sound-dai-cells = <0>;
392         status = "okay";
393 };
394
395 &io_domains {
396         status = "okay";
397
398         sdcard-supply = <&vccio_sd>;
399         wifi-supply = <&vcc_18>;
400 };
401
402 &wdt {
403         status = "okay";
404 };
405
406 &pwm0 {
407         status = "okay";
408 };
409
410 &sdio0 {
411         status = "okay";
412
413         clock-frequency = <50000000>;
414         clock-freq-min-max = <200000 50000000>;
415
416         bus-width = <4>;
417         cap-sd-highspeed;
418         cap-sdio-irq;
419         disable-wp;
420         keep-power-in-suspend;
421         mmc-pwrseq = <&sdio_pwrseq>;
422         non-removable;
423         num-slots = <1>;
424         pinctrl-names = "default";
425         pinctrl-0 = <&sdio0_bus4 &sdio0_cmd &sdio0_clk &sdio0_int>;
426         sd-uhs-sdr104;
427         supports-sdio;
428 };
429
430 &uart0 {
431         pinctrl-names = "default";
432         pinctrl-0 = <&uart0_xfer &uart0_cts>;
433         status = "okay";
434 };
435
436 &uart1 {
437         status = "okay";
438 };
439
440 &uart2 {
441         status = "okay";
442 };
443
444 &uart3 {
445         status = "okay";
446 };
447
448 &uart4 {
449         status = "okay";
450 };
451
452 &vpu_service {
453         status = "okay";
454 };
455
456 &tsadc {
457         rockchip,hw-tshut-mode = <0>; /* tshut mode 0:CRU 1:GPIO */
458         rockchip,hw-tshut-polarity = <0>; /* tshut polarity 0:LOW 1:HIGH */
459         status = "okay";
460 };
461
462 &usbphy {
463         status = "okay";
464 };
465
466 &usb_host0_ehci {
467         status = "okay";
468 };
469
470 &usb_host1 {
471         status = "okay";
472 };
473
474 &usb_otg {
475         status = "okay";
476 };
477
478 &lvds {
479         rockchip,data-mapping = "jeida";
480         rockchip,data-width = <24>;
481         rockchip,output = "lvds";
482         rockchip,panel = <&lvds_panel>;
483         status = "disabled";
484 };
485
486 &vopb {
487         status = "okay";
488
489         /* Don't use vopb for eDP, save it for HDMI */
490         vopb_out: port {
491                 /delete-node/ endpoint@1;
492         };
493 };
494
495 &vopb_mmu {
496         status = "okay";
497 };
498
499 &vopl {
500         status = "okay";
501
502         /* Don't use vopb for HDMI, save it for eDP */
503         vopl_out: port {
504                 /delete-node/ endpoint@0;
505         };
506 };
507
508 &vopl_mmu {
509         status = "okay";
510 };
511
512 &pinctrl {
513         pcfg_pull_none_drv_8ma: pcfg-pull-none-drv-8ma {
514                 drive-strength = <8>;
515         };
516
517         pcfg_pull_up_drv_8ma: pcfg-pull-up-drv-8ma {
518                 bias-pull-up;
519                 drive-strength = <8>;
520         };
521
522         backlight {
523                 bl_en: bl-en {
524                         rockchip,pins = <7 2 RK_FUNC_GPIO &pcfg_pull_none>;
525                 };
526         };
527
528         buttons {
529                 pwrbtn: pwrbtn {
530                         rockchip,pins = <0 5 RK_FUNC_GPIO &pcfg_pull_up>;
531                 };
532         };
533
534         pmic {
535                 pmic_int: pmic-int {
536                         rockchip,pins = <RK_GPIO0 4 RK_FUNC_GPIO &pcfg_pull_up>;
537                 };
538         };
539
540         sdio-pwrseq {
541                 wifi_enable_h: wifi-enable-h {
542                         rockchip,pins = <4 28 RK_FUNC_GPIO &pcfg_pull_none>;
543                 };
544         };
545
546         sdmmc {
547                 /*
548                  * Default drive strength isn't enough to achieve even
549                  * high-speed mode on EVB board so bump up to 8ma.
550                  */
551                 sdmmc_bus4: sdmmc-bus4 {
552                         rockchip,pins = <6 16 RK_FUNC_1 &pcfg_pull_up_drv_8ma>,
553                                         <6 17 RK_FUNC_1 &pcfg_pull_up_drv_8ma>,
554                                         <6 18 RK_FUNC_1 &pcfg_pull_up_drv_8ma>,
555                                         <6 19 RK_FUNC_1 &pcfg_pull_up_drv_8ma>;
556                 };
557
558                 sdmmc_clk: sdmmc-clk {
559                         rockchip,pins = <6 20 RK_FUNC_1 &pcfg_pull_none_drv_8ma>;
560                 };
561
562                 sdmmc_cmd: sdmmc-cmd {
563                         rockchip,pins = <6 21 RK_FUNC_1 &pcfg_pull_up_drv_8ma>;
564                 };
565
566                 sdmmc_pwr: sdmmc-pwr {
567                         rockchip,pins = <7 11 RK_FUNC_GPIO &pcfg_pull_none>;
568                 };
569         };
570
571         usb {
572                 host_vbus_drv: host-vbus-drv {
573                         rockchip,pins = <0 14 RK_FUNC_GPIO &pcfg_pull_none>;
574                 };
575
576                 pwr_3g: pwr-3g {
577                         rockchip,pins = <7 8 RK_FUNC_GPIO &pcfg_pull_none>;
578                 };
579         };
580
581         eth_phy {
582                 eth_phy_pwr: eth-phy-pwr {
583                         rockchip,pins = <0 6 RK_FUNC_GPIO &pcfg_pull_none>;
584                 };
585         };
586
587         lcd {
588                 lcd_cs: lcd-cs {
589                         rockchip,pins = <7 4 RK_FUNC_GPIO &pcfg_pull_none>;
590                 };
591         };
592
593         wireless-bluetooth {
594                 uart0_gpios: uart0-gpios {
595                         rockchip,pins = <4 19 RK_FUNC_GPIO &pcfg_pull_none>;
596                 };
597         };
598 };