4312c67961f06163a3072e27e32d6c39034d7f83
[firefly-linux-kernel-4.4.55.git] / arch / arm64 / boot / dts / rockchip / rk3399-firefly-linux.dts
1 /*
2  * Copyright (c) 2017 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
45 #include "dt-bindings/pwm/pwm.h"
46 #include "rk3399.dtsi"
47 #include "rk3399-opp.dtsi"
48 #include "rk3399-linux.dtsi"
49 #include <dt-bindings/input/input.h>
50
51 / {
52         model = "Rockchip RK3399 Firefly Board (Linux Opensource)";
53         compatible = "rockchip,rk3399-firefly-linux", "rockchip,rk3399";
54
55         adc-keys {
56                 compatible = "adc-keys";
57                 io-channels = <&saradc 1>;
58                 io-channel-names = "buttons";
59                 poll-interval = <100>;
60                 keyup-threshold-microvolt = <1800000>;
61
62                 button-up {
63                         label = "Volume Up";
64                         linux,code = <KEY_VOLUMEUP>;
65                         press-threshold-microvolt = <100000>;
66                 };
67
68                 button-down {
69                         label = "Volume Down";
70                         linux,code = <KEY_VOLUMEDOWN>;
71                         press-threshold-microvolt = <300000>;
72                 };
73
74                 back {
75                         label = "Back";
76                         linux,code = <KEY_BACK>;
77                         press-threshold-microvolt = <985000>;
78                 };
79
80                 menu {
81                         label = "Menu";
82                         linux,code = <KEY_MENU>;
83                         press-threshold-microvolt = <1314000>;
84                 };
85         };
86
87         backlight: backlight {
88                 status = "okay";
89                 compatible = "pwm-backlight";
90                 enable-gpios = <&gpio1 13 GPIO_ACTIVE_HIGH>;
91                 pwms = <&pwm0 0 25000 0>;
92                 brightness-levels = <
93                           0   1   2   3   4   5   6   7
94                           8   9  10  11  12  13  14  15
95                          16  17  18  19  20  21  22  23
96                          24  25  26  27  28  29  30  31
97                          32  33  34  35  36  37  38  39
98                          40  41  42  43  44  45  46  47
99                          48  49  50  51  52  53  54  55
100                          56  57  58  59  60  61  62  63
101                          64  65  66  67  68  69  70  71
102                          72  73  74  75  76  77  78  79
103                          80  81  82  83  84  85  86  87
104                          88  89  90  91  92  93  94  95
105                          96  97  98  99 100 101 102 103
106                         104 105 106 107 108 109 110 111
107                         112 113 114 115 116 117 118 119
108                         120 121 122 123 124 125 126 127
109                         128 129 130 131 132 133 134 135
110                         136 137 138 139 140 141 142 143
111                         144 145 146 147 148 149 150 151
112                         152 153 154 155 156 157 158 159
113                         160 161 162 163 164 165 166 167
114                         168 169 170 171 172 173 174 175
115                         176 177 178 179 180 181 182 183
116                         184 185 186 187 188 189 190 191
117                         192 193 194 195 196 197 198 199
118                         200 201 202 203 204 205 206 207
119                         208 209 210 211 212 213 214 215
120                         216 217 218 219 220 221 222 223
121                         224 225 226 227 228 229 230 231
122                         232 233 234 235 236 237 238 239
123                         240 241 242 243 244 245 246 247
124                         248 249 250 251 252 253 254 255>;
125                 default-brightness-level = <200>;
126         };
127
128         clkin_gmac: external-gmac-clock {
129                 compatible = "fixed-clock";
130                 clock-frequency = <125000000>;
131                 clock-output-names = "clkin_gmac";
132                 #clock-cells = <0>;
133         };
134
135         dw_hdmi_audio: dw-hdmi-audio {
136                 status = "disabled";
137                 compatible = "rockchip,dw-hdmi-audio";
138                 #sound-dai-cells = <0>;
139         };
140
141         edp_panel: edp-panel {
142                 compatible = "lg,lp079qx1-sp0v", "panel-simple";
143                 backlight = <&backlight>;
144                 power-supply = <&vcc3v3_s0>;
145                 enable-gpios = <&gpio4 30 GPIO_ACTIVE_HIGH>;
146                 pinctrl-names = "default";
147                 pinctrl-0 = <&lcd_panel_reset>;
148
149                 ports {
150                         panel_in_edp: endpoint {
151                                 remote-endpoint = <&edp_out_panel>;
152                         };
153                 };
154         };
155
156         fiq_debugger: fiq-debugger {
157                 compatible = "rockchip,fiq-debugger";
158                 rockchip,serial-id = <2>;
159                 rockchip,signal-irq = <182>;
160                 rockchip,wake-irq = <0>;
161                 rockchip,irq-mode-enable = <1>;  /* If enable uart uses irq instead of fiq */
162                 rockchip,baudrate = <1500000>;  /* Only 115200 and 1500000 */
163                 pinctrl-names = "default";
164                 pinctrl-0 = <&uart2c_xfer>;
165         };
166
167         gpio-keys {
168                 compatible = "gpio-keys";
169                 #address-cells = <1>;
170                 #size-cells = <0>;
171                 autorepeat;
172
173                 pinctrl-names = "default";
174                 pinctrl-0 = <&pwrbtn>;
175
176                 button@0 {
177                         gpios = <&gpio0 5 GPIO_ACTIVE_LOW>;
178                         linux,code = <KEY_POWER>;
179                         label = "GPIO Key Power";
180                         linux,input-type = <1>;
181                         gpio-key,wakeup = <1>;
182                         debounce-interval = <100>;
183                 };
184         };
185
186         rt5640-sound {
187                 compatible = "simple-audio-card";
188                 simple-audio-card,format = "i2s";
189                 simple-audio-card,name = "rockchip,rt5640-codec";
190                 simple-audio-card,mclk-fs = <256>;
191                 simple-audio-card,widgets =
192                         "Microphone", "Mic Jack",
193                         "Headphone", "Headphone Jack";
194                 simple-audio-card,routing =
195                         "Mic Jack", "MICBIAS1",
196                         "IN1P", "Mic Jack",
197                         "Headphone Jack", "HPOL",
198                         "Headphone Jack", "HPOR";
199                 simple-audio-card,cpu {
200                         sound-dai = <&i2s1>;
201                 };
202                 simple-audio-card,codec {
203                         sound-dai = <&rt5640>;
204                 };
205         };
206
207         hdmi_sound: hdmi-sound {
208                 status = "disabled";
209                 compatible = "simple-audio-card";
210                 simple-audio-card,format = "i2s";
211                 simple-audio-card,mclk-fs = <256>;
212                 simple-audio-card,name = "rockchip,hdmi";
213
214                 simple-audio-card,cpu {
215                         sound-dai = <&i2s2>;
216                 };
217                 simple-audio-card,codec {
218                         sound-dai = <&dw_hdmi_audio>;
219                 };
220         };
221
222         hdmi_codec: hdmi-codec {
223                 compatible = "simple-audio-card";
224                 simple-audio-card,format = "i2s";
225                 simple-audio-card,mclk-fs = <256>;
226                 simple-audio-card,name = "HDMI-CODEC";
227
228                 simple-audio-card,cpu {
229                         sound-dai = <&i2s2>;
230                 };
231
232                 simple-audio-card,codec {
233                         sound-dai = <&hdmi>;
234                 };
235         };
236
237         spdif-sound {
238                 status = "okay";
239                 compatible = "simple-audio-card";
240                 simple-audio-card,name = "ROCKCHIP,SPDIF";
241                 simple-audio-card,cpu {
242                         sound-dai = <&spdif>;
243                 };
244                 simple-audio-card,codec {
245                         sound-dai = <&spdif_out>;
246                 };
247         };
248
249         spdif_out: spdif-out {
250                 status = "okay";
251                 compatible = "linux,spdif-dit";
252                 #sound-dai-cells = <0>;
253         };
254
255         sdio_pwrseq: sdio-pwrseq {
256                 compatible = "mmc-pwrseq-simple";
257                 clocks = <&rk808 1>;
258                 clock-names = "ext_clock";
259                 pinctrl-names = "default";
260                 pinctrl-0 = <&wifi_enable_h>;
261
262                 /*
263                  * On the module itself this is one of these (depending
264                  * on the actual card populated):
265                  * - SDIO_RESET_L_WL_REG_ON
266                  * - PDN (power down when low)
267                  */
268                 reset-gpios = <&gpio0 10 GPIO_ACTIVE_LOW>; /* GPIO0_B2 */
269         };
270
271         vcc3v3_pcie: vcc3v3-pcie-regulator {
272                 compatible = "regulator-fixed";
273                 enable-active-high;
274                 regulator-always-on;
275                 regulator-boot-on;
276                 gpio = <&gpio1 17 GPIO_ACTIVE_HIGH>;
277                 pinctrl-names = "default";
278                 pinctrl-0 = <&pcie_drv>;
279                 regulator-name = "vcc3v3_pcie";
280         };
281
282         vcc3v3_sys: vcc3v3-sys {
283                 compatible = "regulator-fixed";
284                 regulator-name = "vcc3v3_sys";
285                 regulator-always-on;
286                 regulator-boot-on;
287                 regulator-min-microvolt = <3300000>;
288                 regulator-max-microvolt = <3300000>;
289         };
290
291         vcc5v0_host: vcc5v0-host-regulator {
292                 compatible = "regulator-fixed";
293                 enable-active-high;
294                 gpio = <&gpio1 0 GPIO_ACTIVE_HIGH>;
295                 pinctrl-names = "default";
296                 pinctrl-0 = <&host_vbus_drv>;
297                 regulator-name = "vcc5v0_host";
298                 regulator-always-on;
299         };
300
301         vcc5v0_sys: vcc5v0-sys {
302                 compatible = "regulator-fixed";
303                 regulator-name = "vcc5v0_sys";
304                 regulator-always-on;
305                 regulator-boot-on;
306                 regulator-min-microvolt = <5000000>;
307                 regulator-max-microvolt = <5000000>;
308         };
309
310         vcc_phy: vcc-phy-regulator {
311                 compatible = "regulator-fixed";
312                 regulator-name = "vcc_phy";
313                 regulator-always-on;
314                 regulator-boot-on;
315         };
316
317         vdd_log: vdd-log {
318                 compatible = "pwm-regulator";
319                 pwms = <&pwm2 0 25000 1>;
320                 regulator-name = "vdd_log";
321                 regulator-min-microvolt = <800000>;
322                 regulator-max-microvolt = <1400000>;
323                 regulator-always-on;
324                 regulator-boot-on;
325
326                 /* for rockchip boot on */
327                 rockchip,pwm_id= <2>;
328                 rockchip,pwm_voltage = <1000000>;
329         };
330
331         vccadc_ref: vccadc-ref {
332                 compatible = "regulator-fixed";
333                 regulator-name = "vcc1v8_sys";
334                 regulator-always-on;
335                 regulator-boot-on;
336                 regulator-min-microvolt = <1800000>;
337                 regulator-max-microvolt = <1800000>;
338         };
339
340         wireless-wlan {
341                 compatible = "wlan-platdata";
342                 rockchip,grf = <&grf>;
343                 wifi_chip_type = "ap6354";
344                 sdio_vref = <1800>;
345                 WIFI,host_wake_irq = <&gpio0 3 GPIO_ACTIVE_HIGH>; /* GPIO0_a3 */
346                 status = "okay";
347         };
348
349         wireless-bluetooth {
350                 compatible = "bluetooth-platdata";
351                 //wifi-bt-power-toggle;
352                 uart_rts_gpios = <&gpio2 19 GPIO_ACTIVE_LOW>; /* GPIO2_C3 */
353                 pinctrl-names = "default", "rts_gpio";
354                 pinctrl-0 = <&uart0_rts>;
355                 pinctrl-1 = <&uart0_gpios>;
356                 //BT,power_gpio  = <&gpio3 19 GPIO_ACTIVE_HIGH>; /* GPIOx_xx */
357                 BT,reset_gpio    = <&gpio0 9 GPIO_ACTIVE_HIGH>; /* GPIO0_B1 */
358                 BT,wake_gpio     = <&gpio2 26 GPIO_ACTIVE_HIGH>; /* GPIO2_D2 */
359                 BT,wake_host_irq = <&gpio0 4 GPIO_ACTIVE_HIGH>; /* GPIO0_A4 */
360                 status = "okay";
361         };
362 };
363
364 &cpu_l0 {
365         cpu-supply = <&vdd_cpu_l>;
366 };
367
368 &cpu_l1 {
369         cpu-supply = <&vdd_cpu_l>;
370 };
371
372 &cpu_l2 {
373         cpu-supply = <&vdd_cpu_l>;
374 };
375
376 &cpu_l3 {
377         cpu-supply = <&vdd_cpu_l>;
378 };
379
380 &cpu_b0 {
381         cpu-supply = <&vdd_cpu_b>;
382 };
383
384 &cpu_b1 {
385         cpu-supply = <&vdd_cpu_b>;
386 };
387
388 &display_subsystem {
389         status = "okay";
390 };
391
392 &edp {
393         status = "disabled";
394
395         ports {
396                 edp_out: port@1 {
397                         reg = <1>;
398                         #address-cells = <1>;
399                         #size-cells = <0>;
400
401                         edp_out_panel: endpoint@0 {
402                                 reg = <0>;
403                                 remote-endpoint = <&panel_in_edp>;
404                         };
405                 };
406         };
407 };
408
409 &emmc_phy {
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 = <&gpio3 15 GPIO_ACTIVE_LOW>;
418         snps,reset-active-low;
419         snps,reset-delays-us = <0 10000 50000>;
420         assigned-clocks = <&cru SCLK_RMII_SRC>;
421         assigned-clock-parents = <&clkin_gmac>;
422         pinctrl-names = "default";
423         pinctrl-0 = <&rgmii_pins>;
424         tx_delay = <0x28>;
425         rx_delay = <0x11>;
426         status = "okay";
427 };
428
429 &gpu {
430         status = "okay";
431         mali-supply = <&vdd_gpu>;
432 };
433
434 &hdmi {
435         #address-cells = <1>;
436         #size-cells = <0>;
437         #sound-dai-cells = <0>;
438         ddc-i2c-bus = <&i2c3>;
439         status = "okay";
440 };
441
442 &i2c0 {
443         status = "okay";
444         i2c-scl-rising-time-ns = <168>;
445         i2c-scl-falling-time-ns = <4>;
446         clock-frequency = <400000>;
447
448         vdd_cpu_b: syr827@40 {
449                 compatible = "silergy,syr827";
450                 reg = <0x40>;
451                 vin-supply = <&vcc5v0_sys>;
452                 regulator-compatible = "fan53555-reg";
453                 regulator-name = "vdd_cpu_b";
454                 regulator-min-microvolt = <712500>;
455                 regulator-max-microvolt = <1500000>;
456                 regulator-ramp-delay = <1000>;
457                 vsel-gpios = <&gpio1 18 GPIO_ACTIVE_HIGH>;
458                 fcs,suspend-voltage-selector = <1>;
459                 regulator-always-on;
460                 regulator-boot-on;
461                 regulator-initial-state = <3>;
462                         regulator-state-mem {
463                         regulator-off-in-suspend;
464                 };
465         };
466
467         vdd_gpu: syr828@41 {
468                 compatible = "silergy,syr828";
469                 reg = <0x41>;
470                 vin-supply = <&vcc5v0_sys>;
471                 regulator-compatible = "fan53555-reg";
472                 regulator-name = "vdd_gpu";
473                 regulator-min-microvolt = <712500>;
474                 regulator-max-microvolt = <1500000>;
475                 regulator-ramp-delay = <1000>;
476                 fcs,suspend-voltage-selector = <1>;
477                 regulator-always-on;
478                 regulator-boot-on;
479                 regulator-initial-state = <3>;
480                         regulator-state-mem {
481                         regulator-off-in-suspend;
482                 };
483         };
484
485         rk808: pmic@1b {
486                 compatible = "rockchip,rk808";
487                 reg = <0x1b>;
488                 interrupt-parent = <&gpio1>;
489                 interrupts = <21 IRQ_TYPE_LEVEL_LOW>;
490                 pinctrl-names = "default";
491                 pinctrl-0 = <&pmic_int_l &pmic_dvs2>;
492                 rockchip,system-power-controller;
493                 wakeup-source;
494                 #clock-cells = <1>;
495                 clock-output-names = "xin32k", "rk808-clkout2";
496
497                 vcc1-supply = <&vcc3v3_sys>;
498                 vcc2-supply = <&vcc3v3_sys>;
499                 vcc3-supply = <&vcc3v3_sys>;
500                 vcc4-supply = <&vcc3v3_sys>;
501                 vcc6-supply = <&vcc3v3_sys>;
502                 vcc7-supply = <&vcc3v3_sys>;
503                 vcc8-supply = <&vcc3v3_sys>;
504                 vcc9-supply = <&vcc3v3_sys>;
505                 vcc10-supply = <&vcc3v3_sys>;
506                 vcc11-supply = <&vcc3v3_sys>;
507                 vcc12-supply = <&vcc3v3_sys>;
508                 vddio-supply = <&vcc1v8_pmu>;
509
510                 regulators {
511                         vdd_center: DCDC_REG1 {
512                                 regulator-always-on;
513                                 regulator-boot-on;
514                                 regulator-min-microvolt = <750000>;
515                                 regulator-max-microvolt = <1350000>;
516                                 regulator-ramp-delay = <6001>;
517                                 regulator-name = "vdd_center";
518                                 regulator-state-mem {
519                                         regulator-off-in-suspend;
520                                 };
521                         };
522
523                         vdd_cpu_l: DCDC_REG2 {
524                                 regulator-always-on;
525                                 regulator-boot-on;
526                                 regulator-min-microvolt = <750000>;
527                                 regulator-max-microvolt = <1350000>;
528                                 regulator-ramp-delay = <6001>;
529                                 regulator-name = "vdd_cpu_l";
530                                 regulator-state-mem {
531                                         regulator-off-in-suspend;
532                                 };
533                         };
534
535                         vcc_ddr: DCDC_REG3 {
536                                 regulator-always-on;
537                                 regulator-boot-on;
538                                 regulator-name = "vcc_ddr";
539                                 regulator-state-mem {
540                                         regulator-on-in-suspend;
541                                 };
542                         };
543
544                         vcc_1v8: DCDC_REG4 {
545                                 regulator-always-on;
546                                 regulator-boot-on;
547                                 regulator-min-microvolt = <1800000>;
548                                 regulator-max-microvolt = <1800000>;
549                                 regulator-name = "vcc_1v8";
550                                 regulator-state-mem {
551                                         regulator-on-in-suspend;
552                                         regulator-suspend-microvolt = <1800000>;
553                                 };
554                         };
555
556                         vcc1v8_dvp: LDO_REG1 {
557                                 regulator-always-on;
558                                 regulator-boot-on;
559                                 regulator-min-microvolt = <1800000>;
560                                 regulator-max-microvolt = <1800000>;
561                                 regulator-name = "vcc1v8_dvp";
562                                 regulator-state-mem {
563                                         regulator-off-in-suspend;
564                                 };
565                         };
566
567                         vcc3v0_tp: LDO_REG2 {
568                                 regulator-always-on;
569                                 regulator-boot-on;
570                                 regulator-min-microvolt = <3000000>;
571                                 regulator-max-microvolt = <3000000>;
572                                 regulator-name = "vcc3v0_tp";
573                                 regulator-state-mem {
574                                         regulator-off-in-suspend;
575                                 };
576                         };
577
578                         vcc1v8_pmu: LDO_REG3 {
579                                 regulator-always-on;
580                                 regulator-boot-on;
581                                 regulator-min-microvolt = <1800000>;
582                                 regulator-max-microvolt = <1800000>;
583                                 regulator-name = "vcc1v8_pmu";
584                                 regulator-state-mem {
585                                         regulator-on-in-suspend;
586                                         regulator-suspend-microvolt = <1800000>;
587                                 };
588                         };
589
590                         vcc_sd: LDO_REG4 {
591                                 regulator-always-on;
592                                 regulator-boot-on;
593                                 regulator-min-microvolt = <1800000>;
594                                 regulator-max-microvolt = <3300000>;
595                                 regulator-name = "vcc_sd";
596                                 regulator-state-mem {
597                                         regulator-on-in-suspend;
598                                         regulator-suspend-microvolt = <3300000>;
599                                 };
600                         };
601
602                         vcca3v0_codec: LDO_REG5 {
603                                 regulator-always-on;
604                                 regulator-boot-on;
605                                 regulator-min-microvolt = <3000000>;
606                                 regulator-max-microvolt = <3000000>;
607                                 regulator-name = "vcca3v0_codec";
608                                 regulator-state-mem {
609                                         regulator-off-in-suspend;
610                                 };
611                         };
612
613                         vcc_1v5: LDO_REG6 {
614                                 regulator-always-on;
615                                 regulator-boot-on;
616                                 regulator-min-microvolt = <1500000>;
617                                 regulator-max-microvolt = <1500000>;
618                                 regulator-name = "vcc_1v5";
619                                 regulator-state-mem {
620                                         regulator-on-in-suspend;
621                                         regulator-suspend-microvolt = <1500000>;
622                                 };
623                         };
624
625                         vcca1v8_codec: LDO_REG7 {
626                                 regulator-always-on;
627                                 regulator-boot-on;
628                                 regulator-min-microvolt = <1800000>;
629                                 regulator-max-microvolt = <1800000>;
630                                 regulator-name = "vcca1v8_codec";
631                                 regulator-state-mem {
632                                         regulator-off-in-suspend;
633                                 };
634                         };
635
636                         vcc_3v0: LDO_REG8 {
637                                 regulator-always-on;
638                                 regulator-boot-on;
639                                 regulator-min-microvolt = <3000000>;
640                                 regulator-max-microvolt = <3000000>;
641                                 regulator-name = "vcc_3v0";
642                                 regulator-state-mem {
643                                         regulator-on-in-suspend;
644                                         regulator-suspend-microvolt = <3000000>;
645                                 };
646                         };
647
648                         vcc3v3_s3: SWITCH_REG1 {
649                                 regulator-always-on;
650                                 regulator-boot-on;
651                                 regulator-name = "vcc3v3_s3";
652                                 regulator-state-mem {
653                                         regulator-off-in-suspend;
654                                 };
655                         };
656
657                         vcc3v3_s0: SWITCH_REG2 {
658                                 regulator-always-on;
659                                 regulator-boot-on;
660                                 regulator-name = "vcc3v3_s0";
661                                 regulator-state-mem {
662                                         regulator-off-in-suspend;
663                                 };
664                         };
665                 };
666         };
667 };
668
669 &i2c1 {
670         status = "okay";
671         i2c-scl-rising-time-ns = <300>;
672         i2c-scl-falling-time-ns = <15>;
673
674         gsl3673: gsl3673@40 {
675                 compatible = "GSL,GSL3673";
676                 reg = <0x40>;
677                 screen_max_x = <1536>;
678                 screen_max_y = <2048>;
679                 irq_gpio_number = <&gpio1 20 IRQ_TYPE_LEVEL_LOW>;
680                 rst_gpio_number = <&gpio4 22 GPIO_ACTIVE_HIGH>;
681         };
682
683         rt5640: rt5640@1c {
684                 #sound-dai-cells = <0>;
685                 compatible = "realtek,rt5640";
686                 reg = <0x1c>;
687                 clocks = <&cru SCLK_I2S_8CH_OUT>;
688                 clock-names = "mclk";
689                 realtek,in1-differential;
690                 pinctrl-names = "default";
691                 pinctrl-0 = <&rt5640_hpcon>;
692                 hp-con-gpio = <&gpio4 21 GPIO_ACTIVE_HIGH>;
693                 //hp-det-gpio = <&gpio4 28 GPIO_ACTIVE_LOW>;
694                 io-channels = <&saradc 4>;
695                 hp-det-adc-value = <500>;
696         };
697 };
698
699 &i2c3 {
700         status = "okay";
701         i2c-scl-rising-time-ns = <450>;
702         i2c-scl-falling-time-ns = <15>;
703 };
704
705 &i2c4 {
706         status = "okay";
707         i2c-scl-rising-time-ns = <600>;
708         i2c-scl-falling-time-ns = <20>;
709
710         fusb0: fusb30x@22 {
711                 compatible = "fairchild,fusb302";
712                 reg = <0x22>;
713                 pinctrl-names = "default";
714                 pinctrl-0 = <&fusb0_int>;
715                 int-n-gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>;
716                 vbus-5v-gpios = <&gpio2 0 GPIO_ACTIVE_HIGH>;
717                 status = "okay";
718         };
719
720         mpu6500@68 {
721                 status = "okay";
722                 compatible = "invensense,mpu6500";
723                 reg = <0x68>;
724                 irq-gpio = <&gpio1 22 IRQ_TYPE_EDGE_RISING>;
725                 mpu-int_config = <0x10>;
726                 mpu-level_shifter = <0>;
727                 mpu-orientation = <0 1 0 1 0 0 0 0 1>;
728                 orientation-x= <1>;
729                 orientation-y= <0>;
730                 orientation-z= <0>;
731                 mpu-debug = <1>;
732         };
733 };
734
735 &i2s0 {
736         status = "okay";
737         rockchip,i2s-broken-burst-len;
738         rockchip,playback-channels = <8>;
739         rockchip,capture-channels = <8>;
740         #sound-dai-cells = <0>;
741 };
742
743 &i2s1 {
744         status = "okay";
745         rockchip,i2s-broken-burst-len;
746         rockchip,playback-channels = <2>;
747         rockchip,capture-channels = <2>;
748         #sound-dai-cells = <0>;
749 };
750
751 &i2s2 {
752         #sound-dai-cells = <0>;
753         status = "okay";
754 };
755
756 &io_domains {
757         status = "okay";
758
759         bt656-supply = <&vcc1v8_dvp>;           /* bt656_gpio2ab_ms */
760         audio-supply = <&vcca1v8_codec>;        /* audio_gpio3d4a_ms */
761         sdmmc-supply = <&vcc_sd>;               /* sdmmc_gpio4b_ms */
762         gpio1830-supply = <&vcc_3v0>;           /* gpio1833_gpio4cd_ms */
763 };
764
765 &pcie_phy {
766         status = "okay";
767 };
768
769 &pcie0 {
770         ep-gpios = <&gpio4 25 GPIO_ACTIVE_HIGH>;
771         num-lanes = <4>;
772         pinctrl-names = "default";
773         pinctrl-0 = <&pcie_clkreqn_cpm>;
774         status = "okay";
775 };
776
777 &pmu_io_domains {
778         status = "okay";
779         pmu1830-supply = <&vcc_3v0>;
780 };
781
782 &pinctrl {
783         buttons {
784                 pwrbtn: pwrbtn {
785                         rockchip,pins = <0 5 RK_FUNC_GPIO &pcfg_pull_up>;
786                 };
787         };
788
789         lcd-panel {
790                 lcd_panel_reset: lcd-panel-reset {
791                         rockchip,pins = <4 30 RK_FUNC_GPIO &pcfg_pull_up>;
792                 };
793         };
794
795         pcie {
796                 pcie_drv: pcie-drv {
797                         rockchip,pins =
798                                 <1 17 RK_FUNC_GPIO &pcfg_pull_none>;
799                         };
800                         pcie_3g_drv: pcie-3g-drv {
801                         rockchip,pins =
802                                 <0 2 RK_FUNC_GPIO &pcfg_pull_up>;
803                 };
804         };
805
806         pmic {
807                 vsel1_gpio: vsel1-gpio {
808                         rockchip,pins =
809                                 <1 18 RK_FUNC_GPIO &pcfg_pull_down>;
810                 };
811
812                 vsel2_gpio: vsel2-gpio {
813                         rockchip,pins =
814                         <1 14 RK_FUNC_GPIO &pcfg_pull_down>;
815                 };
816         };
817
818         sdio-pwrseq {
819                 wifi_enable_h: wifi-enable-h {
820                         rockchip,pins =
821                                 <0 10 RK_FUNC_GPIO &pcfg_pull_none>;
822                 };
823         };
824
825         wireless-bluetooth {
826                 uart0_gpios: uart0-gpios {
827                         rockchip,pins =
828                                 <2 19 RK_FUNC_GPIO &pcfg_pull_none>;
829                 };
830         };
831
832         rt5640 {
833                 rt5640_hpcon: rt5640-hpcon {
834                         rockchip,pins = <4 21 RK_FUNC_GPIO &pcfg_pull_none>;
835                 };
836         };
837
838         pmic {
839                 pmic_int_l: pmic-int-l {
840                         rockchip,pins =
841                                 <1 21 RK_FUNC_GPIO &pcfg_pull_up>;
842                 };
843
844                 pmic_dvs2: pmic-dvs2 {
845                         rockchip,pins =
846                                 <1 18 RK_FUNC_GPIO &pcfg_pull_down>;
847                 };
848         };
849
850         usb2 {
851                 host_vbus_drv: host-vbus-drv {
852                         rockchip,pins =
853                                 <4 25 RK_FUNC_GPIO &pcfg_pull_none>;
854                 };
855         };
856
857         fusb30x {
858                 fusb0_int: fusb0-int {
859                         rockchip,pins = <1 2 RK_FUNC_GPIO &pcfg_pull_up>;
860                 };
861         };
862 };
863
864 &pwm0 {
865         status = "okay";
866 };
867
868 &pwm2 {
869         status = "okay";
870 };
871
872 &rkvdec {
873         status = "okay";
874 };
875
876 &rockchip_suspend {
877         rockchip,power-ctrl =
878                 <&gpio1 18 GPIO_ACTIVE_LOW>,
879                 <&gpio1 14 GPIO_ACTIVE_HIGH>;
880 };
881
882 &route_edp {
883         status = "disabled";
884 };
885
886 &saradc {
887         status = "okay";
888         vref-supply = <&vccadc_ref>;
889 };
890
891 &sdhci {
892         bus-width = <8>;
893         keep-power-in-suspend;
894         mmc-hs400-1_8v;
895         mmc-hs400-enhanced-strobe;
896         non-removable;
897         status = "okay";
898         supports-emmc;
899 };
900
901 &sdmmc {
902         max-frequency = <150000000>;
903         supports-sd;
904         bus-width = <4>;
905         cap-mmc-highspeed;
906         cap-sd-highspeed;
907         disable-wp;
908         num-slots = <1>;
909         vqmmc-supply = <&vcc_sd>;
910         pinctrl-names = "default";
911         pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
912         status = "okay";
913 };
914
915 &sdio0 {
916         max-frequency = <50000000>;
917         supports-sdio;
918         bus-width = <4>;
919         disable-wp;
920         cap-sd-highspeed;
921         keep-power-in-suspend;
922         mmc-pwrseq = <&sdio_pwrseq>;
923         non-removable;
924         num-slots = <1>;
925         pinctrl-names = "default";
926         pinctrl-0 = <&sdio0_bus4 &sdio0_cmd &sdio0_clk>;
927         sd-uhs-sdr104;
928         status = "okay";
929 };
930
931 &spdif {
932         status = "okay";
933         pinctrl-0 = <&spdif_bus_1>;
934         i2c-scl-rising-time-ns = <450>;
935         i2c-scl-falling-time-ns = <15>;
936         #sound-dai-cells = <0>;
937 };
938
939 &tcphy0 {
940         extcon = <&fusb0>;
941         status = "okay";
942 };
943
944 &tcphy1 {
945         status = "okay";
946 };
947
948 &tsadc {
949         /* tshut mode 0:CRU 1:GPIO */
950         rockchip,hw-tshut-mode = <1>;
951         /* tshut polarity 0:LOW 1:HIGH */
952         rockchip,hw-tshut-polarity = <1>;
953         status = "okay";
954 };
955
956 &u2phy0 {
957         status = "okay";
958         extcon = <&fusb0>;
959
960         u2phy0_otg: otg-port {
961                 status = "okay";
962         };
963
964         u2phy0_host: host-port {
965                 phy-supply = <&vcc5v0_host>;
966                 status = "okay";
967         };
968 };
969
970 &u2phy1 {
971         status = "okay";
972
973         u2phy1_otg: otg-port {
974                 status = "okay";
975         };
976
977         u2phy1_host: host-port {
978                 phy-supply = <&vcc5v0_host>;
979                 status = "okay";
980         };
981 };
982
983 &uart0 {
984         pinctrl-names = "default";
985         pinctrl-0 = <&uart0_xfer &uart0_cts>;
986         status = "okay";
987 };
988
989 &uart2 {
990         status = "okay";
991 };
992
993 &usbdrd3_0 {
994         status = "okay";
995         extcon = <&fusb0>;
996 };
997
998 &usbdrd3_1 {
999         status = "okay";
1000 };
1001
1002 &usbdrd_dwc3_0 {
1003         status = "okay";
1004 };
1005
1006 &usbdrd_dwc3_1 {
1007         status = "okay";
1008         dr_mode = "host";
1009 };
1010
1011 &usb_host0_ehci {
1012         status = "okay";
1013 };
1014
1015 &usb_host0_ohci {
1016         status = "okay";
1017 };
1018
1019 &usb_host1_ehci {
1020         status = "okay";
1021 };
1022
1023 &usb_host1_ohci {
1024         status = "okay";
1025 };
1026
1027 &vopb {
1028         status = "okay";
1029 };
1030
1031 &vopb_mmu {
1032         status = "okay";
1033 };
1034
1035 &vopl {
1036         status = "okay";
1037 };
1038
1039 &vopl_mmu {
1040         status = "okay";
1041 };
1042
1043 &vpu {
1044         status = "okay";
1045 };