rk3128-box:add pwm_regulator,lcdc,dvfs dts support
[firefly-linux-kernel-4.4.55.git] / arch / arm / boot / dts / rk312x-sdk.dtsi
1 /dts-v1/;
2
3 #include "rk312x.dtsi"
4 #include "lcd-b101ew05.dtsi"
5
6 / {
7         fiq-debugger {
8                 status = "okay";
9         };
10
11         chosen {
12                 bootargs = "vmalloc=512M clk_ignore_unused";
13         };
14
15         usb_control {
16                 compatible = "rockchip,rk3126-usb-control";
17                 host_drv_gpio = <&gpio2 GPIO_B4 GPIO_ACTIVE_LOW>;
18                 otg_drv_gpio = <&gpio2 GPIO_B6 GPIO_ACTIVE_LOW>;
19
20                 rockchip,remote_wakeup;
21                 rockchip,usb_irq_wakeup;
22         };
23
24         pwm_regulator1:pwm-regulator1 {
25                 compatible = "rockchip_pwm_regulator";
26                 pwms = <&pwm1 0 25000>;
27                 rockchip,pwm_id= <1>;
28                 rockchip,pwm_voltage_map= <950000 975000 1000000 1025000 1050000 1075000 1100000 1125000 1150000 1175000 1200000 1225000 1250000 1275000 1300000 1325000 1350000 1375000 1400000 1425000 1450000>;
29                 rockchip,pwm_voltage= <1250000>;
30                 rockchip,pwm_min_voltage= <950000>;
31                 rockchip,pwm_max_voltage= <1450000>;
32                 rockchip,pwm_suspend_voltage= <1250000>;
33                 rockchip,pwm_coefficient= <550>;
34                 status = "disabled";
35                 regulators {
36                         #address-cells = <1>;
37                         #size-cells = <0>;
38                         pwm_reg0: regulator@0 {
39                                 regulator-compatible = "pwm_dcdc1";
40                                 regulator-name= "vdd_arm";
41                                 regulator-min-microvolt = <950000>;
42                                 regulator-max-microvolt = <1450000>;
43                                 regulator-always-on;
44                                 regulator-boot-on;
45                         };
46                 };
47         };
48
49         pwm_regulator2:pwm-regulator2 {
50                 compatible = "rockchip_pwm_regulator";
51                 pwms = <&pwm2 0 25000>;
52                 rockchip,pwm_id= <2>;
53                 rockchip,pwm_voltage_map= <950000 975000 1000000 1025000 1050000 1075000 1100000 1125000 1150000 1175000 1200000 1225000 1250000 1275000 1300000 1325000 1350000 1375000 1400000 1425000 1450000>;
54                 rockchip,pwm_voltage= <1200000>;
55                 rockchip,pwm_min_voltage= <950000>;
56                 rockchip,pwm_max_voltage= <1450000>;
57                 rockchip,pwm_suspend_voltage= <1250000>;
58                 rockchip,pwm_coefficient= <550>;
59                 status = "disabled";
60                 regulators {
61                         #address-cells = <1>;
62                         #size-cells = <0>;
63                         pwm_reg1: regulator@1 {
64                                 regulator-compatible = "pwm_dcdc2";
65                                 regulator-name= "vdd_logic";
66                                 regulator-min-microvolt = <950000>;
67                                 regulator-max-microvolt = <1450000>;
68                                 regulator-always-on;
69                                 regulator-boot-on;
70                         };
71                 };
72         };
73
74 };
75
76 &nandc {
77         status = "okay"; // used nand set "okay" ,used emmc set "disabled"
78 };
79
80 &nandc0reg {
81         status = "disabled"; // used nand set "disabled" ,used emmc set "okay"
82 };
83
84 &emmc {
85         clock-frequency = <100000000>;
86         clock-freq-min-max = <400000 100000000>;
87         supports-highspeed;
88         supports-emmc;
89         bootpart-no-access;
90         supports-DDR_MODE;
91         //caps2-mmc-hs200;
92         ignore-pm-notify;
93         keep-power-in-suspend;
94         //poll-hw-reset
95         status = "disabled";
96 };
97
98 &sdmmc {
99         clock-frequency = <50000000>;
100         clock-freq-min-max = <400000 50000000>;
101         supports-highspeed;
102         supports-sd;
103         cd-gpios = <&gpio2 GPIO_A7 GPIO_ACTIVE_HIGH>;/*CD GPIO*/
104         broken-cd;
105         card-detect-delay = <200>;
106         ignore-pm-notify;
107         keep-power-in-suspend;
108         vmmc-supply = <&rk818_ldo9_reg>;
109         status = "disabled";
110 };
111
112 &sdio {
113         clock-frequency = <50000000>;
114         clock-freq-min-max = <200000 50000000>;
115         supports-highspeed;
116         supports-sdio;
117         ignore-pm-notify;
118         keep-power-in-suspend;
119         //cap-sdio-irq;
120         status = "disabled";
121 };
122
123 &adc {
124         status = "okay";
125
126         key: key {
127                 compatible = "rockchip,key";
128                 io-channels = <&adc 1>;
129
130                 vol-up-key {
131                         linux,code = <115>;
132                         label = "volume up";
133                         rockchip,adc_value = <327>;
134                 };
135
136                 vol-down-key {
137                         linux,code = <114>;
138                         label = "volume down";
139                         rockchip,adc_value = <426>;
140                 };
141
142                 power-key {
143                         gpios = <&gpio0 GPIO_A5 GPIO_ACTIVE_LOW>;
144                         linux,code = <116>;
145                         label = "power";
146                         gpio-key,wakeup;
147                 };
148
149                 menu-key {
150                         linux,code = <59>;
151                         label = "menu";
152                         rockchip,adc_value = <1>;
153                 };
154
155                 home-key {
156                         linux,code = <102>;
157                         label = "home";
158                         rockchip,adc_value = <746>;
159                 };
160
161                 back-key {
162                         linux,code = <158>;
163                         label = "back";
164                         rockchip,adc_value = <103>;
165                 };
166
167                 camera-key {
168                         linux,code = <212>;
169                         label = "camera";
170                         rockchip,adc_value = <450>;
171                 };
172         };
173 };
174
175
176 &i2c0 {
177         status = "okay";
178         rk818: rk818@1c {
179                 reg = <0x1c>;
180                 status = "okay";
181         };
182 };
183 &i2c2 {
184         status = "okay";
185         ts@55 {
186                 compatible = "goodix,gt8xx";
187                 reg = <0x55>;
188                 touch-gpio = <&gpio1 GPIO_B0 IRQ_TYPE_LEVEL_LOW>;
189                 reset-gpio = <&gpio2 GPIO_C1 GPIO_ACTIVE_LOW>;
190                 //power-gpio = <&gpio0 GPIO_C5 GPIO_ACTIVE_LOW>;
191                 max-x = <1280>;
192                 max-y = <800>;
193         };
194         /*
195         ts@01 {
196                 compatible = "ct,vtl_ts";
197                 reg = <0x01>;
198                 screen_max_x = <1280>;
199                 screen_max_y = <800>;
200                 irq_gpio_number = <&gpio1 GPIO_B0 IRQ_TYPE_LEVEL_LOW>;
201                 rst_gpio_number = <&gpio2 GPIO_C1 GPIO_ACTIVE_HIGH>;
202         };
203         */
204 };
205
206 &fb {
207         rockchip,disp-mode = <ONE_DUAL>;
208         rockchip,uboot-logo-on = <0>;
209 };
210
211 &rk_screen {
212         display-timings = <&disp_timings>;
213 };
214
215 &hdmi {
216         status = "okay";
217 };
218
219 /include/ "rk818.dtsi"
220 &rk818 {
221         gpios =<&gpio1 GPIO_B1 GPIO_ACTIVE_HIGH>,<&gpio1 GPIO_A1 GPIO_ACTIVE_LOW>;
222         rk818,system-power-controller;
223         rk818,support_dc_chg = <1>;/*1: dc chg; 0:usb chg*/
224
225         regulators {
226
227                 rk818_dcdc1_reg: regulator@0{
228                         regulator-name= "vdd_arm";
229                         regulator-min-microvolt = <700000>;
230                         regulator-max-microvolt = <1500000>;
231                         regulator-initial-mode = <0x2>;
232                         regulator-initial-state = <3>;
233                         regulator-state-mem {
234                                 regulator-state-mode = <0x2>;
235                                 regulator-state-enabled;
236                                 regulator-state-uv = <900000>;
237                         };
238                 };
239
240                 rk818_dcdc2_reg: regulator@1 {
241                         regulator-name= "vdd_logic";
242                         regulator-min-microvolt = <700000>;
243                         regulator-max-microvolt = <1500000>;
244                         regulator-initial-mode = <0x2>;
245                         regulator-initial-state = <3>;
246                         regulator-state-mem {
247                                 regulator-state-mode = <0x2>;
248                                 regulator-state-enabled;
249                                 regulator-state-uv = <900000>;
250                         };
251                 };
252
253                 rk818_dcdc3_reg: regulator@2 {
254                         regulator-name= "rk818_dcdc3";
255                         regulator-min-microvolt = <1200000>;
256                         regulator-max-microvolt = <1200000>;
257                         regulator-initial-mode = <0x2>;
258                         regulator-initial-state = <3>;
259                         regulator-state-mem {
260                                 regulator-state-mode = <0x2>;
261                                 regulator-state-disabled;
262                                 regulator-state-uv = <1200000>;
263                         };
264                 };
265
266                 rk818_dcdc4_reg: regulator@3 {
267                         regulator-name= "vccio";
268                         regulator-min-microvolt = <1800000>;
269                         regulator-max-microvolt = <3300000>;
270                         regulator-initial-mode = <0x2>;
271                         regulator-initial-state = <3>;
272                         regulator-state-mem {
273                                 regulator-state-mode = <0x2>;
274                                 regulator-state-disabled;
275                                 regulator-state-uv = <2800000>;
276                         };
277                 };
278
279                 rk818_ldo1_reg: regulator@4 {
280                         regulator-name= "rk818_ldo1";
281                         regulator-min-microvolt = <3300000>;
282                         regulator-max-microvolt = <3300000>;
283                         regulator-initial-state = <3>;
284                         regulator-state-mem {
285                                 regulator-state-disabled;
286                                 regulator-state-uv = <3300000>;
287                         };
288                 };
289
290                 rk818_ldo2_reg: regulator@5 {
291                         regulator-name= "rk818_ldo2";
292                         regulator-min-microvolt = <3000000>;
293                         regulator-max-microvolt = <3000000>;
294                         regulator-initial-state = <3>;
295                         regulator-state-mem {
296                                 regulator-state-disabled;
297                                 regulator-state-uv = <3000000>;
298                         };
299                 };
300
301                 rk818_ldo3_reg: regulator@6 {
302                         regulator-name= "rk818_ldo3";
303                         regulator-min-microvolt = <1100000>;
304                         regulator-max-microvolt = <1100000>;
305                         regulator-initial-state = <3>;
306                         regulator-state-mem {
307                                 regulator-state-disabled;
308                                 regulator-state-uv = <1100000>;
309                         };
310                 };
311
312                 rk818_ldo4_reg:regulator@7 {
313                         regulator-name= "rk818_ldo4";
314                         regulator-min-microvolt = <2500000>;
315                         regulator-max-microvolt = <2500000>;
316                         regulator-initial-state = <3>;
317                         regulator-state-mem {
318                                 regulator-state-disabled;
319                                 regulator-state-uv = <2500000>;
320                         };
321                 };
322
323                 rk818_ldo5_reg: regulator@8 {
324                         regulator-name= "rk818_ldo5";
325                         regulator-min-microvolt = <3000000>;
326                         regulator-max-microvolt = <3000000>;
327                         regulator-initial-state = <3>;
328                         regulator-state-mem {
329                                 regulator-state-disabled;
330                                 regulator-state-uv = <3000000>;
331                         };
332                 };
333
334                 rk818_ldo6_reg: regulator@9 {
335                         regulator-name= "rk818_ldo6";
336                         regulator-min-microvolt = <1200000>;
337                         regulator-max-microvolt = <1200000>;
338                         regulator-initial-state = <3>;
339                         regulator-state-mem {
340                                 regulator-state-disabled;
341                                 regulator-state-uv = <1200000>;
342                         };
343                 };
344
345                 rk818_ldo7_reg: regulator@10 {
346                         regulator-name= "rk818_ldo7";
347                         regulator-min-microvolt = <1800000>;
348                         regulator-max-microvolt = <1800000>;
349                         regulator-initial-state = <3>;
350                         regulator-state-mem {
351                                 regulator-state-disabled;
352                                 regulator-state-uv = <1800000>;
353                         };
354                 };
355
356                 rk818_ldo8_reg: regulator@11 {
357                         regulator-name= "rk818_ldo8";
358                         regulator-min-microvolt = <1800000>;
359                         regulator-max-microvolt = <1800000>;
360                         regulator-initial-state = <3>;
361                         regulator-state-mem {
362                                 regulator-state-disabled;
363                                 regulator-state-uv = <1800000>;
364                         };
365                 };
366                 rk818_ldo9_reg: regulator@12 {
367                         regulator-name= "vcc_sd";
368                         regulator-min-microvolt = <1800000>;
369                         regulator-max-microvolt = <3000000>;
370                         regulator-initial-state = <3>;
371                         regulator-state-mem {
372                                 regulator-state-disabled;
373                                 regulator-state-uv = <3000000>;
374                         };
375                 };
376                 rk818_ldo10_reg: regulator@13 {
377                         regulator-name= "rk818_ldo10";
378                         regulator-state-mem {
379                                 regulator-state-disabled;
380                         };
381                 };
382         };
383         battery {
384                 ocv_table = <3350 3677 3693 3719 3752 3770 3775 3778 3785 3796 3812 3839 3881 3907 3933 3958 3978 4033 4087 4123 4174>;
385                 design_capacity = <2100>;
386                 design_qmax = <2200>;
387                 max_overcharge = <100>;
388                 max_charge_currentmA = <1500>;
389                 max_charge_voltagemV = <4260>;
390                 max_bat_voltagemV = <4200>;
391         };
392
393 };
394 &clk_core_dvfs_table {
395         operating-points = <
396                 /* KHz    uV */
397                 408000 1250000
398                 600000 1250000
399                 696000 1250000
400                 816000 1250000
401                 1008000 1250000
402                 >;
403         status="okay";
404 };
405
406 &clk_gpu_dvfs_table {
407         operating-points = <
408                 /* KHz    uV */
409                 200000 1250000
410                 300000 1250000
411                 >;
412         status="okay";
413 };
414
415 &clk_ddr_dvfs_table {
416         operating-points = <
417                 /* KHz    uV */
418                 200000 950000
419                 300000 950000
420                 400000 1000000
421                 533000 1050000
422                 >;
423
424         freq-table = <
425                 /*status                freq(KHz)*/
426                 SYS_STATUS_NORMAL       400000
427                 SYS_STATUS_SUSPEND      200000
428                 SYS_STATUS_VIDEO_1080P  240000
429                 SYS_STATUS_VIDEO_4K     400000
430                 SYS_STATUS_PERFORMANCE  528000
431                 SYS_STATUS_DUALVIEW     400000
432                 SYS_STATUS_BOOST        324000
433                 SYS_STATUS_ISP          533000
434                 >;
435         auto-freq-table = <
436                 240000
437                 324000
438                 396000
439                 528000
440                 >;
441         auto-freq=<0>;
442         status="disable";
443 };
444
445 &pwm0 {
446         status = "okay";
447 };