Merge tag 'nvme-for-4.18' of git://git.infradead.org/nvme
[sfrench/cifs-2.6.git] / arch / arm / boot / dts / rk3288-tinker.dts
1 /*
2  * Copyright (c) 2017 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
45 #include "rk3288.dtsi"
46 #include <dt-bindings/input/input.h>
47
48 / {
49         model = "Rockchip RK3288 Tinker Board";
50         compatible = "asus,rk3288-tinker", "rockchip,rk3288";
51
52         chosen {
53                 stdout-path = "serial2:115200n8";
54         };
55
56         memory {
57                 reg = <0x0 0x0 0x0 0x80000000>;
58                 device_type = "memory";
59         };
60
61         ext_gmac: external-gmac-clock {
62                 compatible = "fixed-clock";
63                 #clock-cells = <0>;
64                 clock-frequency = <125000000>;
65                 clock-output-names = "ext_gmac";
66         };
67
68         gpio-keys {
69                 compatible = "gpio-keys";
70                 #address-cells = <1>;
71                 #size-cells = <0>;
72                 autorepeat;
73
74                 pinctrl-names = "default";
75                 pinctrl-0 = <&pwrbtn>;
76
77                 button@0 {
78                         gpios = <&gpio0 RK_PA5 GPIO_ACTIVE_LOW>;
79                         linux,code = <KEY_POWER>;
80                         label = "GPIO Key Power";
81                         linux,input-type = <1>;
82                         wakeup-source;
83                         debounce-interval = <100>;
84                 };
85         };
86
87         gpio-leds {
88                 compatible = "gpio-leds";
89
90                 act-led {
91                         gpios=<&gpio1 RK_PD0 GPIO_ACTIVE_HIGH>;
92                         linux,default-trigger="mmc0";
93                 };
94
95                 heartbeat-led {
96                         gpios=<&gpio1 RK_PD1 GPIO_ACTIVE_HIGH>;
97                         linux,default-trigger="heartbeat";
98                 };
99
100                 pwr-led {
101                         gpios = <&gpio0 RK_PA3 GPIO_ACTIVE_HIGH>;
102                         linux,default-trigger = "default-on";
103                 };
104         };
105
106         sound {
107                 compatible = "simple-audio-card";
108                 simple-audio-card,format = "i2s";
109                 simple-audio-card,name = "rockchip,tinker-codec";
110                 simple-audio-card,mclk-fs = <512>;
111
112                 simple-audio-card,codec {
113                         sound-dai = <&hdmi>;
114                 };
115
116                 simple-audio-card,cpu {
117                         sound-dai = <&i2s>;
118                 };
119         };
120
121         vcc_sys: vsys-regulator {
122                 compatible = "regulator-fixed";
123                 regulator-name = "vcc_sys";
124                 regulator-min-microvolt = <5000000>;
125                 regulator-max-microvolt = <5000000>;
126                 regulator-always-on;
127                 regulator-boot-on;
128         };
129
130         vcc_sd: sdmmc-regulator {
131                 compatible = "regulator-fixed";
132                 gpio = <&gpio7 11 GPIO_ACTIVE_LOW>;
133                 pinctrl-names = "default";
134                 pinctrl-0 = <&sdmmc_pwr>;
135                 regulator-name = "vcc_sd";
136                 regulator-min-microvolt = <3300000>;
137                 regulator-max-microvolt = <3300000>;
138                 startup-delay-us = <100000>;
139                 vin-supply = <&vcc_io>;
140         };
141 };
142
143 &cpu0 {
144         cpu0-supply = <&vdd_cpu>;
145 };
146
147 &gmac {
148         assigned-clocks = <&cru SCLK_MAC>;
149         assigned-clock-parents = <&ext_gmac>;
150         clock_in_out = "input";
151         phy-mode = "rgmii";
152         phy-supply = <&vcc33_lan>;
153         pinctrl-names = "default";
154         pinctrl-0 = <&rgmii_pins>;
155         snps,reset-gpio = <&gpio4 7 0>;
156         snps,reset-active-low;
157         snps,reset-delays-us = <0 10000 1000000>;
158         tx_delay = <0x30>;
159         rx_delay = <0x10>;
160         status = "ok";
161 };
162
163 &gpu {
164         mali-supply = <&vdd_gpu>;
165         status = "okay";
166 };
167
168 &hdmi {
169         ddc-i2c-bus = <&i2c5>;
170         status = "okay";
171 };
172
173 &i2c0 {
174         clock-frequency = <400000>;
175         status = "okay";
176
177         rk808: pmic@1b {
178                 compatible = "rockchip,rk808";
179                 reg = <0x1b>;
180                 interrupt-parent = <&gpio0>;
181                 interrupts = <4 IRQ_TYPE_LEVEL_LOW>;
182                 #clock-cells = <1>;
183                 clock-output-names = "xin32k", "rk808-clkout2";
184                 dvs-gpios = <&gpio0 11 GPIO_ACTIVE_HIGH>,
185                                 <&gpio0 12 GPIO_ACTIVE_HIGH>;
186                 pinctrl-names = "default";
187                 pinctrl-0 = <&pmic_int &global_pwroff &dvs_1 &dvs_2>;
188                 rockchip,system-power-controller;
189                 wakeup-source;
190
191                 vcc1-supply = <&vcc_sys>;
192                 vcc2-supply = <&vcc_sys>;
193                 vcc3-supply = <&vcc_sys>;
194                 vcc4-supply = <&vcc_sys>;
195                 vcc6-supply = <&vcc_sys>;
196                 vcc7-supply = <&vcc_sys>;
197                 vcc8-supply = <&vcc_io>;
198                 vcc9-supply = <&vcc_io>;
199                 vcc10-supply = <&vcc_io>;
200                 vcc11-supply = <&vcc_sys>;
201                 vcc12-supply = <&vcc_io>;
202                 vddio-supply = <&vcc_io>;
203
204                 regulators {
205                         vdd_cpu: DCDC_REG1 {
206                                 regulator-always-on;
207                                 regulator-boot-on;
208                                 regulator-min-microvolt = <750000>;
209                                 regulator-max-microvolt = <1350000>;
210                                 regulator-name = "vdd_arm";
211                                 regulator-ramp-delay = <6000>;
212                                 regulator-state-mem {
213                                         regulator-off-in-suspend;
214                                 };
215                         };
216
217                         vdd_gpu: DCDC_REG2 {
218                                 regulator-always-on;
219                                 regulator-boot-on;
220                                 regulator-min-microvolt = <850000>;
221                                 regulator-max-microvolt = <1250000>;
222                                 regulator-name = "vdd_gpu";
223                                 regulator-ramp-delay = <6000>;
224                                 regulator-state-mem {
225                                         regulator-on-in-suspend;
226                                         regulator-suspend-microvolt = <1000000>;
227                                 };
228                         };
229
230                         vcc_ddr: DCDC_REG3 {
231                                 regulator-always-on;
232                                 regulator-boot-on;
233                                 regulator-name = "vcc_ddr";
234                                 regulator-state-mem {
235                                         regulator-on-in-suspend;
236                                 };
237                         };
238
239                         vcc_io: DCDC_REG4 {
240                                 regulator-always-on;
241                                 regulator-boot-on;
242                                 regulator-min-microvolt = <3300000>;
243                                 regulator-max-microvolt = <3300000>;
244                                 regulator-name = "vcc_io";
245                                 regulator-state-mem {
246                                         regulator-on-in-suspend;
247                                         regulator-suspend-microvolt = <3300000>;
248                                 };
249                         };
250
251                         vcc18_ldo1: LDO_REG1 {
252                                 regulator-always-on;
253                                 regulator-boot-on;
254                                 regulator-min-microvolt = <1800000>;
255                                 regulator-max-microvolt = <1800000>;
256                                 regulator-name = "vcc18_ldo1";
257                                 regulator-state-mem {
258                                         regulator-on-in-suspend;
259                                         regulator-suspend-microvolt = <1800000>;
260                                 };
261                         };
262
263                         vcc33_mipi: LDO_REG2 {
264                                 regulator-always-on;
265                                 regulator-boot-on;
266                                 regulator-min-microvolt = <3300000>;
267                                 regulator-max-microvolt = <3300000>;
268                                 regulator-name = "vcc33_mipi";
269                                 regulator-state-mem {
270                                         regulator-off-in-suspend;
271                                 };
272                         };
273
274                         vdd_10: LDO_REG3 {
275                                 regulator-always-on;
276                                 regulator-boot-on;
277                                 regulator-min-microvolt = <1000000>;
278                                 regulator-max-microvolt = <1000000>;
279                                 regulator-name = "vdd_10";
280                                 regulator-state-mem {
281                                         regulator-on-in-suspend;
282                                         regulator-suspend-microvolt = <1000000>;
283                                 };
284                         };
285
286                         vcc18_codec: LDO_REG4 {
287                                 regulator-always-on;
288                                 regulator-boot-on;
289                                 regulator-min-microvolt = <1800000>;
290                                 regulator-max-microvolt = <1800000>;
291                                 regulator-name = "vcc18_codec";
292                                 regulator-state-mem {
293                                         regulator-on-in-suspend;
294                                         regulator-suspend-microvolt = <1800000>;
295                                 };
296                         };
297
298                         vccio_sd: LDO_REG5 {
299                                 regulator-min-microvolt = <1800000>;
300                                 regulator-max-microvolt = <3300000>;
301                                 regulator-name = "vccio_sd";
302                                 regulator-state-mem {
303                                         regulator-on-in-suspend;
304                                         regulator-suspend-microvolt = <3300000>;
305                                 };
306                         };
307
308                         vdd10_lcd: LDO_REG6 {
309                                 regulator-always-on;
310                                 regulator-boot-on;
311                                 regulator-min-microvolt = <1000000>;
312                                 regulator-max-microvolt = <1000000>;
313                                 regulator-name = "vdd10_lcd";
314                                 regulator-state-mem {
315                                         regulator-on-in-suspend;
316                                         regulator-suspend-microvolt = <1000000>;
317                                 };
318                         };
319
320                         vcc_18: LDO_REG7 {
321                                 regulator-always-on;
322                                 regulator-boot-on;
323                                 regulator-min-microvolt = <1800000>;
324                                 regulator-max-microvolt = <1800000>;
325                                 regulator-name = "vcc_18";
326                                 regulator-state-mem {
327                                         regulator-on-in-suspend;
328                                         regulator-suspend-microvolt = <1800000>;
329                                 };
330                         };
331
332                         vcc18_lcd: LDO_REG8 {
333                                 regulator-always-on;
334                                 regulator-boot-on;
335                                 regulator-min-microvolt = <1800000>;
336                                 regulator-max-microvolt = <1800000>;
337                                 regulator-name = "vcc18_lcd";
338                                 regulator-state-mem {
339                                         regulator-on-in-suspend;
340                                         regulator-suspend-microvolt = <1800000>;
341                                 };
342                         };
343
344                         vcc33_sd: SWITCH_REG1 {
345                                 regulator-always-on;
346                                 regulator-boot-on;
347                                 regulator-name = "vcc33_sd";
348                                 regulator-state-mem {
349                                         regulator-on-in-suspend;
350                                 };
351                         };
352
353                         vcc33_lan: SWITCH_REG2 {
354                                 regulator-always-on;
355                                 regulator-boot-on;
356                                 regulator-name = "vcc33_lan";
357                                 regulator-state-mem {
358                                         regulator-on-in-suspend;
359                                 };
360                         };
361                 };
362         };
363 };
364
365 &i2c2 {
366         status = "okay";
367 };
368
369 &i2c5 {
370         status = "okay";
371 };
372
373 &i2s {
374         #sound-dai-cells = <0>;
375         status = "okay";
376 };
377
378 &io_domains {
379         status = "okay";
380
381         sdcard-supply = <&vccio_sd>;
382 };
383
384 &pinctrl {
385         pcfg_pull_none_drv_8ma: pcfg-pull-none-drv-8ma {
386                 drive-strength = <8>;
387         };
388
389         pcfg_pull_up_drv_8ma: pcfg-pull-up-drv-8ma {
390                 bias-pull-up;
391                 drive-strength = <8>;
392         };
393
394         backlight {
395                 bl_en: bl-en {
396                         rockchip,pins = <7 2 RK_FUNC_GPIO &pcfg_pull_none>;
397                 };
398         };
399
400         buttons {
401                 pwrbtn: pwrbtn {
402                         rockchip,pins = <0 5 RK_FUNC_GPIO &pcfg_pull_up>;
403                 };
404         };
405
406         eth_phy {
407                 eth_phy_pwr: eth-phy-pwr {
408                         rockchip,pins = <0 6 RK_FUNC_GPIO &pcfg_pull_none>;
409                 };
410         };
411
412         pmic {
413                 pmic_int: pmic-int {
414                         rockchip,pins = <RK_GPIO0 4 RK_FUNC_GPIO \
415                                         &pcfg_pull_up>;
416                 };
417
418                 dvs_1: dvs-1 {
419                         rockchip,pins = <RK_GPIO0 11 RK_FUNC_GPIO \
420                                         &pcfg_pull_down>;
421                 };
422
423                 dvs_2: dvs-2 {
424                         rockchip,pins = <RK_GPIO0 12 RK_FUNC_GPIO \
425                                         &pcfg_pull_down>;
426                 };
427         };
428
429         sdmmc {
430                 sdmmc_bus4: sdmmc-bus4 {
431                         rockchip,pins = <6 16 RK_FUNC_1 &pcfg_pull_up_drv_8ma>,
432                                         <6 17 RK_FUNC_1 &pcfg_pull_up_drv_8ma>,
433                                         <6 18 RK_FUNC_1 &pcfg_pull_up_drv_8ma>,
434                                         <6 19 RK_FUNC_1 &pcfg_pull_up_drv_8ma>;
435                 };
436
437                 sdmmc_clk: sdmmc-clk {
438                         rockchip,pins = <6 20 RK_FUNC_1 \
439                                         &pcfg_pull_none_drv_8ma>;
440                 };
441
442                 sdmmc_cmd: sdmmc-cmd {
443                         rockchip,pins = <6 21 RK_FUNC_1 &pcfg_pull_up_drv_8ma>;
444                 };
445
446                 sdmmc_pwr: sdmmc-pwr {
447                         rockchip,pins = <7 11 RK_FUNC_GPIO &pcfg_pull_none>;
448                 };
449         };
450
451         usb {
452                 host_vbus_drv: host-vbus-drv {
453                         rockchip,pins = <0 14 RK_FUNC_GPIO &pcfg_pull_none>;
454                 };
455
456                 pwr_3g: pwr-3g {
457                         rockchip,pins = <7 8 RK_FUNC_GPIO &pcfg_pull_none>;
458                 };
459         };
460 };
461
462 &pwm0 {
463         status = "okay";
464 };
465
466 &saradc {
467         vref-supply = <&vcc18_ldo1>;
468         status ="okay";
469 };
470
471 &sdmmc {
472         bus-width = <4>;
473         cap-mmc-highspeed;
474         cap-sd-highspeed;
475         card-detect-delay = <200>;
476         disable-wp;                     /* wp not hooked up */
477         pinctrl-names = "default";
478         pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
479         status = "okay";
480         vmmc-supply = <&vcc33_sd>;
481         vqmmc-supply = <&vccio_sd>;
482 };
483
484 &tsadc {
485         rockchip,hw-tshut-mode = <1>; /* tshut mode 0:CRU 1:GPIO */
486         rockchip,hw-tshut-polarity = <1>; /* tshut polarity 0:LOW 1:HIGH */
487         status = "okay";
488 };
489
490 &uart0 {
491         status = "okay";
492 };
493
494 &uart1 {
495         status = "okay";
496 };
497
498 &uart2 {
499         status = "okay";
500 };
501
502 &uart3 {
503         status = "okay";
504 };
505
506 &uart4 {
507         status = "okay";
508 };
509
510 &usbphy {
511         status = "okay";
512 };
513
514 &usb_host0_ehci {
515         status = "okay";
516 };
517
518 &usb_host1 {
519         status = "okay";
520 };
521
522 &usb_otg {
523         status= "okay";
524 };
525
526 &vopb {
527         status = "okay";
528 };
529
530 &vopb_mmu {
531         status = "okay";
532 };
533
534 &vopl {
535         status = "okay";
536 };
537
538 &vopl_mmu {
539         status = "okay";
540 };
541
542 &wdt {
543         status = "okay";
544 };