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