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