de9976e0df646f58231484a3672c0d7f73f02bd3
[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
173 &emmc {
174         status = "okay";
175         bus-width = <8>;
176         cap-mmc-highspeed;
177         supports-emmc;
178         disable-wp;
179         non-removable;
180         num-slots = <1>;
181         pinctrl-names = "default";
182         pinctrl-0 = <&emmc_clk &emmc_cmd &emmc_bus8>;
183 };
184
185 &sdmmc {
186         status = "okay";
187         clock-frequency = <37500000>;
188         clock-freq-min-max = <400000 37500000>;
189         supports-sd;
190         cap-mmc-highspeed;
191         cap-sd-highspeed;
192         card-detect-delay = <200>;
193         disable-wp;
194         num-slots = <1>;
195         pinctrl-names = "default";
196         pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
197 };
198
199 &i2c0 {
200         status = "okay";
201
202         syr827: syr827@40 {
203                 compatible = "silergy,syr827";
204                 reg = <0x40>;
205                 status = "okay";
206
207                 regulator-compatible = "fan53555-reg";
208                 regulator-name = "vdd_arm";
209                 regulator-min-microvolt = <712500>;
210                 regulator-max-microvolt = <1500000>;
211                 regulator-ramp-delay = <1000>;
212                 fcs,suspend-voltage-selector = <1>;
213                 regulator-always-on;
214                 regulator-boot-on;
215                 regulator-initial-state = <3>;
216                 regulator-state-mem {
217                         regulator-off-in-suspend;
218                         regulator-suspend-microvolt = <900000>;
219                 };
220         };
221
222         rk818: pmic@1c {
223                 compatible = "rockchip,rk818";
224                 reg = <0x1c>;
225                 status = "okay";
226
227                 clock-output-names = "xin32k", "wifibt_32kin";
228                 interrupt-parent = <&gpio0>;
229                 interrupts = <1 IRQ_TYPE_LEVEL_LOW>;
230                 pinctrl-names = "default";
231                 pinctrl-0 = <&pmic_int_l>;
232                 rockchip,system-power-controller;
233                 wakeup-source;
234                 #clock-cells = <1>;
235
236                 vcc1-supply = <&vcc_sys>;
237                 vcc2-supply = <&vcc_sys>;
238                 vcc3-supply = <&vcc_sys>;
239                 vcc4-supply = <&vcc_sys>;
240                 vcc6-supply = <&vcc_sys>;
241                 vcc7-supply = <&vcc_sys>;
242                 vcc8-supply = <&vcc_sys>;
243                 vcc9-supply = <&vcc_io>;
244
245                 regulators {
246                         vdd_logic: DCDC_REG1 {
247                                 regulator-name = "vdd_logic";
248                                 regulator-always-on;
249                                 regulator-boot-on;
250                                 regulator-min-microvolt = <750000>;
251                                 regulator-max-microvolt = <1450000>;
252                                 regulator-ramp-delay = <6001>;
253                                 regulator-state-mem {
254                                         regulator-on-in-suspend;
255                                         regulator-suspend-microvolt = <1000000>;
256                                 };
257                         };
258
259                         vdd_gpu: DCDC_REG2 {
260                                 regulator-name = "vdd_gpu";
261                                 regulator-always-on;
262                                 regulator-boot-on;
263                                 regulator-min-microvolt = <800000>;
264                                 regulator-max-microvolt = <1250000>;
265                                 regulator-ramp-delay = <6001>;
266                                 regulator-state-mem {
267                                         regulator-on-in-suspend;
268                                         regulator-suspend-microvolt = <1000000>;
269                                 };
270                         };
271
272                         vcc_ddr: DCDC_REG3 {
273                                 regulator-always-on;
274                                 regulator-boot-on;
275                                 regulator-name = "vcc_ddr";
276                                 regulator-state-mem {
277                                         regulator-on-in-suspend;
278                                 };
279                         };
280
281                         vcc_io: DCDC_REG4 {
282                                 regulator-always-on;
283                                 regulator-boot-on;
284                                 regulator-min-microvolt = <3300000>;
285                                 regulator-max-microvolt = <3300000>;
286                                 regulator-name = "vcc_io";
287                                 regulator-state-mem {
288                                         regulator-on-in-suspend;
289                                         regulator-suspend-microvolt = <3300000>;
290                                 };
291                         };
292
293                         vcca_codec: LDO_REG1 {
294                                 regulator-always-on;
295                                 regulator-boot-on;
296                                 regulator-min-microvolt = <3300000>;
297                                 regulator-max-microvolt = <3300000>;
298                                 regulator-name = "vcca_codec";
299                                 regulator-state-mem {
300                                         regulator-on-in-suspend;
301                                         regulator-suspend-microvolt = <3300000>;
302                                 };
303                         };
304
305                         vcc_tp: LDO_REG2 {
306                                 regulator-boot-on;
307                                 regulator-min-microvolt = <3000000>;
308                                 regulator-max-microvolt = <3000000>;
309                                 regulator-name = "vcc_tp";
310                                 regulator-state-mem {
311                                         regulator-off-in-suspend;
312                                 };
313                         };
314
315                         vdd_10: LDO_REG3 {
316                                 regulator-always-on;
317                                 regulator-boot-on;
318                                 regulator-min-microvolt = <1000000>;
319                                 regulator-max-microvolt = <1000000>;
320                                 regulator-name = "vdd_10";
321                                 regulator-state-mem {
322                                         regulator-on-in-suspend;
323                                         regulator-suspend-microvolt = <1000000>;
324                                 };
325                         };
326
327                         vcc18_lcd: LDO_REG4 {
328                                 regulator-always-on;
329                                 regulator-boot-on;
330                                 regulator-min-microvolt = <1800000>;
331                                 regulator-max-microvolt = <1800000>;
332                                 regulator-name = "vcc18_lcd";
333                                 regulator-state-mem {
334                                         regulator-on-in-suspend;
335                                         regulator-suspend-microvolt = <1800000>;
336                                 };
337                         };
338
339                         vccio_pmu: LDO_REG5 {
340                                 regulator-always-on;
341                                 regulator-boot-on;
342                                 regulator-min-microvolt = <1800000>;
343                                 regulator-max-microvolt = <1800000>;
344                                 regulator-name = "vccio_pmu";
345                                 regulator-state-mem {
346                                         regulator-on-in-suspend;
347                                         regulator-suspend-microvolt = <1800000>;
348                                 };
349                         };
350
351                         vdd10_lcd: LDO_REG6 {
352                                 regulator-always-on;
353                                 regulator-boot-on;
354                                 regulator-min-microvolt = <1000000>;
355                                 regulator-max-microvolt = <1000000>;
356                                 regulator-name = "vdd10_lcd";
357                                 regulator-state-mem {
358                                         regulator-on-in-suspend;
359                                         regulator-suspend-microvolt = <1000000>;
360                                 };
361                         };
362
363                         vcc_18: LDO_REG7 {
364                                 regulator-always-on;
365                                 regulator-boot-on;
366                                 regulator-min-microvolt = <1800000>;
367                                 regulator-max-microvolt = <1800000>;
368                                 regulator-name = "vcc_18";
369                                 regulator-state-mem {
370                                         regulator-on-in-suspend;
371                                         regulator-suspend-microvolt = <1800000>;
372                                 };
373                         };
374
375                         vccio_wl: LDO_REG8 {
376                                 regulator-always-on;
377                                 regulator-boot-on;
378                                 regulator-min-microvolt = <1800000>;
379                                 regulator-max-microvolt = <3300000>;
380                                 regulator-name = "vccio_wl";
381                                 regulator-state-mem {
382                                         regulator-on-in-suspend;
383                                         regulator-suspend-microvolt = <3300000>;
384                                 };
385                         };
386
387                         vccio_sd: LDO_REG9 {
388                                 regulator-always-on;
389                                 regulator-boot-on;
390                                 regulator-min-microvolt = <1800000>;
391                                 regulator-max-microvolt = <3300000>;
392                                 regulator-name = "vccio_sd";
393                                 regulator-state-mem {
394                                         regulator-on-in-suspend;
395                                         regulator-suspend-microvolt = <3300000>;
396                                 };
397                         };
398
399                         vcc_sd: SWITCH_REG {
400                                 regulator-always-on;
401                                 regulator-boot-on;
402                                 regulator-name = "vcc_sd";
403                                 regulator-state-mem {
404                                         regulator-on-in-suspend;
405                                 };
406                         };
407                 };
408         };
409 };
410
411 &cpu_l0 {
412         cpu-supply = <&syr827>;
413 };
414
415 &cpu_l1 {
416         cpu-supply = <&syr827>;
417 };
418
419 &cpu_l2 {
420         cpu-supply = <&syr827>;
421 };
422
423 &cpu_l3 {
424         cpu-supply = <&syr827>;
425 };
426
427 &cpu_b0 {
428         cpu-supply = <&syr827>;
429 };
430
431 &cpu_b1 {
432         cpu-supply = <&syr827>;
433 };
434
435 &cpu_b2 {
436         cpu-supply = <&syr827>;
437 };
438
439 &cpu_b3 {
440         cpu-supply = <&syr827>;
441 };
442
443 &gpu {
444         logic-supply = <&vdd_logic>;
445 };
446
447 &i2c1 {
448         status = "okay";
449
450         rt5640: rt5640@1c {
451                 compatible = "realtek,rt5640";
452                 reg = <0x1c>;
453                 #sound-dai-cells = <0>;
454                 clocks = <&cru SCLK_I2S_8CH_OUT>;
455                 clock-names = "mclk";
456                 realtek,in1-differential;
457                 status = "okay";
458         };
459 };
460
461 &i2c2 {
462         status = "okay";
463
464         gt9xx: gt9xx@14 {
465                 compatible = "goodix,gt9xx";
466                 reg = <0x14>;
467                 touch-gpio = <&gpio0 12 IRQ_TYPE_LEVEL_LOW>;
468                 reset-gpio = <&gpio0 11 GPIO_ACTIVE_HIGH>;
469                 max-x = <1200>;
470                 max-y = <1900>;
471                 tp-size = <911>;
472                 tp-supply = <&vcc_tp>;
473                 status = "okay";
474         };
475 };
476
477 &i2s_8ch {
478         status = "okay";
479         rockchip,i2s-broken-burst-len;
480         rockchip,playback-channels = <8>;
481         rockchip,capture-channels = <2>;
482         #sound-dai-cells = <0>;
483 };
484
485 &io_domains {
486         status = "okay";
487         dvp-supply = <&vcc_18>;
488         audio-supply = <&vcc_io>;
489         gpio30-supply = <&vcc_io>;
490         gpio1830-supply = <&vcc_io>;
491         sdcard-supply = <&vccio_sd>;
492         wifi-supply = <&vccio_wl>;
493 };
494
495 &pmu_io_domains {
496         status = "okay";
497         pmu-supply = <&vcc_io>;
498         vop-supply = <&vcc_io>;
499 };
500
501 &pwm0 {
502         status = "okay";
503 };
504
505 &uart2 {
506         status = "okay";
507 };
508
509 &mailbox {
510         status = "okay";
511 };
512
513 &mailbox_scpi {
514         status = "okay";
515 };
516
517 &saradc {
518         status = "okay";
519 };
520
521 &pinctrl {
522         pmic {
523                 pmic_int_l: pmic-int-l {
524                         rockchip,pins = <RK_GPIO0 1 RK_FUNC_GPIO &pcfg_pull_up>;
525                 };
526         };
527 };