arm64: dts: rockchip: enable ehci/ohci and u2phy for rk3368-sheep
[firefly-linux-kernel-4.4.55.git] / arch / arm64 / boot / dts / rockchip / rk3368-sheep.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 Sheep board";
50         compatible = "rockchip,sheep", "rockchip,rk3368";
51
52         sound {
53                 compatible = "simple-audio-card";
54                 simple-audio-card,format = "i2s";
55                 simple-audio-card,name = "rockchip,rt5640-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 = <&rt5640>;
70                 };
71         };
72
73         backlight: backlight {
74                 compatible = "pwm-backlight";
75                 pwms = <&pwm0 0 25000 PWM_POLARITY_INVERTED>;
76                 brightness-levels = <
77                           0   1   2   3   4   5   6   7
78                           8   9  10  11  12  13  14  15
79                          16  17  18  19  20  21  22  23
80                          24  25  26  27  28  29  30  31
81                          32  33  34  35  36  37  38  39
82                          40  41  42  43  44  45  46  47
83                          48  49  50  51  52  53  54  55
84                          56  57  58  59  60  61  62  63
85                          64  65  66  67  68  69  70  71
86                          72  73  74  75  76  77  78  79
87                          80  81  82  83  84  85  86  87
88                          88  89  90  91  92  93  94  95
89                          96  97  98  99 100 101 102 103
90                         104 105 106 107 108 109 110 111
91                         112 113 114 115 116 117 118 119
92                         120 121 122 123 124 125 126 127
93                         128 129 130 131 132 133 134 135
94                         136 137 138 139 140 141 142 143
95                         144 145 146 147 148 149 150 151
96                         152 153 154 155 156 157 158 159
97                         160 161 162 163 164 165 166 167
98                         168 169 170 171 172 173 174 175
99                         176 177 178 179 180 181 182 183
100                         184 185 186 187 188 189 190 191
101                         192 193 194 195 196 197 198 199
102                         200 201 202 203 204 205 206 207
103                         208 209 210 211 212 213 214 215
104                         216 217 218 219 220 221 222 223
105                         224 225 226 227 228 229 230 231
106                         232 233 234 235 236 237 238 239
107                         240 241 242 243 244 245 246 247
108                         248 249 250 251 252 253 254 255>;
109                 default-brightness-level = <200>;
110                 enable-gpios = <&gpio0 20 GPIO_ACTIVE_HIGH>;
111         };
112
113         rk_key: rockchip-key {
114                 compatible = "rockchip,key";
115                 status = "okay";
116
117                 io-channels = <&saradc 1>;
118
119                 vol-up-key {
120                         linux,code = <115>;
121                         label = "volume up";
122                         rockchip,adc_value = <1>;
123                 };
124
125                 vol-down-key {
126                         linux,code = <114>;
127                         label = "volume down";
128                         rockchip,adc_value = <170>;
129                 };
130
131                 power-key {
132                         gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
133                         linux,code = <116>;
134                         label = "power";
135                         gpio-key,wakeup;
136                 };
137
138                 menu-key {
139                         linux,code = <59>;
140                         label = "menu";
141                         rockchip,adc_value = <355>;
142                 };
143
144                 home-key {
145                         linux,code = <102>;
146                         label = "home";
147                         rockchip,adc_value = <746>;
148                 };
149
150                 back-key {
151                         linux,code = <158>;
152                         label = "back";
153                         rockchip,adc_value = <560>;
154                 };
155
156                 camera-key {
157                         linux,code = <212>;
158                         label = "camera";
159                         rockchip,adc_value = <450>;
160                 };
161         };
162
163         vcc_sys: vcc-sys {
164                 compatible = "regulator-fixed";
165                 regulator-name = "vcc_sys";
166                 regulator-always-on;
167                 regulator-boot-on;
168                 regulator-min-microvolt = <3800000>;
169                 regulator-max-microvolt = <3800000>;
170         };
171
172         vcc_host: vcc-host {
173                 compatible = "regulator-fixed";
174                 enable-active-high;
175                 gpio = <&gpio0 4 GPIO_ACTIVE_HIGH>;
176                 pinctrl-names = "default";
177                 pinctrl-0 = <&host_vbus_drv>;
178                 regulator-name = "vcc_host";
179                 regulator-always-on;
180         };
181 };
182
183 &emmc {
184         status = "okay";
185         bus-width = <8>;
186         cap-mmc-highspeed;
187         supports-emmc;
188         disable-wp;
189         non-removable;
190         num-slots = <1>;
191         pinctrl-names = "default";
192         pinctrl-0 = <&emmc_clk &emmc_cmd &emmc_bus8>;
193 };
194
195 &sdmmc {
196         status = "okay";
197         clock-frequency = <37500000>;
198         clock-freq-min-max = <400000 37500000>;
199         supports-sd;
200         cap-mmc-highspeed;
201         cap-sd-highspeed;
202         card-detect-delay = <200>;
203         disable-wp;
204         num-slots = <1>;
205         pinctrl-names = "default";
206         pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
207 };
208
209 &i2c0 {
210         status = "okay";
211
212         syr827: syr827@40 {
213                 compatible = "silergy,syr827";
214                 reg = <0x40>;
215                 status = "okay";
216
217                 regulator-compatible = "fan53555-reg";
218                 regulator-name = "vdd_arm";
219                 regulator-min-microvolt = <712500>;
220                 regulator-max-microvolt = <1500000>;
221                 regulator-ramp-delay = <1000>;
222                 fcs,suspend-voltage-selector = <1>;
223                 regulator-always-on;
224                 regulator-boot-on;
225                 regulator-initial-state = <3>;
226                 regulator-state-mem {
227                         regulator-off-in-suspend;
228                         regulator-suspend-microvolt = <900000>;
229                 };
230         };
231
232         rk818: pmic@1c {
233                 compatible = "rockchip,rk818";
234                 reg = <0x1c>;
235                 status = "okay";
236
237                 clock-output-names = "xin32k", "wifibt_32kin";
238                 interrupt-parent = <&gpio0>;
239                 interrupts = <1 IRQ_TYPE_LEVEL_LOW>;
240                 pinctrl-names = "default";
241                 pinctrl-0 = <&pmic_int_l>;
242                 rockchip,system-power-controller;
243                 wakeup-source;
244                 #clock-cells = <1>;
245
246                 vcc1-supply = <&vcc_sys>;
247                 vcc2-supply = <&vcc_sys>;
248                 vcc3-supply = <&vcc_sys>;
249                 vcc4-supply = <&vcc_sys>;
250                 vcc6-supply = <&vcc_sys>;
251                 vcc7-supply = <&vcc_sys>;
252                 vcc8-supply = <&vcc_sys>;
253                 vcc9-supply = <&vcc_io>;
254
255                 regulators {
256                         vdd_logic: DCDC_REG1 {
257                                 regulator-name = "vdd_logic";
258                                 regulator-always-on;
259                                 regulator-boot-on;
260                                 regulator-min-microvolt = <750000>;
261                                 regulator-max-microvolt = <1450000>;
262                                 regulator-ramp-delay = <6001>;
263                                 regulator-state-mem {
264                                         regulator-on-in-suspend;
265                                         regulator-suspend-microvolt = <1000000>;
266                                 };
267                         };
268
269                         vdd_gpu: DCDC_REG2 {
270                                 regulator-name = "vdd_gpu";
271                                 regulator-always-on;
272                                 regulator-boot-on;
273                                 regulator-min-microvolt = <800000>;
274                                 regulator-max-microvolt = <1250000>;
275                                 regulator-ramp-delay = <6001>;
276                                 regulator-state-mem {
277                                         regulator-on-in-suspend;
278                                         regulator-suspend-microvolt = <1000000>;
279                                 };
280                         };
281
282                         vcc_ddr: DCDC_REG3 {
283                                 regulator-always-on;
284                                 regulator-boot-on;
285                                 regulator-name = "vcc_ddr";
286                                 regulator-state-mem {
287                                         regulator-on-in-suspend;
288                                 };
289                         };
290
291                         vcc_io: DCDC_REG4 {
292                                 regulator-always-on;
293                                 regulator-boot-on;
294                                 regulator-min-microvolt = <3300000>;
295                                 regulator-max-microvolt = <3300000>;
296                                 regulator-name = "vcc_io";
297                                 regulator-state-mem {
298                                         regulator-on-in-suspend;
299                                         regulator-suspend-microvolt = <3300000>;
300                                 };
301                         };
302
303                         vcca_codec: LDO_REG1 {
304                                 regulator-always-on;
305                                 regulator-boot-on;
306                                 regulator-min-microvolt = <3300000>;
307                                 regulator-max-microvolt = <3300000>;
308                                 regulator-name = "vcca_codec";
309                                 regulator-state-mem {
310                                         regulator-on-in-suspend;
311                                         regulator-suspend-microvolt = <3300000>;
312                                 };
313                         };
314
315                         vcc_tp: LDO_REG2 {
316                                 regulator-boot-on;
317                                 regulator-min-microvolt = <3000000>;
318                                 regulator-max-microvolt = <3000000>;
319                                 regulator-name = "vcc_tp";
320                                 regulator-state-mem {
321                                         regulator-off-in-suspend;
322                                 };
323                         };
324
325                         vdd_10: LDO_REG3 {
326                                 regulator-always-on;
327                                 regulator-boot-on;
328                                 regulator-min-microvolt = <1000000>;
329                                 regulator-max-microvolt = <1000000>;
330                                 regulator-name = "vdd_10";
331                                 regulator-state-mem {
332                                         regulator-on-in-suspend;
333                                         regulator-suspend-microvolt = <1000000>;
334                                 };
335                         };
336
337                         vcc18_lcd: LDO_REG4 {
338                                 regulator-always-on;
339                                 regulator-boot-on;
340                                 regulator-min-microvolt = <1800000>;
341                                 regulator-max-microvolt = <1800000>;
342                                 regulator-name = "vcc18_lcd";
343                                 regulator-state-mem {
344                                         regulator-on-in-suspend;
345                                         regulator-suspend-microvolt = <1800000>;
346                                 };
347                         };
348
349                         vccio_pmu: LDO_REG5 {
350                                 regulator-always-on;
351                                 regulator-boot-on;
352                                 regulator-min-microvolt = <1800000>;
353                                 regulator-max-microvolt = <1800000>;
354                                 regulator-name = "vccio_pmu";
355                                 regulator-state-mem {
356                                         regulator-on-in-suspend;
357                                         regulator-suspend-microvolt = <1800000>;
358                                 };
359                         };
360
361                         vdd10_lcd: LDO_REG6 {
362                                 regulator-always-on;
363                                 regulator-boot-on;
364                                 regulator-min-microvolt = <1000000>;
365                                 regulator-max-microvolt = <1000000>;
366                                 regulator-name = "vdd10_lcd";
367                                 regulator-state-mem {
368                                         regulator-on-in-suspend;
369                                         regulator-suspend-microvolt = <1000000>;
370                                 };
371                         };
372
373                         vcc_18: LDO_REG7 {
374                                 regulator-always-on;
375                                 regulator-boot-on;
376                                 regulator-min-microvolt = <1800000>;
377                                 regulator-max-microvolt = <1800000>;
378                                 regulator-name = "vcc_18";
379                                 regulator-state-mem {
380                                         regulator-on-in-suspend;
381                                         regulator-suspend-microvolt = <1800000>;
382                                 };
383                         };
384
385                         vccio_wl: LDO_REG8 {
386                                 regulator-always-on;
387                                 regulator-boot-on;
388                                 regulator-min-microvolt = <1800000>;
389                                 regulator-max-microvolt = <3300000>;
390                                 regulator-name = "vccio_wl";
391                                 regulator-state-mem {
392                                         regulator-on-in-suspend;
393                                         regulator-suspend-microvolt = <3300000>;
394                                 };
395                         };
396
397                         vccio_sd: LDO_REG9 {
398                                 regulator-always-on;
399                                 regulator-boot-on;
400                                 regulator-min-microvolt = <1800000>;
401                                 regulator-max-microvolt = <3300000>;
402                                 regulator-name = "vccio_sd";
403                                 regulator-state-mem {
404                                         regulator-on-in-suspend;
405                                         regulator-suspend-microvolt = <3300000>;
406                                 };
407                         };
408
409                         vcc_sd: SWITCH_REG {
410                                 regulator-always-on;
411                                 regulator-boot-on;
412                                 regulator-name = "vcc_sd";
413                                 regulator-state-mem {
414                                         regulator-on-in-suspend;
415                                 };
416                         };
417                 };
418         };
419 };
420
421 &cpu_l0 {
422         cpu-supply = <&syr827>;
423 };
424
425 &cpu_l1 {
426         cpu-supply = <&syr827>;
427 };
428
429 &cpu_l2 {
430         cpu-supply = <&syr827>;
431 };
432
433 &cpu_l3 {
434         cpu-supply = <&syr827>;
435 };
436
437 &cpu_b0 {
438         cpu-supply = <&syr827>;
439 };
440
441 &cpu_b1 {
442         cpu-supply = <&syr827>;
443 };
444
445 &cpu_b2 {
446         cpu-supply = <&syr827>;
447 };
448
449 &cpu_b3 {
450         cpu-supply = <&syr827>;
451 };
452
453 &gpu {
454         logic-supply = <&vdd_logic>;
455 };
456
457 &i2c1 {
458         status = "okay";
459
460         rt5640: rt5640@1c {
461                 compatible = "realtek,rt5640";
462                 reg = <0x1c>;
463                 #sound-dai-cells = <0>;
464                 clocks = <&cru SCLK_I2S_8CH_OUT>;
465                 clock-names = "mclk";
466                 realtek,in1-differential;
467                 status = "okay";
468         };
469 };
470
471 &i2c2 {
472         status = "okay";
473
474         gt9xx: gt9xx@14 {
475                 compatible = "goodix,gt9xx";
476                 reg = <0x14>;
477                 touch-gpio = <&gpio0 12 IRQ_TYPE_LEVEL_LOW>;
478                 reset-gpio = <&gpio0 11 GPIO_ACTIVE_HIGH>;
479                 max-x = <1200>;
480                 max-y = <1900>;
481                 tp-size = <911>;
482                 tp-supply = <&vcc_tp>;
483                 status = "okay";
484         };
485 };
486
487 &i2s_8ch {
488         status = "okay";
489         rockchip,i2s-broken-burst-len;
490         rockchip,playback-channels = <8>;
491         rockchip,capture-channels = <2>;
492         #sound-dai-cells = <0>;
493 };
494
495 &io_domains {
496         status = "okay";
497         dvp-supply = <&vcc_18>;
498         audio-supply = <&vcc_io>;
499         gpio30-supply = <&vcc_io>;
500         gpio1830-supply = <&vcc_io>;
501         sdcard-supply = <&vccio_sd>;
502         wifi-supply = <&vccio_wl>;
503 };
504
505 &pmu_io_domains {
506         status = "okay";
507         pmu-supply = <&vcc_io>;
508         vop-supply = <&vcc_io>;
509 };
510
511 &pwm0 {
512         status = "okay";
513 };
514
515 &uart2 {
516         status = "okay";
517 };
518
519 &u2phy {
520         status = "okay";
521
522         u2phy_host: host-port {
523                 phy-supply = <&vcc_host>;
524                 status = "okay";
525         };
526 };
527
528 &usb_host0_ehci {
529         status = "okay";
530 };
531
532 &usb_host0_ohci {
533         status = "okay";
534 };
535
536 &mailbox {
537         status = "okay";
538 };
539
540 &mailbox_scpi {
541         status = "okay";
542 };
543
544 &saradc {
545         status = "okay";
546 };
547
548 &pinctrl {
549         pmic {
550                 pmic_int_l: pmic-int-l {
551                         rockchip,pins = <RK_GPIO0 1 RK_FUNC_GPIO &pcfg_pull_up>;
552                 };
553         };
554
555         usb2 {
556                 host_vbus_drv: host-vbus-drv {
557                         rockchip,pins = <RK_GPIO0 4 RK_FUNC_GPIO &pcfg_pull_none>;
558                 };
559         };
560 };