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