ARM64: dts: rockchip: rename mipi to dsi for rk3366
[firefly-linux-kernel-4.4.55.git] / arch / arm64 / boot / dts / rockchip / rk3366-sheep.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 "rk3366.dtsi"
46 #include "rk3366-android.dtsi"
47
48 / {
49         model = "Rockchip SDK sheep board";
50         compatible = "rockchip,sheep", "rockchip,rk3366";
51
52         chosen {
53                 bootargs = "earlycon=uart8250,mmio32,0xff690000 swiotlb=1 firmware_class.path=/system/vendor/firmware";
54         };
55
56         fiq_debugger: fiq-debugger {
57                 compatible = "rockchip,fiq-debugger";
58                 rockchip,serial-id = <2>;
59                 rockchip,wake-irq = <0>;
60                 rockchip,irq-mode-enable = <0>;  /* If enable uart uses irq instead of fiq */
61                 rockchip,baudrate = <1500000>;  /* Only 115200 and 1500000 */
62                 pinctrl-names = "default";
63                 pinctrl-0 = <&uart2_t1_xfer>;
64                 interrupts = <GIC_SPI 154 IRQ_TYPE_LEVEL_HIGH 0>;   /* signal irq */
65         };
66
67         backlight: backlight {
68                 compatible = "pwm-backlight";
69                 pwms = <&pwm0 0 25000 PWM_POLARITY_INVERTED>;
70                 brightness-levels = <
71                           0   1   2   3   4   5   6   7
72                           8   9  10  11  12  13  14  15
73                          16  17  18  19  20  21  22  23
74                          24  25  26  27  28  29  30  31
75                          32  33  34  35  36  37  38  39
76                          40  41  42  43  44  45  46  47
77                          48  49  50  51  52  53  54  55
78                          56  57  58  59  60  61  62  63
79                          64  65  66  67  68  69  70  71
80                          72  73  74  75  76  77  78  79
81                          80  81  82  83  84  85  86  87
82                          88  89  90  91  92  93  94  95
83                          96  97  98  99 100 101 102 103
84                         104 105 106 107 108 109 110 111
85                         112 113 114 115 116 117 118 119
86                         120 121 122 123 124 125 126 127
87                         128 129 130 131 132 133 134 135
88                         136 137 138 139 140 141 142 143
89                         144 145 146 147 148 149 150 151
90                         152 153 154 155 156 157 158 159
91                         160 161 162 163 164 165 166 167
92                         168 169 170 171 172 173 174 175
93                         176 177 178 179 180 181 182 183
94                         184 185 186 187 188 189 190 191
95                         192 193 194 195 196 197 198 199
96                         200 201 202 203 204 205 206 207
97                         208 209 210 211 212 213 214 215
98                         216 217 218 219 220 221 222 223
99                         224 225 226 227 228 229 230 231
100                         232 233 234 235 236 237 238 239
101                         240 241 242 243 244 245 246 247
102                         248 249 250 251 252 253 254 255>;
103                 default-brightness-level = <200>;
104                 enable-gpios = <&gpio0 26 GPIO_ACTIVE_HIGH>;
105         };
106
107         dwc_control_usb: dwc-control-usb {
108                 compatible = "rockchip,rk3368-dwc-control-usb";
109                 rockchip,grf = <&grf>;
110                 grf-offset = <0x049c>; /* GRF_SOC_STATUS for USB2.0 OTG */
111                 interrupts = <GIC_SPI 93 IRQ_TYPE_LEVEL_HIGH>,
112                              <GIC_SPI 94 IRQ_TYPE_LEVEL_HIGH>,
113                              <GIC_SPI 95 IRQ_TYPE_LEVEL_HIGH>,
114                              <GIC_SPI 96 IRQ_TYPE_LEVEL_HIGH>;
115                 interrupt-names = "otg_id", "otg_bvalid",
116                                   "otg_linestate", "host0_linestate";
117                 clocks = <&cru SCLK_USBPHY480M>, <&cru HCLK_OTG>;
118                 clock-names = "sclk_otgphy0", "otg";
119
120                 usb_bc {
121                         compatible = "inno,phy";
122                         regbase = &dwc_control_usb;
123                         rk_usb,bvalid     = <0x49c 23 1>;
124                         rk_usb,iddig      = <0x49c 26 1>;
125                         rk_usb,vdmsrcen   = <0x718 12 1>;
126                         rk_usb,vdpsrcen   = <0x718 11 1>;
127                         rk_usb,rdmpden    = <0x718 10 1>;
128                         rk_usb,idpsrcen   = <0x718  9 1>;
129                         rk_usb,idmsinken  = <0x718  8 1>;
130                         rk_usb,idpsinken  = <0x718  7 1>;
131                         rk_usb,dpattach   = <0x498 31 1>;
132                         rk_usb,cpdet      = <0x498 30 1>;
133                         rk_usb,dcpattach  = <0x498 29 1>;
134                 };
135         };
136
137         ext_gmac: external-gmac-clock {
138                 compatible = "fixed-clock";
139                 clock-frequency = <125000000>;
140                 clock-output-names = "ext_gmac";
141                 #clock-cells = <0>;
142         };
143
144         ion {
145                 compatible = "rockchip,ion";
146                 #address-cells = <1>;
147                 #size-cells = <0>;
148
149                 cma-heap {
150                         reg = <0x00000000 0x02000000>;
151                 };
152
153                 system-heap {
154                 };
155         };
156
157         io-domains {
158                 compatible = "rockchip,rk3366-io-voltage-domain";
159                 rockchip,grf = <&grf>;
160
161                 lcdc-supply = <&vcc_io>;
162                 dvpts-supply = <&vcc_18>;
163                 wifibt-supply = <&vccio_wl>;
164                 audio-supply = <&vcc_io>;
165                 sdcard-supply = <&vccio_sd>;
166                 tphdsor-supply = <&vcc_io>;
167         };
168
169         i2c@2 {
170                 compatible = "i2c-gpio";
171                 gpios = <&gpio5 15 GPIO_ACTIVE_HIGH>, /* sda */
172                         <&gpio5 16 GPIO_ACTIVE_HIGH>; /* scl */
173                 i2c-gpio,delay-us = <2>;        /* ~100 kHz */
174                 #address-cells = <1>;
175                 #size-cells = <0>;
176                 pinctrl-names = "default";
177                 pinctrl-0 = <&i2c2_gpio>;
178                 status = "disabled";
179
180                 mpu6050@68 {
181                         status = "disabled";
182                         compatible = "invensense,mpu6050";
183                         pinctrl-names = "default";
184                         pinctrl-0 = <&mpu6500_irq_gpio>;
185                         reg = <0x68>;
186                         irq-gpio = <&gpio5 18 IRQ_TYPE_EDGE_RISING>;
187                         mpu-int_config = <0x10>;
188                         mpu-level_shifter = <0>;
189                         mpu-orientation = <0 1 0 1 0 0 0 0 1>;
190                         orientation-x= <0>;
191                         orientation-y= <1>;
192                         orientation-z= <0>;
193                         support-hw-poweroff = <0>;
194                         mpu-debug = <1>;
195                 };
196         };
197
198         i2c@4 {
199                 compatible = "i2c-gpio";
200                 gpios = <&gpio5 9 GPIO_ACTIVE_HIGH>, /* sda */
201                         <&gpio5 8 GPIO_ACTIVE_HIGH>; /* scl */
202                 i2c-gpio,delay-us = <2>;        /* ~100 kHz */
203                 #address-cells = <1>;
204                 #size-cells = <0>;
205                 pinctrl-names = "default";
206                 pinctrl-0 = <&i2c4_gpio>;
207                 status = "okay";
208
209                 gt9xx: gt9xx@14 {
210                         compatible = "goodix,gt9xx";
211                         reg = <0x14>;
212                         touch-gpio = <&gpio5 11 IRQ_TYPE_LEVEL_LOW>;
213                         reset-gpio = <&gpio5 10 GPIO_ACTIVE_HIGH>;
214                         max-x = <1200>;
215                         max-y = <1900>;
216                         tp-size = <911>;
217                         tp-supply = <&vcc_tp>;
218                         status = "okay";
219                 };
220         };
221
222         ramoops_mem: ramoops_mem {
223                 reg = <0x0 0x100000 0x0 0x100000>;
224                 reg-names = "ramoops_mem";
225         };
226
227         ramoops {
228                 compatible = "ramoops";
229                 record-size = <0x0 0x10000>;
230                 console-size = <0x0 0x80000>;
231                 ftrace-size = <0x0 0x10000>;
232                 pmsg-size = <0x0 0x50000>;
233                 memory-region = <&ramoops_mem>;
234         };
235
236         rk_key: rockchip-key {
237                 compatible = "rockchip,key";
238                 status = "okay";
239
240                 io-channels = <&saradc 1>;
241
242                 vol-up-key {
243                         linux,code = <115>;
244                         label = "volume up";
245                         rockchip,adc_value = <1>;
246                 };
247
248                 vol-down-key {
249                         linux,code = <114>;
250                         label = "volume down";
251                         rockchip,adc_value = <170>;
252                 };
253
254                 power-key {
255                         gpios = <&gpio0 11 GPIO_ACTIVE_LOW>;
256                         linux,code = <116>;
257                         label = "power";
258                         gpio-key,wakeup;
259                 };
260
261                 menu-key {
262                         linux,code = <59>;
263                         label = "menu";
264                         rockchip,adc_value = <355>;
265                 };
266
267                 home-key {
268                         linux,code = <102>;
269                         label = "home";
270                         rockchip,adc_value = <746>;
271                 };
272
273                 back-key {
274                         linux,code = <158>;
275                         label = "back";
276                         rockchip,adc_value = <560>;
277                 };
278
279                 camera-key {
280                         linux,code = <212>;
281                         label = "camera";
282                         rockchip,adc_value = <450>;
283                 };
284         };
285
286         rt5640-sound {
287                 compatible = "simple-audio-card";
288                 simple-audio-card,format = "i2s";
289                 simple-audio-card,name = "rockchip,rt5640-codec";
290                 simple-audio-card,mclk-fs = <256>;
291                 simple-audio-card,widgets =
292                         "Microphone", "Mic Jack",
293                         "Headphone", "Headphone Jack";
294                 simple-audio-card,routing =
295                         "Mic Jack", "MICBIAS1",
296                         "IN1P", "Mic Jack",
297                         "Headphone Jack", "HPOL",
298                         "Headphone Jack", "HPOR";
299                 simple-audio-card,cpu {
300                         sound-dai = <&i2s_8ch>;
301                 };
302                 simple-audio-card,codec {
303                         sound-dai = <&rt5640>;
304                 };
305         };
306
307         spdif-sound {
308                 compatible = "simple-audio-card";
309                 simple-audio-card,name = "rockchip,spdif";
310                 simple-audio-card,cpu {
311                         sound-dai = <&spdif>;
312                 };
313                 simple-audio-card,codec {
314                         sound-dai = <&spdif_out>;
315                 };
316         };
317
318         spdif_out: spdif-out {
319                 compatible = "linux,spdif-dit";
320                 #sound-dai-cells = <0>;
321         };
322
323         vcc_sys: vcc-sys {
324                 compatible = "regulator-fixed";
325                 regulator-name = "vcc_sys";
326                 regulator-always-on;
327                 regulator-boot-on;
328                 regulator-min-microvolt = <3800000>;
329                 regulator-max-microvolt = <3800000>;
330         };
331
332         vbus_host: vbus-host-regulator {
333                 compatible = "regulator-fixed";
334                 enable-active-high;
335                 gpio = <&gpio0 16 GPIO_ACTIVE_HIGH>;
336                 pinctrl-names = "default";
337                 pinctrl-0 = <&host_vbus_drv>;
338                 regulator-name = "vbus_host";
339         };
340
341         vcc_phy: vcc-phy-regulator {
342                 compatible = "regulator-fixed";
343                 enable-active-high;
344                 gpio = <&gpio0 25 GPIO_ACTIVE_HIGH>;
345                 pinctrl-names = "default";
346                 pinctrl-0 = <&eth_phy_pwr>;
347                 regulator-name = "vcc_phy";
348                 regulator-always-on;
349                 regulator-boot-on;
350         };
351
352         sdio_pwrseq: sdio-pwrseq {
353                 compatible = "mmc-pwrseq-simple";
354                 clocks = <&rk818 1>;
355                 clock-names = "ext_clock";
356                 pinctrl-names = "default";
357                 pinctrl-0 = <&wifi_enable_h>;
358
359                 /*
360                  * On the module itself this is one of these (depending
361                  * on the actual card populated):
362                  * - SDIO_RESET_L_WL_REG_ON
363                  * - PDN (power down when low)
364                  */
365                 reset-gpios = <&gpio0 14 GPIO_ACTIVE_LOW>; /* GPIO0_B6 */
366         };
367
368         wireless-wlan {
369                 compatible = "wlan-platdata";
370                 rockchip,grf = <&grf>;
371                 wifi_chip_type = "ap6335";
372                 sdio_vref = <1800>;
373                 WIFI,host_wake_irq = <&gpio3 20 GPIO_ACTIVE_HIGH>; /* GPIO3_c4 */
374                 status = "okay";
375         };
376
377         wireless-bluetooth {
378                 compatible = "bluetooth-platdata";
379                 //wifi-bt-power-toggle;
380                 uart_rts_gpios = <&gpio3 11 GPIO_ACTIVE_LOW>; /* GPIO3_b3 */
381                 pinctrl-names = "default","rts_gpio";
382                 pinctrl-0 = <&uart0_rts>;
383                 pinctrl-1 = <&uart0_rts_gpio>;
384                 //BT,power_gpio  = <&gpio3 19 GPIO_ACTIVE_HIGH>; /* GPIO3_c3 */
385                 BT,reset_gpio    = <&gpio3 19 GPIO_ACTIVE_HIGH>; /* GPIO3_c3 */
386                 BT,wake_gpio     = <&gpio3 18 GPIO_ACTIVE_HIGH>; /* GPIO3_c2 */
387                 BT,wake_host_irq = <&gpio3 21 GPIO_ACTIVE_HIGH>; /* GPIO3_c5 */
388                 status = "okay";
389         };
390 };
391
392 &cpu0 {
393         cpu-supply = <&syr827>;
394 };
395
396 &cpu1 {
397         cpu-supply = <&syr827>;
398 };
399
400 &cpu2 {
401         cpu-supply = <&syr827>;
402 };
403
404 &cpu3 {
405         cpu-supply = <&syr827>;
406 };
407
408 &gpu {
409         mali-supply = <&vdd_logic>;
410         status = "okay";
411 };
412
413 &gmac {
414         phy-supply = <&vcc_phy>;
415         phy-mode = "rgmii";
416         clock_in_out = "input";
417         snps,reset-gpio = <&gpio2 15 GPIO_ACTIVE_LOW>;
418         snps,reset-active-low;
419         snps,reset-delays-us = <0 10000 50000>;
420         assigned-clocks = <&cru SCLK_MAC>;
421         assigned-clock-parents = <&ext_gmac>;
422         pinctrl-names = "default";
423         pinctrl-0 = <&rgmii_pins>;
424         tx_delay = <0x25>;
425         rx_delay = <0x1d>;
426         status = "okay";
427 };
428
429 &i2c0 {
430         status = "okay";
431         i2c-scl-rising-time-ns = <250>;
432         i2c-scl-falling-time-ns = <20>;
433
434         syr827: syr827@40 {
435                 regulator-name = "vdd_arm";
436                 compatible = "silergy,syr827";
437                 status = "okay";
438                 reg = <0x40>;
439                 regulator-compatible = "fan53555-reg";
440                 regulator-min-microvolt = <712500>;
441                 regulator-max-microvolt = <1500000>;
442                 fcs,suspend-voltage-selector = <1>;
443                 regulator-always-on;
444                 regulator-boot-on;
445                 regulator-initial-state = <3>;
446                 regulator-ramp-delay = <2000>;
447                 regulator-state-mem {
448                         regulator-off-in-suspend;
449                         regulator-suspend-microvolt = <900000>;
450                 };
451         };
452
453         rk818: pmic@1c {
454                 compatible = "rockchip,rk818";
455                 status = "okay";
456                 reg = <0x1c>;
457                 clock-output-names = "xin32k", "wifibt_32kin";
458                 interrupt-parent = <&gpio0>;
459                 interrupts = <2 IRQ_TYPE_LEVEL_LOW>;
460                 pinctrl-names = "default";
461                 pinctrl-0 = <&pmic_int_l>;
462                 rockchip,system-power-controller;
463                 wakeup-source;
464                 #clock-cells = <1>;
465
466                 vcc1-supply = <&vcc_sys>;
467                 vcc2-supply = <&vcc_sys>;
468                 vcc3-supply = <&vcc_sys>;
469                 vcc4-supply = <&vcc_sys>;
470                 vcc6-supply = <&vcc_sys>;
471                 vcc7-supply = <&vcc_sys>;
472                 vcc8-supply = <&vcc_sys>;
473                 vcc9-supply = <&vcc_io>;
474
475                 regulators {
476                         vdd_logic: DCDC_REG1 {
477                                 regulator-name = "vdd_logic";
478                                 regulator-always-on;
479                                 regulator-boot-on;
480                                 regulator-min-microvolt = <750000>;
481                                 regulator-max-microvolt = <1450000>;
482                                 regulator-ramp-delay = <6001>;
483                                 regulator-state-mem {
484                                         regulator-on-in-suspend;
485                                         regulator-suspend-microvolt = <1000000>;
486                                 };
487                         };
488
489                         vdd_gpu: DCDC_REG2 {
490                                 regulator-name = "vdd_gpu";
491                                 regulator-always-on;
492                                 regulator-boot-on;
493                                 regulator-min-microvolt = <800000>;
494                                 regulator-max-microvolt = <1250000>;
495                                 regulator-ramp-delay = <6001>;
496                                 regulator-state-mem {
497                                         regulator-on-in-suspend;
498                                         regulator-suspend-microvolt = <1000000>;
499                                 };
500                         };
501
502                         vcc_ddr: DCDC_REG3 {
503                                 regulator-name = "vcc_ddr";
504                                 regulator-always-on;
505                                 regulator-boot-on;
506                                 regulator-state-mem {
507                                         regulator-on-in-suspend;
508                                 };
509                         };
510
511                         vcc_io: DCDC_REG4 {
512                                 regulator-name = "vcc_io";
513                                 regulator-always-on;
514                                 regulator-boot-on;
515                                 regulator-min-microvolt = <3300000>;
516                                 regulator-max-microvolt = <3300000>;
517                                 regulator-state-mem {
518                                         regulator-on-in-suspend;
519                                         regulator-suspend-microvolt = <3300000>;
520                                 };
521                         };
522
523                         vcca_codec: LDO_REG1 {
524                                 regulator-name = "vcca_codec";
525                                 regulator-always-on;
526                                 regulator-boot-on;
527                                 regulator-min-microvolt = <3300000>;
528                                 regulator-max-microvolt = <3300000>;
529                                 regulator-state-mem {
530                                         regulator-on-in-suspend;
531                                         regulator-suspend-microvolt = <3300000>;
532                                 };
533                         };
534
535                         vcc_tp: LDO_REG2 {
536                                 regulator-name = "vcc_tp";
537                                 regulator-always-on;
538                                 regulator-boot-on;
539                                 regulator-min-microvolt = <3000000>;
540                                 regulator-max-microvolt = <3000000>;
541                                 regulator-state-mem {
542                                         regulator-on-in-suspend;
543                                         regulator-suspend-microvolt = <3000000>;
544                                 };
545                         };
546
547                         vdd_10: LDO_REG3 {
548                                 regulator-name = "vdd_10";
549                                 regulator-always-on;
550                                 regulator-boot-on;
551                                 regulator-min-microvolt = <1000000>;
552                                 regulator-max-microvolt = <1000000>;
553                                 regulator-state-mem {
554                                         regulator-on-in-suspend;
555                                         regulator-suspend-microvolt = <1000000>;
556                                 };
557                         };
558
559                         vcc18_lcd: LDO_REG4 {
560                                 regulator-name = "vcc18_lcd";
561                                 regulator-always-on;
562                                 regulator-boot-on;
563                                 regulator-min-microvolt = <1800000>;
564                                 regulator-max-microvolt = <1800000>;
565                                 regulator-state-mem {
566                                         regulator-on-in-suspend;
567                                         regulator-suspend-microvolt = <1800000>;
568                                 };
569                         };
570
571                         vccio_pmu: LDO_REG5 {
572                                 regulator-name = "vccio_pmu";
573                                 regulator-always-on;
574                                 regulator-boot-on;
575                                 regulator-min-microvolt = <1800000>;
576                                 regulator-max-microvolt = <1800000>;
577                                 regulator-state-mem {
578                                         regulator-on-in-suspend;
579                                         regulator-suspend-microvolt = <1800000>;
580                                 };
581                         };
582
583                         vdd10_lcd: LDO_REG6 {
584                                 regulator-name = "vdd10_lcd";
585                                 regulator-always-on;
586                                 regulator-boot-on;
587                                 regulator-min-microvolt = <1000000>;
588                                 regulator-max-microvolt = <1000000>;
589                                 regulator-state-mem {
590                                         regulator-on-in-suspend;
591                                         regulator-suspend-microvolt = <1000000>;
592                                 };
593                         };
594
595                         vcc_18: LDO_REG7 {
596                                 regulator-name = "vcc_18";
597                                 regulator-always-on;
598                                 regulator-boot-on;
599                                 regulator-min-microvolt = <1800000>;
600                                 regulator-max-microvolt = <1800000>;
601                                 regulator-state-mem {
602                                         regulator-on-in-suspend;
603                                         regulator-suspend-microvolt = <1800000>;
604                                 };
605                         };
606
607                         vccio_wl: LDO_REG8 {
608                                 regulator-name = "vccio_wl";
609                                 regulator-always-on;
610                                 regulator-boot-on;
611                                 regulator-min-microvolt = <1800000>;
612                                 regulator-max-microvolt = <3300000>;
613                                 regulator-state-mem {
614                                         regulator-on-in-suspend;
615                                         regulator-suspend-microvolt = <3300000>;
616                                 };
617                         };
618
619                         vccio_sd: LDO_REG9 {
620                                 regulator-name = "vccio_sd";
621                                 regulator-always-on;
622                                 regulator-boot-on;
623                                 regulator-min-microvolt = <1800000>;
624                                 regulator-max-microvolt = <3300000>;
625                                 regulator-state-mem {
626                                         regulator-on-in-suspend;
627                                         regulator-suspend-microvolt = <3300000>;
628                                 };
629                         };
630
631                         vcc_sd: SWITCH_REG {
632                                 regulator-name = "vcc_sd";
633                                 regulator-always-on;
634                                 regulator-boot-on;
635                                 regulator-state-mem {
636                                         regulator-on-in-suspend;
637                                 };
638                         };
639                 };
640
641                 battery {
642                         compatible = "rk818-battery";
643                         ocv_table = <3400 3650 3693 3707 3731 3749 3760
644                                      3770 3782 3796 3812 3829 3852 3882
645                                      3915 3951 3981 4047 4086 4132 4182>;
646                         design_capacity = <7916>;
647                         design_qmax = <8708>;
648                         bat_res = <65>;
649                         max_input_current = <2000>;
650                         max_chrg_current = <1600>;
651                         max_chrg_voltage = <4200>;
652                         sleep_enter_current = <300>;
653                         sleep_exit_current = <300>;
654                         power_off_thresd = <3400>;
655                         zero_algorithm_vol = <3850>;
656                         fb_temperature = <105>;
657                         sample_res = <20>;
658                         max_soc_offset = <60>;
659                         energy_mode = <0>;
660                         monitor_sec = <5>;
661                         virtual_power = <0>;
662                         power_dc2otg = <0>;
663                 };
664         };
665 };
666
667 &i2c1 {
668         status = "okay";
669         i2c-scl-rising-time-ns = <460>;
670         i2c-scl-falling-time-ns = <15>;
671
672         rt5640: rt5640@1c {
673                 #sound-dai-cells = <0>;
674                 compatible = "realtek,rt5640";
675                 reg = <0x1c>;
676                 clocks = <&cru SCLK_I2S_8CH_OUT>;
677                 clock-names = "mclk";
678                 realtek,in1-differential;
679         };
680 };
681
682 &i2s_8ch {
683         status = "okay";
684         rockchip,i2s-broken-burst-len;
685         rockchip,playback-channels = <8>;
686         rockchip,capture-channels = <2>;
687         #sound-dai-cells = <0>;
688 };
689
690 &spdif {
691         status = "okay";
692         #sound-dai-cells = <0>;
693 };
694
695 &dsi {
696         status = "okay";
697
698         panel: panel@0 {
699                 compatible = "simple-panel-dsi";
700                 reg = <0>;
701                 backlight = <&backlight>;
702                 enable-gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>;
703
704                 delay,prepare = <20>;
705                 delay,enable = <20>;
706
707                 dsi,flags = <(MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST)>;
708                 dsi,format = <MIPI_DSI_FMT_RGB888>;
709                 dsi,lanes = <4>;
710
711                 display-timings {
712                         native-mode = <&timing0>;
713
714                         timing0: timing0 {
715                                 clock-frequency = <135000000>;
716                                 hactive = <1200>;
717                                 vactive = <1920>;
718                                 hfront-porch = <80>;
719                                 hsync-len = <20>;
720                                 hback-porch = <80>;
721                                 vfront-porch = <21>;
722                                 vsync-len = <3>;
723                                 vback-porch = <21>;
724                                 hsync-active = <0>;
725                                 vsync-active = <0>;
726                                 de-active = <0>;
727                                 pixelclk-active = <0>;
728                         };
729                 };
730         };
731 };
732
733 &pwm0 {
734         status = "okay";
735 };
736
737 &rga {
738         status = "okay";
739 };
740
741 &route_dsi {
742         status = "okay";
743 };
744
745 &mipi_dphy {
746         status = "okay";
747         rockchip,dsi-panel = <&panel>;
748 };
749
750 &dwc_control_usb {
751         otg_drv_gpio = <&gpio0 10 GPIO_ACTIVE_LOW>; /* GPIO_B2 = 10 */
752
753         rockchip,remote_wakeup;
754         rockchip,usb_irq_wakeup;
755 };
756
757 &usb_host0_ehci {
758         assigned-clocks = <&cru SCLK_USBPHY480M>;
759         assigned-clock-parents = <&u2phy>;
760         status = "okay";
761 };
762
763 &usb_host0_ohci {
764         status = "okay";
765 };
766
767 &usb_otg {
768         clocks = <&cru SCLK_USBPHY480M>, <&cru HCLK_OTG>;
769         clock-names = "usbphy_480m", "otg";
770         resets = <&cru SRST_USBOTG_AHB>,
771                  <&cru SRST_USBOTG_PHY>,
772                  <&cru SRST_USBOTG_CON>;
773         reset-names = "otg_ahb", "otg_phy", "otg_controller";
774         /* 0 - Normal, 1 - Force Host, 2 - Force Device */
775         rockchip,usb-mode = <0>;
776         status = "okay";
777 };
778
779 &u2phy_host {
780         phy-supply = <&vbus_host>;
781 };
782
783 &pinctrl {
784         mpu6500 {
785                 mpu6500_irq_gpio: mpu6500-irq-gpio {
786                         rockchip,pins = <5 18 RK_FUNC_GPIO &pcfg_pull_none>;
787                 };
788         };
789
790         pmic {
791                 pmic_int_l: pmic-int-l {
792                         rockchip,pins = <0 2 RK_FUNC_GPIO &pcfg_pull_up>;
793                 };
794         };
795
796         sdio-pwrseq {
797                 wifi_enable_h: wifienable-h {
798                         rockchip,pins = <0 14 RK_FUNC_GPIO &pcfg_pull_none>;
799                 };
800         };
801
802         wireless-bluetooth {
803                 uart0_rts_gpio: uart0-rts-gpios {
804                         rockchip,pins = <3 11 RK_FUNC_GPIO &pcfg_pull_none>;
805                 };
806         };
807 };
808
809 &pvtm {
810         status = "okay";
811 };
812
813 &pmu_pvtm {
814         status = "okay";
815 };
816
817 &emmc {
818         clock-frequency = <100000000>;
819         clock-freq-min-max = <400000 100000000>;
820         supports-emmc;
821         bus-width = <8>;
822         cap-mmc-highspeed;
823         disable-wp;
824         non-removable;
825         num-slots = <1>;
826         pinctrl-names = "default";
827         pinctrl-0 = <&emmc_clk &emmc_cmd &emmc_pwr &emmc_bus8>;
828         status = "okay";
829 };
830
831 &nandc0 {
832         status = "okay"; /* enable both for emmc and nand */
833 };
834
835 &sdmmc {
836         clock-frequency = <37500000>;
837         clock-freq-min-max = <400000 37500000>;
838         supports-sd;
839         bus-width = <4>;
840         cap-mmc-highspeed;
841         cap-sd-highspeed;
842         card-detect-delay = <200>;
843         disable-wp;
844         num-slots = <1>;
845         pinctrl-names = "default";
846         pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
847         status = "okay";
848 };
849
850 &sdio {
851         clock-frequency = <37500000>;
852         clock-freq-min-max = <200000 37500000>;
853         supports-sdio;
854         bus-width = <4>;
855         disable-wp;
856         cap-sd-highspeed;
857         cap-sdio-irq;
858         keep-power-in-suspend;
859         mmc-pwrseq = <&sdio_pwrseq>;
860         non-removable;
861         num-slots = <1>;
862         pinctrl-names = "default";
863         pinctrl-0 = <&sdio_bus4 &sdio_cmd &sdio_clk>;
864         sd-uhs-sdr104;
865         status = "okay";
866 };
867
868 &saradc {
869         status = "okay";
870 };
871
872 &tsadc {
873         status = "okay";
874 };
875
876 &uart0 {
877         status = "okay";
878         pinctrl-0 = <&uart0_xfer &uart0_cts>;
879 };