bbea1646a3441aecbaa0152393280e15dd3b7fbe
[firefly-linux-kernel-4.4.55.git] / arch / arm64 / boot / dts / rockchip / rk3399-vr-android.dts
1 /*
2  * Copyright (c) 2016 Fuzhou Rockchip Electronics Co., Ltd
3  *
4  * This file is dual-licensed: you can use it either under the terms
5  * of the GPL or the X11 license, at your option. Note that this dual
6  * licensing only applies to this file, and not this project as a
7  * whole.
8  *
9  *  a) This file is free software; you can redistribute it and/or
10  *     modify it under the terms of the GNU General Public License as
11  *     published by the Free Software Foundation; either version 2 of the
12  *     License, or (at your option) any later version.
13  *
14  *     This file is distributed in the hope that it will be useful,
15  *     but WITHOUT ANY WARRANTY; without even the implied warranty of
16  *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  *     GNU General Public License for more details.
18  *
19  * Or, alternatively,
20  *
21  *  b) Permission is hereby granted, free of charge, to any person
22  *     obtaining a copy of this software and associated documentation
23  *     files (the "Software"), to deal in the Software without
24  *     restriction, including without limitation the rights to use,
25  *     copy, modify, merge, publish, distribute, sublicense, and/or
26  *     sell copies of the Software, and to permit persons to whom the
27  *     Software is furnished to do so, subject to the following
28  *     conditions:
29  *
30  *     The above copyright notice and this permission notice shall be
31  *     included in all copies or substantial portions of the Software.
32  *
33  *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
34  *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
35  *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
36  *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
37  *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
38  *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
39  *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
40  *     OTHER DEALINGS IN THE SOFTWARE.
41  */
42
43 /dts-v1/;
44 #include <dt-bindings/pwm/pwm.h>
45 #include <dt-bindings/sensor-dev.h>
46 #include "rk3399.dtsi"
47 #include "rk3399-android.dtsi"
48
49 / {
50         model = "Rockchip RK3399 VR Board";
51         compatible = "rockchip,vr", "rockchip,rk3399";
52
53         vdd_log: vdd-log {
54                 compatible = "pwm-regulator";
55                 pwms = <&pwm2 0 25000 0>;
56                 rockchip,pwm_id= <2>;
57                 rockchip,pwm_voltage = <900000>;
58                 regulator-name = "vdd_log";
59                 regulator-min-microvolt = <800000>;
60                 regulator-max-microvolt = <1400000>;
61                 regulator-always-on;
62                 regulator-boot-on;
63         };
64         vcc_sys: vcc-sys {
65                 compatible = "regulator-fixed";
66                 regulator-name = "vcc_sys";
67                 regulator-always-on;
68                 regulator-boot-on;
69                 regulator-min-microvolt = <4000000>;
70                 regulator-max-microvolt = <4000000>;
71         };
72         vcc3v3_sys: vcc3v3-sys {
73                 compatible = "regulator-fixed";
74                 regulator-name = "vcc3v3_sys";
75                 regulator-always-on;
76                 regulator-boot-on;
77                 regulator-min-microvolt = <3300000>;
78                 regulator-max-microvolt = <3300000>;
79         };
80
81         vcc5v0_host: vcc5v0-host-regulator {
82                 compatible = "regulator-fixed";
83                 enable-active-high;
84                 gpio = <&gpio4 25 GPIO_ACTIVE_HIGH>;
85                 pinctrl-names = "default";
86                 pinctrl-0 = <&host_vbus_drv>;
87                 regulator-name = "vcc5v0_host";
88         };
89
90         backlight: backlight {
91                 compatible = "pwm-backlight";
92                 pwms = <&pwm0 0 25000 0>;
93                 brightness-levels = <
94                           0   1   2   3   4   5   6   7
95                           8   9  10  11  12  13  14  15
96                          16  17  18  19  20  21  22  23
97                          24  25  26  27  28  29  30  31
98                          32  33  34  35  36  37  38  39
99                          40  41  42  43  44  45  46  47
100                          48  49  50  51  52  53  54  55
101                          56  57  58  59  60  61  62  63
102                          64  65  66  67  68  69  70  71
103                          72  73  74  75  76  77  78  79
104                          80  81  82  83  84  85  86  87
105                          88  89  90  91  92  93  94  95
106                          96  97  98  99 100 101 102 103
107                         104 105 106 107 108 109 110 111
108                         112 113 114 115 116 117 118 119
109                         120 121 122 123 124 125 126 127
110                         128 129 130 131 132 133 134 135
111                         136 137 138 139 140 141 142 143
112                         144 145 146 147 148 149 150 151
113                         152 153 154 155 156 157 158 159
114                         160 161 162 163 164 165 166 167
115                         168 169 170 171 172 173 174 175
116                         176 177 178 179 180 181 182 183
117                         184 185 186 187 188 189 190 191
118                         192 193 194 195 196 197 198 199
119                         200 201 202 203 204 205 206 207
120                         208 209 210 211 212 213 214 215
121                         216 217 218 219 220 221 222 223
122                         224 225 226 227 228 229 230 231
123                         232 233 234 235 236 237 238 239
124                         240 241 242 243 244 245 246 247
125                         248 249 250 251 252 253 254 255>;
126                 default-brightness-level = <100>;
127         };
128
129         vcc_phy: vcc-phy-regulator {
130                 compatible = "regulator-fixed";
131                 regulator-name = "vcc_phy";
132                 regulator-always-on;
133                 regulator-boot-on;
134         };
135
136         io-domains {
137                 compatible = "rockchip,rk3399-io-voltage-domain";
138                 rockchip,grf = <&grf>;
139
140                 bt656-supply = <&vcc1v8_dvp>;
141                 audio-supply = <&vcca1v8_codec>;
142                 sdmmc-supply = <&vcc_sd>;
143                 gpio1830-supply = <&vcc_3v0>;
144         };
145
146         pmu-io-domains {
147                 compatible = "rockchip,rk3399-pmu-io-voltage-domain";
148                 rockchip,grf = <&pmugrf>;
149
150                 pmu1830-supply = <&vcc_1v8>;
151         };
152
153         es8316-sound {
154                 compatible = "simple-audio-card";
155                 simple-audio-card,format = "i2s";
156                 simple-audio-card,name = "rockchip,es8316-codec";
157                 simple-audio-card,mclk-fs = <256>;
158                 simple-audio-card,widgets =
159                         "Microphone", "Mic Jack",
160                         "Headphone", "Headphone Jack";
161                 simple-audio-card,routing =
162                         "Mic Jack", "MICBIAS1",
163                         "IN1P", "Mic Jack",
164                         "Headphone Jack", "HPOL",
165                         "Headphone Jack", "HPOR";
166                 simple-audio-card,cpu {
167                         sound-dai = <&i2s0>;
168                 };
169                 simple-audio-card,codec {
170                         sound-dai = <&es8316>;
171                 };
172         };
173
174         spdif-sound {
175                 compatible = "simple-audio-card";
176                 simple-audio-card,name = "rockchip,spdif";
177                 simple-audio-card,cpu {
178                         sound-dai = <&spdif>;
179                 };
180                 simple-audio-card,codec {
181                         sound-dai = <&spdif_out>;
182                 };
183         };
184
185         spdif_out: spdif-out {
186                 compatible = "linux,spdif-dit";
187                 #sound-dai-cells = <0>;
188         };
189
190         sdio_pwrseq: sdio-pwrseq {
191                 compatible = "mmc-pwrseq-simple";
192                 clocks = <&rk818 1>;
193                 clock-names = "ext_clock";
194                 pinctrl-names = "default";
195                 pinctrl-0 = <&wifi_enable_h>;
196
197                 /*
198                  * On the module itself this is one of these (depending
199                  * on the actual card populated):
200                  * - SDIO_RESET_L_WL_REG_ON
201                  * - PDN (power down when low)
202                  */
203                 reset-gpios = <&gpio0 10 GPIO_ACTIVE_LOW>; /* GPIO0_B2 */
204         };
205
206         wireless-wlan {
207                 compatible = "wlan-platdata";
208                 rockchip,grf = <&grf>;
209                 wifi_chip_type = "ap6330";
210                 sdio_vref = <1800>;
211                 WIFI,host_wake_irq = <&gpio0 3 GPIO_ACTIVE_HIGH>; /* GPIO0_a3 */
212                 status = "okay";
213         };
214
215         wireless-bluetooth {
216                 compatible = "bluetooth-platdata";
217                 clocks = <&rk818 1>;
218                 clock-names = "ext_clock";
219                 //wifi-bt-power-toggle;
220                 uart_rts_gpios = <&gpio2 19 GPIO_ACTIVE_LOW>; /* GPIO2_C3 */
221                 pinctrl-names = "default", "rts_gpio";
222                 pinctrl-0 = <&uart0_rts>;
223                 pinctrl-1 = <&uart0_gpios>;
224                 //BT,power_gpio  = <&gpio3 19 GPIO_ACTIVE_HIGH>; /* GPIOx_xx */
225                 BT,reset_gpio    = <&gpio0 9 GPIO_ACTIVE_HIGH>; /* GPIO0_B1 */
226                 BT,wake_gpio     = <&gpio2 26 GPIO_ACTIVE_HIGH>; /* GPIO2_D2 */
227                 BT,wake_host_irq = <&gpio0 4 GPIO_ACTIVE_HIGH>; /* GPIO0_A4 */
228                 status = "okay";
229         };
230
231         uboot-charge {
232                 compatible = "rockchip,uboot-charge";
233                 rockchip,uboot-charge-on = <0>;
234                 rockchip,android-charge-on = <1>;
235         };
236 };
237
238 &cluster0_opp {
239         opp@408000000 {
240                 opp-hz = /bits/ 64 <408000000>;
241                 opp-microvolt = <800000>;
242                 clock-latency-ns = <40000>;
243         };
244         opp@600000000 {
245                 opp-hz = /bits/ 64 <600000000>;
246                 opp-microvolt = <800000>;
247         };
248         opp@816000000 {
249                 opp-hz = /bits/ 64 <816000000>;
250                 opp-microvolt = <800000>;
251         };
252         opp@1008000000 {
253                 opp-hz = /bits/ 64 <1008000000>;
254                 opp-microvolt = <850000>;
255         };
256         opp@1200000000 {
257                 opp-hz = /bits/ 64 <1200000000>;
258                 opp-microvolt = <925000>;
259         };
260         opp@1416000000 {
261                 opp-hz = /bits/ 64 <1416000000>;
262                 opp-microvolt = <1075000>;
263         };
264         opp@1512000000 {
265                 opp-hz = /bits/ 64 <1512000000>;
266                 opp-microvolt = <1100000>;
267                 status="disabled";
268         };
269 };
270
271 &cluster1_opp {
272         opp@408000000 {
273                 opp-hz = /bits/ 64 <408000000>;
274                 opp-microvolt = <800000>;
275                 clock-latency-ns = <40000>;
276         };
277         opp@600000000 {
278                 opp-hz = /bits/ 64 <600000000>;
279                 opp-microvolt = <800000>;
280         };
281         opp@816000000 {
282                 opp-hz = /bits/ 64 <816000000>;
283                 opp-microvolt = <825000>;
284         };
285         opp@1008000000 {
286                 opp-hz = /bits/ 64 <1008000000>;
287                 opp-microvolt = <850000>;
288         };
289         opp@1200000000 {
290                 opp-hz = /bits/ 64 <1200000000>;
291                 opp-microvolt = <900000>;
292         };
293         opp@1416000000 {
294                 opp-hz = /bits/ 64 <1416000000>;
295                 opp-microvolt = <1000000>;
296         };
297         opp@1608000000 {
298                 opp-hz = /bits/ 64 <1608000000>;
299                 opp-microvolt = <1050000>;
300         };
301         opp@1800000000 {
302                 opp-hz = /bits/ 64 <1800000000>;
303                 opp-microvolt = <1150000>;
304         };
305         opp@1992000000 {
306                 opp-hz = /bits/ 64 <1992000000>;
307                 opp-microvolt = <1225000>;
308         };
309 };
310
311 &CPU_COST_A72 {
312         busy-cost-data = <
313                 210   129       /*  408MHz */
314                 308   184       /*  600MHz */
315                 419   246       /*  816MHz */
316                 518   335       /* 1008MHz */
317                 617   428       /* 1200MHz */
318                 728   573       /* 1416MHz */
319                 827   724       /* 1608MHz */
320                 925   900       /* 1800MHz */
321                 1024  1108      /* 1992MHz */
322         >;
323         idle-cost-data = <
324               15
325               15
326                0
327         >;
328 };
329
330 &CPU_COST_A53 {
331         busy-cost-data = <
332                 108    46       /*  408M */
333                 159    67       /*  600M */
334                 216    90       /*  816M */
335                 267    120      /* 1008M */
336                 318    153      /* 1200M */
337                 375    198      /* 1416M */
338                 401    222      /* 1512M */
339         >;
340         idle-cost-data = <
341               6
342               6
343               0
344         >;
345 };
346
347 &CLUSTER_COST_A72 {
348         busy-cost-data = <
349                 210   129       /*  408MHz */
350                 308   184       /*  600MHz */
351                 419   246       /*  816MHz */
352                 518   335       /* 1008MHz */
353                 617   428       /* 1200MHz */
354                 728   573       /* 1416MHz */
355                 827   724       /* 1608MHz */
356                 925   900       /* 1800MHz */
357                 1024  1108      /* 1992MHz */
358         >;
359         idle-cost-data = <
360                  65
361                  65
362                  65
363         >;
364 };
365
366 &CLUSTER_COST_A53 {
367         busy-cost-data = <
368                 108    46       /*  408M */
369                 159    67       /*  600M */
370                 216    90       /*  816M */
371                 267    120      /* 1008M */
372                 318    153      /* 1200M */
373                 375    198      /* 1416M */
374                 401    222      /* 1512M */
375         >;
376         idle-cost-data = <
377                 56
378                 56
379                 56
380         >;
381 };
382
383 &gpu_opp_table {
384         compatible = "operating-points-v2";
385         opp-shared;
386         opp@200000000 {
387                 opp-hz = /bits/ 64 <200000000>;
388                 opp-microvolt = <825000>;
389         };
390         opp@300000000 {
391                 opp-hz = /bits/ 64 <300000000>;
392                 opp-microvolt = <850000>;
393         };
394         opp@400000000 {
395                 opp-hz = /bits/ 64 <400000000>;
396                 opp-microvolt = <875000>;
397         };
398         opp@500000000 {
399                 opp-hz = /bits/ 64 <500000000>;
400                 opp-microvolt = <950000>;
401         };
402         opp@600000000 {
403                 opp-hz = /bits/ 64 <600000000>;
404                 opp-microvolt = <1025000>;
405         };
406         opp@800000000 {
407                 opp-hz = /bits/ 64 <800000000>;
408                 opp-microvolt = <1125000>;
409         };
410 };
411
412 &sdmmc {
413         clock-frequency = <150000000>;
414         clock-freq-min-max = <400000 150000000>;
415         supports-sd;
416         bus-width = <4>;
417         cap-mmc-highspeed;
418         cap-sd-highspeed;
419         disable-wp;
420         num-slots = <1>;
421         sd-uhs-sdr104;
422         vqmmc-supply = <&vcc_sd>;
423         pinctrl-names = "default";
424         pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
425         status = "okay";
426 };
427
428 &sdio0 {
429         clock-frequency = <50000000>;
430         clock-freq-min-max = <200000 50000000>;
431         supports-sdio;
432         bus-width = <4>;
433         disable-wp;
434         cap-sd-highspeed;
435         cap-sdio-irq;
436         keep-power-in-suspend;
437         mmc-pwrseq = <&sdio_pwrseq>;
438         non-removable;
439         num-slots = <1>;
440         pinctrl-names = "default";
441         pinctrl-0 = <&sdio0_bus4 &sdio0_cmd &sdio0_clk>;
442         sd-uhs-sdr104;
443         status = "okay";
444 };
445
446 &emmc_phy {
447         freq-sel = <200000000>;
448         dr-sel = <50>;
449         opdelay = <4>;
450         status = "okay";
451 };
452
453 &sdhci {
454         bus-width = <8>;
455         mmc-hs400-1_8v;
456         supports-emmc;
457         non-removable;
458         mmc-hs400-enhanced-strobe;
459         status = "okay";
460 };
461
462 &i2s0 {
463         status = "okay";
464         rockchip,i2s-broken-burst-len;
465         rockchip,playback-channels = <8>;
466         rockchip,capture-channels = <8>;
467         #sound-dai-cells = <0>;
468 };
469
470 &i2s2 {
471         #sound-dai-cells = <0>;
472 };
473
474 &spdif {
475         status = "okay";
476         #sound-dai-cells = <0>;
477 };
478
479 &i2c0 {
480         status = "okay";
481         i2c-scl-rising-time-ns = <219>;
482         i2c-scl-falling-time-ns = <15>;
483         clock-frequency = <400000>;
484
485         vdd_cpu_b: syr827@40 {
486                 compatible = "silergy,syr827";
487                 reg = <0x40>;
488                 vin-supply = <&vcc_sys>;
489                 regulator-compatible = "fan53555-reg";
490                 pinctrl-0 = <&vsel1_gpio>;
491                 vsel-gpios = <&gpio1 17 GPIO_ACTIVE_HIGH>;
492                 regulator-name = "vdd_cpu_b";
493                 regulator-min-microvolt = <712500>;
494                 regulator-max-microvolt = <1500000>;
495                 regulator-ramp-delay = <1000>;
496                 fcs,suspend-voltage-selector = <1>;
497                 regulator-always-on;
498                 regulator-initial-state = <3>;
499                         regulator-state-mem {
500                         regulator-off-in-suspend;
501                 };
502         };
503
504         vdd_gpu: syr828@41 {
505                 compatible = "silergy,syr828";
506                 reg = <0x41>;
507                 vin-supply = <&vcc_sys>;
508                 regulator-compatible = "fan53555-reg";
509                 pinctrl-0 = <&vsel2_gpio>;
510                 vsel-gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>;
511                 regulator-name = "vdd_gpu";
512                 regulator-min-microvolt = <712500>;
513                 regulator-max-microvolt = <1500000>;
514                 regulator-ramp-delay = <1000>;
515                 fcs,suspend-voltage-selector = <1>;
516                 regulator-boot-on;
517                 regulator-initial-state = <3>;
518                 regulator-initial-mode = <1>;/*1:pwm 2: auto mode*/
519                         regulator-state-mem {
520                         regulator-off-in-suspend;
521                 };
522         };
523
524         rk818: pmic@1c {
525                 compatible = "rockchip,rk818";
526                 status = "okay";
527                 reg = <0x1c>;
528                 clock-output-names = "xin32k", "wifibt_32kin";
529                 interrupt-parent = <&gpio1>;
530                 interrupts = <21 IRQ_TYPE_LEVEL_LOW>;
531                 pinctrl-names = "default";
532                 pinctrl-0 = <&pmic_int_l>;
533                 rockchip,system-power-controller;
534                 wakeup-source;
535                 extcon = <&fusb0>;
536                 #clock-cells = <1>;
537
538                 vcc1-supply = <&vcc_sys>;
539                 vcc2-supply = <&vcc_sys>;
540                 vcc3-supply = <&vcc_sys>;
541                 vcc4-supply = <&vcc_sys>;
542                 vcc6-supply = <&vcc_sys>;
543                 vcc7-supply = <&vcc3v3_sys>;
544                 vcc8-supply = <&vcc_sys>;
545                 vcc9-supply = <&vcc3v3_sys>;
546
547                 regulators {
548                         vdd_cpu_l: DCDC_REG1 {
549                                 regulator-name = "vdd_cpu_l";
550                                 regulator-always-on;
551                                 regulator-boot-on;
552                                 regulator-min-microvolt = <750000>;
553                                 regulator-max-microvolt = <1350000>;
554                                 regulator-ramp-delay = <6001>;
555                                 regulator-state-mem {
556                                         regulator-off-in-suspend;
557                                 };
558                         };
559
560                         vdd_center: DCDC_REG2 {
561                                 regulator-name = "vdd_center";
562                                 regulator-always-on;
563                                 regulator-boot-on;
564                                 regulator-min-microvolt = <800000>;
565                                 regulator-max-microvolt = <1350000>;
566                                 regulator-ramp-delay = <6001>;
567                                 regulator-state-mem {
568                                         regulator-on-in-suspend;
569                                         regulator-suspend-microvolt = <1000000>;
570                                 };
571                         };
572
573                         vcc_ddr: DCDC_REG3 {
574                                 regulator-name = "vcc_ddr";
575                                 regulator-always-on;
576                                 regulator-boot-on;
577                                 regulator-state-mem {
578                                         regulator-on-in-suspend;
579                                 };
580                         };
581
582                         vcc_1v8: DCDC_REG4 {
583                                 regulator-name = "vcc_1v8";
584                                 regulator-always-on;
585                                 regulator-boot-on;
586                                 regulator-min-microvolt = <1800000>;
587                                 regulator-max-microvolt = <1800000>;
588                                 regulator-state-mem {
589                                         regulator-on-in-suspend;
590                                         regulator-suspend-microvolt = <1800000>;
591                                 };
592                         };
593
594                         vcca3v0_codec: LDO_REG1 {
595                                 regulator-always-on;
596                                 regulator-boot-on;
597                                 regulator-min-microvolt = <3000000>;
598                                 regulator-max-microvolt = <3000000>;
599                                 regulator-name = "vcca3v0_codec";
600                                 regulator-state-mem {
601                                         regulator-off-in-suspend;
602                                 };
603                         };
604
605                         vcc3v0_tp: LDO_REG2 {
606                                 regulator-always-on;
607                                 regulator-boot-on;
608                                 regulator-min-microvolt = <3000000>;
609                                 regulator-max-microvolt = <3000000>;
610                                 regulator-name = "vcc3v0_tp";
611                                 regulator-state-mem {
612                                         regulator-off-in-suspend;
613                                 };
614                         };
615
616                         vcca1v8_codec: LDO_REG3 {
617                                 regulator-always-on;
618                                 regulator-boot-on;
619                                 regulator-min-microvolt = <1800000>;
620                                 regulator-max-microvolt = <1800000>;
621                                 regulator-name = "vcca1v8_codec";
622                                 regulator-state-mem {
623                                         regulator-off-in-suspend;
624                                 };
625                         };
626
627                         vcc_power_on: LDO_REG4 {
628                                 regulator-always-on;
629                                 regulator-boot-on;
630                                 regulator-min-microvolt = <3300000>;
631                                 regulator-max-microvolt = <3300000>;
632                                 regulator-name = "vcc_power_on";
633                                 regulator-state-mem {
634                                         regulator-on-in-suspend;
635                                         regulator-suspend-microvolt = <3300000>;
636                                 };
637                         };
638
639                         vcc_3v0: LDO_REG5 {
640                                 regulator-always-on;
641                                 regulator-boot-on;
642                                 regulator-min-microvolt = <3000000>;
643                                 regulator-max-microvolt = <3000000>;
644                                 regulator-name = "vcc_3v0";
645                                 regulator-state-mem {
646                                         regulator-on-in-suspend;
647                                         regulator-suspend-microvolt = <3000000>;
648                                 };
649                         };
650
651                         vcc_1v5: LDO_REG6 {
652                                 regulator-always-on;
653                                 regulator-boot-on;
654                                 regulator-min-microvolt = <1500000>;
655                                 regulator-max-microvolt = <1500000>;
656                                 regulator-name = "vcc_1v5";
657                                 regulator-state-mem {
658                                         regulator-on-in-suspend;
659                                         regulator-suspend-microvolt = <1500000>;
660                                 };
661                         };
662
663                         vcc1v8_dvp: LDO_REG7 {
664                                 regulator-always-on;
665                                 regulator-boot-on;
666                                 regulator-min-microvolt = <1800000>;
667                                 regulator-max-microvolt = <1800000>;
668                                 regulator-name = "vcc1v8_dvp";
669                                 regulator-state-mem {
670                                         regulator-on-in-suspend;
671                                         regulator-suspend-microvolt = <1800000>;
672                                 };
673                         };
674
675                         vcc3v3_s3: LDO_REG8 {
676                                 regulator-always-on;
677                                 regulator-boot-on;
678                                 regulator-min-microvolt = <3300000>;
679                                 regulator-max-microvolt = <3300000>;
680                                 regulator-name = "vcc3v3_s3";
681                                 regulator-state-mem {
682                                         regulator-on-in-suspend;
683                                         regulator-suspend-microvolt = <3300000>;
684                                 };
685                         };
686
687                         vcc_sd: LDO_REG9 {
688                                 regulator-always-on;
689                                 regulator-boot-on;
690                                 regulator-min-microvolt = <1800000>;
691                                 regulator-max-microvolt = <3300000>;
692                                 regulator-name = "vcc_sd";
693                                 regulator-state-mem {
694                                         regulator-on-in-suspend;
695                                         regulator-suspend-microvolt = <3300000>;
696                                 };
697                         };
698
699                         vcc3v3_s0: SWITCH_REG {
700                                 regulator-always-on;
701                                 regulator-boot-on;
702                                 regulator-name = "vcc3v3_s0";
703                                 regulator-state-mem {
704                                         regulator-on-in-suspend;
705                                 };
706                         };
707                 };
708
709                 battery {
710                         compatible = "rk818-battery";
711                         ocv_table = <
712                                 3400 3599 3671 3701 3728 3746 3762
713                                 3772 3781 3792 3816 3836 3866 3910
714                                 3942 3971 4002 4050 4088 4132 4183>;
715                         design_capacity = <4000>;
716                         design_qmax = <4100>;
717                         bat_res = <100>;
718                         max_input_current = <2000>;
719                         max_chrg_current = <1800>;
720                         max_chrg_voltage = <4200>;
721                         sleep_enter_current = <300>;
722                         sleep_exit_current = <300>;
723                         power_off_thresd = <3400>;
724                         zero_algorithm_vol = <3850>;
725                         fb_temperature = <115>;
726                         sample_res = <10>;
727                         max_soc_offset = <60>;
728                         energy_mode = <0>;
729                         monitor_sec = <5>;
730                         virtual_power = <0>;
731                         power_dc2otg = <0>;
732                 };
733         };
734 };
735
736 &i2c1 {
737         status = "okay";
738         i2c-scl-rising-time-ns = <164>;
739         i2c-scl-falling-time-ns = <15>;
740
741         es8316: es8316@10 {
742                 #sound-dai-cells = <0>;
743                 compatible = "everest,es8316";
744                 reg = <0x10>;
745                 clocks = <&cru SCLK_I2S_8CH_OUT>;
746                 clock-names = "mclk";
747                 spk-con-gpio = <&gpio0 11 GPIO_ACTIVE_HIGH>;
748                 hp-det-gpio = <&gpio4 28 GPIO_ACTIVE_LOW>;
749         };
750 };
751
752 &i2c4 {
753         status = "okay";
754         i2c-scl-rising-time-ns = <345>;
755         i2c-scl-falling-time-ns = <11>;
756         clock-frequency = <400000>;
757
758         sensor@0f {
759                 status = "okay";
760                 compatible = "ak8963";
761                 pinctrl-names = "default";
762                 pinctrl-0 = <&ak8963_irq_gpio>;
763                 reg = <0x0f>;
764                 type = <SENSOR_TYPE_COMPASS>;
765                 irq-gpio = <&gpio1 0 IRQ_TYPE_EDGE_RISING>;
766                 irq_enable = <1>;
767                 poll_delay_ms = <30>;
768                 layout = <1>;
769         };
770
771         fusb0: fusb30x@22 {
772                 compatible = "fairchild,fusb302";
773                 reg = <0x22>;
774                 pinctrl-names = "default";
775                 pinctrl-0 = <&fusb0_int>;
776                 int-n-gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>;
777                 status = "okay";
778         };
779 };
780
781 &i2c5 {
782         status = "okay";
783
784         touch@40 {
785                 compatible = "gslX680";
786                 reg = <0x40>;
787                 touch-gpio = <&gpio1 20 IRQ_TYPE_LEVEL_LOW>;
788                 reset-gpio = <&gpio4 22 GPIO_ACTIVE_LOW>;
789                 max-x = <1280>;
790                 max-y = <600>;
791                 status = "okay";
792         };
793 };
794
795 &spi1 {
796         status = "okay";
797         max-freq = <50000000>;
798         pinctrl-names = "default", "sleep";
799         pinctrl-1 = <&spi1_gpio>;
800         mpu6500@0 {
801                 status = "okay";
802                 compatible = "inv-spi,mpu6500";
803                 pinctrl-names = "default";
804                 pinctrl-0 = <&mpu6500_irq_gpio>;
805                 irq-gpio = <&gpio1 4 IRQ_TYPE_EDGE_RISING>;
806                 reg = <0>;
807                 spi-max-frequency = <1000000>;
808                 spi-cpha;
809                 spi-cpol;
810                 mpu-int_config = <0x00>;
811                 mpu-level_shifter = <0>;
812                 mpu-orientation = <1 0 0 0 1 0 0 0 1>;
813                 orientation-x= <1>;
814                 orientation-y= <0>;
815                 orientation-z= <1>;
816                 support-hw-poweroff = <1>;
817                 mpu-debug = <1>;
818         };
819 };
820
821 &threshold {
822         temperature = <85000>; /* millicelsius */
823 };
824
825 &target {
826         temperature = <100000>; /* millicelsius */
827 };
828
829 &soc_crit {
830         temperature = <105000>; /* millicelsius */
831 };
832
833 &tsadc {
834         rockchip,hw-tshut-mode = <1>; /* tshut mode 0:CRU 1:GPIO */
835         rockchip,hw-tshut-polarity = <1>; /* tshut polarity 0:LOW 1:HIGH */
836         rockchip,hw-tshut-temp = <110000>;
837         status = "okay";
838 };
839
840 &saradc {
841         status = "okay";
842 };
843
844 &rk_key {
845         compatible = "rockchip,key";
846         status = "okay";
847         io-channels = <&saradc 1>;
848
849         vol-up-key {
850                 linux,code = <115>;
851                 label = "volume up";
852                 rockchip,adc_value = <340>;
853         };
854
855         vol-down-key {
856                 linux,code = <114>;
857                 label = "volume down";
858                 rockchip,adc_value = <170>;
859         };
860
861         power-key {
862                 gpios = <&gpio0 5 GPIO_ACTIVE_LOW>;
863                 linux,code = <116>;
864                 label = "power";
865                 gpio-key,wakeup;
866         };
867
868         back-key {
869                 linux,code = <158>;
870                 label = "back";
871                 rockchip,adc_value = <620>;
872         };
873
874         home-key {
875                 linux,code = <102>;
876                 label = "home";
877                 rockchip,adc_value = <700>;
878         };
879 };
880
881 &u2phy0 {
882         extcon = <&fusb0>;
883         status = "okay";
884
885         u2phy0_otg: otg-port {
886                 status = "okay";
887         };
888
889         u2phy0_host: host-port {
890                 phy-supply = <&vcc5v0_host>;
891                 status = "okay";
892         };
893 };
894
895 &u2phy1 {
896         status = "okay";
897
898         u2phy1_otg: otg-port {
899                 status = "okay";
900         };
901
902         u2phy1_host: host-port {
903                 phy-supply = <&vcc5v0_host>;
904                 status = "okay";
905         };
906 };
907
908 &uart0 {
909         pinctrl-names = "default";
910         pinctrl-0 = <&uart0_xfer &uart0_cts>;
911         status = "okay";
912 };
913
914 &uart2 {
915         status = "okay";
916 };
917
918 &usb_host0_ehci {
919         status = "okay";
920 };
921
922 &usb_host0_ohci {
923         status = "okay";
924 };
925
926 &usb_host1_ehci {
927         status = "okay";
928 };
929
930 &usb_host1_ohci {
931         status = "okay";
932 };
933
934 &usbdrd3_0 {
935         extcon = <&fusb0>;
936         status = "okay";
937 };
938
939 &usbdrd_dwc3_0 {
940         status = "okay";
941 };
942
943 &usbdrd3_1 {
944         status = "okay";
945 };
946
947 &usbdrd_dwc3_1 {
948         status = "okay";
949 };
950
951 &tcphy0 {
952         status = "okay";
953         extcon = <&fusb0>;
954 };
955
956 &pwm0 {
957         status = "okay";
958 };
959
960 &pwm2 {
961         status = "okay";
962 };
963
964 &vdd_center {
965         rockchip,pwm_id= <3>;
966         rockchip,pwm_voltage = <900000>;
967 };
968
969 &rk_screen {
970         assigned-clocks = <&cru PLL_VPLL>;
971         assigned-clock-rates = <245000000>;
972         #include <dt-bindings/display/screen-timing/lcd-ls055r1sx04-mipi.dtsi>
973 };
974
975 &fb {
976         rockchip,uboot-logo-on = <1>;
977         rockchip,disp-mode = <NO_DUAL>;
978 };
979
980 &vopb_rk_fb {
981         status = "okay";
982         power_ctr: power_ctr {
983                 lcd_en: lcd-en {
984                         rockchip,power_type = <GPIO>;
985                         gpios = <&gpio3 5 GPIO_ACTIVE_HIGH>;
986                         rockchip,delay = <10>;
987                 };
988                 lcd_rst: lcd-rst {
989                         rockchip,power_type = <GPIO>;
990                         gpios = <&gpio3 4 GPIO_ACTIVE_HIGH>;
991                         rockchip,delay = <10>;
992                 };
993         };
994 };
995
996 &vopl_rk_fb {
997         status = "okay";
998 };
999
1000 &mipi0_rk_fb {
1001         status = "okay";
1002 };
1003
1004 &mipi1_rk_fb {
1005         status = "okay";
1006 };
1007
1008 &cpu_l0 {
1009         cpu-supply = <&vdd_cpu_l>;
1010 };
1011
1012 &cpu_l1 {
1013         cpu-supply = <&vdd_cpu_l>;
1014 };
1015
1016 &cpu_l2 {
1017         cpu-supply = <&vdd_cpu_l>;
1018 };
1019
1020 &cpu_l3 {
1021         cpu-supply = <&vdd_cpu_l>;
1022 };
1023
1024 &cpu_b0 {
1025         cpu-supply = <&vdd_cpu_b>;
1026 };
1027
1028 &cpu_b1 {
1029         cpu-supply = <&vdd_cpu_b>;
1030 };
1031
1032 &gpu {
1033         status = "okay";
1034         mali-supply = <&vdd_gpu>;
1035 };
1036
1037 &pinctrl {
1038         sdio-pwrseq {
1039                 wifi_enable_h: wifi-enable-h {
1040                         rockchip,pins = <0 10 RK_FUNC_GPIO &pcfg_pull_none>;
1041                 };
1042         };
1043
1044         wireless-bluetooth {
1045                 uart0_gpios: uart0-gpios {
1046                         rockchip,pins = <2 19 RK_FUNC_GPIO &pcfg_pull_none>;
1047                 };
1048         };
1049
1050         pmic {
1051                 pmic_int_l: pmic-int-l {
1052                         rockchip,pins =
1053                                 <1 21 RK_FUNC_GPIO &pcfg_pull_up>;
1054                 };
1055
1056                 pmic_dvs2: pmic-dvs2 {
1057                         rockchip,pins =
1058                                 <1 18 RK_FUNC_GPIO &pcfg_pull_down>;
1059                 };
1060
1061                 vsel1_gpio: vsel1-gpio {
1062                         rockchip,pins =
1063                                 <1 17 RK_FUNC_GPIO &pcfg_pull_down>;
1064                 };
1065
1066                 vsel2_gpio: vsel2-gpio {
1067                         rockchip,pins =
1068                                 <1 14 RK_FUNC_GPIO &pcfg_pull_down>;
1069                 };
1070         };
1071
1072         mpu6500 {
1073                 mpu6500_irq_gpio: mpu6500-irq-gpio {
1074                         rockchip,pins = <1 4 RK_FUNC_GPIO &pcfg_pull_none>;
1075                 };
1076         };
1077
1078         usb2 {
1079                 host_vbus_drv: host-vbus-drv {
1080                         rockchip,pins =
1081                                 <4 25 RK_FUNC_GPIO &pcfg_pull_none>;
1082                 };
1083         };
1084
1085         ak8963 {
1086                 ak8963_irq_gpio: ak8963-irq-gpio {
1087                         rockchip,pins = <1 0 RK_FUNC_GPIO &pcfg_pull_none>;
1088                 };
1089         };
1090
1091         spi1 {
1092                 spi1_gpio: spi1-gpio {
1093                         rockchip,pins =
1094                                 <1 7 RK_FUNC_GPIO &pcfg_output_low>,
1095                                 <1 8 RK_FUNC_GPIO &pcfg_output_low>,
1096                                 <1 9 RK_FUNC_GPIO &pcfg_output_low>,
1097                                 <1 10 RK_FUNC_GPIO &pcfg_output_low>;
1098                 };
1099         };
1100
1101         fusb30x {
1102                 fusb0_int: fusb0-int {
1103                         rockchip,pins = <1 2 RK_FUNC_GPIO &pcfg_pull_up>;
1104                 };
1105         };
1106 };