arm: dts: rk3288-evb-act8846: add power supply for eDP
[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         panel: panel {
53                 compatible ="lg,lp079qx1-sp0v", "simple-panel";
54                 enable-gpios = <&gpio7 4 GPIO_ACTIVE_HIGH>;
55                 pinctrl-0 = <&lcd_cs>;
56                 ports {
57                         panel_in: port {
58                                 panel_in_edp: endpoint {
59                                         remote-endpoint = <&edp_out_panel>;
60                                 };
61                         };
62                 };
63         };
64
65         sound {
66                 compatible = "simple-audio-card";
67                 simple-audio-card,format = "i2s";
68                 simple-audio-card,name = "rockchip,rt5640-codec";
69                 simple-audio-card,mclk-fs = <512>;
70                 simple-audio-card,widgets =
71                         "Microphone", "Microphone Jack",
72                         "Headphone", "Headphone Jack";
73                 simple-audio-card,routing =
74                         "MIC1", "Microphone Jack",
75                         "MIC2", "Microphone Jack",
76                         "Microphone Jack", "micbias1",
77                         "Headphone Jack", "HPOL",
78                         "Headphone Jack", "HPOR";
79
80                 simple-audio-card,dai-link@0 {
81                         format = "i2s";
82                         cpu {
83                                 sound-dai = <&i2s>;
84                         };
85
86                         codec {
87                                 sound-dai = <&rt5640>;
88                         };
89                 };
90
91                 simple-audio-card,dai-link@1 {
92                         format = "i2s";
93                         cpu {
94                                 sound-dai = <&i2s>;
95                         };
96
97                         codec {
98                                 sound-dai = <&hdmi>;
99                         };
100                 };
101         };
102
103         lvds_panel: lvds_panel {
104                 compatible ="auo,b101ew05","simple-panel";
105                 enable-gpios = <&gpio7 4 GPIO_ACTIVE_HIGH>;
106                 pinctrl-0 = <&lcd_cs>;
107                 status = "disabled";
108         };
109
110         ext_gmac: external-gmac-clock {
111                 compatible = "fixed-clock";
112                 clock-frequency = <125000000>;
113                 clock-output-names = "ext_gmac";
114                 #clock-cells = <0>;
115         };
116
117         vccadc_ref: vccadc-ref {
118                 compatible = "regulator-fixed";
119                 regulator-name = "vcc1v8_sys";
120                 regulator-always-on;
121                 regulator-boot-on;
122                 regulator-min-microvolt = <1800000>;
123                 regulator-max-microvolt = <1800000>;
124         };
125
126         /* This turns on USB vbus for both host0 (ehci) and host1 (dwc2) */
127         vcc_host: vcc-host-regulator {
128                 compatible = "regulator-fixed";
129                 enable-active-high;
130                 gpio = <&gpio0 14 GPIO_ACTIVE_HIGH>;
131                 pinctrl-names = "default";
132                 pinctrl-0 = <&host_vbus_drv>;
133                 regulator-name = "vcc_host";
134                 regulator-always-on;
135                 regulator-boot-on;
136         };
137
138         vcc_phy: vcc-phy-regulator {
139                 compatible = "regulator-fixed";
140                 enable-active-high;
141                 gpio = <&gpio0 6 GPIO_ACTIVE_HIGH>;
142                 pinctrl-names = "default";
143                 pinctrl-0 = <&eth_phy_pwr>;
144                 regulator-name = "vcc_phy";
145                 regulator-min-microvolt = <3300000>;
146                 regulator-max-microvolt = <3300000>;
147                 regulator-always-on;
148                 regulator-boot-on;
149         };
150
151         vcc_sys: vsys-regulator {
152                 compatible = "regulator-fixed";
153                 regulator-name = "vcc_sys";
154                 regulator-min-microvolt = <5000000>;
155                 regulator-max-microvolt = <5000000>;
156                 regulator-always-on;
157                 regulator-boot-on;
158         };
159
160         /* This switch DIO3222 HOST_DP_HOST to host2 (dwc2) */
161         vcc_3g: vcc-3g-regulator {
162                 compatible = "regulator-fixed";
163                 enable-active-high;
164                 gpio = <&gpio7 8 GPIO_ACTIVE_HIGH>;
165                 pinctrl-names = "default";
166                 pinctrl-0 = <&pwr_3g>;
167                 regulator-name = "vcc_3g";
168         };
169
170         /*
171          * NOTE: vcc_sd isn't hooked up on v1.0 boards where power comes from
172          * vcc_io directly.  Those boards won't be able to power cycle SD cards
173          * but it shouldn't hurt to toggle this pin there anyway.
174          */
175         vcc_sd: sdmmc-regulator {
176                 compatible = "regulator-fixed";
177                 pinctrl-names = "default";
178                 pinctrl-0 = <&sdmmc_pwr>;
179                 regulator-name = "vcc_sd";
180                 regulator-min-microvolt = <3300000>;
181                 regulator-max-microvolt = <3300000>;
182                 startup-delay-us = <100000>;
183                 vin-supply = <&vcc_io>;
184         };
185
186         wireless-bluetooth {
187                 compatible = "bluetooth-platdata";
188                 uart_rts_gpios = <&gpio4 19 GPIO_ACTIVE_LOW>;
189                 pinctrl-names = "default", "rts_gpio";
190                 pinctrl-0 = <&uart0_rts>;
191                 pinctrl-1 = <&uart0_gpios>;
192                 BT,reset_gpio    = <&gpio4 29 GPIO_ACTIVE_HIGH>;
193                 BT,wake_gpio     = <&gpio4 26 GPIO_ACTIVE_HIGH>;
194                 BT,wake_host_irq = <&gpio4 31 GPIO_ACTIVE_HIGH>;
195                 status = "okay";
196         };
197
198         wireless-wlan {
199                 compatible = "wlan-platdata";
200                 rockchip,grf = <&grf>;
201                 wifi_chip_type = "ap6335";
202                 sdio_vref = <1800>;
203                 WIFI,host_wake_irq = <&gpio4 30 GPIO_ACTIVE_HIGH>;
204                 status = "okay";
205         };
206 };
207
208 &emmc {
209         bus-width = <8>;
210         cap-mmc-highspeed;
211         disable-wp;
212         non-removable;
213         num-slots = <1>;
214         pinctrl-names = "default";
215         pinctrl-0 = <&emmc_clk &emmc_cmd &emmc_pwr &emmc_bus8>;
216         status = "okay";
217 };
218
219 &gmac {
220         phy-supply = <&vcc_phy>;
221         phy-mode = "rgmii";
222         clock_in_out = "input";
223         snps,reset-gpio = <&gpio4 7 0>;
224         snps,reset-active-low;
225         snps,reset-delays-us = <0 10000 1000000>;
226         assigned-clocks = <&cru SCLK_MAC>;
227         assigned-clock-parents = <&ext_gmac>;
228         pinctrl-names = "default";
229         pinctrl-0 = <&rgmii_pins>;
230         tx_delay = <0x30>;
231         rx_delay = <0x10>;
232         max-speed = <100>;
233         status = "okay";
234 };
235
236 &hdmi {
237         #address-cells = <1>;
238         #size-cells = <0>;
239         #sound-dai-cells = <0>;
240         status = "okay";
241
242         /* Don't use vopl for HDMI */
243         ports {
244                 hdmi_in: port {
245                         /delete-node/ endpoint@1;
246                 };
247         };
248 };
249
250 &saradc {
251         vref-supply = <&vccadc_ref>;
252         status = "okay";
253 };
254
255 &sdmmc {
256         supports-sd;
257         bus-width = <4>;
258         cap-mmc-highspeed;
259         sd-uhs-sdr12;
260         sd-uhs-sdr25;
261         sd-uhs-sdr50;
262         sd-uhs-sdr104;
263         cap-sd-highspeed;
264         card-detect-delay = <200>;
265         disable-wp;                     /* wp not hooked up */
266         num-slots = <1>;
267         pinctrl-names = "default";
268         pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
269         status = "okay";
270         vmmc-supply = <&vcc_sd>;
271         vqmmc-supply = <&vccio_sd>;
272         supports-sd;
273 };
274
275 &edp_phy {
276         status = "okay";
277 };
278
279 &edp {
280         force-hpd;
281         status = "okay";
282
283         ports {
284                 /* Don't use vopb for eDP */
285                 edp_in: port@0 {
286                         /delete-node/ endpoint@0;
287                 };
288
289                 edp_out: port@1 {
290                         reg = <1>;
291                         #address-cells = <1>;
292                         #size-cells = <0>;
293                         edp_out_panel: endpoint {
294                                 reg = <0>;
295                                 remote-endpoint = <&panel_in_edp>;
296                         };
297                 };
298         };
299 };
300
301 &hevc_service {
302         status = "okay";
303 };
304
305 &i2c0 {
306         status = "okay";
307 };
308
309 &i2c2 {
310         status = "okay";
311
312         rt5640: rt5640@1c {
313                 #sound-dai-cells = <0>;
314                 compatible = "realtek,rt5640";
315                 reg = <0x1c>;
316                 clocks = <&cru SCLK_I2S0_OUT>;
317                 clock-names = "mclk";
318                 interrupt-parent = <&gpio6>;
319                 interrupts = <7 IRQ_TYPE_EDGE_FALLING>;
320         };
321 };
322
323 &i2c4 {
324         status = "okay";
325
326         gsl3673@40 {
327                 compatible = "GSL,GSL3673";
328                 reg = <0x40>;
329                 screen_max_x = <1536>;
330                 screen_max_y = <2048>;
331                 irq_gpio_number = <&gpio7 6 IRQ_TYPE_LEVEL_LOW>;
332                 rst_gpio_number = <&gpio7 5 GPIO_ACTIVE_HIGH>;
333                 status = "okay";
334         };
335 };
336
337 &i2s {
338         #sound-dai-cells = <0>;
339         status = "okay";
340 };
341
342 &io_domains {
343         status = "okay";
344
345         sdcard-supply = <&vccio_sd>;
346         wifi-supply = <&vcc_18>;
347 };
348
349 &wdt {
350         status = "okay";
351 };
352
353 &pwm0 {
354         status = "okay";
355 };
356
357 &rga {
358         status = "okay";
359 };
360
361 &sdio0 {
362         status = "okay";
363
364         clock-frequency = <50000000>;
365         clock-freq-min-max = <200000 50000000>;
366
367         bus-width = <4>;
368         cap-sd-highspeed;
369         cap-sdio-irq;
370         disable-wp;
371         keep-power-in-suspend;
372         mmc-pwrseq = <&sdio_pwrseq>;
373         non-removable;
374         num-slots = <1>;
375         pinctrl-names = "default";
376         pinctrl-0 = <&sdio0_bus4 &sdio0_cmd &sdio0_clk &sdio0_int>;
377         sd-uhs-sdr104;
378         supports-sdio;
379 };
380
381 &uart0 {
382         pinctrl-names = "default";
383         pinctrl-0 = <&uart0_xfer &uart0_cts>;
384         status = "okay";
385 };
386
387 &uart2 {
388         status = "okay";
389 };
390
391 &vpu_service {
392         status = "okay";
393 };
394
395 &tsadc {
396         rockchip,hw-tshut-mode = <0>; /* tshut mode 0:CRU 1:GPIO */
397         rockchip,hw-tshut-polarity = <0>; /* tshut polarity 0:LOW 1:HIGH */
398         status = "okay";
399 };
400
401 &usbphy {
402         status = "okay";
403 };
404
405 &usb_host0_ehci {
406         rockchip-relinquish-port;
407         status = "okay";
408 };
409
410 &usb_host1 {
411         status = "okay";
412 };
413
414 &usb_otg {
415         status = "okay";
416 };
417
418 &lvds {
419         rockchip,data-mapping = "jeida";
420         rockchip,data-width = <24>;
421         rockchip,output = "lvds";
422         rockchip,panel = <&lvds_panel>;
423         status = "disabled";
424 };
425
426 &vopb {
427         status = "okay";
428
429         /* Don't use vopb for eDP, save it for HDMI */
430         vopb_out: port {
431                 /delete-node/ endpoint@1;
432         };
433 };
434
435 &vopb_mmu {
436         status = "okay";
437 };
438
439 &vopl {
440         status = "okay";
441
442         /* Don't use vopb for HDMI, save it for eDP */
443         vopl_out: port {
444                 /delete-node/ endpoint@0;
445         };
446 };
447
448 &vopl_mmu {
449         status = "okay";
450 };
451
452 &pinctrl {
453         pcfg_pull_none_drv_8ma: pcfg-pull-none-drv-8ma {
454                 drive-strength = <8>;
455         };
456
457         pcfg_pull_up_drv_8ma: pcfg-pull-up-drv-8ma {
458                 bias-pull-up;
459                 drive-strength = <8>;
460         };
461
462         pmic {
463                 pmic_int: pmic-int {
464                         rockchip,pins = <RK_GPIO0 4 RK_FUNC_GPIO &pcfg_pull_up>;
465                 };
466         };
467
468         sdio-pwrseq {
469                 wifi_enable_h: wifi-enable-h {
470                         rockchip,pins = <4 28 RK_FUNC_GPIO &pcfg_pull_none>;
471                 };
472         };
473
474         sdmmc {
475                 /*
476                  * Default drive strength isn't enough to achieve even
477                  * high-speed mode on EVB board so bump up to 8ma.
478                  */
479                 sdmmc_bus4: sdmmc-bus4 {
480                         rockchip,pins = <6 16 RK_FUNC_1 &pcfg_pull_up_drv_8ma>,
481                                         <6 17 RK_FUNC_1 &pcfg_pull_up_drv_8ma>,
482                                         <6 18 RK_FUNC_1 &pcfg_pull_up_drv_8ma>,
483                                         <6 19 RK_FUNC_1 &pcfg_pull_up_drv_8ma>;
484                 };
485
486                 sdmmc_clk: sdmmc-clk {
487                         rockchip,pins = <6 20 RK_FUNC_1 &pcfg_pull_none_drv_8ma>;
488                 };
489
490                 sdmmc_cmd: sdmmc-cmd {
491                         rockchip,pins = <6 21 RK_FUNC_1 &pcfg_pull_up_drv_8ma>;
492                 };
493
494                 sdmmc_pwr: sdmmc-pwr {
495                         rockchip,pins = <7 11 RK_FUNC_GPIO &pcfg_pull_none>;
496                 };
497         };
498
499         usb {
500                 host_vbus_drv: host-vbus-drv {
501                         rockchip,pins = <0 14 RK_FUNC_GPIO &pcfg_pull_none>;
502                 };
503
504                 pwr_3g: pwr-3g {
505                         rockchip,pins = <7 8 RK_FUNC_GPIO &pcfg_pull_none>;
506                 };
507         };
508
509         eth_phy {
510                 eth_phy_pwr: eth-phy-pwr {
511                         rockchip,pins = <0 6 RK_FUNC_GPIO &pcfg_pull_none>;
512                 };
513         };
514
515         lcd {
516                 lcd_cs: lcd-cs {
517                         rockchip,pins = <7 4 RK_FUNC_GPIO &pcfg_pull_none>;
518                 };
519         };
520
521         wireless-bluetooth {
522                 uart0_gpios: uart0-gpios {
523                         rockchip,pins = <4 19 RK_FUNC_GPIO &pcfg_pull_none>;
524                 };
525         };
526 };