rk3368: p9_dts: add lcd_en delay time
[firefly-linux-kernel-4.4.55.git] / arch / arm64 / boot / dts / rk3368-p9_818.dts
1 /dts-v1/;
2
3 #include <dt-bindings/interrupt-controller/arm-gic.h>
4 #include <dt-bindings/rkfb/rk_fb.h>
5 #include "rk3368.dtsi"
6 #include "../../../arm/boot/dts/lcd-ld089wu1-mipi.dtsi"
7 / {
8         chosen {
9                 bootargs = "earlyprintk=uart8250-32bit,0xff690000 clk_ignore_unused";
10         };
11
12         wireless-wlan {
13                 compatible = "wlan-platdata";
14
15                 rockchip,grf = <&grf>;
16                 
17                 /* wifi_chip_type - wifi chip define
18                  * bcmwifi ==> like ap6xxx, rk90x;
19                  * rtkwifi ==> like rtl8188xx, rtl8723xx;
20                  * esp8089 ==> esp8089;
21                  * other   ==> for other wifi;
22                  */
23                 wifi_chip_type = "bcmwifi";
24
25                 sdio_vref = <1800>; //1800mv or 3300mv
26                 power_pmu_regulator = "rk818_ldo8_reg";
27                 power_pmu_enable_level = <1>; //1->HIGH, 0->LOW
28                 vref_pmu_regulator = "rk818_ldo8_reg";
29                 vref_pmu_enable_level = <1>; //1->HIGH, 0->LOW
30
31                 WIFI,poweren_gpio = <&gpio3 GPIO_A4 GPIO_ACTIVE_HIGH>;
32                 WIFI,host_wake_irq = <&gpio3 GPIO_A6 GPIO_ACTIVE_HIGH>;
33
34                 status = "okay";
35         };
36
37         wireless-bluetooth {
38                 compatible = "bluetooth-platdata";
39                 uart_rts_gpios = <&gpio2 GPIO_D3 GPIO_ACTIVE_LOW>;
40                 pinctrl-names = "default","rts_gpio";
41                 pinctrl-0 = <&uart0_rts>;
42                 pinctrl-1 = <&uart0_rts_gpio>;
43
44                 BT,power_gpio = <&gpio3 GPIO_A3 GPIO_ACTIVE_HIGH>;
45                 BT,reset_gpio = <&gpio3 GPIO_A5 GPIO_ACTIVE_HIGH>;
46                 BT,wake_gpio = <&gpio3 GPIO_A2 GPIO_ACTIVE_HIGH>;
47                 BT,wake_host_irq = <&gpio3 GPIO_A7 GPIO_ACTIVE_HIGH>;
48
49                 status = "okay";
50         };
51
52         hallsensor {
53                compatible = "hall_och165t";
54                type = <SENSOR_TYPE_HALL>;
55                irq-gpio = <&gpio0 GPIO_C0 IRQ_TYPE_EDGE_BOTH>;
56         };
57
58         backlight {
59                 compatible = "pwm-backlight";
60                 pwms = <&pwm0 0 25000>;
61                 brightness-levels = <255 254 253 252 251 250 249 248 247 246 245 244 243 242 241 240
62                      239 238 237 236 235 234 233 232 231 230 229 228 227 226 225 224 223 222 221 220
63                      219 218 217 216 215 214 213 212 211 210 209 208 207 206 205 204 203 202 201 200
64                      199 198 197 196 195 194 193 192 191 190 189 188 187 186 185 184 183 182 181 180
65                      179 178 177 176 175 174 173 172 171 170 169 168 167 166 165 164 163 162 161 160
66                      159 158 157 156 155 154 153 152 151 150 149 148 147 146 145 144 143 142 141 140
67                      139 138 137 136 135 134 133 132 131 130 129 128 127 126 125 124 123 122 121 120
68                      119 118 117 116 115 114 113 112 111 110 109 108 107 106 105 104 103 102 101 100
69                      99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 75 74 73 72 71 70
70                      69 68 67 66 65 64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49 48 47 46 45 44 43 42 41 40
71                      39 38 37 36 35 34 33 32 31 30 29 28 27 26 25 24 23 22 21 20 19 18 17 16 15 14 13 12 11 10
72                      9 8 7 6 5 4 3 2 1 0>;
73                 default-brightness-level = <200>;
74                 enable-gpios = <&gpio0 GPIO_C4 GPIO_ACTIVE_HIGH>;
75         };
76
77         pwm_regulator {
78                 compatible = "rockchip_pwm_regulator";
79                 pwms = <&pwm1 0 2000>;
80                 rockchip,pwm_id= <1>;
81                 rockchip,pwm_voltage_map= <925000 950000 975000 1000000 1025000 1050000 1075000 1100000 1125000 1150000 1175000 1200000 1225000 1250000 1275000 1300000 1325000 1350000 1375000 1400000>;
82                 rockchip,pwm_voltage= <1000000>;
83                 rockchip,pwm_min_voltage= <925000>;
84                 rockchip,pwm_max_voltage= <1400000>;
85                 rockchip,pwm_suspend_voltage= <950000>;
86                 rockchip,pwm_coefficient= <475>;
87                 regulators {
88                         #address-cells = <1>;
89                         #size-cells = <0>;
90                         pwm_reg0: regulator@0 {
91                                 regulator-compatible = "pwm_dcdc1";
92                                 regulator-name= "vdd_logic";
93                                 regulator-min-microvolt = <925000>;
94                                 regulator-max-microvolt = <1400000>;
95                                 regulator-always-on;
96                                 regulator-boot-on;
97                         };
98                 };
99         };
100
101         codec_hdmi_i2s: codec-hdmi-i2s {
102                 compatible = "hdmi-i2s";
103         };
104
105         codec_hdmi_spdif: codec-hdmi-spdif {
106                 compatible = "hdmi-spdif";
107         };
108
109         rockchip-hdmi-i2s {
110                 compatible = "rockchip-hdmi-i2s";
111                 dais {
112                         dai0 {
113                                 audio-codec = <&codec_hdmi_i2s>;
114                                 i2s-controller = <&i2s0>;
115                                 format = "i2s";
116                         };
117                 };
118         };
119
120         rockchip-hdmi-spdif {
121                 compatible = "rockchip-hdmi-spdif";
122                 dais {
123                         dai0 {
124                                 audio-codec = <&codec_hdmi_spdif>;
125                                 i2s-controller = <&spdif>;
126                         };
127                 };
128         };
129
130         rockchip-es8316 {
131                 compatible = "rockchip-es8316";
132                 dais {
133                         dai0 {
134                                 audio-codec = <&es8316>;
135                                 i2s-controller = <&i2s0>;
136                                 format = "i2s";
137                         };
138                 };
139         };
140
141         io-domains {
142                 compatible = "rockchip,rk3368-io-voltage-domain";
143                 rockchip,grf = <&grf>;
144                 rockchip,pmugrf = <&pmugrf>;
145
146                 /*GRF_IO_VSEL*/
147                 gpio30-supply = <&rk818_dcdc4_reg>;     /*APIO1_VDD*/
148                 wifi-supply = <&rk818_ldo8_reg>;     /*APIO2_VDD*/
149                 audio-supply = <&rk818_dcdc4_reg>;   /*APIO3_VDD*/
150                 gpio1830-supply = <&rk818_dcdc4_reg>;   /*ADIO4_VDD*/
151                 sdcard-supply = <&rk818_ldo9_reg>;   /*SDMMC_VDD*/
152
153                 /*PMU_GRF_IO_VSEL*/
154                 pmu-supply = <&rk818_ldo5_reg>;      /*PMUIO_VDD*/
155                 vop-supply = <&rk818_ldo5_reg>;      /*LCDC_VDD*/
156         };
157 };
158
159 &pinctrl {
160         //used for init some gpio
161         init-gpios = <&gpio0 GPIO_A6 GPIO_ACTIVE_HIGH>;
162
163         gpio0_gpio {
164                         gpio0_c7: gpio0-c7 {
165                                 rockchip,pins = <0 GPIO_C7 RK_FUNC_GPIO &pcfg_pull_down>;
166                         };
167                         gpio0_a3: gpio0-a3 {
168                                 rockchip,pins = <0 GPIO_A3 RK_FUNC_3 &pcfg_pull_none>;
169                         };
170                         gpio0_c2: gpio0-c2 {
171                                 rockchip,pins = <0 GPIO_C2 RK_FUNC_GPIO &pcfg_pull_down>;
172                         };
173
174                         //to add
175                 };
176
177 };
178
179 &nandc0 {
180         status = "disabled"; // used nand set "disabled" ,used emmc set "okay"
181 };
182
183 &nandc0reg {
184         status = "okay"; // used nand set "disabled" ,used emmc set "okay"
185 };
186
187 &emmc {
188         clock-frequency = <150000000>;
189         clock-freq-min-max = <400000 150000000>;
190
191         supports-highspeed;
192         supports-emmc;
193         bootpart-no-access;
194
195         //supports-tSD;
196         supports-DDR_MODE; //you should set the two value in your project. only close in RK3288-SDK board.
197         caps2-mmc-hs200;
198
199         ignore-pm-notify;
200         keep-power-in-suspend;
201
202         //poll-hw-reset
203         status = "okay";
204 };
205
206 &sdmmc {
207         clock-frequency = <50000000>;
208         clock-freq-min-max = <400000 50000000>;
209         supports-highspeed;
210         supports-sd;
211         broken-cd;
212         card-detect-delay = <200>;
213
214         ignore-pm-notify;
215         keep-power-in-suspend;
216
217         vmmc-supply = <&rk818_ldo1_reg>;
218                 status = "okay";
219 };
220
221 &sdio {
222         clock-frequency = <50000000>;
223         clock-freq-min-max = <200000 50000000>;
224         supports-highspeed;
225         supports-sdio;
226         ignore-pm-notify;
227         keep-power-in-suspend;
228         //cap-sdio-irq;
229         status = "okay";
230 };
231
232 &spi0 {
233         status = "disabled";
234 };
235
236 &spi1 {
237         status = "disabled";
238 };
239
240 &spi2 {
241         status = "disabled";
242 };
243
244 &uart_dbg {
245         status = "okay";
246 };
247
248 &uart_bt {
249         status = "okay";
250         dma-names = "!tx", "!rx";
251         pinctrl-0 = <&uart0_xfer &uart0_cts>;
252 };
253
254 &i2c0 {
255         status = "okay";
256         syr827: syr827@40 {
257                 compatible = "silergy,syr82x";
258                 reg = <0x40>;
259                 status = "okay";
260                 regulators {
261                         #address-cells = <1>;
262                         #size-cells = <0>;
263                         syr827_dc1: regulator@0 {
264                         reg = <0>;
265                         regulator-compatible = "syr82x_dcdc1";
266                         regulator-name = "vdd_arm";
267                         regulator-min-microvolt = <712500>;
268                         regulator-max-microvolt = <1500000>;
269                         regulator-always-on;
270                         regulator-boot-on;
271                         regulator-initial-mode = <0x2>;
272                         regulator-initial-state = <3>;
273                         regulator-state-mem {
274                                 regulator-state-mode = <0x2>;
275                                 regulator-state-disabled;
276                                 regulator-state-uv = <900000>;
277                         };
278                 };
279            };
280         };
281         syr828: syr828@41 {
282                 compatible = "silergy,syr82x";
283                 reg = <0x41>;
284                 status = "okay";
285                 regulators {
286                         #address-cells = <1>;
287                         #size-cells = <0>;
288                         syr828_dc1: regulator@0 {
289                         reg = <0>;
290                         regulator-compatible = "syr82x_dcdc1";
291                         regulator-name = "vdd_gpu";
292                         regulator-min-microvolt = <712500>;
293                         regulator-max-microvolt = <1500000>;
294                         regulator-always-on;
295                         regulator-boot-on;
296                         regulator-initial-mode = <0x2>;
297                         regulator-initial-state = <3>;
298                         regulator-state-mem {
299                                 regulator-state-mode = <0x2>;
300                                 regulator-state-enabled;
301                                 regulator-state-uv = <900000>;
302                         };
303                 };
304            };
305         };
306
307         rk818: rk818@1c {
308                 reg = <0x1c>;
309                 status = "okay";
310                 compatible = "rockchip,rk818";
311                 battery {
312                         ocv_table = <3300 3599 3671 3701 3728 3746 3762
313                                      3772 3781 3792 3816 3836 3866 3910
314                                      3942 3971 4002 4050 4088 4132 4183>;
315                         design_capacity = <3914>;
316                         design_qmax = <4000>;
317                         max_overcharge = <100>;
318                         max_charge_currentmA = <1500>;
319                         max_charge_voltagemV = <4260>;
320                         max_bat_voltagemV = <4200>;
321                         sleep_enter_current = <150>;
322                         sleep_exit_current = <180>;
323                 };
324         };
325 };
326
327 &i2c1 {
328         status = "okay";
329         es8316: es8316@10 {
330                 compatible = "es8316";
331                 reg = <0x10>;
332                 status = "okay";
333         };
334 };
335
336 &i2c2 {
337         status = "okay";
338         touchscreen@14 {
339                 compatible = "goodix,gt9xx";
340                 reg = <0x14>;
341                 touch-gpio = <&gpio0 GPIO_B4 IRQ_TYPE_LEVEL_LOW>;
342                 reset-gpio = <&gpio0 GPIO_B3 GPIO_ACTIVE_HIGH>;  
343                 max-x = <1920>;                  
344                 max-y = <1200>;
345                 tp-size = <89>;
346         };
347 };
348
349 &i2c3 {
350         status = "okay";
351 };
352
353 &i2c4 {
354         status = "okay";
355
356         mpu6050:mpu@68{
357                 compatible = "mpu6050";
358                 reg = <0x68>;
359                 mpu-int_config = <0x10>;
360                 mpu-level_shifter = <0>;
361                 mpu-orientation = <0 1 0 1 0 0 0 0 1>;
362                 orientation-x= <0>;
363                 orientation-y= <1>;
364                 orientation-z= <1>;
365                 irq-gpio = <&gpio3 GPIO_B6 IRQ_TYPE_LEVEL_LOW>;
366                 mpu-debug = <0>;
367         };
368
369
370         ak8963:compass@0d{
371                 compatible = "mpu_ak8963";
372                 reg = <0x0d>;
373                 compass-bus = <0>;
374                 compass-adapt_num = <0>;
375                 compass-orientation = <1 0 0 0 1 0 0 0 1>;
376                 orientation-x= <0>;
377                 orientation-y= <0>;
378                 orientation-z= <1>;
379                 compass-debug = <1>;
380                 status = "okay";
381         };
382
383 };
384
385 &i2c5 {
386         status = "disabled";
387 };
388
389 &fb {
390         status = "okay";
391         rockchip,disp-mode = <NO_DUAL>;
392         rockchip,uboot-logo-on = <0>;
393 };
394
395 &rk_screen {
396         status = "okay";
397         display-timings = <&disp_timings>;
398 };
399
400 &lcdc {
401         status = "okay";
402         rockchip,mirror = <NO_MIRROR>;
403         rockchip,cabc_mode = <0>;
404         rockchip,fb-win-map = <FB_DEFAULT_ORDER>;
405         power_ctr: power_ctr {
406                 rockchip,debug = <0>;
407                 lcd_en:lcd_en {
408                         rockchip,power_type = <GPIO>;
409                         gpios = <&gpio0 GPIO_C6 GPIO_ACTIVE_HIGH>;
410                         rockchip,delay = <120>;
411                 };
412
413                 lcd_cs:lcd_cs {
414                         rockchip,power_type = <GPIO>;
415                         gpios = <&gpio0 GPIO_C5 GPIO_ACTIVE_HIGH>;
416                         rockchip,delay = <10>;
417                 };
418
419                 /*lcd_rst:lcd_rst {
420                         rockchip,power_type = <GPIO>;
421                         gpios = <&gpio3 GPIO_D6 GPIO_ACTIVE_HIGH>;
422                         rockchip,delay = <5>;
423                 };*/
424         };
425 };
426
427
428 &hdmi {
429         status = "okay";
430         rockchips,hdmi_audio_source = <0>;
431 };
432
433 &adc {
434         status = "okay";
435
436         rockchip_headset {
437                 compatible = "rockchip_headset";
438                 headset_gpio = <&gpio0 GPIO_C7 GPIO_ACTIVE_LOW>;
439                 pinctrl-names = "default";
440                 pinctrl-0 = <&gpio0_c7>;//gpio0_c7
441                 io-channels = <&adc 2>;
442        /*
443                hook_gpio = ;
444                hook_down_type = ; //interrupt hook key down status
445                 */
446        };
447
448         key {
449                 compatible = "rockchip,key";
450                 io-channels = <&adc 1>;
451
452                 vol-up-key {
453                         linux,code = <115>;
454                         label = "volume up";
455                         rockchip,adc_value = <1>;
456                 };
457
458                 vol-down-key {
459                         linux,code = <114>;
460                         label = "volume down";
461                         rockchip,adc_value = <170>;
462                 };
463
464                 power-key {
465                         gpios = <&gpio0 GPIO_A2 GPIO_ACTIVE_LOW>;
466                         linux,code = <116>;
467                         label = "power";
468                         gpio-key,wakeup;
469                 };
470         };
471 };
472
473 &pwm0 {
474         status = "okay";
475 };
476
477 &pwm1 {
478         status = "disabled";
479 };
480
481 &clk_ddr_dvfs_table {
482         operating-points = <
483                 /* KHz    uV */
484                 200000 1100000
485                 300000 1100000
486                 400000 1100000
487                 533000 1150000
488                 >;
489
490         freq-table = <
491                 /*status                freq(KHz)*/
492                 SYS_STATUS_NORMAL       400000
493                 SYS_STATUS_SUSPEND      200000
494                 SYS_STATUS_VIDEO_1080P  240000
495                 SYS_STATUS_VIDEO_4K     400000
496                 SYS_STATUS_PERFORMANCE  528000
497                 SYS_STATUS_DUALVIEW     400000
498                 SYS_STATUS_BOOST        324000
499                 SYS_STATUS_ISP          400000
500                 >;
501         auto-freq-table = <
502                 240000
503                 324000
504                 396000
505                 528000
506                 >;
507         auto-freq=<0>;
508         status="disabled";
509 };
510
511 &dwc_control_usb {
512         host_drv_gpio = <&gpio0 GPIO_A4 GPIO_ACTIVE_LOW>;
513         otg_drv_gpio = <&gpio0 GPIO_D1 GPIO_ACTIVE_LOW>;
514         rockchip,remote_wakeup;
515         rockchip,usb_irq_wakeup;
516 };
517
518 /include/ "../../../arm/boot/dts/rk818.dtsi"
519 &rk818 {
520         gpios =<&gpio0 GPIO_A1 GPIO_ACTIVE_HIGH>,<&gpio0 GPIO_A0 GPIO_ACTIVE_LOW>;
521         rk818,system-power-controller;
522         
523         regulators {
524
525                 rk818_dcdc1_reg: regulator@0{
526                         regulator-name= "vdd_arm";/*vcc arm*/
527                         regulator-min-microvolt = <700000>;/*<725000>;*/
528                         regulator-max-microvolt = <1500000>;
529                         regulator-initial-mode = <0x2>;
530                         regulator-initial-state = <3>;
531                         regulator-state-mem {
532                                 regulator-state-mode = <0x2>;
533                                 regulator-state-enabled;
534                                 regulator-state-uv =<900000>;
535                         };
536                 };
537
538                 rk818_dcdc2_reg: regulator@1 {
539                         regulator-name= "vdd_gpu";/*vcc gpu*/
540                         regulator-min-microvolt = <700000>;
541                         regulator-max-microvolt = <1200000>;
542                         regulator-initial-mode = <0x2>;
543                         regulator-initial-state = <3>;
544                         regulator-state-mem {
545                                 regulator-state-mode = <0x2>;
546                                 regulator-state-enabled;
547                                 regulator-state-uv = <1200000>;
548                         };
549                 };
550
551                 rk818_dcdc3_reg: regulator@2 {
552                         regulator-name= "vcc_ddr";
553                         regulator-min-microvolt = <1200000>;
554                         regulator-max-microvolt = <1200000>;
555                         regulator-initial-mode = <0x2>;
556                         regulator-initial-state = <3>;
557                         regulator-state-mem {
558                                 regulator-state-mode = <0x2>;
559                                 regulator-state-enabled;
560                                 regulator-state-uv = <1200000>;
561                         };
562                 };
563
564                 rk818_dcdc4_reg: regulator@3 {
565                         regulator-name= "vccio";
566                         regulator-min-microvolt = <3000000>;
567                         regulator-max-microvolt = <3000000>;
568                         regulator-initial-mode = <0x2>;
569                         regulator-initial-state = <3>;
570                         regulator-state-mem {
571                                 regulator-state-mode = <0x2>;
572                                 regulator-state-enabled;
573                                 regulator-state-uv = <3000000>;
574                         };
575                 };
576
577                 rk818_ldo1_reg: regulator@4 {
578                         regulator-name= "vcc_codec";
579                         regulator-min-microvolt = <3300000>;
580                         regulator-max-microvolt = <3300000>;
581                         regulator-initial-state = <3>;
582                         regulator-state-mem {
583                                 regulator-state-enabled;
584                                 regulator-state-uv = <3300000>;
585                         };
586                 };
587
588                 rk818_ldo2_reg: regulator@5 {
589                         regulator-name= "vcc_tp";
590                         regulator-min-microvolt = <3300000>;
591                         regulator-max-microvolt = <3300000>;
592                         regulator-initial-state = <3>;
593                         regulator-state-mem {
594                                 regulator-state-enabled;
595                                 regulator-state-uv = <3300000>;
596                         };
597                 };
598
599                 rk818_ldo3_reg: regulator@6 {
600                         regulator-name= "vdd_10";
601                         regulator-min-microvolt = <1000000>;
602                         regulator-max-microvolt = <1000000>;
603                         regulator-initial-state = <3>;
604                         regulator-state-mem {
605                                 regulator-state-enabled;
606                                 regulator-state-uv = <1000000>;
607                         };
608                 };
609
610                 rk818_ldo4_reg:regulator@7 {
611                         regulator-name= "vcc18_lcd";
612                         regulator-min-microvolt = <1800000>;
613                         regulator-max-microvolt = <1800000>;
614                         regulator-initial-state = <3>;
615                         regulator-state-mem {
616                                 regulator-state-disabled;
617                                 regulator-state-uv = <1800000>;
618                         };
619                 };
620
621                 rk818_ldo5_reg: regulator@8 {
622                         regulator-name= "vccio_pmu";
623                         regulator-min-microvolt = <1800000>;
624                         regulator-max-microvolt = <1800000>;
625                         regulator-initial-state = <3>;
626                         regulator-state-mem {
627                                 regulator-state-enabled;
628                                 regulator-state-uv = <1800000>;
629                         };
630                 };
631
632                 rk818_ldo6_reg: regulator@9 {
633                         regulator-name= "vdd10_lcd";
634                         regulator-min-microvolt = <1000000>;
635                         regulator-max-microvolt = <1000000>;
636                         regulator-initial-state = <3>;
637                         regulator-state-mem {
638                                 regulator-state-disabled;
639                                 regulator-state-uv = <1000000>;
640                         };
641                 };
642
643                 rk818_ldo7_reg: regulator@10 {
644                         regulator-name= "vcc_18";
645                         regulator-min-microvolt = <1800000>;
646                         regulator-max-microvolt = <1800000>;
647                         regulator-initial-state = <3>;
648                         regulator-state-mem {
649                                 regulator-state-enabled;
650                                 regulator-state-uv = <1800000>;
651                         };
652                 };
653
654                 rk818_ldo8_reg: regulator@11 {
655                         regulator-name= "vccio_wl";
656                         regulator-min-microvolt = <1800000>;
657                         regulator-max-microvolt = <1800000>;
658                         regulator-initial-state = <3>;
659                         regulator-state-mem {
660                                 regulator-state-enabled;
661                                 regulator-state-uv = <1800000>;
662                         };
663                 };
664
665                 rk818_ldo9_reg: regulator@12 {
666                         regulator-name= "vcc_sd";
667                         regulator-min-microvolt = <1800000>;
668                         regulator-max-microvolt = <3300000>;
669                         regulator-initial-state = <3>;
670                         regulator-state-mem {
671                                 regulator-state-enabled;
672                                 regulator-state-uv = <3300000>;
673                         };
674                 };
675
676                 rk818_ldo10_reg: regulator@13 {
677                         regulator-name= "rk818_ldo10";
678                         regulator-state-mem {
679                                 regulator-state-disabled;
680                         };
681                 };
682         };
683 };
684
685 &ion_cma {
686        reg = <0x00000000 0x28000000>; /* 640MB */
687 };
688