137058d921a6ca128dd26f9ae6f1791163e70de5
[firefly-linux-kernel-4.4.55.git] / arch / arm / boot / dts / rk3288-tb.dts
1 /dts-v1/;
2
3 #include "rk3288.dtsi"
4 #include "lcd-b101ew05.dtsi"
5
6 / {
7         fiq-debugger {
8                 status = "okay";
9         };
10
11     wireless-wlan {
12         compatible = "wlan-platdata";
13
14         wifi_chip_type = "";
15         sdio_vref = <28000>;
16
17         //power_ctrl_by_pmu;
18         pmu_regulator = "act_ldo3";
19         pmu_enable_level = <1>; //1->HIGH, 0->LOW
20
21         WIFI,poweren_gpio = <&gpio4 GPIO_D4 GPIO_ACTIVE_HIGH>;
22         WIFI,host_wake_irq = <&gpio4 GPIO_D6 GPIO_ACTIVE_HIGH>;
23         //WIFI,reset_gpio = <&gpio0 GPIO_A2 GPIO_ACTIVE_LOW>;
24
25         status = "okay";
26     };
27
28     wireless-bluetooth {
29         compatible = "bluetooth-platdata";
30
31         uart_rts_gpios = <&gpio4 GPIO_C3 GPIO_ACTIVE_LOW>;
32         pinctrl-names = "default","rts_gpio";
33         pinctrl-0 = <&uart0_rts>;
34         pinctrl-1 = <&uart0_rts_gpio>;
35
36         BT,power_gpio = <&gpio4 GPIO_D3 GPIO_ACTIVE_HIGH>;
37         BT,reset_gpio = <&gpio4 GPIO_D5 GPIO_ACTIVE_HIGH>;
38         BT,wake_gpio = <&gpio4 GPIO_D2 GPIO_ACTIVE_HIGH>;
39         BT,wake_host_irq = <&gpio4 GPIO_D7 GPIO_ACTIVE_LOW>;
40
41         status = "okay";
42     };
43
44     hallsensor {
45                compatible = "hall_och165t";
46                type = <SENSOR_TYPE_HALL>;
47                irq-gpio = <&gpio0 GPIO_A6 IRQ_TYPE_EDGE_BOTH>;
48      };
49
50         backlight {
51                 compatible = "pwm-backlight";
52                 pwms = <&pwm0 0 25000>;
53                 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>;
54                 default-brightness-level = <128>;
55                 enable-gpios = <&gpio7 GPIO_A2 GPIO_ACTIVE_HIGH>;
56                 brightness_invert = <0>;
57         };
58
59         pwm_regulator {
60                 compatible = "rockchip_pwm_regulator";
61                 pwms = <&pwm1 0 25000>;
62                 rockchip,pwm_id= <1>;
63                 rockchip,pwm_voltage_map= <925000 950000 975000 1000000 1025000 1050000 1075000 1100000 1125000 1150000 1175000 1200000 1225000 1250000 1275000 1300000 1325000 1350000 1375000 1400000>;
64                 rockchip,pwm_voltage= <1000000>;
65                 rockchip,pwm_min_voltage= <925000>;
66                 rockchip,pwm_max_voltage= <1400000>;
67                 rockchip,pwm_suspend_voltage= <950000>;
68                 rockchip,pwm_coefficient= <475>;
69                 regulators {
70                         #address-cells = <1>;
71                         #size-cells = <0>;
72                         pwm_reg0: regulator@0 {
73                                 regulator-compatible = "pwm_dcdc1";
74                                 regulator-name= "vdd_logic";
75                                 regulator-min-microvolt = <925000>;
76                                 regulator-max-microvolt = <1400000>;
77                                 regulator-always-on;
78                                 regulator-boot-on;
79                         };
80                 };
81         };
82
83         codec_hdmi_i2s: codec-hdmi-i2s {
84                 compatible = "hdmi-i2s";
85         };
86
87         codec_hdmi_spdif: codec-hdmi-spdif {
88                 compatible = "hdmi-spdif";
89         };
90
91         rockchip-hdmi-i2s {
92                 compatible = "rockchip-hdmi-i2s";
93                 dais {
94                         dai0 {
95                                 audio-codec = <&codec_hdmi_i2s>;
96                                 i2s-controller = <&i2s>;
97                                 format = "i2s";
98                                 //continuous-clock;
99                                 //bitclock-inversion;
100                                 //frame-inversion;
101                                 //bitclock-master;
102                                 //frame-master;
103                         };
104                 };
105         };
106         
107         rockchip-hdmi-spdif {
108                 compatible = "rockchip-hdmi-spdif";
109                 dais {
110                         dai0 {
111                                 audio-codec = <&codec_hdmi_spdif>;
112                                 i2s-controller = <&spdif>;
113                                 format = "spdif";
114                                 //continuous-clock;
115                                 //bitclock-inversion;
116                                 //frame-inversion;
117                                 //bitclock-master;
118                                 //frame-master;
119                         };
120                 };              
121         };
122
123         rockchip-rt5631 {
124                 compatible = "rockchip-rt5631";
125                 dais {
126                         dai0 {
127                                 audio-codec = <&rt5631>;
128                                 i2s-controller = <&i2s>;
129                                 format = "i2s";
130                                 //continuous-clock;
131                                 //bitclock-inversion;
132                                 //frame-inversion;
133                                 //bitclock-master;
134                                 //frame-master;
135                         };
136                 };
137         };
138
139         rockchip-rt3224 {
140                 compatible = "rockchip-rt3261";
141                 dais {
142                         dai0 {
143                                 audio-codec = <&rt3261>;
144                                 i2s-controller = <&i2s>;
145                                 format = "i2s";
146                                 //continuous-clock;
147                                 //bitclock-inversion;
148                                 //frame-inversion;
149                                 //bitclock-master;
150                                 //frame-master;
151                         };
152                         dai1 {
153                                 audio-codec = <&rt3261>;
154                                 i2s-controller = <&i2s>;
155                                 format = "i2s";
156                                 //continuous-clock;
157                                 //bitclock-inversion;
158                                 //frame-inversion;
159                                 //bitclock-master;
160                                 //frame-master;
161                         };
162                 };
163         };
164
165 };
166
167 &pinctrl {
168
169         gpio7_gpio {
170                         gpio7_b7: gpio7-b7 {
171                                 rockchip,pins = <GPIO7_B7>;
172                                 rockchip,pull = <VALUE_PULL_UP>;
173                         };
174
175                         //to add
176                 };
177
178         //could add other pinctrl definition such as gpio
179
180 };
181
182 &emmc {
183         clock-frequency = <50000000>;
184         clock-freq-min-max = <400000 50000000>;
185
186         supports-highspeed;
187         supports-emmc;
188         bootpart-no-access;
189         
190         status = "okay";
191 };
192     
193 &sdmmc {
194         clock-frequency = <50000000>;
195         lock-freq-min-max = <400000 50000000>;              
196             
197         supports-highspeed;
198         supports-sd;
199         broken-cd;
200         card-detect-delay = <200>;
201
202         
203         vmmc-supply = <&rk808_ldo5_reg>;
204         status = "disabled";
205 };
206                 
207 &sdio {
208         clock-frequency = <50000000>;
209         clock-freq-min-max = <200000 50000000>;
210                 
211         supports-highspeed;             
212         supports-sdio;
213         //cap-sdio-irq;
214
215         status = "okay";
216 };
217
218 &spi0 {
219         status = "okay";
220         max-freq = <48000000>;  
221         /*
222         spi_test@00 {
223                 compatible = "rockchip,spi_test_bus0_cs0";
224                 reg = <0>;
225                 spi-max-frequency = <24000000>;
226                 poll_mode = <0>;
227                 type = <0>;
228                 enable_dma = <0>;
229
230         };
231
232         spi_test@01 {
233                 compatible = "rockchip,spi_test_bus0_cs1";
234                 reg = <1>;
235                 spi-max-frequency = <24000000>;
236                 poll_mode = <0>;
237                 type = <0>;
238                 enable_dma = <0>;               
239         };
240         */
241 };
242
243 &spi1 {
244         status = "okay";
245         max-freq = <48000000>;
246         /*
247         spi_test@10 {
248                 compatible = "rockchip,spi_test_bus1_cs0";
249                 reg = <0>;
250                 spi-max-frequency = <24000000>;
251                 poll_mode = <0>;
252                 type = <0>;
253                 enable_dma = <0>;
254         };
255
256         spi_test@11 {
257                 compatible = "rockchip,spi_test_bus1_cs1";
258                 reg = <1>;
259                 spi-max-frequency = <24000000>;
260                 poll_mode = <0>;
261                 type = <0>;
262                 enable_dma = <0>;
263         };
264         */
265 };
266
267 &spi2 {
268         status = "okay";
269         max-freq = <48000000>;
270         /*
271         spi_test@20 {
272                 compatible = "rockchip,spi_test_bus2_cs0";
273                 reg = <0>;
274                 spi-max-frequency = <24000000>;
275                 poll_mode = <0>;
276                 type = <0>;
277                 enable_dma = <0>;
278         };
279
280         spi_test@21 {
281                 compatible = "rockchip,spi_test_bus2_cs1";
282                 reg = <1>;
283                 spi-max-frequency = <24000000>;
284                 poll_mode = <0>;
285                 type = <0>;
286                 enable_dma = <0>;
287         };
288         */
289 };
290
291 &i2c0 {
292         status = "okay";
293         rk808: rk808@1b {
294                 reg = <0x1b>;
295                 status = "okay";
296         };
297         
298         bq24296: bq24296@6b {
299                 compatible = "ti,bq24296";
300                 reg = <0x6b>;
301                 gpios = <&gpio0 GPIO_A7 GPIO_ACTIVE_HIGH>,<&gpio0 GPIO_B0 GPIO_ACTIVE_HIGH>;
302                 bq24296,chg_current = <1000 2000 3000>;
303                 status = "okay";
304         };
305         bq27320: bq27320@55 {
306                 compatible = "ti,bq27320";
307                 reg = <0x55>;
308         /*   gpios = <&gpio0 GPIO_A7 GPIO_ACTIVE_HIGH>; */
309                 status = "okay";
310         };
311
312         CW2015@62 {
313                 compatible = "cw201x";
314                 reg = <0x62>;
315                 dc_det_gpio = <&gpio0 GPIO_B0 GPIO_ACTIVE_LOW>;
316                 bat_low_gpio = <&gpio0 GPIO_A7 GPIO_ACTIVE_LOW>;
317                 chg_ok_gpio = <&gpio0 GPIO_B1 GPIO_ACTIVE_HIGH>;
318                 bat_config_info = <0x15 0x42 0x60 0x59 0x52 0x58 0x4D 0x48 0x48 0x44 0x44 0x46 0x49 0x48 0x32
319                         0x24 0x20 0x17 0x13 0x0F 0x19 0x3E 0x51 0x45 0x08 0x76 0x0B 0x85 0x0E 0x1C 0x2E 0x3E 0x4D 0x52 0x52
320                         0x57 0x3D 0x1B 0x6A 0x2D 0x25 0x43 0x52 0x87 0x8F 0x91 0x94 0x52 0x82 0x8C 0x92 0x96 0xFF 0x7B 0xBB
321                         0xCB 0x2F 0x7D 0x72 0xA5 0xB5 0xC1 0x46 0xAE>;
322                 is_dc_charge = <1>;
323                 is_usb_charge = <0>;
324         };
325 };
326
327 &i2c1 {
328         status = "okay";
329         rtc@51 {
330                 compatible = "nxp,pcf8563";
331                 reg = <0x51>;
332         };
333         
334         sensor@1d {
335                 compatible = "gs_mma8452";
336                 reg = <0x1d>;
337                 type = <SENSOR_TYPE_ACCEL>;
338                 irq-gpio = <&gpio8 GPIO_A0 IRQ_TYPE_EDGE_FALLING>;
339                 irq_enable = <1>;
340                 poll_delay_ms = <30>;
341                 layout = <1>;
342         };
343                 sensor@19 {
344                 compatible = "gs_lis3dh";
345                 reg = <0x19>;
346                 type = <SENSOR_TYPE_ACCEL>;
347                 irq-gpio = <&gpio0 GPIO_A0 IRQ_TYPE_LEVEL_LOW>;
348                 irq_enable = <1>;
349                 poll_delay_ms = <30>;
350                 layout = <1>;
351         };
352                 sensor@0d {
353                 compatible = "ak8963";
354                 reg = <0x0d>;
355                 type = <SENSOR_TYPE_COMPASS>;
356                 irq-gpio = <&gpio8 GPIO_A2 IRQ_TYPE_EDGE_RISING>;
357                 irq_enable = <1>;
358                 poll_delay_ms = <30>;
359                 layout = <1>;
360         };
361
362                 sensor@6b {
363                 compatible = "l3g20d_gyro";
364                 reg = <0x6b>;
365                 type = <SENSOR_TYPE_GYROSCOPE>;
366                 irq-gpio = <&gpio8 GPIO_A3 IRQ_TYPE_LEVEL_LOW>;
367                 irq_enable = <1>;
368                 poll_delay_ms = <30>;
369                 layout = <1>;
370         };
371         sensor@10 {
372               compatible = "ls_cm3218";
373               reg = <0x10>;
374               type = <SENSOR_TYPE_LIGHT>;
375               irq-gpio = <&gpio8 GPIO_A3 IRQ_TYPE_EDGE_FALLING>;              
376               irq_enable = <1>;
377               poll_delay_ms = <30>;
378               layout = <1>;
379        };
380         
381 };
382
383 &i2c2 {
384         status = "okay";
385         rt5631: rt5631@1a {
386                 compatible = "rt5631";
387                 reg = <0x1a>;
388         };
389         es8323: es8323@10 {
390                 compatible = "es8323";
391                 reg = <0x10>;
392         };
393         rt3261: rt3261@1c {
394                 compatible = "rt3261";
395                 reg = <0x1c>;
396         //      codec-en-gpio = <0>;//sdk default high level
397                 spk-num= <2>;
398                 modem-input-mode = <1>;
399                 lout-to-modem_mode = <1>;
400                 spk-amplify = <2>;
401                 playback-if1-data_control = <0>;
402                 playback-if2-data_control = <0>;
403         };
404         rt5616: rt5616@1b {
405                 compatible = "rt5616";
406                 reg = <0x1b>;
407         };
408 };
409
410 &i2c3 {
411         status = "okay";
412 };
413
414 &i2c4 {
415         status = "okay";
416         ts@55 {
417                 compatible = "goodix,gt8xx";
418                 reg = <0x55>;
419                 touch-gpio = <&gpio7 GPIO_A6 IRQ_TYPE_LEVEL_LOW>;
420                 reset-gpio = <&gpio7 GPIO_A5 GPIO_ACTIVE_LOW>;
421                 //power-gpio = <&gpio0 GPIO_C5 GPIO_ACTIVE_LOW>;
422                 max-x = <1280>;
423                 max-y = <800>;
424         };
425         
426         ts@01 {
427                 compatible = "ct,ct36x";
428                 reg = <0x01>;
429                 ct-model = <365>;
430                 touch-gpio = <&gpio7 GPIO_A6 IRQ_TYPE_LEVEL_LOW>;
431                 reset-gpio = <&gpio7 GPIO_A5 GPIO_ACTIVE_HIGH>;
432                 max-x = <1280>;
433                 max-y = <800>;
434                 orientation=<1 0 0 1>;
435         };
436 };
437
438 &i2c5 {
439         status = "disable";
440 };
441
442 &fb {
443         rockchip,disp-mode = <DUAL>;
444 };
445
446 &rk_screen {
447          display-timings = <&disp_timings>;
448 };
449
450 /*lcdc1 as PRMRY(LCD),lcdc0 as EXTEND(HDMI)*/
451 &lcdc1 {
452         status = "okay";
453         power_ctr: power_ctr {
454                 rockchip,debug = <0>;
455                 rockchip,mirror = <NO_MIRROR>;
456                 lcd_en:lcd_en {
457                         rockchip,power_type = <GPIO>;
458                         gpios = <&gpio7 GPIO_A3 GPIO_ACTIVE_HIGH>;
459                         rockchip,delay = <10>;
460                 };
461                 
462                 lcd_cs:lcd_cs {
463 rockchip,power_type = <GPIO>;
464                         gpios = <&gpio7 GPIO_A4 GPIO_ACTIVE_HIGH>;
465                         rockchip,delay = <10>;
466                 };
467
468                 /*lcd_rst:lcd_rst {
469                         rockchip,power_type = <GPIO>;
470                         gpios = <&gpio3 GPIO_D6 GPIO_ACTIVE_HIGH>;
471                         rockchip,delay = <5>;
472                 };*/
473
474         };
475 };
476
477 &lcdc0 {
478         status = "okay";
479 };
480
481 &hdmi {
482         status = "okay";
483         rockchips,hdmi_audio_source = <0>;
484 };
485
486 &adc {
487         status = "okay";
488
489         key {
490                 compatible = "rockchip,key";
491                 io-channels = <&adc 1>;
492
493                 vol-up-key {
494                         linux,code = <115>;
495                         label = "volume up";
496                         rockchip,adc_value = <1>;
497                 };
498
499                 vol-down-key {
500                         linux,code = <114>;
501                         label = "volume down";
502                         rockchip,adc_value = <170>;
503                 };
504
505                 power-key {
506                         gpios = <&gpio0 GPIO_A5 GPIO_ACTIVE_LOW>;
507                         linux,code = <116>;
508                         label = "power";
509                         gpio-key,wakeup;
510                 };
511
512                 menu-key {
513                         linux,code = <139>;
514                         label = "menu";
515                         rockchip,adc_value = <355>;
516                 };
517
518                 home-key {
519                         linux,code = <102>;
520                         label = "home";
521                         rockchip,adc_value = <746>;
522                 };
523
524                 back-key {
525                         linux,code = <158>;
526                         label = "back";
527                         rockchip,adc_value = <560>;
528                 };
529
530                 camera-key {
531                         linux,code = <212>;
532                         label = "camera";
533                         rockchip,adc_value = <450>;
534                 };
535         };
536 };
537
538 &pwm0 {
539         status = "okay";
540 };
541
542 &pwm1 {
543         status = "okay";
544 };
545
546
547 &clk_core_dvfs_table {
548         operating-points = <
549                 /* KHz    uV */
550                 312000 1100000
551                 504000 1100000
552                 816000 1100000
553                 1008000 1100000
554                 >;
555 };
556
557 &clk_gpu_dvfs_table {
558         operating-points = <
559                 /* KHz    uV */
560                 200000 1200000
561                 300000 1200000
562                 400000 1200000
563                 600000 1300000
564                 >;
565 };
566
567 &clk_ddr_dvfs_table {
568         operating-points = <
569                 /* KHz    uV */
570                 200000 1200000
571                 300000 1200000
572                 400000 1200000
573                 >;
574
575         freq_table = <
576                 /*status                freq(KHz)*/
577                 SYS_STATUS_NORMAL       400000
578                 SYS_STATUS_SUSPEND      200000
579                 SYS_STATUS_VIDEO        300000
580                 SYS_STATUS_DUALVIEW     500000
581                 >;
582 };
583
584 /include/ "rk808.dtsi"
585 &rk808 {
586         gpios =<&gpio0 GPIO_A4 GPIO_ACTIVE_HIGH>,<&gpio0 GPIO_B3 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_gpu";
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 = <3300000>;
653                         regulator-max-microvolt = <3300000>;
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 = <1000000>;
661                         regulator-max-microvolt = <1000000>;
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 = <3300000>;
677                         regulator-max-microvolt = <3300000>;
678                         regulator-always-on;
679                         regulator-boot-on;
680                 };
681         };
682 };