109e24170a404ccf4c03a968143a4151d2c4c51c
[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 = <1800>; //1800mv or 3300mv
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         };
57
58         pwm_regulator {
59                 compatible = "rockchip_pwm_regulator";
60                 pwms = <&pwm1 0 25000>;
61                 rockchip,pwm_id= <1>;
62                 rockchip,pwm_voltage_map= <925000 950000 975000 1000000 1025000 1050000 1075000 1100000 1125000 1150000 1175000 1200000 1225000 1250000 1275000 1300000 1325000 1350000 1375000 1400000>;
63                 rockchip,pwm_voltage= <1000000>;
64                 rockchip,pwm_min_voltage= <925000>;
65                 rockchip,pwm_max_voltage= <1400000>;
66                 rockchip,pwm_suspend_voltage= <950000>;
67                 rockchip,pwm_coefficient= <475>;
68                 regulators {
69                         #address-cells = <1>;
70                         #size-cells = <0>;
71                         pwm_reg0: regulator@0 {
72                                 regulator-compatible = "pwm_dcdc1";
73                                 regulator-name= "vdd_logic";
74                                 regulator-min-microvolt = <925000>;
75                                 regulator-max-microvolt = <1400000>;
76                                 regulator-always-on;
77                                 regulator-boot-on;
78                         };
79                 };
80         };
81
82         codec_hdmi_i2s: codec-hdmi-i2s {
83                 compatible = "hdmi-i2s";
84         };
85
86         codec_hdmi_spdif: codec-hdmi-spdif {
87                 compatible = "hdmi-spdif";
88         };
89
90         rockchip-hdmi-i2s {
91                 compatible = "rockchip-hdmi-i2s";
92                 dais {
93                         dai0 {
94                                 audio-codec = <&codec_hdmi_i2s>;
95                                 i2s-controller = <&i2s>;
96                                 format = "i2s";
97                                 //continuous-clock;
98                                 //bitclock-inversion;
99                                 //frame-inversion;
100                                 //bitclock-master;
101                                 //frame-master;
102                         };
103                 };
104         };
105         
106         rockchip-hdmi-spdif {
107                 compatible = "rockchip-hdmi-spdif";
108                 dais {
109                         dai0 {
110                                 audio-codec = <&codec_hdmi_spdif>;
111                                 i2s-controller = <&spdif>;
112                                 format = "spdif";
113                                 //continuous-clock;
114                                 //bitclock-inversion;
115                                 //frame-inversion;
116                                 //bitclock-master;
117                                 //frame-master;
118                         };
119                 };              
120         };
121
122         rockchip-rt5631 {
123                 compatible = "rockchip-rt5631";
124                 dais {
125                         dai0 {
126                                 audio-codec = <&rt5631>;
127                                 i2s-controller = <&i2s>;
128                                 format = "i2s";
129                                 //continuous-clock;
130                                 //bitclock-inversion;
131                                 //frame-inversion;
132                                 //bitclock-master;
133                                 //frame-master;
134                         };
135                 };
136         };
137
138         rockchip-rt3224 {
139                 compatible = "rockchip-rt3261";
140                 dais {
141                         dai0 {
142                                 audio-codec = <&rt3261>;
143                                 i2s-controller = <&i2s>;
144                                 format = "i2s";
145                                 //continuous-clock;
146                                 //bitclock-inversion;
147                                 //frame-inversion;
148                                 //bitclock-master;
149                                 //frame-master;
150                         };
151                         dai1 {
152                                 audio-codec = <&rt3261>;
153                                 i2s-controller = <&i2s>;
154                                 format = "i2s";
155                                 //continuous-clock;
156                                 //bitclock-inversion;
157                                 //frame-inversion;
158                                 //bitclock-master;
159                                 //frame-master;
160                         };
161                 };
162         };
163 };
164
165 &gmac {
166 //      power_ctl_by = "gpio";  //"gpio" "pmu"
167         power-gpio = <&gpio0 GPIO_A6 GPIO_ACTIVE_HIGH>;
168 //      power-pmu = "act_ldo"
169         reset-gpio = <&gpio4 GPIO_A7 GPIO_ACTIVE_HIGH>;
170 };
171
172 &pinctrl {
173
174         gpio7_gpio {
175                         gpio7_b7: gpio7-b7 {
176                                 rockchip,pins = <GPIO7_B7>;
177                                 rockchip,pull = <VALUE_PULL_UP>;
178                         };
179
180                         //to add
181                 };
182
183         //could add other pinctrl definition such as gpio
184
185 };
186
187 &emmc {
188         clock-frequency = <200000000>;
189         clock-freq-min-max = <400000 200000000>;
190
191         supports-highspeed;
192         supports-emmc;
193         bootpart-no-access;
194         
195         status = "okay";
196 };
197     
198 &sdmmc {
199         clock-frequency = <50000000>;
200         lock-freq-min-max = <400000 50000000>;              
201             
202         supports-highspeed;
203         supports-sd;
204         broken-cd;
205         card-detect-delay = <200>;
206
207         
208         vmmc-supply = <&rk808_ldo5_reg>;
209         status = "okay";
210 };
211                 
212 &sdio {
213         clock-frequency = <50000000>;
214         clock-freq-min-max = <200000 50000000>;
215                 
216         supports-highspeed;             
217         supports-sdio;
218         //cap-sdio-irq;
219
220         status = "okay";
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 &spi2 {
273         status = "okay";
274         max-freq = <48000000>;
275         /*
276         spi_test@20 {
277                 compatible = "rockchip,spi_test_bus2_cs0";
278                 reg = <0>;
279                 spi-max-frequency = <24000000>;
280                 poll_mode = <0>;
281                 type = <0>;
282                 enable_dma = <0>;
283         };
284
285         spi_test@21 {
286                 compatible = "rockchip,spi_test_bus2_cs1";
287                 reg = <1>;
288                 spi-max-frequency = <24000000>;
289                 poll_mode = <0>;
290                 type = <0>;
291                 enable_dma = <0>;
292         };
293         */
294 };
295
296 &uart_bt {
297         status = "okay";
298         dma-names = "!tx", "!rx";
299         pinctrl-0 = <&uart0_xfer &uart0_cts>;
300 };
301
302 &i2c0 {
303         status = "okay";
304         rk808: rk808@1b {
305                 reg = <0x1b>;
306                 status = "okay";
307         };
308         
309         bq24296: bq24296@6b {
310                 compatible = "ti,bq24296";
311                 reg = <0x6b>;
312                 gpios = <&gpio0 GPIO_A7 GPIO_ACTIVE_HIGH>,<&gpio0 GPIO_B0 GPIO_ACTIVE_HIGH>;
313                 bq24296,chg_current = <1000 2000 3000>;
314                 status = "okay";
315         };
316         bq27320: bq27320@55 {
317                 compatible = "ti,bq27320";
318                 reg = <0x55>;
319         /*   gpios = <&gpio0 GPIO_A7 GPIO_ACTIVE_HIGH>; */
320                 status = "okay";
321         };
322
323         CW2015@62 {
324                 compatible = "cw201x";
325                 reg = <0x62>;
326                 dc_det_gpio = <&gpio0 GPIO_B0 GPIO_ACTIVE_LOW>;
327                 bat_low_gpio = <&gpio0 GPIO_A7 GPIO_ACTIVE_LOW>;
328                 chg_ok_gpio = <&gpio0 GPIO_B1 GPIO_ACTIVE_HIGH>;
329                 bat_config_info = <0x15 0x42 0x60 0x59 0x52 0x58 0x4D 0x48 0x48 0x44 0x44 0x46 0x49 0x48 0x32
330                         0x24 0x20 0x17 0x13 0x0F 0x19 0x3E 0x51 0x45 0x08 0x76 0x0B 0x85 0x0E 0x1C 0x2E 0x3E 0x4D 0x52 0x52
331                         0x57 0x3D 0x1B 0x6A 0x2D 0x25 0x43 0x52 0x87 0x8F 0x91 0x94 0x52 0x82 0x8C 0x92 0x96 0xFF 0x7B 0xBB
332                         0xCB 0x2F 0x7D 0x72 0xA5 0xB5 0xC1 0x46 0xAE>;
333                 is_dc_charge = <1>;
334                 is_usb_charge = <0>;
335         };
336 };
337
338 &i2c1 {
339         status = "okay";
340         rtc@51 {
341                 compatible = "nxp,pcf8563";
342                 reg = <0x51>;
343         };
344         
345         sensor@1d {
346                 compatible = "gs_mma8452";
347                 reg = <0x1d>;
348                 type = <SENSOR_TYPE_ACCEL>;
349                 irq-gpio = <&gpio8 GPIO_A0 IRQ_TYPE_EDGE_FALLING>;
350                 irq_enable = <1>;
351                 poll_delay_ms = <30>;
352                 layout = <1>;
353         };
354                 sensor@19 {
355                 compatible = "gs_lis3dh";
356                 reg = <0x19>;
357                 type = <SENSOR_TYPE_ACCEL>;
358                 irq-gpio = <&gpio0 GPIO_A0 IRQ_TYPE_LEVEL_LOW>;
359                 irq_enable = <1>;
360                 poll_delay_ms = <30>;
361                 layout = <1>;
362         };
363                 sensor@0d {
364                 compatible = "ak8963";
365                 reg = <0x0d>;
366                 type = <SENSOR_TYPE_COMPASS>;
367                 irq-gpio = <&gpio8 GPIO_A2 IRQ_TYPE_EDGE_RISING>;
368                 irq_enable = <1>;
369                 poll_delay_ms = <30>;
370                 layout = <1>;
371         };
372
373                 sensor@6b {
374                 compatible = "l3g20d_gyro";
375                 reg = <0x6b>;
376                 type = <SENSOR_TYPE_GYROSCOPE>;
377                 irq-gpio = <&gpio8 GPIO_A3 IRQ_TYPE_LEVEL_LOW>;
378                 irq_enable = <1>;
379                 poll_delay_ms = <30>;
380                 layout = <1>;
381         };
382         sensor@10 {
383               compatible = "ls_cm3218";
384               reg = <0x10>;
385               type = <SENSOR_TYPE_LIGHT>;
386               irq-gpio = <&gpio8 GPIO_A3 IRQ_TYPE_EDGE_FALLING>;              
387               irq_enable = <1>;
388               poll_delay_ms = <30>;
389               layout = <1>;
390        };
391         
392 };
393
394 &i2c2 {
395         status = "okay";
396         rt5631: rt5631@1a {
397                 compatible = "rt5631";
398                 reg = <0x1a>;
399         };
400         es8323: es8323@10 {
401                 compatible = "es8323";
402                 reg = <0x10>;
403         };
404         rt3261: rt3261@1c {
405                 compatible = "rt3261";
406                 reg = <0x1c>;
407         //      codec-en-gpio = <0>;//sdk default high level
408                 spk-num= <2>;
409                 modem-input-mode = <1>;
410                 lout-to-modem_mode = <1>;
411                 spk-amplify = <2>;
412                 playback-if1-data_control = <0>;
413                 playback-if2-data_control = <0>;
414         };
415         rt5616: rt5616@1b {
416                 compatible = "rt5616";
417                 reg = <0x1b>;
418         };
419 };
420
421 &i2c3 {
422         status = "okay";
423 };
424
425 &i2c4 {
426         status = "okay";
427         ts@55 {
428                 compatible = "goodix,gt8xx";
429                 reg = <0x55>;
430                 touch-gpio = <&gpio7 GPIO_A6 IRQ_TYPE_LEVEL_LOW>;
431                 reset-gpio = <&gpio7 GPIO_A5 GPIO_ACTIVE_LOW>;
432                 //power-gpio = <&gpio0 GPIO_C5 GPIO_ACTIVE_LOW>;
433                 max-x = <1280>;
434                 max-y = <800>;
435         };
436         
437         ts@01 {
438                 compatible = "ct,ct36x";
439                 reg = <0x01>;
440                 ct-model = <365>;
441                 touch-gpio = <&gpio7 GPIO_A6 IRQ_TYPE_LEVEL_LOW>;
442                 reset-gpio = <&gpio7 GPIO_A5 GPIO_ACTIVE_HIGH>;
443                 max-x = <1280>;
444                 max-y = <800>;
445                 orientation=<1 0 0 1>;
446         };
447 };
448
449 &i2c5 {
450         status = "disable";
451 };
452
453 &fb {
454         rockchip,disp-mode = <DUAL>;
455 };
456
457 &rk_screen {
458          display-timings = <&disp_timings>;
459 };
460
461 /*lcdc1 as PRMRY(LCD),lcdc0 as EXTEND(HDMI)*/
462 &lcdc1 {
463         status = "okay";
464         power_ctr: power_ctr {
465                 rockchip,debug = <0>;
466                 rockchip,mirror = <NO_MIRROR>;
467                 lcd_en:lcd_en {
468                         rockchip,power_type = <GPIO>;
469                         gpios = <&gpio7 GPIO_A3 GPIO_ACTIVE_HIGH>;
470                         rockchip,delay = <10>;
471                 };
472                 
473                 lcd_cs:lcd_cs {
474 rockchip,power_type = <GPIO>;
475                         gpios = <&gpio7 GPIO_A4 GPIO_ACTIVE_HIGH>;
476                         rockchip,delay = <10>;
477                 };
478
479                 /*lcd_rst:lcd_rst {
480                         rockchip,power_type = <GPIO>;
481                         gpios = <&gpio3 GPIO_D6 GPIO_ACTIVE_HIGH>;
482                         rockchip,delay = <5>;
483                 };*/
484
485         };
486 };
487
488 &lcdc0 {
489         status = "okay";
490 };
491
492 &hdmi {
493         status = "okay";
494         rockchips,hdmi_audio_source = <0>;
495 };
496
497 &adc {
498         status = "okay";
499
500         key {
501                 compatible = "rockchip,key";
502                 io-channels = <&adc 1>;
503
504                 vol-up-key {
505                         linux,code = <115>;
506                         label = "volume up";
507                         rockchip,adc_value = <1>;
508                 };
509
510                 vol-down-key {
511                         linux,code = <114>;
512                         label = "volume down";
513                         rockchip,adc_value = <170>;
514                 };
515
516                 power-key {
517                         gpios = <&gpio0 GPIO_A5 GPIO_ACTIVE_LOW>;
518                         linux,code = <116>;
519                         label = "power";
520                         gpio-key,wakeup;
521                 };
522
523                 menu-key {
524                         linux,code = <139>;
525                         label = "menu";
526                         rockchip,adc_value = <355>;
527                 };
528
529                 home-key {
530                         linux,code = <102>;
531                         label = "home";
532                         rockchip,adc_value = <746>;
533                 };
534
535                 back-key {
536                         linux,code = <158>;
537                         label = "back";
538                         rockchip,adc_value = <560>;
539                 };
540
541                 camera-key {
542                         linux,code = <212>;
543                         label = "camera";
544                         rockchip,adc_value = <450>;
545                 };
546         };
547 };
548
549 &pwm0 {
550         status = "okay";
551 };
552
553 &pwm1 {
554         status = "okay";
555 };
556
557
558 &clk_core_dvfs_table {
559         operating-points = <
560                 /* KHz    uV */
561                 312000 1100000
562                 504000 1100000
563                 816000 1100000
564                 1008000 1100000
565                 >;
566 };
567
568 &clk_gpu_dvfs_table {
569         operating-points = <
570                 /* KHz    uV */
571                 200000 1200000
572                 300000 1200000
573                 400000 1200000
574                 600000 1300000
575                 >;
576 };
577
578 &clk_ddr_dvfs_table {
579         operating-points = <
580                 /* KHz    uV */
581                 200000 1200000
582                 300000 1200000
583                 400000 1200000
584                 >;
585
586         freq_table = <
587                 /*status                freq(KHz)*/
588                 SYS_STATUS_NORMAL       400000
589                 SYS_STATUS_SUSPEND      200000
590                 SYS_STATUS_VIDEO        300000
591                 SYS_STATUS_DUALVIEW     500000
592                 >;
593 };
594
595 /include/ "rk808.dtsi"
596 &rk808 {
597         gpios =<&gpio0 GPIO_A4 GPIO_ACTIVE_HIGH>,<&gpio0 GPIO_B3 GPIO_ACTIVE_LOW>;
598         rk808,system-power-controller;
599
600         regulators {
601                 
602                 rk808_dcdc1_reg: regulator@0{
603                         regulator-name= "vdd_arm";
604                         regulator-always-on;
605                         regulator-boot-on;
606                 };
607
608                 rk808_dcdc2_reg: regulator@1 {
609                         regulator-name= "vdd_gpu";
610                         regulator-always-on;
611                         regulator-boot-on;
612                 };
613
614                 rk808_dcdc3_reg: regulator@2 {
615                         regulator-name= "rk_dcdc3";
616                         regulator-min-microvolt = <1200000>;
617                         regulator-max-microvolt = <1200000>;
618                         regulator-always-on;
619                         regulator-boot-on;
620                 };
621
622                 rk808_dcdc4_reg: regulator@3 {
623                         regulator-name= "vccio";
624                         regulator-min-microvolt = <1800000>;
625                         regulator-max-microvolt = <3300000>;
626                         regulator-always-on;
627                         regulator-boot-on;
628                 };
629
630                 rk808_ldo1_reg: regulator@4 {
631                         regulator-name= "rk_ldo1";
632                         regulator-min-microvolt = <3300000>;
633                         regulator-max-microvolt = <3300000>;
634                         regulator-always-on;
635                         regulator-boot-on;
636                 };
637
638                 rk808_ldo2_reg: regulator@5 {
639                         regulator-name= "rk_ldo2";
640                         regulator-min-microvolt = <3300000>;
641                         regulator-max-microvolt = <3300000>;
642                         regulator-always-on;
643                         regulator-boot-on;
644                 };
645
646                 rk808_ldo3_reg: regulator@6 {
647                         regulator-name= "rk_ldo3";
648                         regulator-min-microvolt = <1000000>;
649                         regulator-max-microvolt = <1000000>;
650                         regulator-always-on;
651                         regulator-boot-on;
652                 };
653
654                 rk808_ldo4_reg:regulator@7 {
655                         regulator-name= "rk_ldo4";
656                         regulator-min-microvolt = <1800000>;
657                         regulator-max-microvolt = <1800000>;
658                         regulator-always-on;
659                         regulator-boot-on;
660                 };
661
662                 rk808_ldo5_reg: regulator@8 {
663                         regulator-name= "rk_ldo5";
664                         regulator-min-microvolt = <3300000>;
665                         regulator-max-microvolt = <3300000>;
666                         regulator-always-on;
667                         regulator-boot-on;
668                 };
669
670                 rk808_ldo6_reg: regulator@9 {
671                         regulator-name= "rk_ldo6";
672                         regulator-min-microvolt = <1000000>;
673                         regulator-max-microvolt = <1000000>;
674                         regulator-always-on;
675                         regulator-boot-on;
676                 };
677
678                 rk808_ldo7_reg: regulator@10 {
679                         regulator-name= "rk_ldo7";
680                         regulator-min-microvolt = <1800000>;
681                         regulator-max-microvolt = <1800000>;
682                         regulator-always-on;
683                         regulator-boot-on;
684                 };
685
686                 rk808_ldo8_reg: regulator@11 {
687                         regulator-name= "rk_ldo8";
688                         regulator-min-microvolt = <3300000>;
689                         regulator-max-microvolt = <3300000>;
690                         regulator-always-on;
691                         regulator-boot-on;
692                 };
693         };
694 };