Merge branch 'linux-linaro-lsk-v4.4-android' of git://git.linaro.org/kernel/linux...
[firefly-linux-kernel-4.4.55.git] / arch / arm / boot / dts / rk3288-veyron.dtsi
1 /*
2  * Google Veyron (and derivatives) board device tree source
3  *
4  * Copyright 2015 Google, Inc
5  *
6  * This file is dual-licensed: you can use it either under the terms
7  * of the GPL or the X11 license, at your option. Note that this dual
8  * licensing only applies to this file, and not this project as a
9  * whole.
10  *
11  *  a) This file is free software; you can redistribute it and/or
12  *     modify it under the terms of the GNU General Public License as
13  *     published by the Free Software Foundation; either version 2 of the
14  *     License, or (at your option) any later version.
15  *
16  *     This file is distributed in the hope that it will be useful,
17  *     but WITHOUT ANY WARRANTY; without even the implied warranty of
18  *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19  *     GNU General Public License for more details.
20  *
21  *  Or, alternatively,
22  *
23  *  b) Permission is hereby granted, free of charge, to any person
24  *     obtaining a copy of this software and associated documentation
25  *     files (the "Software"), to deal in the Software without
26  *     restriction, including without limitation the rights to use,
27  *     copy, modify, merge, publish, distribute, sublicense, and/or
28  *     sell copies of the Software, and to permit persons to whom the
29  *     Software is furnished to do so, subject to the following
30  *     conditions:
31  *
32  *     The above copyright notice and this permission notice shall be
33  *     included in all copies or substantial portions of the Software.
34  *
35  *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
36  *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
37  *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
38  *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
39  *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
40  *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
41  *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
42  *     OTHER DEALINGS IN THE SOFTWARE.
43  */
44
45 #include <dt-bindings/clock/rockchip,rk808.h>
46 #include <dt-bindings/input/input.h>
47 #include "rk3288.dtsi"
48
49 / {
50         memory {
51                 device_type = "memory";
52                 reg = <0x0 0x80000000>;
53         };
54
55         gpio_keys: gpio-keys {
56                 compatible = "gpio-keys";
57                 #address-cells = <1>;
58                 #size-cells = <0>;
59
60                 pinctrl-names = "default";
61                 pinctrl-0 = <&pwr_key_l>;
62                 power {
63                         label = "Power";
64                         gpios = <&gpio0 5 GPIO_ACTIVE_LOW>;
65                         linux,code = <KEY_POWER>;
66                         debounce-interval = <100>;
67                         gpio-key,wakeup;
68                 };
69         };
70
71         gpio-restart {
72                 compatible = "gpio-restart";
73                 gpios = <&gpio0 13 GPIO_ACTIVE_HIGH>;
74                 pinctrl-names = "default";
75                 pinctrl-0 = <&ap_warm_reset_h>;
76                 priority = <200>;
77         };
78
79         emmc_pwrseq: emmc-pwrseq {
80                 compatible = "mmc-pwrseq-emmc";
81                 pinctrl-0 = <&emmc_reset>;
82                 pinctrl-names = "default";
83                 reset-gpios = <&gpio2 9 GPIO_ACTIVE_HIGH>;
84         };
85
86         sdio_pwrseq: sdio-pwrseq {
87                 compatible = "mmc-pwrseq-simple";
88                 clocks = <&rk808 RK808_CLKOUT1>;
89                 clock-names = "ext_clock";
90                 pinctrl-names = "default";
91                 pinctrl-0 = <&bt_enable_l>, <&wifi_enable_h>;
92
93                 /*
94                  * On the module itself this is one of these (depending
95                  * on the actual card populated):
96                  * - SDIO_RESET_L_WL_REG_ON
97                  * - PDN (power down when low)
98                  */
99                 reset-gpios = <&gpio4 28 GPIO_ACTIVE_LOW>;
100         };
101
102         vcc_5v: vcc-5v {
103                 compatible = "regulator-fixed";
104                 regulator-name = "vcc_5v";
105                 regulator-always-on;
106                 regulator-boot-on;
107                 regulator-min-microvolt = <5000000>;
108                 regulator-max-microvolt = <5000000>;
109         };
110
111         vcc33_sys: vcc33-sys {
112                 compatible = "regulator-fixed";
113                 regulator-name = "vcc33_sys";
114                 regulator-always-on;
115                 regulator-boot-on;
116                 regulator-min-microvolt = <3300000>;
117                 regulator-max-microvolt = <3300000>;
118         };
119
120         vcc50_hdmi: vcc50-hdmi {
121                 compatible = "regulator-fixed";
122                 regulator-name = "vcc50_hdmi";
123                 regulator-always-on;
124                 regulator-boot-on;
125                 vin-supply = <&vcc_5v>;
126         };
127 };
128
129 &cpu0 {
130         cpu0-supply = <&vdd_cpu>;
131 };
132
133 &emmc {
134         status = "okay";
135
136         bus-width = <8>;
137         cap-mmc-highspeed;
138         rockchip,default-sample-phase = <158>;
139         disable-wp;
140         mmc-hs200-1_8v;
141         mmc-pwrseq = <&emmc_pwrseq>;
142         non-removable;
143         num-slots = <1>;
144         pinctrl-names = "default";
145         pinctrl-0 = <&emmc_clk &emmc_cmd &emmc_bus8>;
146 };
147
148 &hdmi {
149         ddc-i2c-bus = <&i2c5>;
150         status = "okay";
151 };
152
153 &i2c0 {
154         status = "okay";
155
156         clock-frequency = <400000>;
157         i2c-scl-falling-time-ns = <50>;         /* 2.5ns measured */
158         i2c-scl-rising-time-ns = <100>;         /* 45ns measured */
159
160         rk808: pmic@1b {
161                 compatible = "rockchip,rk808";
162                 reg = <0x1b>;
163                 clock-output-names = "xin32k", "wifibt_32kin";
164                 interrupt-parent = <&gpio0>;
165                 interrupts = <4 IRQ_TYPE_LEVEL_LOW>;
166                 pinctrl-names = "default";
167                 pinctrl-0 = <&pmic_int_l>;
168                 rockchip,system-power-controller;
169                 wakeup-source;
170                 #clock-cells = <1>;
171
172                 vcc1-supply = <&vcc33_sys>;
173                 vcc2-supply = <&vcc33_sys>;
174                 vcc3-supply = <&vcc33_sys>;
175                 vcc4-supply = <&vcc33_sys>;
176                 vcc6-supply = <&vcc_5v>;
177                 vcc7-supply = <&vcc33_sys>;
178                 vcc8-supply = <&vcc33_sys>;
179                 vcc12-supply = <&vcc_18>;
180                 vddio-supply = <&vcc33_io>;
181
182                 regulators {
183                         vdd_cpu: DCDC_REG1 {
184                                 regulator-name = "vdd_arm";
185                                 regulator-always-on;
186                                 regulator-boot-on;
187                                 regulator-min-microvolt = <750000>;
188                                 regulator-max-microvolt = <1450000>;
189                                 regulator-ramp-delay = <6001>;
190                                 regulator-state-mem {
191                                         regulator-off-in-suspend;
192                                 };
193                         };
194
195                         vdd_gpu: DCDC_REG2 {
196                                 regulator-name = "vdd_gpu";
197                                 regulator-always-on;
198                                 regulator-boot-on;
199                                 regulator-min-microvolt = <800000>;
200                                 regulator-max-microvolt = <1250000>;
201                                 regulator-ramp-delay = <6001>;
202                                 regulator-state-mem {
203                                         regulator-on-in-suspend;
204                                         regulator-suspend-microvolt = <1000000>;
205                                 };
206                         };
207
208                         vcc135_ddr: DCDC_REG3 {
209                                 regulator-name = "vcc135_ddr";
210                                 regulator-always-on;
211                                 regulator-boot-on;
212                                 regulator-state-mem {
213                                         regulator-on-in-suspend;
214                                 };
215                         };
216
217                         /*
218                          * vcc_18 has several aliases.  (vcc18_flashio and
219                          * vcc18_wl).  We'll add those aliases here just to
220                          * make it easier to follow the schematic.  The signals
221                          * are actually hooked together and only separated for
222                          * power measurement purposes).
223                          */
224                         vcc18_wl: vcc18_flashio: vcc_18: DCDC_REG4 {
225                                 regulator-name = "vcc_18";
226                                 regulator-always-on;
227                                 regulator-boot-on;
228                                 regulator-min-microvolt = <1800000>;
229                                 regulator-max-microvolt = <1800000>;
230                                 regulator-state-mem {
231                                         regulator-on-in-suspend;
232                                         regulator-suspend-microvolt = <1800000>;
233                                 };
234                         };
235
236                         /*
237                          * Note that both vcc33_io and vcc33_pmuio are always
238                          * powered together. To simplify the logic in the dts
239                          * we just refer to vcc33_io every time something is
240                          * powered from vcc33_pmuio. In fact, on later boards
241                          * (such as danger) they're the same net.
242                          */
243                         vcc33_io: LDO_REG1 {
244                                 regulator-name = "vcc33_io";
245                                 regulator-always-on;
246                                 regulator-boot-on;
247                                 regulator-min-microvolt = <3300000>;
248                                 regulator-max-microvolt = <3300000>;
249                                 regulator-state-mem {
250                                         regulator-on-in-suspend;
251                                         regulator-suspend-microvolt = <3300000>;
252                                 };
253                         };
254
255                         vdd_10: LDO_REG3 {
256                                 regulator-name = "vdd_10";
257                                 regulator-always-on;
258                                 regulator-boot-on;
259                                 regulator-min-microvolt = <1000000>;
260                                 regulator-max-microvolt = <1000000>;
261                                 regulator-state-mem {
262                                         regulator-on-in-suspend;
263                                         regulator-suspend-microvolt = <1000000>;
264                                 };
265                         };
266
267                         vdd10_lcd_pwren_h: LDO_REG7 {
268                                 regulator-name = "vdd10_lcd_pwren_h";
269                                 regulator-always-on;
270                                 regulator-boot-on;
271                                 regulator-min-microvolt = <2500000>;
272                                 regulator-max-microvolt = <2500000>;
273                                 regulator-state-mem {
274                                         regulator-off-in-suspend;
275                                 };
276                         };
277
278                         vcc33_lcd: SWITCH_REG1 {
279                                 regulator-name = "vcc33_lcd";
280                                 regulator-always-on;
281                                 regulator-boot-on;
282                                 regulator-state-mem {
283                                         regulator-off-in-suspend;
284                                 };
285                         };
286                 };
287         };
288 };
289
290 &i2c1 {
291         status = "okay";
292
293         clock-frequency = <400000>;
294         i2c-scl-falling-time-ns = <50>;         /* 2.5ns measured */
295         i2c-scl-rising-time-ns = <100>;         /* 40ns measured */
296
297         tpm: tpm@20 {
298                 compatible = "infineon,slb9645tt";
299                 reg = <0x20>;
300                 powered-while-suspended;
301         };
302 };
303
304 &i2c2 {
305         status = "okay";
306
307         /* 100kHz since 4.7k resistors don't rise fast enough */
308         clock-frequency = <100000>;
309         i2c-scl-falling-time-ns = <50>;         /* 10ns measured */
310         i2c-scl-rising-time-ns = <800>;         /* 600ns measured */
311 };
312
313 &i2c4 {
314         status = "okay";
315
316         clock-frequency = <400000>;
317         i2c-scl-falling-time-ns = <50>;         /* 11ns measured */
318         i2c-scl-rising-time-ns = <300>;         /* 225ns measured */
319 };
320
321 &i2c5 {
322         status = "okay";
323
324         clock-frequency = <100000>;
325         i2c-scl-falling-time-ns = <300>;
326         i2c-scl-rising-time-ns = <1000>;
327 };
328
329 &io_domains {
330         status = "okay";
331
332         bb-supply = <&vcc33_io>;
333         dvp-supply = <&vcc_18>;
334         flash0-supply = <&vcc18_flashio>;
335         gpio1830-supply = <&vcc33_io>;
336         gpio30-supply = <&vcc33_io>;
337         lcdc-supply = <&vcc33_lcd>;
338         wifi-supply = <&vcc18_wl>;
339 };
340
341 &pwm1 {
342         status = "okay";
343 };
344
345 &sdio0 {
346         status = "okay";
347
348         bus-width = <4>;
349         cap-sd-highspeed;
350         cap-sdio-irq;
351         keep-power-in-suspend;
352         mmc-pwrseq = <&sdio_pwrseq>;
353         non-removable;
354         num-slots = <1>;
355         pinctrl-names = "default";
356         pinctrl-0 = <&sdio0_clk &sdio0_cmd &sdio0_bus4>;
357         sd-uhs-sdr12;
358         sd-uhs-sdr25;
359         sd-uhs-sdr50;
360         sd-uhs-sdr104;
361         vmmc-supply = <&vcc33_sys>;
362         vqmmc-supply = <&vcc18_wl>;
363 };
364
365 &spi2 {
366         status = "okay";
367
368         rx-sample-delay-ns = <12>;
369 };
370
371 &tsadc {
372         status = "okay";
373
374         rockchip,hw-tshut-mode = <1>; /* tshut mode 0:CRU 1:GPIO */
375         rockchip,hw-tshut-polarity = <1>; /* tshut polarity 0:LOW 1:HIGH */
376 };
377
378 &uart0 {
379         status = "okay";
380
381         /* We need to go faster than 24MHz, so adjust clock parents / rates */
382         assigned-clocks = <&cru SCLK_UART0>;
383         assigned-clock-rates = <48000000>;
384
385         /* Pins don't include flow control by default; add that in */
386         pinctrl-names = "default";
387         pinctrl-0 = <&uart0_xfer &uart0_cts &uart0_rts>;
388 };
389
390 &uart1 {
391         status = "okay";
392 };
393
394 &uart2 {
395         status = "okay";
396 };
397
398 &usbphy {
399         status = "okay";
400 };
401
402 &usb_host0_ehci {
403         status = "okay";
404
405         needs-reset-on-resume;
406 };
407
408 &usb_host1 {
409         status = "okay";
410 };
411
412 &usb_otg {
413         status = "okay";
414
415         assigned-clocks = <&cru SCLK_USBPHY480M_SRC>;
416         assigned-clock-parents = <&cru SCLK_OTGPHY0>;
417         dr_mode = "host";
418 };
419
420 &vopb {
421         status = "okay";
422 };
423
424 &vopb_mmu {
425         status = "okay";
426 };
427
428 &wdt {
429         status = "okay";
430 };
431
432 &pinctrl {
433         pinctrl-names = "default", "sleep";
434         pinctrl-0 = <
435                 /* Common for sleep and wake, but no owners */
436                 &global_pwroff
437         >;
438         pinctrl-1 = <
439                 /* Common for sleep and wake, but no owners */
440                 &global_pwroff
441         >;
442
443         pcfg_pull_none_drv_8ma: pcfg-pull-none-drv-8ma {
444                 bias-disable;
445                 drive-strength = <8>;
446         };
447
448         pcfg_pull_up_drv_8ma: pcfg-pull-up-drv-8ma {
449                 bias-pull-up;
450                 drive-strength = <8>;
451         };
452
453         pcfg_output_high: pcfg-output-high {
454                 output-high;
455         };
456
457         pcfg_output_low: pcfg-output-low {
458                 output-low;
459         };
460
461         buttons {
462                 pwr_key_l: pwr-key-l {
463                         rockchip,pins = <0 5 RK_FUNC_GPIO &pcfg_pull_up>;
464                 };
465         };
466
467         emmc {
468                 emmc_reset: emmc-reset {
469                         rockchip,pins = <2 9 RK_FUNC_GPIO &pcfg_pull_none>;
470                 };
471
472                 /*
473                  * We run eMMC at max speed; bump up drive strength.
474                  * We also have external pulls, so disable the internal ones.
475                  */
476                 emmc_clk: emmc-clk {
477                         rockchip,pins = <3 18 RK_FUNC_2 &pcfg_pull_none_drv_8ma>;
478                 };
479
480                 emmc_cmd: emmc-cmd {
481                         rockchip,pins = <3 16 RK_FUNC_2 &pcfg_pull_none_drv_8ma>;
482                 };
483
484                 emmc_bus8: emmc-bus8 {
485                         rockchip,pins = <3 0 RK_FUNC_2 &pcfg_pull_none_drv_8ma>,
486                                         <3 1 RK_FUNC_2 &pcfg_pull_none_drv_8ma>,
487                                         <3 2 RK_FUNC_2 &pcfg_pull_none_drv_8ma>,
488                                         <3 3 RK_FUNC_2 &pcfg_pull_none_drv_8ma>,
489                                         <3 4 RK_FUNC_2 &pcfg_pull_none_drv_8ma>,
490                                         <3 5 RK_FUNC_2 &pcfg_pull_none_drv_8ma>,
491                                         <3 6 RK_FUNC_2 &pcfg_pull_none_drv_8ma>,
492                                         <3 7 RK_FUNC_2 &pcfg_pull_none_drv_8ma>;
493                 };
494         };
495
496         pmic {
497                 pmic_int_l: pmic-int-l {
498                         rockchip,pins = <RK_GPIO0 4 RK_FUNC_GPIO &pcfg_pull_up>;
499                 };
500         };
501
502         reboot {
503                 ap_warm_reset_h: ap-warm-reset-h {
504                         rockchip,pins = <RK_GPIO0 13 RK_FUNC_GPIO &pcfg_pull_none>;
505                 };
506         };
507
508         recovery-switch {
509                 rec_mode_l: rec-mode-l {
510                         rockchip,pins = <0 9 RK_FUNC_GPIO &pcfg_pull_up>;
511                 };
512         };
513
514         sdio0 {
515                 wifi_enable_h: wifienable-h {
516                         rockchip,pins = <4 28 RK_FUNC_GPIO &pcfg_pull_none>;
517                 };
518
519                 /* NOTE: mislabelled on schematic; should be bt_enable_h */
520                 bt_enable_l: bt-enable-l {
521                         rockchip,pins = <4 29 RK_FUNC_GPIO &pcfg_pull_none>;
522                 };
523
524                 /*
525                  * We run sdio0 at max speed; bump up drive strength.
526                  * We also have external pulls, so disable the internal ones.
527                  */
528                 sdio0_bus4: sdio0-bus4 {
529                         rockchip,pins = <4 20 RK_FUNC_1 &pcfg_pull_none_drv_8ma>,
530                                         <4 21 RK_FUNC_1 &pcfg_pull_none_drv_8ma>,
531                                         <4 22 RK_FUNC_1 &pcfg_pull_none_drv_8ma>,
532                                         <4 23 RK_FUNC_1 &pcfg_pull_none_drv_8ma>;
533                 };
534
535                 sdio0_cmd: sdio0-cmd {
536                         rockchip,pins = <4 24 RK_FUNC_1 &pcfg_pull_none_drv_8ma>;
537                 };
538
539                 sdio0_clk: sdio0-clk {
540                         rockchip,pins = <4 25 RK_FUNC_1 &pcfg_pull_none_drv_8ma>;
541                 };
542         };
543
544         tpm {
545                 tpm_int_h: tpm-int-h {
546                         rockchip,pins = <7 4 RK_FUNC_GPIO &pcfg_pull_none>;
547                 };
548         };
549
550         write-protect {
551                 fw_wp_ap: fw-wp-ap {
552                         rockchip,pins = <7 6 RK_FUNC_GPIO &pcfg_pull_none>;
553                 };
554         };
555 };