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