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