0609a31e5dc8e55558194627d81bdb54f9c04e3b
[firefly-linux-kernel-4.4.55.git] / arch / arm64 / boot / dts / rockchip / rk3366-tb.dts
1 /*
2  * Copyright (c) 2016 Fuzhou Rockchip Electronics Co., Ltd
3  *
4  * This file is dual-licensed: you can use it either under the terms
5  * of the GPL or the X11 license, at your option. Note that this dual
6  * licensing only applies to this file, and not this project as a
7  * whole.
8  *
9  *  a) This file is free software; you can redistribute it and/or
10  *     modify it under the terms of the GNU General Public License as
11  *     published by the Free Software Foundation; either version 2 of the
12  *     License, or (at your option) any later version.
13  *
14  *     This file is distributed in the hope that it will be useful,
15  *     but WITHOUT ANY WARRANTY; without even the implied warranty of
16  *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  *     GNU General Public License for more details.
18  *
19  * Or, alternatively,
20  *
21  *  b) Permission is hereby granted, free of charge, to any person
22  *     obtaining a copy of this software and associated documentation
23  *     files (the "Software"), to deal in the Software without
24  *     restriction, including without limitation the rights to use,
25  *     copy, modify, merge, publish, distribute, sublicense, and/or
26  *     sell copies of the Software, and to permit persons to whom the
27  *     Software is furnished to do so, subject to the following
28  *     conditions:
29  *
30  *     The above copyright notice and this permission notice shall be
31  *     included in all copies or substantial portions of the Software.
32  *
33  *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
34  *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
35  *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
36  *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
37  *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
38  *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
39  *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
40  *     OTHER DEALINGS IN THE SOFTWARE.
41  */
42
43 /dts-v1/;
44 #include <dt-bindings/pwm/pwm.h>
45 #include "rk3366.dtsi"
46
47 / {
48         model = "Rockchip SDK tb board";
49         compatible = "rockchip,tb", "rockchip,rk3366";
50
51         chosen {
52                 bootargs = "console=uart,mmio32,0xff690000";
53         };
54
55         ion {
56                 compatible = "rockchip,ion";
57                 #address-cells = <1>;
58                 #size-cells = <0>;
59
60                 cma-heap {
61                         reg = <0x00000000 0x02000000>;
62                 };
63
64                 system-heap {
65                 };
66         };
67
68         backlight: backlight {
69                 compatible = "pwm-backlight";
70                 pwms = <&pwm0 0 25000 PWM_POLARITY_INVERTED>;
71                 brightness-levels = <
72                           0   1   2   3   4   5   6   7
73                           8   9  10  11  12  13  14  15
74                          16  17  18  19  20  21  22  23
75                          24  25  26  27  28  29  30  31
76                          32  33  34  35  36  37  38  39
77                          40  41  42  43  44  45  46  47
78                          48  49  50  51  52  53  54  55
79                          56  57  58  59  60  61  62  63
80                          64  65  66  67  68  69  70  71
81                          72  73  74  75  76  77  78  79
82                          80  81  82  83  84  85  86  87
83                          88  89  90  91  92  93  94  95
84                          96  97  98  99 100 101 102 103
85                         104 105 106 107 108 109 110 111
86                         112 113 114 115 116 117 118 119
87                         120 121 122 123 124 125 126 127
88                         128 129 130 131 132 133 134 135
89                         136 137 138 139 140 141 142 143
90                         144 145 146 147 148 149 150 151
91                         152 153 154 155 156 157 158 159
92                         160 161 162 163 164 165 166 167
93                         168 169 170 171 172 173 174 175
94                         176 177 178 179 180 181 182 183
95                         184 185 186 187 188 189 190 191
96                         192 193 194 195 196 197 198 199
97                         200 201 202 203 204 205 206 207
98                         208 209 210 211 212 213 214 215
99                         216 217 218 219 220 221 222 223
100                         224 225 226 227 228 229 230 231
101                         232 233 234 235 236 237 238 239
102                         240 241 242 243 244 245 246 247
103                         248 249 250 251 252 253 254 255>;
104                 default-brightness-level = <200>;
105                 enable-gpios = <&gpio0 26 GPIO_ACTIVE_HIGH>;
106         };
107
108         rk_key: rockchip-key {
109                 compatible = "rockchip,key";
110                 status = "okay";
111
112                 io-channels = <&saradc 1>;
113
114                 vol-up-key {
115                         linux,code = <115>;
116                         label = "volume up";
117                         rockchip,adc_value = <1>;
118                 };
119
120                 vol-down-key {
121                         linux,code = <114>;
122                         label = "volume down";
123                         rockchip,adc_value = <170>;
124                 };
125
126                 power-key {
127                         gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
128                         linux,code = <116>;
129                         label = "power";
130                         gpio-key,wakeup;
131                 };
132
133                 menu-key {
134                         linux,code = <59>;
135                         label = "menu";
136                         rockchip,adc_value = <355>;
137                 };
138
139                 home-key {
140                         linux,code = <102>;
141                         label = "home";
142                         rockchip,adc_value = <746>;
143                 };
144
145                 back-key {
146                         linux,code = <158>;
147                         label = "back";
148                         rockchip,adc_value = <560>;
149                 };
150
151                 camera-key {
152                         linux,code = <212>;
153                         label = "camera";
154                         rockchip,adc_value = <450>;
155                 };
156         };
157
158         vcc_sys: vcc-sys {
159                 compatible = "regulator-fixed";
160                 regulator-name = "vcc_sys";
161                 regulator-always-on;
162                 regulator-boot-on;
163                 regulator-min-microvolt = <3800000>;
164                 regulator-max-microvolt = <3800000>;
165         };
166
167         ext_gmac: external-gmac-clock {
168                 compatible = "fixed-clock";
169                 clock-frequency = <125000000>;
170                 clock-output-names = "ext_gmac";
171                 #clock-cells = <0>;
172         };
173
174         vcc_phy: vcc-phy-regulator {
175                 compatible = "regulator-fixed";
176                 enable-active-high;
177                 gpio = <&gpio0 24 GPIO_ACTIVE_HIGH>;
178                 pinctrl-names = "default";
179                 pinctrl-0 = <&eth_phy_pwr>;
180                 regulator-name = "vcc_phy";
181                 regulator-always-on;
182                 regulator-boot-on;
183         };
184 };
185
186 &emmc {
187         clock-frequency = <100000000>;
188         clock-freq-min-max = <400000 100000000>;
189         supports-emmc;
190         bus-width = <8>;
191         cap-mmc-highspeed;
192         disable-wp;
193         non-removable;
194         num-slots = <1>;
195         pinctrl-names = "default";
196         pinctrl-0 = <&emmc_clk &emmc_cmd &emmc_pwr &emmc_bus8>;
197         status = "okay";
198 };
199
200 &sdmmc {
201         clock-frequency = <37500000>;
202         clock-freq-min-max = <400000 37500000>;
203         supports-sd;
204         bus-width = <4>;
205         cap-mmc-highspeed;
206         cap-sd-highspeed;
207         card-detect-delay = <200>;
208         disable-wp;
209         num-slots = <1>;
210         pinctrl-names = "default";
211         pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
212         status = "disabled";
213 };
214
215 &sdio {
216         clock-frequency = <50000000>;
217         clock-freq-min-max = <200000 50000000>;
218         supports-sdio;
219         bus-width = <4>;
220         disable-wp;
221         non-removable;
222         num-slots = <1>;
223         pinctrl-names = "default";
224         pinctrl-0 = <&sdio_bus4 &sdio_cmd &sdio_clk>;
225         status = "disabled";
226 };
227
228 &saradc {
229         status = "okay";
230 };
231
232 &i2c0 {
233         status = "okay";
234
235         syr827: syr827@40 {
236                 regulator-name = "vdd_arm";
237                 compatible = "silergy,syr827";
238                 status = "okay";
239                 reg = <0x40>;
240                 regulator-compatible = "fan53555-reg";
241                 regulator-min-microvolt = <712500>;
242                 regulator-max-microvolt = <1500000>;
243                 fcs,suspend-voltage-selector = <1>;
244                 regulator-always-on;
245                 regulator-boot-on;
246                 regulator-initial-state = <3>;
247                 regulator-state-mem {
248                         regulator-on-in-suspend;
249                         regulator-suspend-microvolt = <900000>;
250                 };
251         };
252
253         rk818: pmic@1c {
254                 compatible = "rockchip,rk818";
255                 status = "okay";
256                 reg = <0x1c>;
257                 clock-output-names = "xin32k", "wifibt_32kin";
258                 interrupt-parent = <&gpio0>;
259                 interrupts = <2 IRQ_TYPE_LEVEL_LOW>;
260                 pinctrl-names = "default";
261                 pinctrl-0 = <&pmic_int_l>;
262                 rockchip,system-power-controller;
263                 wakeup-source;
264                 #clock-cells = <1>;
265
266                 vcc1-supply = <&vcc_sys>;
267                 vcc2-supply = <&vcc_sys>;
268                 vcc3-supply = <&vcc_sys>;
269                 vcc4-supply = <&vcc_sys>;
270                 vcc6-supply = <&vcc_sys>;
271                 vcc7-supply = <&vcc_sys>;
272                 vcc8-supply = <&vcc_sys>;
273                 vcc9-supply = <&vcc_io>;
274
275                 regulators {
276                         vdd_logic: DCDC_REG1 {
277                                 regulator-name = "vdd_logic";
278                                 regulator-always-on;
279                                 regulator-boot-on;
280                                 regulator-min-microvolt = <750000>;
281                                 regulator-max-microvolt = <1450000>;
282                                 regulator-ramp-delay = <6001>;
283                                 regulator-state-mem {
284                                         regulator-on-in-suspend;
285                                         regulator-suspend-microvolt = <1000000>;
286                                 };
287                         };
288
289                         vdd_gpu: DCDC_REG2 {
290                                 regulator-name = "vdd_gpu";
291                                 regulator-always-on;
292                                 regulator-boot-on;
293                                 regulator-min-microvolt = <800000>;
294                                 regulator-max-microvolt = <1250000>;
295                                 regulator-ramp-delay = <6001>;
296                                 regulator-state-mem {
297                                         regulator-on-in-suspend;
298                                         regulator-suspend-microvolt = <1000000>;
299                                 };
300                         };
301
302                         vcc_ddr: DCDC_REG3 {
303                                 regulator-name = "vcc_ddr";
304                                 regulator-always-on;
305                                 regulator-boot-on;
306                                 regulator-state-mem {
307                                         regulator-on-in-suspend;
308                                 };
309                         };
310
311                         vcc_io: DCDC_REG4 {
312                                 regulator-name = "vcc_io";
313                                 regulator-always-on;
314                                 regulator-boot-on;
315                                 regulator-min-microvolt = <3300000>;
316                                 regulator-max-microvolt = <3300000>;
317                                 regulator-state-mem {
318                                         regulator-on-in-suspend;
319                                         regulator-suspend-microvolt = <3300000>;
320                                 };
321                         };
322
323                         vcca_codec: LDO_REG1 {
324                                 regulator-name = "vcca_codec";
325                                 regulator-always-on;
326                                 regulator-boot-on;
327                                 regulator-min-microvolt = <3300000>;
328                                 regulator-max-microvolt = <3300000>;
329                                 regulator-state-mem {
330                                         regulator-on-in-suspend;
331                                         regulator-suspend-microvolt = <3300000>;
332                                 };
333                         };
334
335                         vcc_tp: LDO_REG2 {
336                                 regulator-name = "vcc_tp";
337                                 regulator-always-on;
338                                 regulator-boot-on;
339                                 regulator-min-microvolt = <3000000>;
340                                 regulator-max-microvolt = <3000000>;
341                                 regulator-state-mem {
342                                         regulator-on-in-suspend;
343                                         regulator-suspend-microvolt = <3000000>;
344                                 };
345                         };
346
347                         vdd_10: LDO_REG3 {
348                                 regulator-name = "vdd_10";
349                                 regulator-always-on;
350                                 regulator-boot-on;
351                                 regulator-min-microvolt = <1000000>;
352                                 regulator-max-microvolt = <1000000>;
353                                 regulator-state-mem {
354                                         regulator-on-in-suspend;
355                                         regulator-suspend-microvolt = <1000000>;
356                                 };
357                         };
358
359                         vcc18_lcd: LDO_REG4 {
360                                 regulator-name = "vcc18_lcd";
361                                 regulator-always-on;
362                                 regulator-boot-on;
363                                 regulator-min-microvolt = <1800000>;
364                                 regulator-max-microvolt = <1800000>;
365                                 regulator-state-mem {
366                                         regulator-on-in-suspend;
367                                         regulator-suspend-microvolt = <1800000>;
368                                 };
369                         };
370
371                         vccio_pmu: LDO_REG5 {
372                                 regulator-name = "vccio_pmu";
373                                 regulator-always-on;
374                                 regulator-boot-on;
375                                 regulator-min-microvolt = <1800000>;
376                                 regulator-max-microvolt = <1800000>;
377                                 regulator-state-mem {
378                                         regulator-on-in-suspend;
379                                         regulator-suspend-microvolt = <1800000>;
380                                 };
381                         };
382
383                         vdd10_lcd: LDO_REG6 {
384                                 regulator-name = "vdd10_lcd";
385                                 regulator-always-on;
386                                 regulator-boot-on;
387                                 regulator-min-microvolt = <1000000>;
388                                 regulator-max-microvolt = <1000000>;
389                                 regulator-state-mem {
390                                         regulator-on-in-suspend;
391                                         regulator-suspend-microvolt = <1000000>;
392                                 };
393                         };
394
395                         vcc_18: LDO_REG7 {
396                                 regulator-name = "vcc_18";
397                                 regulator-always-on;
398                                 regulator-boot-on;
399                                 regulator-min-microvolt = <1800000>;
400                                 regulator-max-microvolt = <1800000>;
401                                 regulator-state-mem {
402                                         regulator-on-in-suspend;
403                                         regulator-suspend-microvolt = <1800000>;
404                                 };
405                         };
406
407                         vccio_wl: LDO_REG8 {
408                                 regulator-name = "vccio_wl";
409                                 regulator-always-on;
410                                 regulator-boot-on;
411                                 regulator-min-microvolt = <1800000>;
412                                 regulator-max-microvolt = <3300000>;
413                                 regulator-state-mem {
414                                         regulator-on-in-suspend;
415                                         regulator-suspend-microvolt = <3300000>;
416                                 };
417                         };
418
419                         vccio_sd: LDO_REG9 {
420                                 regulator-name = "vccio_sd";
421                                 regulator-always-on;
422                                 regulator-boot-on;
423                                 regulator-min-microvolt = <1800000>;
424                                 regulator-max-microvolt = <3300000>;
425                                 regulator-state-mem {
426                                         regulator-on-in-suspend;
427                                         regulator-suspend-microvolt = <3300000>;
428                                 };
429                         };
430
431                         vcc_sd: SWITCH_REG {
432                                 regulator-name = "vcc_sd";
433                                 regulator-always-on;
434                                 regulator-boot-on;
435                                 regulator-state-mem {
436                                         regulator-on-in-suspend;
437                                 };
438                         };
439                 };
440         };
441 };
442
443 &pwm0 {
444         status = "okay";
445 };
446
447 &uart2 {
448         status = "okay";
449 };
450
451 &fb {
452         status = "okay";
453         rockchip,disp-mode = <DUAL>;
454         rockchip,uboot-logo-on = <0>;
455 };
456
457 &rk_screen {
458         status = "okay";
459         #include <dt-bindings/display/screen-timing/lcd-b101ew05.dtsi>
460 };
461
462 &lvds {
463         pinctrl-names = "lcdc", "sleep";
464         pinctrl-0 = <&lcdc_lcdc>;
465         pinctrl-1 = <&lcdc_gpio>;
466         status = "disabled";
467 };
468
469 &vop_lite {
470         status = "okay";
471         rockchip,prop = <EXTEND>;
472         rockchip,mirror = <NO_MIRROR>;
473         rockchip,cabc_mode = <0>;
474         rockchip,fb-win-map = <FB_DEFAULT_ORDER>;
475 };
476
477 &vopl_mmu {
478         status = "okay";
479 };
480
481 &vop_big {
482         status = "okay";
483         rockchip,prop = <PRMRY>;
484         backlight = <&backlight>;
485         rockchip,mirror = <NO_MIRROR>;
486         rockchip,cabc_mode = <0>;
487         rockchip,fb-win-map = <FB_DEFAULT_ORDER>;
488         power_ctr: power_ctr {
489                 rockchip,debug = <0>;
490                 lcd_en: lcd-en {
491                         rockchip,power_type = <GPIO>;
492                         gpios = <&gpio0 12 GPIO_ACTIVE_HIGH>; /* GPIO_B4 = 12 */
493                         rockchip,delay = <10>;
494                 };
495
496                 lcd_cs: lcd-cs {
497                         rockchip,power_type = <GPIO>;
498                         gpios = <&gpio0 24 GPIO_ACTIVE_HIGH>; /* GPIO_D0 = 24 */
499                         rockchip,delay = <10>;
500                 };
501
502                 /* lcd_rst: lcd-rst {
503                  *      rockchip,power_type = <GPIO>;
504                  *      gpios = <&gpio3 GPIO_D6 GPIO_ACTIVE_HIGH>;
505                  *      rockchip,delay = <5>;
506                  * };
507                  */
508         };
509 };
510
511 &vopb_mmu {
512         status = "okay";
513 };
514
515 &pinctrl {
516         pmic {
517                 pmic_int_l: pmic-int-l {
518                         rockchip,pins = <0 2 RK_FUNC_GPIO &pcfg_pull_up>;
519                 };
520         };
521 };
522
523 &gmac {
524         phy_regulator = "vcc_phy";
525         phy-mode = "rgmii";
526         clock_in_out = "input";
527         snps,reset-gpio = <&gpio2 15 0>;
528         snps,reset-active-low;
529         snps,reset-delays-us = <0 10000 1000000>;
530         assigned-clocks = <&cru SCLK_MAC>;
531         assigned-clock-parents = <&ext_gmac>;
532         pinctrl-names = "default";
533         pinctrl-0 = <&rgmii_pins>;
534         tx_delay = <0x30>;
535         rx_delay = <0x10>;
536         status = "okay";
537 };