add spi dts demo code for rk3288
[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
155 &emmc {
156         clock-frequency = <50000000>;
157         clock-freq-min-max = <400000 50000000>;
158
159         supports-highspeed;
160         supports-emmc;
161         bootpart-no-access;
162         
163         status = "okay";
164 };
165     
166 &sdmmc {
167         clock-frequency = <50000000>;
168         lock-freq-min-max = <400000 50000000>;              
169             
170         supports-highspeed;
171         supports-sd;
172         broken-cd;
173         card-detect-delay = <200>;
174
175         pwr-gpios = <&gpio3 GPIO_A1 GPIO_ACTIVE_LOW>; /*pwr_en = GPIO3_A1*/
176
177         status = "okay";
178 };
179                 
180 &sdio {
181         clock-frequency = <50000000>;
182         clock-freq-min-max = <200000 50000000>;
183                 
184         supports-highspeed;             
185         supports-sdio;
186         cap-sdio-irq;
187         status = "okay";
188 };
189
190
191 &uart0 {
192         status = "okay";
193         dma-names = "!tx", "!rx";
194         pinctrl-0 = <&uart0_xfer &uart0_cts>;
195 };
196
197 &uart3 {
198         status = "okay";
199         dma-names = "!tx", "!rx";
200 };
201
202 &watchdog {
203         rockchip,timeout = <50>;
204         rockchip,debug = <1>;
205         status = "disabled";
206 };
207
208 &spi0 {
209         status = "okay";
210         max-freq = <48000000>;  
211         /*
212         spi_test@00 {
213                 compatible = "rockchip,spi_test_bus0_cs0";
214                 reg = <0>;
215                 spi-max-frequency = <24000000>;
216                 poll_mode = <0>;
217                 type = <0>;
218                 enable_dma = <0>;
219
220         };
221
222         spi_test@01 {
223                 compatible = "rockchip,spi_test_bus0_cs1";
224                 reg = <1>;
225                 spi-max-frequency = <24000000>;
226                 poll_mode = <0>;
227                 type = <0>;
228                 enable_dma = <0>;
229         };
230         */
231 };
232
233 &spi1 {
234         status = "okay";
235         max-freq = <48000000>;
236         /*
237         spi_test@10 {
238                 compatible = "rockchip,spi_test_bus1_cs0";
239                 reg = <0>;
240                 spi-max-frequency = <24000000>;
241                 poll_mode = <0>;
242                 type = <0>;
243                 enable_dma = <0>;
244         };
245
246         spi_test@11 {
247                 compatible = "rockchip,spi_test_bus1_cs1";
248                 reg = <1>;
249                 spi-max-frequency = <24000000>;
250                 poll_mode = <0>;
251                 type = <0>;
252                 enable_dma = <0>;
253         };
254         */
255 };
256
257
258 &i2c0 {
259         status = "okay";
260         rt5631: rt5631@1a {
261                 compatible = "rt5631";
262                 reg = <0x1a>;
263         };
264
265         rk610ctl@40 {
266                 compatible = "rk610_ctl";
267                 reg = <0x40>;
268                 rk610-reset-io = <&gpio3 GPIO_B2 GPIO_ACTIVE_HIGH>;
269                 clocks = <&clk_i2s>;
270                 clock-names = "i2s_clk";
271         };
272
273         rk610_codec: rk610codec@60 {//RK610_CODEC addr  from 0x60 to 0x80 (0x60~0x80)
274                 compatible = "rk610_codec";
275                 reg = <0x60>;
276                 spk_ctl_io = <&gpio2 GPIO_D7 GPIO_ACTIVE_HIGH>;
277                 boot_depop = <1>;
278                 pa_enable_time = <1000>;
279         };
280
281         sensor@1d {
282                 compatible = "gs_mma8452";
283                 reg = <0x1d>;
284                 type = <SENSOR_TYPE_ACCEL>;
285                 irq-gpio = <&gpio0 GPIO_B7 IRQ_TYPE_EDGE_FALLING>;              
286                 irq_enable = <1>;
287                 poll_delay_ms = <30>;
288                 layout = <1>;
289         };
290 };
291
292 &i2c1 {
293         status = "okay";
294         rtc@51 {
295                 compatible = "nxp,pcf8563";
296                 reg = <0x51>;
297         };
298
299         act8846: act8846@5a {
300                 reg = <0x5a>;
301                 status = "okay";
302         };
303         rk808: rk808@1b {
304                 reg = <0x1b>;
305                 status = "okay";
306         };
307         bq24296: bq24296@6b {
308                 compatible = "ti,bq24296";
309                 reg = <0x6b>;
310 /*      gpios = <&gpio0 GPIO_A7 GPIO_ACTIVE_HIGH>; */
311           bq24296,chg_current = <1000 500 2000>;
312                 status = "disable";
313         };
314         bq27320: bq27320@55 {
315                 compatible = "ti,bq27320";
316                 reg = <0x55>;
317 /*  gpios = <&gpio0 GPIO_A7 GPIO_ACTIVE_HIGH>; */
318                 status = "disable";
319         };
320 };
321
322 &i2c2 {
323         status = "okay";
324         ts@55 {
325                 compatible = "goodix,gt8xx";
326                 reg = <0x55>;
327                 touch-gpio = <&gpio1 GPIO_B7 IRQ_TYPE_LEVEL_LOW>;
328                 reset-gpio = <&gpio0 GPIO_B6 GPIO_ACTIVE_LOW>;
329                 power-gpio = <&gpio0 GPIO_C5 GPIO_ACTIVE_LOW>;
330                 max-x = <1280>;
331                 max-y = <800>;
332         };
333         ts@01 {
334                 compatible = "ct,ct36x";
335                 reg = <0x01>;
336                 ct-model = <365>;
337                 touch-gpio = <&gpio1 GPIO_B7 IRQ_TYPE_LEVEL_LOW>;
338                 reset-gpio = <&gpio0 GPIO_B6 GPIO_ACTIVE_HIGH>;
339                 max-x = <1280>;
340                 max-y = <800>;
341                 orientation=<1 0 0 1>;
342         };
343 };
344
345 &i2c3 {
346         status = "okay";
347 };
348
349 &fb {
350         rockchip,disp-mode = <DUAL>;
351 };
352
353 &rk_screen {
354          display-timings = <&disp_timings>;
355 };
356
357 &lcdc0 {
358         status = "okay";
359         power_ctr: power_ctr {
360                 rockchip,debug = <0>;
361                 lcd_en:lcd_en {
362                         rockchip,power_type = <GPIO>;
363                         gpios = <&gpio0 GPIO_B0 GPIO_ACTIVE_HIGH>;
364                         rockchip,delay = <10>;
365                 };
366
367                      /*lcd_cs:lcd_cs {
368                                 rockchip,power_type = <GPIO>;
369                                 gpios = <&gpio3 GPIO_D6 GPIO_ACTIVE_HIGH>;
370                                 rockchip,delay = <10>;
371                         };
372
373                         lcd_rst:lcd_rst {
374                                 rockchip,power_type = <REGULATOR>;
375                                 rockchip,delay = <5>;
376                         };*/
377
378         };
379 };
380
381 &lcdc1 {
382         status = "okay";
383 };
384
385 &adc {
386         status = "okay";
387
388         key {
389                 compatible = "rockchip,key";
390                 io-channels = <&adc 1>;
391
392                 vol-up-key {
393                         linux,code = <115>;
394                         label = "volume up";
395                         rockchip,adc_value = <1>;
396                 };
397
398                 vol-down-key {
399                         linux,code = <114>;
400                         label = "volume down";
401                         rockchip,adc_value = <170>;
402                 };
403
404                 power-key {
405                         gpios = <&gpio0 GPIO_A4 GPIO_ACTIVE_LOW>;
406                         linux,code = <116>;
407                         label = "power";
408                         gpio-key,wakeup;
409                 };
410
411                 menu-key {
412                         linux,code = <139>;
413                         label = "menu";
414                         rockchip,adc_value = <355>;
415                 };
416
417                 home-key {
418                         linux,code = <102>;
419                         label = "home";
420                         rockchip,adc_value = <746>;
421                 };
422
423                 back-key {
424                         linux,code = <158>;
425                         label = "back";
426                         rockchip,adc_value = <560>;
427                 };
428
429                 camera-key {
430                         linux,code = <212>;
431                         label = "camera";
432                         rockchip,adc_value = <450>;
433                 };
434         };
435 };
436
437 &pwm3 {
438         status = "okay";
439 };
440
441 &pwm0 {
442         status = "disable";
443 };
444
445 &clk_core_dvfs_table {
446         operating-points = <
447                 /* KHz    uV */
448                 312000 1100000
449                 504000 1100000
450                 816000 1100000
451                 1008000 1100000
452                 1200000 1200000
453                 1416000 1300000
454                 1608000 1350000
455                 >;
456 };
457
458 &clk_gpu_dvfs_table {
459         operating-points = <
460                 /* KHz    uV */
461                 200000 1200000
462                 300000 1200000
463                 400000 1200000
464                 >;
465 };
466
467 &clk_ddr_dvfs_table {
468         operating-points = <
469                 /* KHz    uV */
470                 200000 1200000
471                 300000 1200000
472                 400000 1200000
473                 >;
474
475         freq_table = <
476                 /*status                freq(KHz)*/
477                 SYS_STATUS_NORMAL       400000
478                 SYS_STATUS_SUSPEND      200000
479                 SYS_STATUS_VIDEO        300000
480                 SYS_STATUS_DUALVIEW     500000
481                 >;
482 };
483
484 /include/ "act8846.dtsi"
485 &act8846 {
486         gpios =<&gpio3 GPIO_D3 GPIO_ACTIVE_LOW>;
487
488         regulators {
489                 
490                 dcdc1_reg: regulator@0{
491                         regulator-name= "act_dcdc1";
492                         regulator-min-microvolt = <1200000>;
493                         regulator-max-microvolt = <1200000>;
494                         regulator-always-on;
495                         regulator-boot-on;
496                 };
497
498                 dcdc2_reg: regulator@1 {
499                         regulator-name= "vdd_logic";
500                         regulator-always-on;
501                         regulator-boot-on;                      
502                 };
503
504                 dcdc3_reg: regulator@2 {
505                         regulator-name= "vdd_arm";
506                         regulator-always-on;
507                         regulator-boot-on;
508                 };
509
510                 dcdc4_reg: regulator@3 {
511                         regulator-name= "vccio";
512                         regulator-min-microvolt = <1800000>;
513                         regulator-max-microvolt = <3300000>;
514                         regulator-always-on;
515                         regulator-boot-on;
516                 };
517
518                 ldo1_reg: regulator@4 {
519                         regulator-name= "act_ldo1";
520                         regulator-min-microvolt = <1000000>;
521                         regulator-max-microvolt = <1000000>;
522                         regulator-always-on;
523                         regulator-boot-on;
524                 };
525
526                 ldo2_reg: regulator@5 {
527                         regulator-name= "act_ldo2";
528                         regulator-min-microvolt = <1200000>;
529                         regulator-max-microvolt = <1200000>;
530                         regulator-always-on;
531                         regulator-boot-on;
532                 };
533
534                 ldo3_reg: regulator@6 {
535                         regulator-name= "act_ldo3";
536                         regulator-min-microvolt = <1800000>;
537                         regulator-max-microvolt = <1800000>;
538                         regulator-always-on;
539                         regulator-boot-on;
540                 };
541
542                 ldo4_reg:regulator@7 {
543                         regulator-name= "act_ldo4";
544                         regulator-min-microvolt = <3300000>;
545                         regulator-max-microvolt = <3300000>;
546                         regulator-always-on;
547                         regulator-boot-on;
548                 };
549
550                 ldo5_reg: regulator@8 {
551                         regulator-name= "act_ldo5";
552                         regulator-min-microvolt = <3300000>;
553                         regulator-max-microvolt = <3300000>;
554                         regulator-always-on;
555                         regulator-boot-on;
556                 };
557
558                 ldo6_reg: regulator@9 {
559                         regulator-name= "act_ldo6";
560                         regulator-min-microvolt = <3300000>;
561                         regulator-max-microvolt = <3300000>;
562                         regulator-always-on;
563                         regulator-boot-on;
564                 };
565
566                 ldo7_reg: regulator@10 {
567                         regulator-name= "act_ldo7";
568                         regulator-min-microvolt = <1800000>;
569                         regulator-max-microvolt = <1800000>;
570                         regulator-always-on;
571                         regulator-boot-on;
572                 };
573
574                 ldo8_reg: regulator@11 {
575                         regulator-name= "act_ldo8";
576                         regulator-min-microvolt = <2800000>;
577                         regulator-max-microvolt = <2800000>;
578                         regulator-always-on;
579                         regulator-boot-on;
580                 };
581         };
582 };
583
584 /include/ "rk808.dtsi"
585 &rk808 {
586         gpios =<&gpio0 GPIO_B3 GPIO_ACTIVE_HIGH>,<&gpio0 GPIO_A1 GPIO_ACTIVE_LOW>;
587
588         regulators {
589                 
590                 rk808_dcdc1_reg: regulator@0{
591                         regulator-name= "vdd_arm";      
592                         regulator-always-on;
593                         regulator-boot-on;
594                 };
595
596                 rk808_dcdc2_reg: regulator@1 {
597                         regulator-name= "vdd_logic";
598                         regulator-always-on;
599                         regulator-boot-on;              
600                 };
601
602                 rk808_dcdc3_reg: regulator@2 {
603                         regulator-name= "rk_dcdc3";
604                         regulator-min-microvolt = <1200000>;
605                         regulator-max-microvolt = <1200000>;
606                         regulator-always-on;
607                         regulator-boot-on;
608                 };
609
610                 rk808_dcdc4_reg: regulator@3 {
611                         regulator-name= "vccio";
612                         regulator-min-microvolt = <1800000>;
613                         regulator-max-microvolt = <3300000>;
614                         regulator-always-on;
615                         regulator-boot-on;
616                 };
617
618                 rk808_ldo1_reg: regulator@4 {
619                         regulator-name= "rk_ldo1";
620                         regulator-min-microvolt = <3300000>;
621                         regulator-max-microvolt = <3300000>;
622                         regulator-always-on;
623                         regulator-boot-on;
624                 };
625
626                 rk808_ldo2_reg: regulator@5 {
627                         regulator-name= "rk_ldo2";
628                         regulator-min-microvolt = <3300000>;
629                         regulator-max-microvolt = <3300000>;
630                         regulator-always-on;
631                         regulator-boot-on;
632                 };
633
634                 rk808_ldo3_reg: regulator@6 {
635                         regulator-name= "rk_ldo3";
636                         regulator-min-microvolt = <1000000>;
637                         regulator-max-microvolt = <1000000>;
638                         regulator-always-on;
639                         regulator-boot-on;
640                 };
641
642                 rk808_ldo4_reg:regulator@7 {
643                         regulator-name= "rk_ldo4";
644                         regulator-min-microvolt = <1800000>;
645                         regulator-max-microvolt = <1800000>;
646                         regulator-always-on;
647                         regulator-boot-on;
648                 };
649
650                 rk808_ldo5_reg: regulator@8 {
651                         regulator-name= "rk_ldo5";
652                         regulator-min-microvolt = <2800000>;
653                         regulator-max-microvolt = <2800000>;
654                         regulator-always-on;
655                         regulator-boot-on;
656                 };
657
658                 rk808_ldo6_reg: regulator@9 {
659                         regulator-name= "rk_ldo6";
660                         regulator-min-microvolt = <1200000>;
661                         regulator-max-microvolt = <1200000>;
662                         regulator-always-on;
663                         regulator-boot-on;
664                 };
665
666                 rk808_ldo7_reg: regulator@10 {
667                         regulator-name= "rk_ldo7";
668                         regulator-min-microvolt = <1800000>;
669                         regulator-max-microvolt = <1800000>;
670                         regulator-always-on;
671                         regulator-boot-on;
672                 };
673
674                 rk808_ldo8_reg: regulator@11 {
675                         regulator-name= "rk_ldo8";
676                         regulator-min-microvolt = <1800000>;
677                         regulator-max-microvolt = <1800000>;
678                         regulator-always-on;
679                         regulator-boot-on;
680                 };
681         };
682 };
683
684 &ap0_vcc_domain{
685         regulator-name= "vccio_wl";     
686 };
687 &ap1_vcc_domain{
688         regulator-name= "vccio";        
689 };
690 &cif_vcc_domain{
691         regulator-name= "vcc18_cif";    
692 };
693 &flash_vcc_domain{
694         regulator-name= "vcc_flash";    
695 };
696 &vccio0_vcc_domain{
697         regulator-name= "vccio";        
698 };
699 &vccio1_vcc_domain{
700         regulator-name= "vccio";        
701 };
702 &lcdc0_vcc_domain{
703         regulator-name= "vcc_lcd";      
704 };
705 &lcdc1_vcc_domain{
706         regulator-name= "vccio";        
707 };