ethernet: gmac with rgmii interface works
[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 &gmac {
167 //      power_ctl_by = "gpio";  //"gpio" "pmu"
168         power-gpio = <&gpio0 GPIO_A6 GPIO_ACTIVE_HIGH>;
169 //      power-pmu = "act_ldo"
170         reset-gpio = <&gpio4 GPIO_A7 GPIO_ACTIVE_HIGH>;
171 };
172
173 &pinctrl {
174
175         gpio7_gpio {
176                         gpio7_b7: gpio7-b7 {
177                                 rockchip,pins = <GPIO7_B7>;
178                                 rockchip,pull = <VALUE_PULL_UP>;
179                         };
180
181                         //to add
182                 };
183
184         //could add other pinctrl definition such as gpio
185
186 };
187
188 &emmc {
189         clock-frequency = <50000000>;
190         clock-freq-min-max = <400000 50000000>;
191
192         supports-highspeed;
193         supports-emmc;
194         bootpart-no-access;
195         
196         status = "okay";
197 };
198     
199 &sdmmc {
200         clock-frequency = <50000000>;
201         lock-freq-min-max = <400000 50000000>;              
202             
203         supports-highspeed;
204         supports-sd;
205         broken-cd;
206         card-detect-delay = <200>;
207
208         
209         vmmc-supply = <&rk808_ldo5_reg>;
210         status = "disabled";
211 };
212                 
213 &sdio {
214         clock-frequency = <50000000>;
215         clock-freq-min-max = <200000 50000000>;
216                 
217         supports-highspeed;             
218         supports-sdio;
219         //cap-sdio-irq;
220
221         status = "okay";
222 };
223
224 &spi0 {
225         status = "okay";
226         max-freq = <48000000>;  
227         /*
228         spi_test@00 {
229                 compatible = "rockchip,spi_test_bus0_cs0";
230                 reg = <0>;
231                 spi-max-frequency = <24000000>;
232                 poll_mode = <0>;
233                 type = <0>;
234                 enable_dma = <0>;
235
236         };
237
238         spi_test@01 {
239                 compatible = "rockchip,spi_test_bus0_cs1";
240                 reg = <1>;
241                 spi-max-frequency = <24000000>;
242                 poll_mode = <0>;
243                 type = <0>;
244                 enable_dma = <0>;               
245         };
246         */
247 };
248
249 &spi1 {
250         status = "okay";
251         max-freq = <48000000>;
252         /*
253         spi_test@10 {
254                 compatible = "rockchip,spi_test_bus1_cs0";
255                 reg = <0>;
256                 spi-max-frequency = <24000000>;
257                 poll_mode = <0>;
258                 type = <0>;
259                 enable_dma = <0>;
260         };
261
262         spi_test@11 {
263                 compatible = "rockchip,spi_test_bus1_cs1";
264                 reg = <1>;
265                 spi-max-frequency = <24000000>;
266                 poll_mode = <0>;
267                 type = <0>;
268                 enable_dma = <0>;
269         };
270         */
271 };
272
273 &spi2 {
274         status = "okay";
275         max-freq = <48000000>;
276         /*
277         spi_test@20 {
278                 compatible = "rockchip,spi_test_bus2_cs0";
279                 reg = <0>;
280                 spi-max-frequency = <24000000>;
281                 poll_mode = <0>;
282                 type = <0>;
283                 enable_dma = <0>;
284         };
285
286         spi_test@21 {
287                 compatible = "rockchip,spi_test_bus2_cs1";
288                 reg = <1>;
289                 spi-max-frequency = <24000000>;
290                 poll_mode = <0>;
291                 type = <0>;
292                 enable_dma = <0>;
293         };
294         */
295 };
296
297 &i2c0 {
298         status = "okay";
299         rk808: rk808@1b {
300                 reg = <0x1b>;
301                 status = "okay";
302         };
303         
304         bq24296: bq24296@6b {
305                 compatible = "ti,bq24296";
306                 reg = <0x6b>;
307                 gpios = <&gpio0 GPIO_A7 GPIO_ACTIVE_HIGH>,<&gpio0 GPIO_B0 GPIO_ACTIVE_HIGH>;
308                 bq24296,chg_current = <1000 2000 3000>;
309                 status = "okay";
310         };
311         bq27320: bq27320@55 {
312                 compatible = "ti,bq27320";
313                 reg = <0x55>;
314         /*   gpios = <&gpio0 GPIO_A7 GPIO_ACTIVE_HIGH>; */
315                 status = "okay";
316         };
317
318         CW2015@62 {
319                 compatible = "cw201x";
320                 reg = <0x62>;
321                 dc_det_gpio = <&gpio0 GPIO_B0 GPIO_ACTIVE_LOW>;
322                 bat_low_gpio = <&gpio0 GPIO_A7 GPIO_ACTIVE_LOW>;
323                 chg_ok_gpio = <&gpio0 GPIO_B1 GPIO_ACTIVE_HIGH>;
324                 bat_config_info = <0x15 0x42 0x60 0x59 0x52 0x58 0x4D 0x48 0x48 0x44 0x44 0x46 0x49 0x48 0x32
325                         0x24 0x20 0x17 0x13 0x0F 0x19 0x3E 0x51 0x45 0x08 0x76 0x0B 0x85 0x0E 0x1C 0x2E 0x3E 0x4D 0x52 0x52
326                         0x57 0x3D 0x1B 0x6A 0x2D 0x25 0x43 0x52 0x87 0x8F 0x91 0x94 0x52 0x82 0x8C 0x92 0x96 0xFF 0x7B 0xBB
327                         0xCB 0x2F 0x7D 0x72 0xA5 0xB5 0xC1 0x46 0xAE>;
328                 is_dc_charge = <1>;
329                 is_usb_charge = <0>;
330         };
331 };
332
333 &i2c1 {
334         status = "okay";
335         rtc@51 {
336                 compatible = "nxp,pcf8563";
337                 reg = <0x51>;
338         };
339         
340         sensor@1d {
341                 compatible = "gs_mma8452";
342                 reg = <0x1d>;
343                 type = <SENSOR_TYPE_ACCEL>;
344                 irq-gpio = <&gpio8 GPIO_A0 IRQ_TYPE_EDGE_FALLING>;
345                 irq_enable = <1>;
346                 poll_delay_ms = <30>;
347                 layout = <1>;
348         };
349                 sensor@19 {
350                 compatible = "gs_lis3dh";
351                 reg = <0x19>;
352                 type = <SENSOR_TYPE_ACCEL>;
353                 irq-gpio = <&gpio0 GPIO_A0 IRQ_TYPE_LEVEL_LOW>;
354                 irq_enable = <1>;
355                 poll_delay_ms = <30>;
356                 layout = <1>;
357         };
358                 sensor@0d {
359                 compatible = "ak8963";
360                 reg = <0x0d>;
361                 type = <SENSOR_TYPE_COMPASS>;
362                 irq-gpio = <&gpio8 GPIO_A2 IRQ_TYPE_EDGE_RISING>;
363                 irq_enable = <1>;
364                 poll_delay_ms = <30>;
365                 layout = <1>;
366         };
367
368                 sensor@6b {
369                 compatible = "l3g20d_gyro";
370                 reg = <0x6b>;
371                 type = <SENSOR_TYPE_GYROSCOPE>;
372                 irq-gpio = <&gpio8 GPIO_A3 IRQ_TYPE_LEVEL_LOW>;
373                 irq_enable = <1>;
374                 poll_delay_ms = <30>;
375                 layout = <1>;
376         };
377         sensor@10 {
378               compatible = "ls_cm3218";
379               reg = <0x10>;
380               type = <SENSOR_TYPE_LIGHT>;
381               irq-gpio = <&gpio8 GPIO_A3 IRQ_TYPE_EDGE_FALLING>;              
382               irq_enable = <1>;
383               poll_delay_ms = <30>;
384               layout = <1>;
385        };
386         
387 };
388
389 &i2c2 {
390         status = "okay";
391         rt5631: rt5631@1a {
392                 compatible = "rt5631";
393                 reg = <0x1a>;
394         };
395         es8323: es8323@10 {
396                 compatible = "es8323";
397                 reg = <0x10>;
398         };
399         rt3261: rt3261@1c {
400                 compatible = "rt3261";
401                 reg = <0x1c>;
402         //      codec-en-gpio = <0>;//sdk default high level
403                 spk-num= <2>;
404                 modem-input-mode = <1>;
405                 lout-to-modem_mode = <1>;
406                 spk-amplify = <2>;
407                 playback-if1-data_control = <0>;
408                 playback-if2-data_control = <0>;
409         };
410         rt5616: rt5616@1b {
411                 compatible = "rt5616";
412                 reg = <0x1b>;
413         };
414 };
415
416 &i2c3 {
417         status = "okay";
418 };
419
420 &i2c4 {
421         status = "okay";
422         ts@55 {
423                 compatible = "goodix,gt8xx";
424                 reg = <0x55>;
425                 touch-gpio = <&gpio7 GPIO_A6 IRQ_TYPE_LEVEL_LOW>;
426                 reset-gpio = <&gpio7 GPIO_A5 GPIO_ACTIVE_LOW>;
427                 //power-gpio = <&gpio0 GPIO_C5 GPIO_ACTIVE_LOW>;
428                 max-x = <1280>;
429                 max-y = <800>;
430         };
431         
432         ts@01 {
433                 compatible = "ct,ct36x";
434                 reg = <0x01>;
435                 ct-model = <365>;
436                 touch-gpio = <&gpio7 GPIO_A6 IRQ_TYPE_LEVEL_LOW>;
437                 reset-gpio = <&gpio7 GPIO_A5 GPIO_ACTIVE_HIGH>;
438                 max-x = <1280>;
439                 max-y = <800>;
440                 orientation=<1 0 0 1>;
441         };
442 };
443
444 &i2c5 {
445         status = "disable";
446 };
447
448 &fb {
449         rockchip,disp-mode = <DUAL>;
450 };
451
452 &rk_screen {
453          display-timings = <&disp_timings>;
454 };
455
456 /*lcdc1 as PRMRY(LCD),lcdc0 as EXTEND(HDMI)*/
457 &lcdc1 {
458         status = "okay";
459         power_ctr: power_ctr {
460                 rockchip,debug = <0>;
461                 rockchip,mirror = <NO_MIRROR>;
462                 lcd_en:lcd_en {
463                         rockchip,power_type = <GPIO>;
464                         gpios = <&gpio7 GPIO_A3 GPIO_ACTIVE_HIGH>;
465                         rockchip,delay = <10>;
466                 };
467                 
468                 lcd_cs:lcd_cs {
469 rockchip,power_type = <GPIO>;
470                         gpios = <&gpio7 GPIO_A4 GPIO_ACTIVE_HIGH>;
471                         rockchip,delay = <10>;
472                 };
473
474                 /*lcd_rst:lcd_rst {
475                         rockchip,power_type = <GPIO>;
476                         gpios = <&gpio3 GPIO_D6 GPIO_ACTIVE_HIGH>;
477                         rockchip,delay = <5>;
478                 };*/
479
480         };
481 };
482
483 &lcdc0 {
484         status = "okay";
485 };
486
487 &hdmi {
488         status = "okay";
489         rockchips,hdmi_audio_source = <0>;
490 };
491
492 &adc {
493         status = "okay";
494
495         key {
496                 compatible = "rockchip,key";
497                 io-channels = <&adc 1>;
498
499                 vol-up-key {
500                         linux,code = <115>;
501                         label = "volume up";
502                         rockchip,adc_value = <1>;
503                 };
504
505                 vol-down-key {
506                         linux,code = <114>;
507                         label = "volume down";
508                         rockchip,adc_value = <170>;
509                 };
510
511                 power-key {
512                         gpios = <&gpio0 GPIO_A5 GPIO_ACTIVE_LOW>;
513                         linux,code = <116>;
514                         label = "power";
515                         gpio-key,wakeup;
516                 };
517
518                 menu-key {
519                         linux,code = <139>;
520                         label = "menu";
521                         rockchip,adc_value = <355>;
522                 };
523
524                 home-key {
525                         linux,code = <102>;
526                         label = "home";
527                         rockchip,adc_value = <746>;
528                 };
529
530                 back-key {
531                         linux,code = <158>;
532                         label = "back";
533                         rockchip,adc_value = <560>;
534                 };
535
536                 camera-key {
537                         linux,code = <212>;
538                         label = "camera";
539                         rockchip,adc_value = <450>;
540                 };
541         };
542 };
543
544 &pwm0 {
545         status = "okay";
546 };
547
548 &pwm1 {
549         status = "okay";
550 };
551
552
553 &clk_core_dvfs_table {
554         operating-points = <
555                 /* KHz    uV */
556                 312000 1100000
557                 504000 1100000
558                 816000 1100000
559                 1008000 1100000
560                 >;
561 };
562
563 &clk_gpu_dvfs_table {
564         operating-points = <
565                 /* KHz    uV */
566                 200000 1200000
567                 300000 1200000
568                 400000 1200000
569                 600000 1300000
570                 >;
571 };
572
573 &clk_ddr_dvfs_table {
574         operating-points = <
575                 /* KHz    uV */
576                 200000 1200000
577                 300000 1200000
578                 400000 1200000
579                 >;
580
581         freq_table = <
582                 /*status                freq(KHz)*/
583                 SYS_STATUS_NORMAL       400000
584                 SYS_STATUS_SUSPEND      200000
585                 SYS_STATUS_VIDEO        300000
586                 SYS_STATUS_DUALVIEW     500000
587                 >;
588 };
589
590 /include/ "rk808.dtsi"
591 &rk808 {
592         gpios =<&gpio0 GPIO_A4 GPIO_ACTIVE_HIGH>,<&gpio0 GPIO_B3 GPIO_ACTIVE_LOW>;
593
594         regulators {
595                 
596                 rk808_dcdc1_reg: regulator@0{
597                         regulator-name= "vdd_arm";
598                         regulator-always-on;
599                         regulator-boot-on;
600                 };
601
602                 rk808_dcdc2_reg: regulator@1 {
603                         regulator-name= "vdd_gpu";
604                         regulator-always-on;
605                         regulator-boot-on;
606                 };
607
608                 rk808_dcdc3_reg: regulator@2 {
609                         regulator-name= "rk_dcdc3";
610                         regulator-min-microvolt = <1200000>;
611                         regulator-max-microvolt = <1200000>;
612                         regulator-always-on;
613                         regulator-boot-on;
614                 };
615
616                 rk808_dcdc4_reg: regulator@3 {
617                         regulator-name= "vccio";
618                         regulator-min-microvolt = <1800000>;
619                         regulator-max-microvolt = <3300000>;
620                         regulator-always-on;
621                         regulator-boot-on;
622                 };
623
624                 rk808_ldo1_reg: regulator@4 {
625                         regulator-name= "rk_ldo1";
626                         regulator-min-microvolt = <3300000>;
627                         regulator-max-microvolt = <3300000>;
628                         regulator-always-on;
629                         regulator-boot-on;
630                 };
631
632                 rk808_ldo2_reg: regulator@5 {
633                         regulator-name= "rk_ldo2";
634                         regulator-min-microvolt = <3300000>;
635                         regulator-max-microvolt = <3300000>;
636                         regulator-always-on;
637                         regulator-boot-on;
638                 };
639
640                 rk808_ldo3_reg: regulator@6 {
641                         regulator-name= "rk_ldo3";
642                         regulator-min-microvolt = <1000000>;
643                         regulator-max-microvolt = <1000000>;
644                         regulator-always-on;
645                         regulator-boot-on;
646                 };
647
648                 rk808_ldo4_reg:regulator@7 {
649                         regulator-name= "rk_ldo4";
650                         regulator-min-microvolt = <1800000>;
651                         regulator-max-microvolt = <1800000>;
652                         regulator-always-on;
653                         regulator-boot-on;
654                 };
655
656                 rk808_ldo5_reg: regulator@8 {
657                         regulator-name= "rk_ldo5";
658                         regulator-min-microvolt = <3300000>;
659                         regulator-max-microvolt = <3300000>;
660                         regulator-always-on;
661                         regulator-boot-on;
662                 };
663
664                 rk808_ldo6_reg: regulator@9 {
665                         regulator-name= "rk_ldo6";
666                         regulator-min-microvolt = <1000000>;
667                         regulator-max-microvolt = <1000000>;
668                         regulator-always-on;
669                         regulator-boot-on;
670                 };
671
672                 rk808_ldo7_reg: regulator@10 {
673                         regulator-name= "rk_ldo7";
674                         regulator-min-microvolt = <1800000>;
675                         regulator-max-microvolt = <1800000>;
676                         regulator-always-on;
677                         regulator-boot-on;
678                 };
679
680                 rk808_ldo8_reg: regulator@11 {
681                         regulator-name= "rk_ldo8";
682                         regulator-min-microvolt = <3300000>;
683                         regulator-max-microvolt = <3300000>;
684                         regulator-always-on;
685                         regulator-boot-on;
686                 };
687         };
688 };