Merge branch 'linux-linaro-lsk-v4.4-android' of git://git.linaro.org/kernel/linux...
[firefly-linux-kernel-4.4.55.git] / arch / arm / boot / dts / rk3128-box-rk88.dts
1 /dts-v1/;
2
3 #include "rk3128.dtsi"
4 #include "rk312x-sdk.dtsi"
5 #include "lcd-box.dtsi"
6 #include <dt-bindings/input/input.h>
7
8 / {
9          compatible = "rockchip,rk3128";
10
11          gpio_poweroff {
12                 compatible = "gpio-poweroff";
13                 gpios = <&gpio1 GPIO_A2 GPIO_ACTIVE_LOW>;
14         };
15         wireless-wlan {
16                 compatible = "wlan-platdata";
17
18                 /* wifi_chip_type - wifi chip define
19                 * bcmwifi ==> like ap6xxx, rk90x, ...;
20                 * rtkwifi ==> like rtl8188xx, rtl8723xx, ...;
21                 * esp8089 ==> esp8089;
22                 * other   ==> for other wifi;
23                 */
24                 wifi_chip_type = "esp8089";
25                 sdio_vref = <0>; //1800mv or 3300mv
26
27                 //keep_wifi_power_on;
28                 //power_ctrl_by_pmu;
29                 //power_pmu_regulator = "act_ldo3";
30                 //power_pmu_enable_level = <1>; //1->HIGH, 0->LOW
31
32                 //vref_ctrl_enable;
33                 //vref_ctrl_gpio = <&gpio0 GPIO_A2 GPIO_ACTIVE_HIGH>;
34                 //vref_pmu_regulator = "act_ldo3";
35                 //vref_pmu_enable_level = <1>; //1->HIGH, 0->LOW
36
37                 WIFI,poweren_gpio = <&gpio0 GPIO_D6 GPIO_ACTIVE_HIGH>;
38                 WIFI,host_wake_irq = <&gpio0 GPIO_A2 GPIO_ACTIVE_HIGH>;
39                 //WIFI,reset_gpio = <&gpio0 GPIO_A2 GPIO_ACTIVE_LOW>;
40
41                 status = "okay";
42         };
43
44         wireless-bluetooth {
45                 compatible = "bluetooth-platdata";
46
47                 //wifi-bt-power-toggle;
48
49                 uart_rts_gpios = <&gpio1 GPIO_B3 GPIO_ACTIVE_LOW>;
50                 pinctrl-names = "default","rts_gpio";
51                 pinctrl-0 = <&uart1_rts>;
52                 pinctrl-1 = <&uart1_rts_gpio>;
53
54                 //BT,power_gpio = <&gpio4 GPIO_D3 GPIO_ACTIVE_HIGH>;
55                 BT,reset_gpio = <&gpio3 GPIO_C5 GPIO_ACTIVE_HIGH>;
56                 BT,wake_gpio = <&gpio1 GPIO_B4 GPIO_ACTIVE_HIGH>;
57                 BT,wake_host_irq = <&gpio0 GPIO_C6 GPIO_ACTIVE_LOW>;
58
59                 status = "disabled";
60         };
61
62         power-led {
63                 compatible = "gpio-leds";
64                 power {
65                         gpios = <&gpio0 GPIO_B0 GPIO_ACTIVE_LOW>;
66                         default-state = "on";
67                 };
68                 work {
69                         gpios = <&gpio0 GPIO_D2 GPIO_ACTIVE_HIGH>;
70                         default-state = "on";
71                 };
72         };
73
74         rockchip-spdif-card {
75                 compatible = "rockchip-spdif-card";
76                 dais {
77                         dai0 {
78                                 audio-codec = <&codec_hdmi_spdif>;
79                                 audio-controller = <&spdif>;
80                         };
81                 };
82         };
83
84         usb_control {
85                 compatible = "rockchip,rk3126-usb-control";
86                 host_drv_gpio = <&gpio3 GPIO_C4 GPIO_ACTIVE_LOW>;
87                 otg_drv_gpio = <&gpio3 GPIO_C1 GPIO_ACTIVE_LOW>;
88
89                 rockchip,remote_wakeup;
90                 rockchip,usb_irq_wakeup;
91         };
92                 usb0: usb@10180000 {
93                 /*0 - Normal, 1 - Force Host, 2 - Force Device*/
94                 rockchip,usb-mode = <1>;
95         };
96
97         rockchip_suspend: rockchip_suspend {
98                 rockchip,ctrbits = <
99                         (0
100                         |RKPM_CTR_PWR_DMNS
101                         |RKPM_CTR_GTCLKS
102                         |RKPM_CTR_PLLS
103                         //|RKPM_CTR_ARMOFF_LPMD
104                         |RKPM_CTR_DDR
105                         |RKPM_CTR_IDLESRAM_MD
106                         |RKPM_CTR_DDR
107                         //|RKPM_CTR_BUS_IDLE
108                         //|RKPM_CTR_VOLTS
109                         //|RKPM_CTR_VOL_PWM1
110                         //|RKPM_CTR_VOL_PWM2
111                         )
112                 >;
113                rockchip,pmic-suspend_gpios = <
114                        0
115                         >;
116         };
117
118 };
119
120
121         &clk_core_dvfs_table {
122                 operating-points = <
123                         /* KHz    uV */
124                         /*408000 1250000
125                         600000 1250000
126                         696000 1250000
127                         */
128                         816000 1100000
129                         1008000 1200000
130                         1200000 1325000
131                         >;
132                         virt-temp-limit-1-cpu-busy = <
133                         /* target-temp  limit-freq */
134                                 75      1008000
135                                 85      1200000
136                                 95      1200000
137                                 100     1200000
138                                 >;
139                         virt-temp-limit-2-cpu-busy = <
140                         /* target-temp  limit-freq */
141                                 75      912000
142                                 85      1008000
143                                 95      1104000
144                                 100     1200000
145                                 >;
146                         virt-temp-limit-3-cpu-busy = <
147                         /* target-temp  limit-freq */
148                                 75      816000
149                                 85      912000
150                                 95      100800
151                                 100     110400
152                                 >;
153                         virt-temp-limit-4-cpu-busy = <
154                         /* target-temp  limit-freq */
155                                 75      696000
156                                 85      816000
157                                 95      912000
158                                 100     100800
159                                 >;
160                         temp-limit-enable = <1>;
161                         target-temp = <85>;
162                 status="okay";
163         };
164
165         &clk_gpu_dvfs_table {
166                 operating-points = <
167                         /* KHz    uV */
168                         200000 950000
169                         300000 975000
170                         400000 1075000
171                         >;
172                 status="okay";
173         };
174
175         &clk_ddr_dvfs_table {
176                 operating-points = <
177                         /* KHz    uV */
178                         200000 950000
179                         300000 950000
180                         400000 1000000
181                         533000 1200000
182                         >;
183
184                 freq-table = <
185                         /*status                freq(KHz)*/
186                         SYS_STATUS_NORMAL       533000
187                         SYS_STATUS_SUSPEND      200000
188                         /*
189                         SYS_STATUS_VIDEO_1080P  240000
190                         SYS_STATUS_VIDEO_4K     400000
191                         SYS_STATUS_PERFORMANCE  528000
192                         SYS_STATUS_DUALVIEW     400000
193                         SYS_STATUS_BOOST        324000
194                         SYS_STATUS_ISP          533000
195                         */
196                         >;
197                 auto-freq-table = <
198                         240000
199                         324000
200                         396000
201                         528000
202                         >;
203                 auto-freq=<0>;
204                 status="okay";
205         };
206
207         &pwm_regulator1 {
208                 status = "okay";
209         };
210
211         &pwm_regulator2 {
212                 status = "okay";
213         };
214
215         &pwm1 {
216                 status = "okay";
217         };
218
219         &uart1{
220                 status = "okay";
221                 dma-names = "!tx", "!rx";
222         pinctrl-0 = <&uart1_xfer &uart1_cts>;
223 };
224
225 &pwm2 {
226         status = "okay";
227 };
228
229 &disp_timings {
230         native-mode = <&timing1>;
231 };
232
233 &rk_screen {
234         display-timings = <&disp_timings>;
235 };
236
237 &fb {
238         rockchip,disp-mode = <NO_DUAL>;
239         rockchip,disp-policy = <DISPLAY_POLICY_BOX>;
240         rockchip,uboot-logo-on = <1>;
241 };
242
243 &lcdc {
244         status = "okay";
245         rockchip,fb-win-map = <FB0_WIN0_FB1_WIN1_FB2_WIN2>;
246 };
247
248 &hdmi {
249         status = "okay";
250 };
251
252 &tve {
253         status = "okay";
254         test_mode = <0>;
255 };
256
257 &i2c2 {
258         status = "disabled";
259 };
260
261 &spi0 {
262         status = "disabled";
263         max-freq = <48000000>;
264         /*
265         spi_test@00 {
266                 compatible = "rockchip,spi_test_bus0_cs0";
267                 reg = <0>;
268                 spi-max-frequency = <24000000>;
269                 //spi-cpha;
270                 //spi-cpol;
271                 poll_mode = <0>;
272                 type = <0>;
273                 enable_dma = <0>;
274
275         };
276
277         spi_test@01 {
278                 compatible = "rockchip,spi_test_bus0_cs1";
279                 reg = <1>;
280                 spi-max-frequency = <24000000>;
281                 spi-cpha;
282                 spi-cpol;
283                 poll_mode = <0>;
284                 type = <0>;
285                 enable_dma = <0>;
286         };
287         */
288 };
289
290 &gmac_clkin {
291         clock-frequency = <50000000>;
292 };
293 &gmac {
294         //pmu_regulator = "act_ldo5";
295         //pmu_enable_level = <1>; //1->HIGH, 0->LOW
296         //power-gpio = <&gpio0 GPIO_A6 GPIO_ACTIVE_HIGH>;
297         reset-gpio = <&gpio2 GPIO_D0 GPIO_ACTIVE_LOW>;
298         phy-mode = "rmii";
299         clock_in_out = "output";
300         tx_delay = <0x30>;
301         rx_delay = <0x10>;
302 };
303
304 &codec {
305         spk_ctl_io = <&gpio1 GPIO_A3 GPIO_ACTIVE_HIGH>;
306         spk-mute-delay = <200>;
307         hp-mute-delay = <100>;
308         rk312x_for_mid = <0>;
309         is_rk3128 = <0>;
310         spk_volume = <25>;
311         hp_volume = <25>;
312         capture_volume = <26>;
313         gpio_debug = <1>;
314         codec_hp_det = <0>;
315 };
316
317 &dwc_control_usb {
318         usb_uart {
319                 status = "disabled";
320         };
321 };
322
323 &sdmmc {
324         status = "okay";
325         cd-gpios = <&gpio1 GPIO_C1 GPIO_ACTIVE_HIGH>;/*CD GPIO*/
326 };
327
328 &remotectl {
329         handle_cpu_id = <1>;
330         ir_key1{
331                 rockchip,usercode = <0x4040>;
332                 rockchip,key_table =
333                         <0xf2   KEY_REPLY>,
334                         <0xba   KEY_BACK>,
335                         <0xf4   KEY_UP>,
336                         <0xf1   KEY_DOWN>,
337                         <0xef   KEY_LEFT>,
338                         <0xee   KEY_RIGHT>,
339                         <0xbd   KEY_HOME>,
340                         <0xea   KEY_VOLUMEUP>,
341                         <0xe3   KEY_VOLUMEDOWN>,
342                         <0xe2   KEY_SEARCH>,
343                         <0xb2   KEY_POWER>,
344                         <0xbc   KEY_MUTE>,
345                         <0xec   KEY_MENU>,
346                         <0xbf   0x190>,
347                         <0xe0   0x191>,
348                         <0xe1   0x192>,
349                         <0xe9   183>,
350                         <0xe6   248>,
351                         <0xe8   185>,
352                         <0xe7   186>,
353                         <0xf0   388>,
354                         <0xbe   0x175>;
355         };
356         ir_key2{
357                 rockchip,usercode = <0xff00>;
358                 rockchip,key_table =
359                         <0xf9   KEY_HOME>,
360                         <0xbf   KEY_BACK>,
361                         <0xfb   KEY_MENU>,
362                         <0xaa   KEY_REPLY>,
363                         <0xb9   KEY_UP>,
364                         <0xe9   KEY_DOWN>,
365                         <0xb8   KEY_LEFT>,
366                         <0xea   KEY_RIGHT>,
367                         <0xeb   KEY_VOLUMEDOWN>,
368                         <0xef   KEY_VOLUMEUP>,
369                         <0xf7   KEY_MUTE>,
370                         <0xe7   KEY_POWER>,
371                         <0xfc   KEY_POWER>,
372                         <0xa9   KEY_VOLUMEDOWN>,
373                         <0xa8   KEY_VOLUMEDOWN>,
374                         <0xe0   KEY_VOLUMEDOWN>,
375                         <0xa5   KEY_VOLUMEDOWN>,
376                         <0xab   183>,
377                         <0xb7   388>,
378                         <0xf8   184>,
379                         <0xaf   185>,
380                         <0xed   KEY_VOLUMEDOWN>,
381                         <0xee   186>,
382                         <0xb3   KEY_VOLUMEDOWN>,
383                         <0xf1   KEY_VOLUMEDOWN>,
384                         <0xf2   KEY_VOLUMEDOWN>,
385                         <0xf3   KEY_SEARCH>,
386                         <0xb4   KEY_VOLUMEDOWN>,
387                         <0xbe   KEY_SEARCH>;
388         };
389         ir_key3{
390                 rockchip,usercode = <0x1dcc>;
391                 rockchip,key_table =
392                         <0xee   KEY_REPLY>,
393                         <0xf0   KEY_BACK>,
394                         <0xf8   KEY_UP>,
395                         <0xbb   KEY_DOWN>,
396                         <0xef   KEY_LEFT>,
397                         <0xed   KEY_RIGHT>,
398                         <0xfc   KEY_HOME>,
399                         <0xf1   KEY_VOLUMEUP>,
400                         <0xfd   KEY_VOLUMEDOWN>,
401                         <0xb7   KEY_SEARCH>,
402                         <0xff   KEY_POWER>,
403                         <0xf3   KEY_MUTE>,
404                         <0xbf   KEY_MENU>,
405                         <0xf9   0x191>,
406                         <0xf5   0x192>,
407                         <0xb3   388>,
408                         <0xbe   KEY_1>,
409                         <0xba   KEY_2>,
410                         <0xb2   KEY_3>,
411                         <0xbd   KEY_4>,
412                         <0xf9   KEY_5>,
413                         <0xb1   KEY_6>,
414                         <0xfc   KEY_7>,
415                         <0xf8   KEY_8>,
416                         <0xb0   KEY_9>,
417                         <0xb6   KEY_0>,
418                         <0xb5   KEY_BACKSPACE>;
419         };
420 };