4fbd9668995241f21eec8a4bfc11c48ef9378a20
[firefly-linux-kernel-4.4.55.git] / arch / arm64 / boot / dts / rockchip / rk3368-tb.dtsi
1 /*
2  * Copyright (c) 2015 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 "rk3368.dtsi"
45
46 / {
47         compatible = "rockchip,tb", "rockchip,rk3368";
48
49         chosen {
50                 bootargs = "console=uart,mmio32,0xff690000";
51         };
52
53         ion {
54                 compatible = "rockchip,ion";
55                 #address-cells = <1>;
56                 #size-cells = <0>;
57
58                 cma-heap {
59                         reg = <0x00000000 0x02000000>;
60                 };
61
62                 system-heap {
63                 };
64         };
65
66         backlight: backlight {
67                 compatible = "pwm-backlight";
68                 pwms = <&pwm0 0 25000 PWM_POLARITY_INVERTED>;
69                 brightness-levels = <
70                           0   1   2   3   4   5   6   7
71                           8   9  10  11  12  13  14  15
72                          16  17  18  19  20  21  22  23
73                          24  25  26  27  28  29  30  31
74                          32  33  34  35  36  37  38  39
75                          40  41  42  43  44  45  46  47
76                          48  49  50  51  52  53  54  55
77                          56  57  58  59  60  61  62  63
78                          64  65  66  67  68  69  70  71
79                          72  73  74  75  76  77  78  79
80                          80  81  82  83  84  85  86  87
81                          88  89  90  91  92  93  94  95
82                          96  97  98  99 100 101 102 103
83                         104 105 106 107 108 109 110 111
84                         112 113 114 115 116 117 118 119
85                         120 121 122 123 124 125 126 127
86                         128 129 130 131 132 133 134 135
87                         136 137 138 139 140 141 142 143
88                         144 145 146 147 148 149 150 151
89                         152 153 154 155 156 157 158 159
90                         160 161 162 163 164 165 166 167
91                         168 169 170 171 172 173 174 175
92                         176 177 178 179 180 181 182 183
93                         184 185 186 187 188 189 190 191
94                         192 193 194 195 196 197 198 199
95                         200 201 202 203 204 205 206 207
96                         208 209 210 211 212 213 214 215
97                         216 217 218 219 220 221 222 223
98                         224 225 226 227 228 229 230 231
99                         232 233 234 235 236 237 238 239
100                         240 241 242 243 244 245 246 247
101                         248 249 250 251 252 253 254 255>;
102                 default-brightness-level = <200>;
103                 enable-gpios = <&gpio0 20 GPIO_ACTIVE_HIGH>;
104         };
105
106         rk_key: rockchip-key {
107                 compatible = "rockchip,key";
108                 status = "disabled";
109
110                 io-channels = <&saradc 1>;
111
112                 vol-up-key {
113                         linux,code = <115>;
114                         label = "volume up";
115                         rockchip,adc_value = <1>;
116                 };
117
118                 vol-down-key {
119                         linux,code = <114>;
120                         label = "volume down";
121                         rockchip,adc_value = <170>;
122                 };
123
124                 power-key {
125                         gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
126                         linux,code = <116>;
127                         label = "power";
128                         gpio-key,wakeup;
129                 };
130
131                 menu-key {
132                         linux,code = <59>;
133                         label = "menu";
134                         rockchip,adc_value = <355>;
135                 };
136
137                 home-key {
138                         linux,code = <102>;
139                         label = "home";
140                         rockchip,adc_value = <746>;
141                 };
142
143                 back-key {
144                         linux,code = <158>;
145                         label = "back";
146                         rockchip,adc_value = <560>;
147                 };
148
149                 camera-key {
150                         linux,code = <212>;
151                         label = "camera";
152                         rockchip,adc_value = <450>;
153                 };
154         };
155
156         vcc_sys: vcc-sys {
157                 compatible = "regulator-fixed";
158                 regulator-name = "vcc_sys";
159                 regulator-always-on;
160                 regulator-boot-on;
161                 regulator-min-microvolt = <3800000>;
162                 regulator-max-microvolt = <3800000>;
163         };
164 };
165
166 &emmc {
167         bus-width = <8>;
168         cap-mmc-highspeed;
169         supports-emmc;
170         disable-wp;
171         non-removable;
172         num-slots = <1>;
173         pinctrl-names = "default";
174         pinctrl-0 = <&emmc_clk &emmc_cmd &emmc_bus8>;
175         status = "okay";
176 };
177
178 &sdmmc {
179         clock-frequency = <37500000>;
180         clock-freq-min-max = <400000 37500000>;
181         supports-sd;
182         cap-mmc-highspeed;
183         cap-sd-highspeed;
184         card-detect-delay = <200>;
185         disable-wp;
186         num-slots = <1>;
187         pinctrl-names = "default";
188         pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
189         status = "disabled";
190 };
191
192 &i2c0 {
193         status = "okay";
194
195         syr827: syr827@40 {
196                 compatible = "silergy,syr827";
197                 status = "disabled";
198                 reg = <0x40>;
199
200                 regulator-compatible = "fan53555-reg";
201                 regulator-name = "vdd_arm";
202                 regulator-min-microvolt = <712500>;
203                 regulator-max-microvolt = <1500000>;
204                 fcs,suspend-voltage-selector = <1>;
205                 regulator-always-on;
206                 regulator-boot-on;
207                 regulator-initial-state = <3>;
208                 regulator-state-mem {
209                         regulator-off-in-suspend;
210                         regulator-suspend-microvolt = <900000>;
211                 };
212         };
213
214         syr828: syr828@41 {
215                 compatible = "silergy,syr828";
216                 status = "disabled";
217                 reg = <0x41>;
218
219                 regulator-compatible = "fan53555-reg";
220                 regulator-name = "vdd_gpu";
221                 regulator-min-microvolt = <712500>;
222                 regulator-max-microvolt = <1500000>;
223                 fcs,suspend-voltage-selector = <1>;
224                 regulator-always-on;
225                 regulator-boot-on;
226                 regulator-initial-state = <3>;
227                 regulator-state-mem {
228                         regulator-on-in-suspend;
229                         regulator-suspend-microvolt = <900000>;
230                 };
231         };
232
233         act8846: act8846@5a {
234                 /*
235                  * Note: u-boot ONLY match old compatible,
236                  * it's better to add both instances here.
237                  */
238                 compatible = "act,act8846", "active-semi,act8846";
239                 status = "disabled";
240                 reg = <0x5a>;
241                 system-power-controller;
242
243                 regulators {
244                         act8846_reg1: REG1 {
245                                 regulator-name = "VCC_DDR";
246                                 regulator-min-microvolt = <1200000>;
247                                 regulator-max-microvolt = <1200000>;
248                                 regulator-always-on;
249                         };
250
251                         act8846_reg2: REG2 {
252                                 regulator-name = "VCC_IO";
253                                 regulator-min-microvolt = <3300000>;
254                                 regulator-max-microvolt = <3300000>;
255                                 regulator-always-on;
256                         };
257
258                         act8846_reg3: REG3 {
259                                 regulator-name = "VDD_LOG";
260                                 regulator-min-microvolt = <700000>;
261                                 regulator-max-microvolt = <1500000>;
262                                 regulator-always-on;
263                         };
264
265                         act8846_reg4: REG4 {
266                                 regulator-name = "VCC_20";
267                                 regulator-min-microvolt = <2000000>;
268                                 regulator-max-microvolt = <2000000>;
269                                 regulator-always-on;
270                         };
271
272                         act8846_reg5: REG5 {
273                                 regulator-name = "VCCIO_SD";
274                                 regulator-min-microvolt = <1800000>;
275                                 regulator-max-microvolt = <3300000>;
276                                 regulator-always-on;
277                         };
278
279                         act8846_reg6: REG6 {
280                                 regulator-name = "VDD10_LCD";
281                                 regulator-min-microvolt = <1000000>;
282                                 regulator-max-microvolt = <1000000>;
283                                 regulator-always-on;
284                         };
285
286                         act8846_reg7: REG7 {
287                                 regulator-name = "VCCA_CODEC";
288                                 regulator-min-microvolt = <3300000>;
289                                 regulator-max-microvolt = <3300000>;
290                                 regulator-always-on;
291                         };
292
293                         act8846_reg8: REG8 {
294                                 regulator-name = "VCCA_TP";
295                                 regulator-min-microvolt = <3300000>;
296                                 regulator-max-microvolt = <3300000>;
297                                 regulator-always-on;
298                         };
299
300                         act8846_reg9: REG9 {
301                                 regulator-name = "VCCIO_PMU";
302                                 regulator-min-microvolt = <3300000>;
303                                 regulator-max-microvolt = <3300000>;
304                                 regulator-always-on;
305                         };
306
307                         act8846_reg10: REG10 {
308                                 regulator-name = "VDD_10";
309                                 regulator-min-microvolt = <1000000>;
310                                 regulator-max-microvolt = <1000000>;
311                                 regulator-always-on;
312                         };
313
314                         act8846_reg11: REG11 {
315                                 regulator-name = "VCC_18";
316                                 regulator-min-microvolt = <1800000>;
317                                 regulator-max-microvolt = <1800000>;
318                                 regulator-always-on;
319                         };
320
321                         act8846_reg12: REG12 {
322                                 regulator-name = "VCC18_LCD";
323                                 regulator-min-microvolt = <1800000>;
324                                 regulator-max-microvolt = <1800000>;
325                                 regulator-always-on;
326                         };
327                 };
328         };
329
330         rk818: pmic@1c {
331                 compatible = "rockchip,rk818";
332                 status = "disabled";
333                 reg = <0x1c>;
334                 clock-output-names = "xin32k", "wifibt_32kin";
335                 interrupt-parent = <&gpio0>;
336                 interrupts = <1 IRQ_TYPE_LEVEL_LOW>;
337                 pinctrl-names = "default";
338                 pinctrl-0 = <&pmic_int_l>;
339                 rockchip,system-power-controller;
340                 wakeup-source;
341                 #clock-cells = <1>;
342
343                 vcc1-supply = <&vcc_sys>;
344                 vcc2-supply = <&vcc_sys>;
345                 vcc3-supply = <&vcc_sys>;
346                 vcc4-supply = <&vcc_sys>;
347                 vcc6-supply = <&vcc_sys>;
348                 vcc7-supply = <&vcc_sys>;
349                 vcc8-supply = <&vcc_sys>;
350                 vcc9-supply = <&vcc33_io>;
351
352                 regulators {
353                         vdd_logic: DCDC_REG1 {
354                                 regulator-name = "vdd_logic";
355                                 regulator-always-on;
356                                 regulator-boot-on;
357                                 regulator-min-microvolt = <750000>;
358                                 regulator-max-microvolt = <1450000>;
359                                 regulator-ramp-delay = <6001>;
360                                 regulator-state-mem {
361                                         regulator-off-in-suspend;
362                                 };
363                         };
364
365                         vdd_gpu: DCDC_REG2 {
366                                 regulator-name = "vdd_gpu";
367                                 regulator-always-on;
368                                 regulator-boot-on;
369                                 regulator-min-microvolt = <800000>;
370                                 regulator-max-microvolt = <1250000>;
371                                 regulator-ramp-delay = <6001>;
372                                 regulator-state-mem {
373                                 regulator-on-in-suspend;
374                                         regulator-suspend-microvolt = <1000000>;
375                                 };
376                         };
377
378                         vcc_ddr: DCDC_REG3 {
379                                 regulator-always-on;
380                                 regulator-boot-on;
381                                 regulator-name = "vcc_ddr";
382                                 regulator-state-mem {
383                                         regulator-on-in-suspend;
384                                 };
385                         };
386
387                         vcc33_io: DCDC_REG4 {
388                                 regulator-always-on;
389                                 regulator-boot-on;
390                                 regulator-min-microvolt = <3300000>;
391                                 regulator-max-microvolt = <3300000>;
392                                 regulator-name = "vcc33_io";
393                                 regulator-state-mem {
394                                 regulator-on-in-suspend;
395                                         regulator-suspend-microvolt = <3300000>;
396                                 };
397                         };
398
399                         vccio_pmu: LDO_REG1 {
400                                 regulator-always-on;
401                                 regulator-boot-on;
402                                 regulator-min-microvolt = <3300000>;
403                                 regulator-max-microvolt = <3300000>;
404                                 regulator-name = "vccio_pmu";
405                                 regulator-state-mem {
406                                         regulator-on-in-suspend;
407                                         regulator-suspend-microvolt = <3300000>;
408                                 };
409                         };
410
411                         vcc_tp: LDO_REG2 {
412                                 regulator-always-on;
413                                 regulator-boot-on;
414                                 regulator-min-microvolt = <3300000>;
415                                 regulator-max-microvolt = <3300000>;
416                                 regulator-name = "vcc_tp";
417                                         regulator-state-mem {
418                                         regulator-off-in-suspend;
419                                 };
420                         };
421
422                         vdd_10: LDO_REG3 {
423                                 regulator-always-on;
424                                 regulator-boot-on;
425                                 regulator-min-microvolt = <1000000>;
426                                 regulator-max-microvolt = <1000000>;
427                                 regulator-name = "vdd_10";
428                                 regulator-state-mem {
429                                         regulator-on-in-suspend;
430                                         regulator-suspend-microvolt = <1000000>;
431                                 };
432                         };
433
434                         vcc18_lcd: LDO_REG4 {
435                                 regulator-always-on;
436                                 regulator-boot-on;
437                                 regulator-min-microvolt = <1800000>;
438                                 regulator-max-microvolt = <1800000>;
439                                 regulator-name = "vcc18_lcd";
440                                 regulator-state-mem {
441                                         regulator-on-in-suspend;
442                                         regulator-suspend-microvolt = <1800000>;
443                                 };
444                         };
445
446                         vccio_sd: LDO_REG5 {
447                                 regulator-always-on;
448                                 regulator-boot-on;
449                                 regulator-min-microvolt = <1800000>;
450                                 regulator-max-microvolt = <3300000>;
451                                 regulator-name = "vccio_sd";
452                                 regulator-state-mem {
453                                         regulator-on-in-suspend;
454                                         regulator-suspend-microvolt = <3300000>;
455                                 };
456                         };
457
458                         vdd10_lcd: LDO_REG6 {
459                                 regulator-always-on;
460                                 regulator-boot-on;
461                                 regulator-min-microvolt = <1000000>;
462                                 regulator-max-microvolt = <1000000>;
463                                 regulator-name = "vdd10_lcd";
464                                 regulator-state-mem {
465                                         regulator-on-in-suspend;
466                                         regulator-suspend-microvolt = <1000000>;
467                                 };
468                         };
469
470                         vcc_18: LDO_REG7 {
471                                 regulator-always-on;
472                                 regulator-boot-on;
473                                 regulator-min-microvolt = <1800000>;
474                                 regulator-max-microvolt = <1800000>;
475                                 regulator-name = "vcc_18";
476                                 regulator-state-mem {
477                                         regulator-on-in-suspend;
478                                         regulator-suspend-microvolt = <1800000>;
479                                 };
480                         };
481
482                         vcca_codec: LDO_REG8 {
483                                 regulator-always-on;
484                                 regulator-boot-on;
485                                 regulator-min-microvolt = <3300000>;
486                                 regulator-max-microvolt = <3300000>;
487                                 regulator-name = "vcca_codec";
488                                 regulator-state-mem {
489                                         regulator-on-in-suspend;
490                                         regulator-suspend-microvolt = <3300000>;
491                                 };
492                         };
493
494                         vcc_wl: LDO_REG9 {
495                                 regulator-always-on;
496                                 regulator-boot-on;
497                                 regulator-min-microvolt = <3300000>;
498                                 regulator-max-microvolt = <3300000>;
499                                 regulator-name = "vcc_wl";
500                                 regulator-state-mem {
501                                         regulator-on-in-suspend;
502                                         regulator-suspend-microvolt = <3300000>;
503                                 };
504                         };
505
506                         vcc_lcd: SWITCH_REG {
507                                 regulator-always-on;
508                                 regulator-boot-on;
509                                 regulator-name = "vcc_lcd";
510                                 regulator-state-mem {
511                                         regulator-on-in-suspend;
512                                 };
513                         };
514                 };
515         };
516
517 };
518
519 &i2c2 {
520         status = "okay";
521
522         gt911: gt911@14 {
523                 compatible = "goodix,gt911";
524                 reg = <0x14>;
525                 interrupt-parent = <&gpio0>;
526                 interrupts = <12 0>;
527                 status = "disabled";
528         };
529
530         gt9xx: gt9xx@14 {
531                 compatible = "goodix,gt9xx";
532                 reg = <0x14>;
533                 touch-gpio = <&gpio0 12 IRQ_TYPE_LEVEL_LOW>;
534                 reset-gpio = <&gpio0 11 GPIO_ACTIVE_HIGH>;
535                 max-x = <1200>;
536                 max-y = <1900>;
537                 tp-size = <911>;
538                 status = "disabled";
539         };
540 };
541
542 &pwm0 {
543         status = "okay";
544 };
545
546 &uart2 {
547         status = "okay";
548 };
549
550 &fb {
551         status = "okay";
552         rockchip,disp-mode = <NO_DUAL>;
553         rockchip,uboot-logo-on = <0>;
554 };
555
556 &lcdc {
557         status = "okay";
558         backlight = <&backlight>;
559         rockchip,mirror = <NO_MIRROR>;
560         rockchip,cabc_mode = <0>;
561         rockchip,fb-win-map = <FB_DEFAULT_ORDER>;
562         power_ctr: power_ctr {
563                 rockchip,debug = <0>;
564                 lcd_en: lcd-en {
565                         rockchip,power_type = <GPIO>;
566                         gpios = <&gpio0 22 GPIO_ACTIVE_HIGH>;/*GPIO_C6 = 22*/
567                         rockchip,delay = <10>;
568                 };
569
570                 lcd_cs: lcd-cs {
571                         rockchip,power_type = <GPIO>;
572                         gpios = <&gpio0 21 GPIO_ACTIVE_HIGH>;/*GPIO_C5 = 21*/
573                         rockchip,delay = <10>;
574                 };
575
576                 /*lcd_rst: lcd-rst {
577                         rockchip,power_type = <GPIO>;
578                         gpios = <&gpio3 GPIO_D6 GPIO_ACTIVE_HIGH>;
579                         rockchip,delay = <5>;
580                 };*/
581         };
582 };
583
584 &lvds {
585         pinctrl-names = "lcdc", "sleep";
586         pinctrl-0 = <&lcdc_lcdc>;
587         pinctrl-1 = <&lcdc_gpio>;
588         status = "disabled";
589 };
590
591 &rga {
592         status = "okay";
593 };
594
595 &saradc {
596         status = "okay";
597 };
598
599 &vopb_mmu {
600         status = "okay";
601 };
602
603 &pinctrl {
604         pmic {
605                 pmic_int_l: pmic-int-l {
606                         rockchip,pins = <RK_GPIO0 1 RK_FUNC_GPIO &pcfg_pull_up>;
607                 };
608         };
609 };