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