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