add pinctrl dts demo code in rkxx-tb.dts
[firefly-linux-kernel-4.4.55.git] / arch / arm / boot / dts / rk3188-tb.dts
1 /dts-v1/;
2
3 #include "rk3188.dtsi"
4 #include "lcd-b101ew05.dtsi"
5
6 / {
7         memory {
8                 device_type = "memory";
9                 reg = <0x60000000 0x40000000>;
10         };
11
12         chosen {
13                 bootargs = "clk_ignore_unused";
14         };
15
16         fiq-debugger {
17                 status = "okay";
18         };
19
20
21         wireless-wlan {
22                 compatible = "wlan-platdata";
23
24                 wifi_chip_type = "";
25                 sdio_vref = <28000>;
26
27                 //power_ctrl_by_pmu;
28                 pmu_regulator = "act_ldo3";
29                 pmu_enable_level = <1>; //1->HIGH, 0->LOW
30
31                 WIFI,poweren_gpio = <&gpio3 GPIO_D0 GPIO_ACTIVE_HIGH>;
32                 WIFI,host_wake_irq = <&gpio3 GPIO_D2 GPIO_ACTIVE_HIGH>;
33                 //WIFI,reset_gpio = <&gpio0 GPIO_A2 GPIO_ACTIVE_LOW>;
34
35                 status = "okay";
36         };
37
38         wireless-bluetooth {
39                 compatible = "bluetooth-platdata";
40
41                 uart_rts_gpios = <&gpio1 GPIO_A3 GPIO_ACTIVE_LOW>;
42                 pinctrl-names = "default","rts_gpio";
43                 pinctrl-0 = <&uart0_rts>;
44                 pinctrl-1 = <&uart0_rts_gpio>;
45
46                 BT,power_gpio = <&gpio3 GPIO_C7 GPIO_ACTIVE_HIGH>;
47                 BT,reset_gpio = <&gpio3 GPIO_D1 GPIO_ACTIVE_HIGH>;
48                 BT,wake_gpio = <&gpio3 GPIO_C6 GPIO_ACTIVE_HIGH>;
49                 BT,wake_host_irq = <&gpio0 GPIO_A5 GPIO_ACTIVE_LOW>;
50
51                 status = "okay";
52         };
53
54         backlight {
55                 compatible = "pwm-backlight";
56                 pwms = <&pwm3 0 25000>;
57                 brightness-levels = <0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255>;
58                 default-brightness-level = <128>;
59                 enable-gpios = <&gpio0 GPIO_A2 GPIO_ACTIVE_HIGH>;
60         };
61
62         pwm_regulator {
63        compatible = "rockchip_pwm_regulator";
64         pwms = <&pwm0 0 25000>;
65         rockchip,pwm_id= <0>;
66        rockchip,pwm_voltage_map= <925000 950000 975000 1000000 1025000 1050000 1075000 1100000 1125000 1150000 1175000 1200000 1225000 1250000 1275000 1300000 1325000 1350000 1375000 1400000>;
67         rockchip,pwm_voltage= <1000000>;
68         rockchip,pwm_min_voltage= <925000>;
69         rockchip,pwm_max_voltage= <1400000>;
70         rockchip,pwm_suspend_voltage= <950000>;
71         rockchip,pwm_coefficient= <475>;
72         regulators {
73                 #address-cells = <1>;
74                 #size-cells = <0>;                      
75                  pwm_reg0: regulator@0{
76                         regulator-compatible = "pwm_dcdc1";
77                         regulator-name= "vdd_gpu";
78                         regulator-min-microvolt = <925000>;
79                         regulator-max-microvolt = <1400000>;    
80                         regulator-always-on;
81                         regulator-boot-on;
82                 };
83             };
84         };
85
86
87         codec_hdmi_i2s: codec-hdmi-i2s {
88                 compatible = "hdmi-i2s";
89         };
90
91         codec_hdmi_spdif: codec-hdmi-spdif {
92                 compatible = "hdmi-spdif";
93         };
94
95         rockchip-rt5631 {
96                 compatible = "rockchip-rt5631";
97                 dais {
98                         dai0 {
99                                 audio-codec = <&rt5631>;
100                                 i2s-controller = <&i2s0>;
101                                 format = "i2s";
102                                 //continuous-clock;
103                                 //bitclock-inversion;
104                                 //frame-inversion;
105                                 //bitclock-master;
106                                 //frame-master;
107                         };
108                 };
109         };
110
111         rockchip-rk610 {
112                 compatible = "rockchip-rk610";
113                 dais {
114                         dai0 {
115                                 audio-codec = <&rk610_codec>;
116                                 i2s-controller = <&i2s0>;
117                                 format = "i2s";
118                                 //continuous-clock;
119                                 //bitclock-inversion;
120                                 //frame-inversion;
121                                 //bitclock-master;
122                                 //frame-master;
123                         };
124                 };
125         };
126
127         rockchip-hdmi-i2s {
128                 compatible = "rockchip-hdmi-i2s";
129                 dais {
130                         dai0 {
131                                 audio-codec = <&codec_hdmi_i2s>;
132                                 i2s-controller = <&i2s0>;
133                                 format = "i2s";
134                                 //continuous-clock;
135                                 //bitclock-inversion;
136                                 //frame-inversion;
137                                 //bitclock-master;
138                                 //frame-master;
139                         };
140                 };
141         };
142
143         rockchip-hdmi-spdif {
144                 compatible = "rockchip-hdmi-spdif";
145         };
146
147         vmac-phy {
148                 compatible = "rockchip,vmac-phy";
149                 power-gpios = <&gpio0 GPIO_C0 GPIO_ACTIVE_HIGH>;
150         };
151
152 };
153
154 &pinctrl {
155
156         gpio1_gpio {
157                         gpio1_a2: gpio1-a2 {
158                                 rockchip,pins = <GPIO1_A2>;
159                                 rockchip,pull = <VALUE_PULL_UP>;
160                         };
161
162                         //to add
163                 };
164
165         //could add other pinctrl definition such as gpio
166
167 };
168
169
170 &emmc {
171         clock-frequency = <50000000>;
172         clock-freq-min-max = <400000 50000000>;
173
174         supports-highspeed;
175         supports-emmc;
176         bootpart-no-access;
177         
178         status = "okay";
179 };
180     
181 &sdmmc {
182         clock-frequency = <50000000>;
183         lock-freq-min-max = <400000 50000000>;              
184             
185         supports-highspeed;
186         supports-sd;
187         broken-cd;
188         card-detect-delay = <200>;
189
190         pwr-gpios = <&gpio3 GPIO_A1 GPIO_ACTIVE_LOW>; /*pwr_en = GPIO3_A1*/
191
192         status = "okay";
193 };
194                 
195 &sdio {
196         clock-frequency = <50000000>;
197         clock-freq-min-max = <200000 50000000>;
198                 
199         supports-highspeed;             
200         supports-sdio;
201         cap-sdio-irq;
202         status = "okay";
203 };
204
205
206 &uart0 {
207         status = "okay";
208         dma-names = "!tx", "!rx";
209         pinctrl-0 = <&uart0_xfer &uart0_cts>;
210 };
211
212 &uart3 {
213         status = "okay";
214         dma-names = "!tx", "!rx";
215 };
216
217 &watchdog {
218         rockchip,timeout = <50>;
219         rockchip,debug = <1>;
220         status = "disabled";
221 };
222
223 &spi0 {
224         status = "okay";
225         max-freq = <48000000>;  
226         /*
227         spi_test@00 {
228                 compatible = "rockchip,spi_test_bus0_cs0";
229                 reg = <0>;
230                 spi-max-frequency = <24000000>;
231                 poll_mode = <0>;
232                 type = <0>;
233                 enable_dma = <0>;
234
235         };
236
237         spi_test@01 {
238                 compatible = "rockchip,spi_test_bus0_cs1";
239                 reg = <1>;
240                 spi-max-frequency = <24000000>;
241                 poll_mode = <0>;
242                 type = <0>;
243                 enable_dma = <0>;
244         };
245         */
246 };
247
248 &spi1 {
249         status = "okay";
250         max-freq = <48000000>;
251         /*
252         spi_test@10 {
253                 compatible = "rockchip,spi_test_bus1_cs0";
254                 reg = <0>;
255                 spi-max-frequency = <24000000>;
256                 poll_mode = <0>;
257                 type = <0>;
258                 enable_dma = <0>;
259         };
260
261         spi_test@11 {
262                 compatible = "rockchip,spi_test_bus1_cs1";
263                 reg = <1>;
264                 spi-max-frequency = <24000000>;
265                 poll_mode = <0>;
266                 type = <0>;
267                 enable_dma = <0>;
268         };
269         */
270 };
271
272
273 &i2c0 {
274         status = "okay";
275         rt5631: rt5631@1a {
276                 compatible = "rt5631";
277                 reg = <0x1a>;
278         };
279
280         rk610ctl@40 {
281                 compatible = "rk610_ctl";
282                 reg = <0x40>;
283                 rk610-reset-io = <&gpio3 GPIO_B2 GPIO_ACTIVE_HIGH>;
284                 clocks = <&clk_i2s>;
285                 clock-names = "i2s_clk";
286         };
287
288         rk610_codec: rk610codec@60 {//RK610_CODEC addr  from 0x60 to 0x80 (0x60~0x80)
289                 compatible = "rk610_codec";
290                 reg = <0x60>;
291                 spk_ctl_io = <&gpio2 GPIO_D7 GPIO_ACTIVE_HIGH>;
292                 boot_depop = <1>;
293                 pa_enable_time = <1000>;
294         };
295
296         sensor@1d {
297                 compatible = "gs_mma8452";
298                 reg = <0x1d>;
299                 type = <SENSOR_TYPE_ACCEL>;
300                 irq-gpio = <&gpio0 GPIO_B7 IRQ_TYPE_EDGE_FALLING>;              
301                 irq_enable = <1>;
302                 poll_delay_ms = <30>;
303                 layout = <1>;
304         };
305 };
306
307 &i2c1 {
308         status = "okay";
309         rtc@51 {
310                 compatible = "nxp,pcf8563";
311                 reg = <0x51>;
312         };
313
314         act8846: act8846@5a {
315                 reg = <0x5a>;
316                 status = "okay";
317         };
318         rk808: rk808@1b {
319                 reg = <0x1b>;
320                 status = "okay";
321         };
322         bq24296: bq24296@6b {
323                 compatible = "ti,bq24296";
324                 reg = <0x6b>;
325 /*      gpios = <&gpio0 GPIO_A7 GPIO_ACTIVE_HIGH>; */
326           bq24296,chg_current = <1000 500 2000>;
327                 status = "disable";
328         };
329         bq27320: bq27320@55 {
330                 compatible = "ti,bq27320";
331                 reg = <0x55>;
332 /*  gpios = <&gpio0 GPIO_A7 GPIO_ACTIVE_HIGH>; */
333                 status = "disable";
334         };
335 };
336
337 &i2c2 {
338         status = "okay";
339         ts@55 {
340                 compatible = "goodix,gt8xx";
341                 reg = <0x55>;
342                 touch-gpio = <&gpio1 GPIO_B7 IRQ_TYPE_LEVEL_LOW>;
343                 reset-gpio = <&gpio0 GPIO_B6 GPIO_ACTIVE_LOW>;
344                 power-gpio = <&gpio0 GPIO_C5 GPIO_ACTIVE_LOW>;
345                 max-x = <1280>;
346                 max-y = <800>;
347         };
348         ts@01 {
349                 compatible = "ct,ct36x";
350                 reg = <0x01>;
351                 ct-model = <365>;
352                 touch-gpio = <&gpio1 GPIO_B7 IRQ_TYPE_LEVEL_LOW>;
353                 reset-gpio = <&gpio0 GPIO_B6 GPIO_ACTIVE_HIGH>;
354                 max-x = <1280>;
355                 max-y = <800>;
356                 orientation=<1 0 0 1>;
357         };
358 };
359
360 &i2c3 {
361         status = "okay";
362 };
363
364 &fb {
365         rockchip,disp-mode = <DUAL>;
366 };
367
368 &rk_screen {
369          display-timings = <&disp_timings>;
370 };
371
372 &lcdc0 {
373         status = "okay";
374         power_ctr: power_ctr {
375                 rockchip,debug = <0>;
376                 lcd_en:lcd_en {
377                         rockchip,power_type = <GPIO>;
378                         gpios = <&gpio0 GPIO_B0 GPIO_ACTIVE_HIGH>;
379                         rockchip,delay = <10>;
380                 };
381
382                      /*lcd_cs:lcd_cs {
383                                 rockchip,power_type = <GPIO>;
384                                 gpios = <&gpio3 GPIO_D6 GPIO_ACTIVE_HIGH>;
385                                 rockchip,delay = <10>;
386                         };
387
388                         lcd_rst:lcd_rst {
389                                 rockchip,power_type = <REGULATOR>;
390                                 rockchip,delay = <5>;
391                         };*/
392
393         };
394 };
395
396 &lcdc1 {
397         status = "okay";
398 };
399
400 &adc {
401         status = "okay";
402
403         key {
404                 compatible = "rockchip,key";
405                 io-channels = <&adc 1>;
406
407                 vol-up-key {
408                         linux,code = <115>;
409                         label = "volume up";
410                         rockchip,adc_value = <1>;
411                 };
412
413                 vol-down-key {
414                         linux,code = <114>;
415                         label = "volume down";
416                         rockchip,adc_value = <170>;
417                 };
418
419                 power-key {
420                         gpios = <&gpio0 GPIO_A4 GPIO_ACTIVE_LOW>;
421                         linux,code = <116>;
422                         label = "power";
423                         gpio-key,wakeup;
424                 };
425
426                 menu-key {
427                         linux,code = <139>;
428                         label = "menu";
429                         rockchip,adc_value = <355>;
430                 };
431
432                 home-key {
433                         linux,code = <102>;
434                         label = "home";
435                         rockchip,adc_value = <746>;
436                 };
437
438                 back-key {
439                         linux,code = <158>;
440                         label = "back";
441                         rockchip,adc_value = <560>;
442                 };
443
444                 camera-key {
445                         linux,code = <212>;
446                         label = "camera";
447                         rockchip,adc_value = <450>;
448                 };
449         };
450 };
451
452 &pwm3 {
453         status = "okay";
454 };
455
456 &pwm0 {
457         status = "disable";
458 };
459
460 &clk_core_dvfs_table {
461         operating-points = <
462                 /* KHz    uV */
463                 312000 1100000
464                 504000 1100000
465                 816000 1100000
466                 1008000 1100000
467                 1200000 1200000
468                 1416000 1300000
469                 1608000 1350000
470                 >;
471 };
472
473 &clk_gpu_dvfs_table {
474         operating-points = <
475                 /* KHz    uV */
476                 200000 1200000
477                 300000 1200000
478                 400000 1200000
479                 >;
480 };
481
482 &clk_ddr_dvfs_table {
483         operating-points = <
484                 /* KHz    uV */
485                 200000 1200000
486                 300000 1200000
487                 400000 1200000
488                 >;
489
490         freq_table = <
491                 /*status                freq(KHz)*/
492                 SYS_STATUS_NORMAL       400000
493                 SYS_STATUS_SUSPEND      200000
494                 SYS_STATUS_VIDEO        300000
495                 SYS_STATUS_DUALVIEW     500000
496                 >;
497 };
498
499 /include/ "act8846.dtsi"
500 &act8846 {
501         gpios =<&gpio3 GPIO_D3 GPIO_ACTIVE_LOW>;
502
503         regulators {
504                 
505                 dcdc1_reg: regulator@0{
506                         regulator-name= "act_dcdc1";
507                         regulator-min-microvolt = <1200000>;
508                         regulator-max-microvolt = <1200000>;
509                         regulator-always-on;
510                         regulator-boot-on;
511                 };
512
513                 dcdc2_reg: regulator@1 {
514                         regulator-name= "vdd_logic";
515                         regulator-always-on;
516                         regulator-boot-on;                      
517                 };
518
519                 dcdc3_reg: regulator@2 {
520                         regulator-name= "vdd_arm";
521                         regulator-always-on;
522                         regulator-boot-on;
523                 };
524
525                 dcdc4_reg: regulator@3 {
526                         regulator-name= "vccio";
527                         regulator-min-microvolt = <1800000>;
528                         regulator-max-microvolt = <3300000>;
529                         regulator-always-on;
530                         regulator-boot-on;
531                 };
532
533                 ldo1_reg: regulator@4 {
534                         regulator-name= "act_ldo1";
535                         regulator-min-microvolt = <1000000>;
536                         regulator-max-microvolt = <1000000>;
537                         regulator-always-on;
538                         regulator-boot-on;
539                 };
540
541                 ldo2_reg: regulator@5 {
542                         regulator-name= "act_ldo2";
543                         regulator-min-microvolt = <1200000>;
544                         regulator-max-microvolt = <1200000>;
545                         regulator-always-on;
546                         regulator-boot-on;
547                 };
548
549                 ldo3_reg: regulator@6 {
550                         regulator-name= "act_ldo3";
551                         regulator-min-microvolt = <1800000>;
552                         regulator-max-microvolt = <1800000>;
553                         regulator-always-on;
554                         regulator-boot-on;
555                 };
556
557                 ldo4_reg:regulator@7 {
558                         regulator-name= "act_ldo4";
559                         regulator-min-microvolt = <3300000>;
560                         regulator-max-microvolt = <3300000>;
561                         regulator-always-on;
562                         regulator-boot-on;
563                 };
564
565                 ldo5_reg: regulator@8 {
566                         regulator-name= "act_ldo5";
567                         regulator-min-microvolt = <3300000>;
568                         regulator-max-microvolt = <3300000>;
569                         regulator-always-on;
570                         regulator-boot-on;
571                 };
572
573                 ldo6_reg: regulator@9 {
574                         regulator-name= "act_ldo6";
575                         regulator-min-microvolt = <3300000>;
576                         regulator-max-microvolt = <3300000>;
577                         regulator-always-on;
578                         regulator-boot-on;
579                 };
580
581                 ldo7_reg: regulator@10 {
582                         regulator-name= "act_ldo7";
583                         regulator-min-microvolt = <1800000>;
584                         regulator-max-microvolt = <1800000>;
585                         regulator-always-on;
586                         regulator-boot-on;
587                 };
588
589                 ldo8_reg: regulator@11 {
590                         regulator-name= "act_ldo8";
591                         regulator-min-microvolt = <2800000>;
592                         regulator-max-microvolt = <2800000>;
593                         regulator-always-on;
594                         regulator-boot-on;
595                 };
596         };
597 };
598
599 /include/ "rk808.dtsi"
600 &rk808 {
601         gpios =<&gpio0 GPIO_B3 GPIO_ACTIVE_HIGH>,<&gpio0 GPIO_A1 GPIO_ACTIVE_LOW>;
602
603         regulators {
604                 
605                 rk808_dcdc1_reg: regulator@0{
606                         regulator-name= "vdd_arm";      
607                         regulator-always-on;
608                         regulator-boot-on;
609                 };
610
611                 rk808_dcdc2_reg: regulator@1 {
612                         regulator-name= "vdd_logic";
613                         regulator-always-on;
614                         regulator-boot-on;              
615                 };
616
617                 rk808_dcdc3_reg: regulator@2 {
618                         regulator-name= "rk_dcdc3";
619                         regulator-min-microvolt = <1200000>;
620                         regulator-max-microvolt = <1200000>;
621                         regulator-always-on;
622                         regulator-boot-on;
623                 };
624
625                 rk808_dcdc4_reg: regulator@3 {
626                         regulator-name= "vccio";
627                         regulator-min-microvolt = <1800000>;
628                         regulator-max-microvolt = <3300000>;
629                         regulator-always-on;
630                         regulator-boot-on;
631                 };
632
633                 rk808_ldo1_reg: regulator@4 {
634                         regulator-name= "rk_ldo1";
635                         regulator-min-microvolt = <3300000>;
636                         regulator-max-microvolt = <3300000>;
637                         regulator-always-on;
638                         regulator-boot-on;
639                 };
640
641                 rk808_ldo2_reg: regulator@5 {
642                         regulator-name= "rk_ldo2";
643                         regulator-min-microvolt = <3300000>;
644                         regulator-max-microvolt = <3300000>;
645                         regulator-always-on;
646                         regulator-boot-on;
647                 };
648
649                 rk808_ldo3_reg: regulator@6 {
650                         regulator-name= "rk_ldo3";
651                         regulator-min-microvolt = <1000000>;
652                         regulator-max-microvolt = <1000000>;
653                         regulator-always-on;
654                         regulator-boot-on;
655                 };
656
657                 rk808_ldo4_reg:regulator@7 {
658                         regulator-name= "rk_ldo4";
659                         regulator-min-microvolt = <1800000>;
660                         regulator-max-microvolt = <1800000>;
661                         regulator-always-on;
662                         regulator-boot-on;
663                 };
664
665                 rk808_ldo5_reg: regulator@8 {
666                         regulator-name= "rk_ldo5";
667                         regulator-min-microvolt = <2800000>;
668                         regulator-max-microvolt = <2800000>;
669                         regulator-always-on;
670                         regulator-boot-on;
671                 };
672
673                 rk808_ldo6_reg: regulator@9 {
674                         regulator-name= "rk_ldo6";
675                         regulator-min-microvolt = <1200000>;
676                         regulator-max-microvolt = <1200000>;
677                         regulator-always-on;
678                         regulator-boot-on;
679                 };
680
681                 rk808_ldo7_reg: regulator@10 {
682                         regulator-name= "rk_ldo7";
683                         regulator-min-microvolt = <1800000>;
684                         regulator-max-microvolt = <1800000>;
685                         regulator-always-on;
686                         regulator-boot-on;
687                 };
688
689                 rk808_ldo8_reg: regulator@11 {
690                         regulator-name= "rk_ldo8";
691                         regulator-min-microvolt = <1800000>;
692                         regulator-max-microvolt = <1800000>;
693                         regulator-always-on;
694                         regulator-boot-on;
695                 };
696         };
697 };
698
699 &ap0_vcc_domain{
700         regulator-name= "vccio_wl";     
701 };
702 &ap1_vcc_domain{
703         regulator-name= "vccio";        
704 };
705 &cif_vcc_domain{
706         regulator-name= "vcc18_cif";    
707 };
708 &flash_vcc_domain{
709         regulator-name= "vcc_flash";    
710 };
711 &vccio0_vcc_domain{
712         regulator-name= "vccio";        
713 };
714 &vccio1_vcc_domain{
715         regulator-name= "vccio";        
716 };
717 &lcdc0_vcc_domain{
718         regulator-name= "vcc_lcd";      
719 };
720 &lcdc1_vcc_domain{
721         regulator-name= "vccio";        
722 };