arm64: dts: rockchip: rk3368-p9: add ramp-delay for syr82x dcdc
[firefly-linux-kernel-4.4.55.git] / arch / arm64 / boot / dts / rockchip / rk3368-p9.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 #include <dt-bindings/pwm/pwm.h>
45 #include "rk3368.dtsi"
46 #include "rk3368-android.dtsi"
47
48 / {
49         model = "Rockchip rk3368 p9 board";
50         compatible = "rockchip,p9", "rockchip,rk3368";
51
52         es8316-sound {
53                 compatible = "simple-audio-card";
54                 simple-audio-card,format = "i2s";
55                 simple-audio-card,name = "rockchip,es8316-codec";
56                 simple-audio-card,mclk-fs = <256>;
57                 simple-audio-card,widgets =
58                         "Microphone", "Mic Jack",
59                         "Headphone", "Headphone Jack";
60                 simple-audio-card,routing =
61                         "Mic Jack", "MICBIAS1",
62                         "IN1P", "Mic Jack",
63                         "Headphone Jack", "HPOL",
64                         "Headphone Jack", "HPOR";
65                 simple-audio-card,cpu {
66                         sound-dai = <&i2s_8ch>;
67                 };
68                 simple-audio-card,codec {
69                         sound-dai = <&es8316>;
70                 };
71         };
72
73         hdmi_sound: hdmi-sound {
74                 status = "okay";
75                 compatible = "simple-audio-card";
76                 simple-audio-card,format = "i2s";
77                 simple-audio-card,mclk-fs = <256>;
78                 simple-audio-card,name = "rockchip,hdmi";
79
80                 simple-audio-card,cpu {
81                         sound-dai = <&i2s_8ch>;
82                 };
83                 simple-audio-card,codec {
84                         sound-dai = <&hdmi>;
85                 };
86         };
87
88         sdio_pwrseq: sdio-pwrseq {
89                 compatible = "mmc-pwrseq-simple";
90                 clocks = <&rk818 1>;
91                 clock-names = "ext_clock";
92                 pinctrl-names = "default";
93                 pinctrl-0 = <&wifi_enable_h>;
94
95                 /*
96                  * On the module itself this is one of these (depending
97                  * on the actual card populated):
98                  * - SDIO_RESET_L_WL_REG_ON
99                  * - PDN (power down when low)
100                  */
101                 reset-gpios = <&gpio3 4 GPIO_ACTIVE_LOW>; /* GPIO3_A4 */
102         };
103
104         backlight: backlight {
105                 compatible = "pwm-backlight";
106                 pwms = <&pwm0 0 25000 PWM_POLARITY_INVERTED>;
107                 brightness-levels = <
108                           0   1   2   3   4   5   6   7
109                           8   9  10  11  12  13  14  15
110                          16  17  18  19  20  21  22  23
111                          24  25  26  27  28  29  30  31
112                          32  33  34  35  36  37  38  39
113                          40  41  42  43  44  45  46  47
114                          48  49  50  51  52  53  54  55
115                          56  57  58  59  60  61  62  63
116                          64  65  66  67  68  69  70  71
117                          72  73  74  75  76  77  78  79
118                          80  81  82  83  84  85  86  87
119                          88  89  90  91  92  93  94  95
120                          96  97  98  99 100 101 102 103
121                         104 105 106 107 108 109 110 111
122                         112 113 114 115 116 117 118 119
123                         120 121 122 123 124 125 126 127
124                         128 129 130 131 132 133 134 135
125                         136 137 138 139 140 141 142 143
126                         144 145 146 147 148 149 150 151
127                         152 153 154 155 156 157 158 159
128                         160 161 162 163 164 165 166 167
129                         168 169 170 171 172 173 174 175
130                         176 177 178 179 180 181 182 183
131                         184 185 186 187 188 189 190 191
132                         192 193 194 195 196 197 198 199
133                         200 201 202 203 204 205 206 207
134                         208 209 210 211 212 213 214 215
135                         216 217 218 219 220 221 222 223
136                         224 225 226 227 228 229 230 231
137                         232 233 234 235 236 237 238 239
138                         240 241 242 243 244 245 246 247
139                         248 249 250 251 252 253 254 255>;
140                 default-brightness-level = <200>;
141                 enable-gpios = <&gpio0 20 GPIO_ACTIVE_HIGH>;
142         };
143
144         rk_key: rockchip-key {
145                 compatible = "rockchip,key";
146                 status = "okay";
147
148                 io-channels = <&saradc 1>;
149
150                 vol-up-key {
151                         linux,code = <115>;
152                         label = "volume up";
153                         rockchip,adc_value = <1>;
154                 };
155
156                 vol-down-key {
157                         linux,code = <114>;
158                         label = "volume down";
159                         rockchip,adc_value = <170>;
160                 };
161
162                 power-key {
163                         gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
164                         linux,code = <116>;
165                         label = "power";
166                         gpio-key,wakeup;
167                 };
168         };
169
170         wireless-wlan {
171                 compatible = "wlan-platdata";
172                 rockchip,grf = <&grf>;
173                 /* wifi_chip_type - wifi chip define
174                 * ap6210, ap6330, ap6335
175                 * rtl8188eu, rtl8723bs, rtl8723bu
176                 * esp8089
177                 */
178                 wifi_chip_type = "ap6210";
179                 sdio_vref = <1800>; //1800mv or 3300mv
180                 WIFI,host_wake_irq = <&gpio3 6 GPIO_ACTIVE_HIGH>;
181                 status = "okay";
182         };
183
184         wireless-bluetooth {
185                 compatible = "bluetooth-platdata";
186                 clocks = <&rk818 1>;
187                 clock-names = "ext_clock";
188                 uart_rts_gpios = <&gpio2 27 GPIO_ACTIVE_LOW>;
189                 pinctrl-names = "default","rts_gpio";
190                 pinctrl-0 = <&uart0_rts>;
191                 pinctrl-1 = <&uart0_rts_gpio>;
192
193                 //BT,power_gpio = <&gpio3 3 GPIO_ACTIVE_HIGH>;
194                 BT,reset_gpio = <&gpio3 5 GPIO_ACTIVE_HIGH>;
195                 BT,wake_gpio = <&gpio3 2 GPIO_ACTIVE_HIGH>;
196                 BT,wake_host_irq = <&gpio3 7 GPIO_ACTIVE_HIGH>;
197
198                 status = "okay";
199         };
200
201         vcc_sys: vcc-sys {
202                 compatible = "regulator-fixed";
203                 regulator-name = "vcc_sys";
204                 regulator-always-on;
205                 regulator-boot-on;
206                 regulator-min-microvolt = <3800000>;
207                 regulator-max-microvolt = <3800000>;
208         };
209 };
210
211 &hdmi {
212         status = "okay";
213 };
214
215 &cpu_l0 {
216         cpu-supply = <&syr827>;
217 };
218
219 &cpu_l1 {
220         cpu-supply = <&syr827>;
221 };
222
223 &cpu_l2 {
224         cpu-supply = <&syr827>;
225 };
226
227 &cpu_l3 {
228         cpu-supply = <&syr827>;
229 };
230
231 &cpu_b0 {
232         cpu-supply = <&syr827>;
233 };
234
235 &cpu_b1 {
236         cpu-supply = <&syr827>;
237 };
238
239 &cpu_b2 {
240         cpu-supply = <&syr827>;
241 };
242
243 &cpu_b3 {
244         cpu-supply = <&syr827>;
245 };
246
247 &gpu {
248         logic-supply = <&vdd_logic>;
249 };
250
251 &emmc {
252         bus-width = <8>;
253         cap-mmc-highspeed;
254         supports-emmc;
255         disable-wp;
256         non-removable;
257         num-slots = <1>;
258         pinctrl-names = "default";
259         pinctrl-0 = <&emmc_clk &emmc_cmd &emmc_bus8>;
260         status = "okay";
261 };
262
263 &sdmmc {
264         clock-frequency = <37500000>;
265         clock-freq-min-max = <400000 37500000>;
266         supports-sd;
267         cap-mmc-highspeed;
268         cap-sd-highspeed;
269         card-detect-delay = <200>;
270         disable-wp;
271         num-slots = <1>;
272         pinctrl-names = "default";
273         pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
274         status = "disabled";
275 };
276
277 &sdio0 {
278         clock-frequency = <50000000>;
279         clock-freq-min-max = <200000 50000000>;
280         supports-sdio;
281         bus-width = <4>;
282         disable-wp;
283         cap-sd-highspeed;
284         cap-sdio-irq;
285         keep-power-in-suspend;
286         mmc-pwrseq = <&sdio_pwrseq>;
287         non-removable;
288         num-slots = <1>;
289         pinctrl-names = "default";
290         pinctrl-0 = <&sdio0_bus4 &sdio0_cmd &sdio0_clk>;
291         sd-uhs-sdr104;
292         status = "okay";
293 };
294
295 &i2c0 {
296         status = "okay";
297
298         syr827: syr827@40 {
299                 compatible = "silergy,syr827";
300                 status = "okay";
301                 reg = <0x40>;
302
303                 regulator-compatible = "fan53555-reg";
304                 regulator-name = "vdd_arm";
305                 regulator-min-microvolt = <712500>;
306                 regulator-max-microvolt = <1500000>;
307                 regulator-ramp-delay = <1000>;
308                 fcs,suspend-voltage-selector = <1>;
309                 regulator-always-on;
310                 regulator-boot-on;
311                 regulator-initial-state = <3>;
312                 regulator-state-mem {
313                         regulator-off-in-suspend;
314                         regulator-suspend-microvolt = <900000>;
315                 };
316         };
317
318         rk818: pmic@1c {
319                 compatible = "rockchip,rk818";
320                 status = "okay";
321                 reg = <0x1c>;
322                 clock-output-names = "xin32k", "wifibt_32kin";
323                 interrupt-parent = <&gpio0>;
324                 interrupts = <1 IRQ_TYPE_LEVEL_LOW>;
325                 pinctrl-names = "default";
326                 pinctrl-0 = <&pmic_int_l>;
327                 rockchip,system-power-controller;
328                 wakeup-source;
329                 #clock-cells = <1>;
330
331                 vcc1-supply = <&vcc_sys>;
332                 vcc2-supply = <&vcc_sys>;
333                 vcc3-supply = <&vcc_sys>;
334                 vcc4-supply = <&vcc_sys>;
335                 vcc6-supply = <&vcc_sys>;
336                 vcc7-supply = <&vcc_sys>;
337                 vcc8-supply = <&vcc_sys>;
338                 vcc9-supply = <&vcc_io>;
339
340                 regulators {
341                         vdd_logic: DCDC_REG1 {
342                                 regulator-name = "vdd_logic";
343                                 regulator-always-on;
344                                 regulator-boot-on;
345                                 regulator-min-microvolt = <750000>;
346                                 regulator-max-microvolt = <1450000>;
347                                 regulator-ramp-delay = <6001>;
348                                 regulator-state-mem {
349                                         regulator-on-in-suspend;
350                                         regulator-suspend-microvolt = <1000000>;
351                                 };
352                         };
353
354                         vdd_gpu: DCDC_REG2 {
355                                 regulator-name = "vdd_gpu";
356                                 regulator-always-on;
357                                 regulator-boot-on;
358                                 regulator-min-microvolt = <800000>;
359                                 regulator-max-microvolt = <1250000>;
360                                 regulator-ramp-delay = <6001>;
361                                 regulator-state-mem {
362                                         regulator-on-in-suspend;
363                                         regulator-suspend-microvolt = <1000000>;
364                                 };
365                         };
366
367                         vcc_ddr: DCDC_REG3 {
368                                 regulator-always-on;
369                                 regulator-boot-on;
370                                 regulator-name = "vcc_ddr";
371                                 regulator-state-mem {
372                                         regulator-on-in-suspend;
373                                 };
374                         };
375
376                         vcc_io: DCDC_REG4 {
377                                 regulator-always-on;
378                                 regulator-boot-on;
379                                 regulator-min-microvolt = <3300000>;
380                                 regulator-max-microvolt = <3300000>;
381                                 regulator-name = "vcc_io";
382                                 regulator-state-mem {
383                                         regulator-on-in-suspend;
384                                         regulator-suspend-microvolt = <3300000>;
385                                 };
386                         };
387
388                         vcca_codec: LDO_REG1 {
389                                 regulator-always-on;
390                                 regulator-boot-on;
391                                 regulator-min-microvolt = <3300000>;
392                                 regulator-max-microvolt = <3300000>;
393                                 regulator-name = "vcca_codec";
394                                 regulator-state-mem {
395                                         regulator-on-in-suspend;
396                                         regulator-suspend-microvolt = <3300000>;
397                                 };
398                         };
399
400                         vcc_tp: LDO_REG2 {
401                                 regulator-boot-on;
402                                 regulator-min-microvolt = <3000000>;
403                                 regulator-max-microvolt = <3000000>;
404                                 regulator-name = "vcc_tp";
405                                 regulator-state-mem {
406                                         regulator-off-in-suspend;
407                                 };
408                         };
409
410                         vdd_10: LDO_REG3 {
411                                 regulator-always-on;
412                                 regulator-boot-on;
413                                 regulator-min-microvolt = <1000000>;
414                                 regulator-max-microvolt = <1000000>;
415                                 regulator-name = "vdd_10";
416                                 regulator-state-mem {
417                                         regulator-on-in-suspend;
418                                         regulator-suspend-microvolt = <1000000>;
419                                 };
420                         };
421
422                         vcc18_lcd: LDO_REG4 {
423                                 regulator-always-on;
424                                 regulator-boot-on;
425                                 regulator-min-microvolt = <1800000>;
426                                 regulator-max-microvolt = <1800000>;
427                                 regulator-name = "vcc18_lcd";
428                                 regulator-state-mem {
429                                         regulator-on-in-suspend;
430                                         regulator-suspend-microvolt = <1800000>;
431                                 };
432                         };
433
434                         vccio_pmu: LDO_REG5 {
435                                 regulator-always-on;
436                                 regulator-boot-on;
437                                 regulator-min-microvolt = <1800000>;
438                                 regulator-max-microvolt = <1800000>;
439                                 regulator-name = "vccio_pmu";
440                                 regulator-state-mem {
441                                         regulator-on-in-suspend;
442                                         regulator-suspend-microvolt = <1800000>;
443                                 };
444                         };
445
446                         vdd10_lcd: LDO_REG6 {
447                                 regulator-always-on;
448                                 regulator-boot-on;
449                                 regulator-min-microvolt = <1000000>;
450                                 regulator-max-microvolt = <1000000>;
451                                 regulator-name = "vdd10_lcd";
452                                 regulator-state-mem {
453                                         regulator-on-in-suspend;
454                                         regulator-suspend-microvolt = <1000000>;
455                                 };
456                         };
457
458                         vcc_18: LDO_REG7 {
459                                 regulator-always-on;
460                                 regulator-boot-on;
461                                 regulator-min-microvolt = <1800000>;
462                                 regulator-max-microvolt = <1800000>;
463                                 regulator-name = "vcc_18";
464                                 regulator-state-mem {
465                                         regulator-on-in-suspend;
466                                         regulator-suspend-microvolt = <1800000>;
467                                 };
468                         };
469
470                         vccio_wl: LDO_REG8 {
471                                 regulator-always-on;
472                                 regulator-boot-on;
473                                 regulator-min-microvolt = <1800000>;
474                                 regulator-max-microvolt = <3300000>;
475                                 regulator-name = "vccio_wl";
476                                 regulator-state-mem {
477                                         regulator-on-in-suspend;
478                                         regulator-suspend-microvolt = <3300000>;
479                                 };
480                         };
481
482                         vccio_sd: LDO_REG9 {
483                                 regulator-always-on;
484                                 regulator-boot-on;
485                                 regulator-min-microvolt = <1800000>;
486                                 regulator-max-microvolt = <3300000>;
487                                 regulator-name = "vccio_sd";
488                                 regulator-state-mem {
489                                         regulator-on-in-suspend;
490                                         regulator-suspend-microvolt = <3300000>;
491                                 };
492                         };
493
494                         vcc_sd: SWITCH_REG {
495                                 regulator-always-on;
496                                 regulator-boot-on;
497                                 regulator-name = "vcc_sd";
498                                 regulator-state-mem {
499                                         regulator-on-in-suspend;
500                                 };
501                         };
502                 };
503
504                 battery {
505                         compatible = "rk818-battery";
506                         ocv_table = <
507                                 3400 3650 3693 3707 3731 3749 3760
508                                 3770 3782 3796 3812 3829 3852 3882
509                                 3915 3951 3981 4047 4086 4132 4182>;
510                         design_capacity = <8650>;
511                         design_qmax = <8800>;
512                         bat_res = <85>;
513                         max_input_current = <2000>;
514                         max_chrg_current = <1800>;
515                         max_chrg_voltage = <4200>;
516                         sleep_enter_current = <600>;
517                         sleep_exit_current = <600>;
518                         power_off_thresd = <3400>;
519                         zero_algorithm_vol = <3850>;
520                         fb_temperature = <115>;
521                         sample_res = <10>;
522                         max_soc_offset = <60>;
523                         energy_mode = <0>;
524                         monitor_sec = <5>;
525                         virtual_power = <0>;
526                         power_dc2otg = <1>;
527                         support_usb_adp = <1>;
528                         support_dc_adp = <1>;
529                         dc_det_gpio = <&gpio0 17 GPIO_ACTIVE_LOW>;
530                 };
531         };
532 };
533
534 &i2c1 {
535         status = "okay";
536
537         es8316: es8316@10 {
538                 status = "okay";
539                 #sound-dai-cells = <0>;
540                 compatible = "everest,es8316";
541                 reg = <0x10>;
542                 clocks = <&cru SCLK_I2S_8CH_OUT>;
543                 clock-names = "mclk";
544                 spk-con-gpio = <&gpio0 27 GPIO_ACTIVE_HIGH>;
545                 hp-det-gpio = <&gpio0 23 GPIO_ACTIVE_HIGH>;
546         };
547 };
548
549 &i2c2 {
550         status = "okay";
551
552         gt9xx: gt9xx@14 {
553                 compatible = "goodix,gt9xx";
554                 reg = <0x14>;
555                 touch-gpio = <&gpio0 12 IRQ_TYPE_LEVEL_LOW>;
556                 reset-gpio = <&gpio0 11 GPIO_ACTIVE_HIGH>;
557                 max-x = <1920>;
558                 max-y = <1200>;
559                 tp-size = <89>;
560                 status = "okay";
561                 tp-supply = <&vcc_tp>;
562         };
563 };
564
565 &i2c3 {
566         status = "okay";
567 };
568
569 &i2c4 {
570         status = "okay";
571         mpu6500@68 {
572                 status = "okay";
573                 compatible = "invensense,mpu6500";
574                 pinctrl-names = "default";
575                 pinctrl-0 = <&mpu6500_irq_gpio>;
576                 reg = <0x68>;
577                 irq-gpio = <&gpio3 14 IRQ_TYPE_EDGE_RISING>;
578                 mpu-int_config = <0x10>;
579                 mpu-level_shifter = <0>;
580                 mpu-orientation = <1 0 0 0 1 0 0 0 1>;
581                 orientation-x= <1>;
582                 orientation-y= <0>;
583                 orientation-z= <1>;
584                 support-hw-poweroff = <1>;
585                 mpu-debug = <1>;
586         };
587 };
588
589 &i2s_8ch {
590         status = "okay";
591         rockchip,i2s-broken-burst-len;
592         rockchip,playback-channels = <8>;
593         rockchip,capture-channels = <2>;
594         #sound-dai-cells = <0>;
595 };
596
597 &io_domains {
598         status = "okay";
599
600         dvp-supply = <&vcc_18>;
601         audio-supply = <&vcc_io>;
602         gpio30-supply = <&vcc_io>;
603         gpio1830-supply = <&vcc_io>;
604         sdcard-supply = <&vccio_sd>;
605         wifi-supply = <&vccio_wl>;
606 };
607
608 &pmu_io_domains {
609         status = "okay";
610
611         pmu-supply = <&vccio_pmu>;
612         vop-supply = <&vccio_pmu>;
613 };
614
615 &pwm0 {
616         status = "okay";
617 };
618
619 &uart0 {
620         pinctrl-names = "default";
621         pinctrl-0 = <&uart0_xfer &uart0_cts>;
622         status = "okay";
623 };
624
625 &uart2 {
626         status = "okay";
627 };
628
629 &saradc {
630         status = "okay";
631 };
632
633 &pinctrl {
634         pmic {
635                 pmic_int_l: pmic-int-l {
636                         rockchip,pins = <RK_GPIO0 1 RK_FUNC_GPIO &pcfg_pull_up>;
637                 };
638         };
639
640         mpu6500 {
641                 mpu6500_irq_gpio: mpu6500-irq-gpio {
642                         rockchip,pins = <3 14 RK_FUNC_GPIO &pcfg_pull_none>;
643                 };
644         };
645
646         sdio-pwrseq {
647                 wifi_enable_h: wifi-enable-h {
648                         rockchip,pins = <3 4 RK_FUNC_GPIO &pcfg_pull_none>;
649                 };
650         };
651
652         wireless-bluetooth {
653                 uart0_rts_gpio: uart0-rts-gpio {
654                         rockchip,pins = <2 27 RK_FUNC_GPIO &pcfg_pull_none>;
655                 };
656         };
657 };
658