ARM64: dts: rk3399-tb: add support for mp8865
[firefly-linux-kernel-4.4.55.git] / arch / arm64 / boot / dts / rockchip / rk3399-tb.dtsi
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 #include <dt-bindings/pwm/pwm.h>
44 #include "rk3399.dtsi"
45
46 / {
47         compatible = "rockchip,tb", "rockchip,rk3399";
48
49         vdd_log: vdd-log {
50                 compatible = "pwm-regulator";
51                 pwms = <&pwm2 0 1000>;
52                 regulator-name = "vdd_log";
53                 regulator-min-microvolt = <800000>;
54                 regulator-max-microvolt = <1400000>;
55                 regulator-always-on;
56                 status = "okay";
57         };
58
59         vdd_center: vdd-center {
60                 compatible = "pwm-regulator";
61                 pwms = <&pwm3 0 1000>;
62                 regulator-name = "vdd_center";
63                 regulator-min-microvolt = <800000>;
64                 regulator-max-microvolt = <1400000>;
65                 regulator-always-on;
66                 status = "okay";
67         };
68
69         vcc3v3_sys: vcc3v3-sys {
70                 compatible = "regulator-fixed";
71                 regulator-name = "vcc3v3_sys";
72                 regulator-always-on;
73                 regulator-boot-on;
74                 regulator-min-microvolt = <3300000>;
75                 regulator-max-microvolt = <3300000>;
76         };
77
78         backlight: backlight {
79                 compatible = "pwm-backlight";
80                 pwms = <&pwm0 0 25000 PWM_POLARITY_INVERTED>;
81                 brightness-levels = <
82                           0   1   2   3   4   5   6   7
83                           8   9  10  11  12  13  14  15
84                          16  17  18  19  20  21  22  23
85                          24  25  26  27  28  29  30  31
86                          32  33  34  35  36  37  38  39
87                          40  41  42  43  44  45  46  47
88                          48  49  50  51  52  53  54  55
89                          56  57  58  59  60  61  62  63
90                          64  65  66  67  68  69  70  71
91                          72  73  74  75  76  77  78  79
92                          80  81  82  83  84  85  86  87
93                          88  89  90  91  92  93  94  95
94                          96  97  98  99 100 101 102 103
95                         104 105 106 107 108 109 110 111
96                         112 113 114 115 116 117 118 119
97                         120 121 122 123 124 125 126 127
98                         128 129 130 131 132 133 134 135
99                         136 137 138 139 140 141 142 143
100                         144 145 146 147 148 149 150 151
101                         152 153 154 155 156 157 158 159
102                         160 161 162 163 164 165 166 167
103                         168 169 170 171 172 173 174 175
104                         176 177 178 179 180 181 182 183
105                         184 185 186 187 188 189 190 191
106                         192 193 194 195 196 197 198 199
107                         200 201 202 203 204 205 206 207
108                         208 209 210 211 212 213 214 215
109                         216 217 218 219 220 221 222 223
110                         224 225 226 227 228 229 230 231
111                         232 233 234 235 236 237 238 239
112                         240 241 242 243 244 245 246 247
113                         248 249 250 251 252 253 254 255>;
114                 default-brightness-level = <200>;
115                 enable-gpios = <&gpio1 13 GPIO_ACTIVE_HIGH>;
116         };
117
118         ext_gmac: external-gmac-clock {
119                 compatible = "fixed-clock";
120                 clock-frequency = <125000000>;
121                 clock-output-names = "ext_gmac";
122                 #clock-cells = <0>;
123         };
124
125         vcc_phy: vcc-phy-regulator {
126                 compatible = "regulator-fixed";
127                 regulator-name = "vcc_phy";
128                 regulator-always-on;
129                 regulator-boot-on;
130         };
131
132         io-domains {
133                 compatible = "rockchip,rk3399-io-voltage-domain";
134                 rockchip,grf = <&grf>;
135
136                 bt656-supply = <&vcc1v8_dvp>;
137                 audio-supply = <&vcca1v8_codec>;
138                 sdmmc-supply = <&vcc_sd>;
139                 gpio1830-supply = <&vcc_3v0>;
140         };
141
142         pmu-io-domains {
143                 compatible = "rockchip,rk3399-pmu-io-voltage-domain";
144                 rockchip,grf = <&pmugrf>;
145
146                 pmu1830-supply = <&vcc1v8_pmu>;
147         };
148 };
149
150 &sdmmc {
151         clock-frequency = <37500000>;
152         clock-freq-min-max = <400000 37500000>;
153         supports-sd;
154         bus-width = <4>;
155         cap-mmc-highspeed;
156         cap-sd-highspeed;
157         disable-wp;
158         num-slots = <1>;
159         pinctrl-names = "default";
160         pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
161         status = "disabled";
162 };
163
164 &sdio0 {
165         clock-frequency = <37500000>;
166         clock-freq-min-max = <200000 37500000>;
167         supports-sdio;
168         bus-width = <4>;
169         disable-wp;
170         cap-sd-highspeed;
171         cap-sdio-irq;
172         keep-power-in-suspend;
173         //mmc-pwrseq = <&sdio_pwrseq>;
174         non-removable;
175         num-slots = <1>;
176         pinctrl-names = "default";
177         pinctrl-0 = <&sdio0_bus4 &sdio0_cmd &sdio0_clk>;
178         sd-uhs-sdr104;
179         status = "disabled";
180 };
181
182 &emmc_phy {
183         status = "okay";
184 };
185
186 &sdhci {
187         bus-width = <8>;
188         supports-emmc;
189         non-removable;
190         max-frequency = <50000000>;
191         status = "okay";
192 };
193
194 &i2s0 {
195         status = "okay";
196 };
197
198 &i2c0 {
199         status = "okay";
200
201         mp8865: mp8865@68 {
202                 compatible = "mps,mp8865";
203                 reg = <0x68>;
204                 status = "okay";
205                 regulators {
206                         vdd_gpu: mp8865_dcdc1 {
207                                 regulator-name = "vdd_gpu";
208                                 regulator-min-microvolt = <712500>;
209                                 regulator-max-microvolt = <1500000>;
210                                 regulator-always-on;
211                                 regulator-boot-on;
212                         };
213                 };
214         };
215
216         rk808: pmic@1b {
217                 compatible = "rockchip,rk808";
218                 reg = <0x1b>;
219                 interrupt-parent = <&gpio1>;
220                 interrupts = <21 IRQ_TYPE_LEVEL_LOW>;
221                 pinctrl-names = "default";
222                 pinctrl-0 = <&pmic_int_l>;
223                 rockchip,system-power-controller;
224                 wakeup-source;
225                 #clock-cells = <1>;
226                 clock-output-names = "xin32k", "rk808-clkout2";
227
228                 vcc1-supply = <&vcc3v3_sys>;
229                 vcc2-supply = <&vcc3v3_sys>;
230                 vcc3-supply = <&vcc3v3_sys>;
231                 vcc4-supply = <&vcc3v3_sys>;
232                 vcc6-supply = <&vcc3v3_sys>;
233                 vcc7-supply = <&vcc3v3_sys>;
234                 vcc8-supply = <&vcc3v3_sys>;
235                 vcc9-supply = <&vcc3v3_sys>;
236                 vcc10-supply = <&vcc3v3_sys>;
237                 vcc11-supply = <&vcc3v3_sys>;
238                 vcc12-supply = <&vcc3v3_sys>;
239                 vddio-supply = <&vcc1v8_pmu>;
240
241                 regulators {
242                         vdd_cpu_b: DCDC_REG1 {
243                                 regulator-always-on;
244                                 regulator-boot-on;
245                                 regulator-min-microvolt = <750000>;
246                                 regulator-max-microvolt = <1350000>;
247                                 regulator-name = "vdd_cpu_b";
248                                 regulator-state-mem {
249                                         regulator-off-in-suspend;
250                                 };
251                         };
252
253                         vdd_cpu_l: DCDC_REG2 {
254                                 regulator-always-on;
255                                 regulator-boot-on;
256                                 regulator-min-microvolt = <750000>;
257                                 regulator-max-microvolt = <1350000>;
258                                 regulator-name = "vdd_cpu_l";
259                                 regulator-state-mem {
260                                         regulator-off-in-suspend;
261                                 };
262                         };
263
264                         vcc_ddr: DCDC_REG3 {
265                                 regulator-always-on;
266                                 regulator-boot-on;
267                                 regulator-name = "vcc_ddr";
268                                 regulator-state-mem {
269                                         regulator-on-in-suspend;
270                                 };
271                         };
272
273                         vcc_1v8: DCDC_REG4 {
274                                 regulator-always-on;
275                                 regulator-boot-on;
276                                 regulator-min-microvolt = <1800000>;
277                                 regulator-max-microvolt = <1800000>;
278                                 regulator-name = "vcc_1v8";
279                                 regulator-state-mem {
280                                         regulator-on-in-suspend;
281                                         regulator-suspend-microvolt = <1800000>;
282                                 };
283                         };
284
285                         vcc1v8_dvp: LDO_REG1 {
286                                 regulator-always-on;
287                                 regulator-boot-on;
288                                 regulator-min-microvolt = <1800000>;
289                                 regulator-max-microvolt = <1800000>;
290                                 regulator-name = "vcc1v8_dvp";
291                                 regulator-state-mem {
292                                         regulator-on-in-suspend;
293                                         regulator-suspend-microvolt = <1800000>;
294                                 };
295                         };
296
297                         vcc3v0_tp: LDO_REG2 {
298                                 regulator-always-on;
299                                 regulator-boot-on;
300                                 regulator-min-microvolt = <3000000>;
301                                 regulator-max-microvolt = <3000000>;
302                                 regulator-name = "vcc3v0_tp";
303                                 regulator-state-mem {
304                                         regulator-off-in-suspend;
305                                 };
306                         };
307
308                         vcc1v8_pmu: LDO_REG3 {
309                                 regulator-always-on;
310                                 regulator-boot-on;
311                                 regulator-min-microvolt = <1800000>;
312                                 regulator-max-microvolt = <1800000>;
313                                 regulator-name = "vcc1v8_pmu";
314                                 regulator-state-mem {
315                                         regulator-on-in-suspend;
316                                         regulator-suspend-microvolt = <1800000>;
317                                 };
318                         };
319
320                         vcc_sd: LDO_REG4 {
321                                 regulator-always-on;
322                                 regulator-boot-on;
323                                 regulator-min-microvolt = <1800000>;
324                                 regulator-max-microvolt = <3300000>;
325                                 regulator-name = "vcc_sd";
326                                 regulator-state-mem {
327                                         regulator-on-in-suspend;
328                                         regulator-suspend-microvolt = <3300000>;
329                                 };
330                         };
331
332                         vcca3v0_codec: LDO_REG5 {
333                                 regulator-always-on;
334                                 regulator-boot-on;
335                                 regulator-min-microvolt = <3000000>;
336                                 regulator-max-microvolt = <3000000>;
337                                 regulator-name = "vcca3v0_codec";
338                                 regulator-state-mem {
339                                         regulator-on-in-suspend;
340                                         regulator-suspend-microvolt = <3000000>;
341                                 };
342                         };
343
344                         vcc_1v5: LDO_REG6 {
345                                 regulator-always-on;
346                                 regulator-boot-on;
347                                 regulator-min-microvolt = <1500000>;
348                                 regulator-max-microvolt = <1500000>;
349                                 regulator-name = "vcc_1v5";
350                                 regulator-state-mem {
351                                         regulator-on-in-suspend;
352                                         regulator-suspend-microvolt = <1500000>;
353                                 };
354                         };
355
356                         vcca1v8_codec: LDO_REG7 {
357                                 regulator-always-on;
358                                 regulator-boot-on;
359                                 regulator-min-microvolt = <1800000>;
360                                 regulator-max-microvolt = <1800000>;
361                                 regulator-name = "vcca1v8_codec";
362                                 regulator-state-mem {
363                                         regulator-on-in-suspend;
364                                         regulator-suspend-microvolt = <1800000>;
365                                 };
366                         };
367
368                         vcc_3v0: LDO_REG8 {
369                                 regulator-always-on;
370                                 regulator-boot-on;
371                                 regulator-min-microvolt = <3000000>;
372                                 regulator-max-microvolt = <3000000>;
373                                 regulator-name = "vcc_3v0";
374                                 regulator-state-mem {
375                                         regulator-on-in-suspend;
376                                         regulator-suspend-microvolt = <3000000>;
377                                 };
378                         };
379
380                         vcc3v3_s3: SWITCH_REG1 {
381                                 regulator-always-on;
382                                 regulator-boot-on;
383                                 regulator-name = "vcc3v3_s3";
384                                 regulator-state-mem {
385                                         regulator-on-in-suspend;
386                                 };
387                         };
388
389                         vcc3v3_s0: SWITCH_REG2 {
390                                 regulator-always-on;
391                                 regulator-boot-on;
392                                 regulator-name = "vcc3v3_s0";
393                                 regulator-state-mem {
394                                         regulator-on-in-suspend;
395                                 };
396                         };
397                 };
398         };
399 };
400
401 &i2c4 {
402         status = "okay";
403
404         gt9xx: gt9xx@14 {
405                 compatible = "goodix,gt9xx";
406                 reg = <0x14>;
407                 touch-gpio = <&gpio1 20 IRQ_TYPE_LEVEL_LOW>;
408                 reset-gpio = <&gpio4 22 GPIO_ACTIVE_HIGH>;
409                 max-x = <1200>;
410                 max-y = <1900>;
411                 tp-size = <911>;
412                 tp-supply = <&vcc3v0_tp>;
413                 status = "disabled";
414         };
415 };
416
417 &pwm2 {
418         status = "okay";
419 };
420
421 &pwm3 {
422         status = "okay";
423 };
424
425 &tsadc {
426         rockchip,hw-tshut-mode = <1>; /* tshut mode 0:CRU 1:GPIO */
427         rockchip,hw-tshut-polarity = <0>; /* tshut polarity 0:LOW 1:HIGH */
428         status = "okay";
429 };
430
431 &uart2 {
432         status = "okay";
433 };
434
435 &usb_host0_echi {
436         status = "okay";
437 };
438
439 &usb_host0_ohci {
440         status = "okay";
441 };
442
443 &usb_host1_echi {
444         status = "okay";
445 };
446
447 &usb_host1_ohci {
448         status = "okay";
449 };
450
451 &usbdrd3_0 {
452         status = "okay";
453 };
454
455 &usbdrd_dwc3_0 {
456         status = "okay";
457 };
458
459 &usbdrd3_1 {
460         status = "okay";
461 };
462
463 &usbdrd_dwc3_1 {
464         status = "okay";
465 };
466
467 &pwm0 {
468         status = "okay";
469 };
470
471 &cpu_l0 {
472         cpu-supply = <&vdd_cpu_l>;
473 };
474
475 &cpu_l1 {
476         cpu-supply = <&vdd_cpu_l>;
477 };
478
479 &cpu_l2 {
480         cpu-supply = <&vdd_cpu_l>;
481 };
482
483 &cpu_l3 {
484         cpu-supply = <&vdd_cpu_l>;
485 };
486
487 &cpu_b0 {
488         cpu-supply = <&vdd_cpu_b>;
489 };
490
491 &cpu_b1 {
492         cpu-supply = <&vdd_cpu_b>;
493 };
494
495 &gmac {
496         phy-supply = <&vcc_phy>;
497         phy-mode = "rgmii";
498         clock_in_out = "input";
499         snps,reset-gpio = <&gpio3 15 GPIO_ACTIVE_LOW>;
500         snps,reset-active-low;
501         snps,reset-delays-us = <0 10000 50000>;
502         assigned-clocks = <&cru SCLK_MAC>;
503         assigned-clock-parents = <&ext_gmac>;
504         pinctrl-names = "default";
505         pinctrl-0 = <&rgmii_pins>;
506         tx_delay = <0x30>;
507         rx_delay = <0x10>;
508         status = "disabled";
509 };
510
511 &gpu {
512         status = "okay";
513 };