arm64: dts: rockchip: rk3328: Use new define for RK3328 pins
[firefly-linux-kernel-4.4.55.git] / arch / arm64 / boot / dts / rockchip / rk3399-evb.dtsi
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 #include <dt-bindings/pwm/pwm.h>
44 #include "rk3399.dtsi"
45 #include "rk3399-opp.dtsi"
46
47 / {
48         compatible = "rockchip,rk3399-evb", "rockchip,rk3399";
49
50         vcc3v3_sys: vcc3v3-sys {
51                 compatible = "regulator-fixed";
52                 regulator-name = "vcc3v3_sys";
53                 regulator-always-on;
54                 regulator-boot-on;
55                 regulator-min-microvolt = <3300000>;
56                 regulator-max-microvolt = <3300000>;
57         };
58
59         vcc5v0_host: vcc5v0-host-regulator {
60                 compatible = "regulator-fixed";
61                 enable-active-high;
62                 gpio = <&gpio4 25 GPIO_ACTIVE_HIGH>;
63                 pinctrl-names = "default";
64                 pinctrl-0 = <&host_vbus_drv>;
65                 regulator-name = "vcc5v0_host";
66                 regulator-always-on;
67         };
68
69         backlight: backlight {
70                 compatible = "pwm-backlight";
71                 pwms = <&pwm0 0 25000 0>;
72                 brightness-levels = <
73                           0   1   2   3   4   5   6   7
74                           8   9  10  11  12  13  14  15
75                          16  17  18  19  20  21  22  23
76                          24  25  26  27  28  29  30  31
77                          32  33  34  35  36  37  38  39
78                          40  41  42  43  44  45  46  47
79                          48  49  50  51  52  53  54  55
80                          56  57  58  59  60  61  62  63
81                          64  65  66  67  68  69  70  71
82                          72  73  74  75  76  77  78  79
83                          80  81  82  83  84  85  86  87
84                          88  89  90  91  92  93  94  95
85                          96  97  98  99 100 101 102 103
86                         104 105 106 107 108 109 110 111
87                         112 113 114 115 116 117 118 119
88                         120 121 122 123 124 125 126 127
89                         128 129 130 131 132 133 134 135
90                         136 137 138 139 140 141 142 143
91                         144 145 146 147 148 149 150 151
92                         152 153 154 155 156 157 158 159
93                         160 161 162 163 164 165 166 167
94                         168 169 170 171 172 173 174 175
95                         176 177 178 179 180 181 182 183
96                         184 185 186 187 188 189 190 191
97                         192 193 194 195 196 197 198 199
98                         200 201 202 203 204 205 206 207
99                         208 209 210 211 212 213 214 215
100                         216 217 218 219 220 221 222 223
101                         224 225 226 227 228 229 230 231
102                         232 233 234 235 236 237 238 239
103                         240 241 242 243 244 245 246 247
104                         248 249 250 251 252 253 254 255>;
105                 default-brightness-level = <200>;
106         };
107
108         clkin_gmac: external-gmac-clock {
109                 compatible = "fixed-clock";
110                 clock-frequency = <125000000>;
111                 clock-output-names = "clkin_gmac";
112                 #clock-cells = <0>;
113         };
114
115         vcc_phy: vcc-phy-regulator {
116                 compatible = "regulator-fixed";
117                 regulator-name = "vcc_phy";
118                 regulator-always-on;
119                 regulator-boot-on;
120         };
121
122         es8316-sound {
123                 compatible = "simple-audio-card";
124                 simple-audio-card,format = "i2s";
125                 simple-audio-card,name = "rockchip,es8316-codec";
126                 simple-audio-card,mclk-fs = <256>;
127                 simple-audio-card,widgets =
128                         "Microphone", "Mic Jack",
129                         "Headphone", "Headphone Jack";
130                 simple-audio-card,routing =
131                         "Mic Jack", "MICBIAS1",
132                         "IN1P", "Mic Jack",
133                         "Headphone Jack", "HPOL",
134                         "Headphone Jack", "HPOR";
135                 simple-audio-card,cpu {
136                         sound-dai = <&i2s0>;
137                 };
138                 simple-audio-card,codec {
139                         sound-dai = <&es8316>;
140                 };
141         };
142
143         hdmi_sound: hdmi-sound {
144                 status = "disabled";
145                 compatible = "simple-audio-card";
146                 simple-audio-card,format = "i2s";
147                 simple-audio-card,mclk-fs = <256>;
148                 simple-audio-card,name = "rockchip,hdmi";
149                 simple-audio-card,cpu {
150                         sound-dai = <&i2s2>;
151                 };
152                 simple-audio-card,codec {
153                         sound-dai = <&dw_hdmi_audio>;
154                 };
155         };
156
157         dw_hdmi_audio: dw-hdmi-audio {
158                 status = "disabled";
159                 compatible = "rockchip,dw-hdmi-audio";
160                 #sound-dai-cells = <0>;
161         };
162
163         spdif_sound: spdif-sound {
164                 status = "disabled";
165                 compatible = "simple-audio-card";
166                 simple-audio-card,name = "ROCKCHIP,SPDIF";
167                 simple-audio-card,cpu {
168                         sound-dai = <&spdif>;
169                 };
170                 simple-audio-card,codec {
171                         sound-dai = <&spdif_out>;
172                 };
173         };
174
175         spdif_out: spdif-out {
176                 status = "disabled";
177                 compatible = "linux,spdif-dit";
178                 #sound-dai-cells = <0>;
179         };
180
181         sdio_pwrseq: sdio-pwrseq {
182                 compatible = "mmc-pwrseq-simple";
183                 clocks = <&rk808 1>;
184                 clock-names = "ext_clock";
185                 pinctrl-names = "default";
186                 pinctrl-0 = <&wifi_enable_h>;
187
188                 /*
189                  * On the module itself this is one of these (depending
190                  * on the actual card populated):
191                  * - SDIO_RESET_L_WL_REG_ON
192                  * - PDN (power down when low)
193                  */
194                 reset-gpios = <&gpio0 10 GPIO_ACTIVE_LOW>; /* GPIO0_B2 */
195         };
196
197         wireless-wlan {
198                 compatible = "wlan-platdata";
199                 rockchip,grf = <&grf>;
200                 wifi_chip_type = "ap6354";
201                 sdio_vref = <1800>;
202                 WIFI,host_wake_irq = <&gpio0 3 GPIO_ACTIVE_HIGH>; /* GPIO0_a3 */
203                 status = "okay";
204         };
205
206         wireless-bluetooth {
207                 compatible = "bluetooth-platdata";
208                 clocks = <&rk808 1>;
209                 clock-names = "ext_clock";
210                 //wifi-bt-power-toggle;
211                 uart_rts_gpios = <&gpio2 19 GPIO_ACTIVE_LOW>; /* GPIO2_C3 */
212                 pinctrl-names = "default", "rts_gpio";
213                 pinctrl-0 = <&uart0_rts>;
214                 pinctrl-1 = <&uart0_gpios>;
215                 //BT,power_gpio  = <&gpio3 19 GPIO_ACTIVE_HIGH>; /* GPIOx_xx */
216                 BT,reset_gpio    = <&gpio0 9 GPIO_ACTIVE_HIGH>; /* GPIO0_B1 */
217                 BT,wake_gpio     = <&gpio2 26 GPIO_ACTIVE_HIGH>; /* GPIO2_D2 */
218                 BT,wake_host_irq = <&gpio0 4 GPIO_ACTIVE_HIGH>; /* GPIO0_A4 */
219                 status = "okay";
220         };
221
222         test-power {
223                 status = "okay";
224         };
225 };
226
227 &cpu_l0 {
228         cpu-supply = <&vdd_cpu_l>;
229 };
230
231 &cpu_l1 {
232         cpu-supply = <&vdd_cpu_l>;
233 };
234
235 &cpu_l2 {
236         cpu-supply = <&vdd_cpu_l>;
237 };
238
239 &cpu_l3 {
240         cpu-supply = <&vdd_cpu_l>;
241 };
242
243 &cpu_b0 {
244         cpu-supply = <&vdd_cpu_b>;
245 };
246
247 &cpu_b1 {
248         cpu-supply = <&vdd_cpu_b>;
249 };
250
251 &gpu {
252         status = "okay";
253         mali-supply = <&vdd_gpu>;
254 };
255
256 &sdmmc {
257         clock-frequency = <150000000>;
258         clock-freq-min-max = <400000 150000000>;
259         supports-sd;
260         bus-width = <4>;
261         cap-mmc-highspeed;
262         cap-sd-highspeed;
263         disable-wp;
264         num-slots = <1>;
265         //sd-uhs-sdr104;
266         vqmmc-supply = <&vcc_sd>;
267         pinctrl-names = "default";
268         pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
269         status = "okay";
270 };
271
272 &sdio0 {
273         clock-frequency = <150000000>;
274         clock-freq-min-max = <200000 150000000>;
275         supports-sdio;
276         bus-width = <4>;
277         disable-wp;
278         cap-sd-highspeed;
279         cap-sdio-irq;
280         keep-power-in-suspend;
281         mmc-pwrseq = <&sdio_pwrseq>;
282         non-removable;
283         num-slots = <1>;
284         pinctrl-names = "default";
285         pinctrl-0 = <&sdio0_bus4 &sdio0_cmd &sdio0_clk>;
286         sd-uhs-sdr104;
287         status = "okay";
288 };
289
290 &emmc_phy {
291         status = "okay";
292 };
293
294 &dfi {
295 //      status = "okay";
296 };
297
298 &dmc {
299 //      status = "okay";
300         center-supply = <&vdd_center>;
301         upthreshold = <60>;
302         downdifferential = <40>;
303 };
304
305 &sdhci {
306         bus-width = <8>;
307         mmc-hs400-1_8v;
308         supports-emmc;
309         non-removable;
310         keep-power-in-suspend;
311         mmc-hs400-enhanced-strobe;
312         status = "okay";
313 };
314
315 &i2s0 {
316         status = "okay";
317         rockchip,i2s-broken-burst-len;
318         rockchip,playback-channels = <8>;
319         rockchip,capture-channels = <8>;
320         #sound-dai-cells = <0>;
321 };
322
323 &i2s2 {
324         #sound-dai-cells = <0>;
325 };
326
327 &spdif {
328         #sound-dai-cells = <0>;
329 };
330
331 &i2c0 {
332         status = "okay";
333         i2c-scl-rising-time-ns = <450>;
334         i2c-scl-falling-time-ns = <15>;
335 };
336
337 &i2c1 {
338         status = "okay";
339         i2c-scl-rising-time-ns = <300>;
340         i2c-scl-falling-time-ns = <15>;
341
342         es8316: es8316@10 {
343                 #sound-dai-cells = <0>;
344                 compatible = "everest,es8316";
345                 reg = <0x10>;
346                 clocks = <&cru SCLK_I2S_8CH_OUT>;
347                 clock-names = "mclk";
348                 spk-con-gpio = <&gpio0 11 GPIO_ACTIVE_HIGH>;
349                 hp-det-gpio = <&gpio4 28 GPIO_ACTIVE_LOW>;
350         };
351 };
352
353 &i2c4 {
354         status = "okay";
355         i2c-scl-rising-time-ns = <600>;
356         i2c-scl-falling-time-ns = <20>;
357
358         gt9xx: gt9xx@14 {
359                 compatible = "goodix,gt9xx";
360                 reg = <0x14>;
361                 touch-gpio = <&gpio1 20 IRQ_TYPE_LEVEL_LOW>;
362                 reset-gpio = <&gpio4 22 GPIO_ACTIVE_HIGH>;
363                 max-x = <1200>;
364                 max-y = <1900>;
365                 tp-size = <911>;
366                 tp-supply = <&vcc3v0_tp>;
367         };
368
369         gsl3673: gsl3673@40 {
370                 compatible = "GSL,GSL3673";
371                 reg = <0x40>;
372                 screen_max_x = <1536>;
373                 screen_max_y = <2048>;
374                 irq_gpio_number = <&gpio1 20 IRQ_TYPE_LEVEL_LOW>;
375                 rst_gpio_number = <&gpio4 22 GPIO_ACTIVE_HIGH>;
376         };
377 };
378
379 &io_domains {
380         status = "okay";
381
382         bt656-supply = <&vcc1v8_dvp>;
383         audio-supply = <&vcca1v8_codec>;
384         sdmmc-supply = <&vcc_sd>;
385         gpio1830-supply = <&vcc_3v0>;
386 };
387
388 &pcie_phy {
389         status = "disabled";
390 };
391
392 &pcie0 {
393         ep-gpios = <&gpio3 13 GPIO_ACTIVE_HIGH>;
394         num-lanes = <4>;
395         pinctrl-names = "default";
396         pinctrl-0 = <&pcie_clkreqn_cpm>;
397         status = "disabled";
398 };
399
400 &tcphy0 {
401         extcon = <&fusb0>;
402         status = "okay";
403 };
404
405 &tcphy1 {
406         extcon = <&fusb1>;
407         status = "okay";
408 };
409
410 &tsadc {
411         rockchip,hw-tshut-mode = <1>; /* tshut mode 0:CRU 1:GPIO */
412         rockchip,hw-tshut-polarity = <1>; /* tshut polarity 0:LOW 1:HIGH */
413         status = "okay";
414 };
415
416 &u2phy0 {
417         status = "okay";
418         extcon = <&fusb0>;
419
420         u2phy0_otg: otg-port {
421                 status = "okay";
422         };
423
424         u2phy0_host: host-port {
425                 phy-supply = <&vcc5v0_host>;
426                 status = "okay";
427         };
428 };
429
430 &u2phy1 {
431         status = "okay";
432         extcon = <&fusb1>;
433
434         u2phy1_otg: otg-port {
435                 status = "okay";
436         };
437
438         u2phy1_host: host-port {
439                 phy-supply = <&vcc5v0_host>;
440                 status = "okay";
441         };
442 };
443
444 &uart0 {
445         pinctrl-names = "default";
446         pinctrl-0 = <&uart0_xfer &uart0_cts>;
447         status = "okay";
448 };
449
450 &uart2 {
451         status = "okay";
452 };
453
454 &usb_host0_ehci {
455         status = "okay";
456 };
457
458 &usb_host0_ohci {
459         status = "okay";
460 };
461
462 &usb_host1_ehci {
463         status = "okay";
464 };
465
466 &usb_host1_ohci {
467         status = "okay";
468 };
469
470 &usbdrd3_0 {
471         extcon = <&fusb0>;
472         status = "okay";
473 };
474
475 &usbdrd_dwc3_0 {
476         status = "okay";
477 };
478
479 &usbdrd3_1 {
480         extcon = <&fusb1>;
481         status = "okay";
482 };
483
484 &usbdrd_dwc3_1 {
485         status = "okay";
486 };
487
488 &pwm0 {
489         status = "okay";
490 };
491
492 &gmac {
493         phy-supply = <&vcc_phy>;
494         phy-mode = "rgmii";
495         clock_in_out = "input";
496         snps,reset-gpio = <&gpio3 15 GPIO_ACTIVE_LOW>;
497         snps,reset-active-low;
498         snps,reset-delays-us = <0 10000 50000>;
499         assigned-clocks = <&cru SCLK_RMII_SRC>;
500         assigned-clock-parents = <&clkin_gmac>;
501         pinctrl-names = "default";
502         pinctrl-0 = <&rgmii_pins>;
503         tx_delay = <0x28>;
504         rx_delay = <0x11>;
505         status = "okay";
506 };
507
508 &saradc {
509         status = "okay";
510 };
511
512 &pinctrl {
513         sdio-pwrseq {
514                 wifi_enable_h: wifi-enable-h {
515                         rockchip,pins = <0 10 RK_FUNC_GPIO &pcfg_pull_none>;
516                 };
517         };
518
519         wireless-bluetooth {
520                 uart0_gpios: uart0-gpios {
521                         rockchip,pins = <2 19 RK_FUNC_GPIO &pcfg_pull_none>;
522                 };
523         };
524
525         pmic {
526                 pmic_int_l: pmic-int-l {
527                         rockchip,pins =
528                                 <1 21 RK_FUNC_GPIO &pcfg_pull_up>;
529                 };
530
531                 pmic_dvs2: pmic-dvs2 {
532                         rockchip,pins =
533                                 <1 18 RK_FUNC_GPIO &pcfg_pull_down>;
534                 };
535                 vsel1_gpio: vsel1-gpio {
536                         rockchip,pins =
537                                 <1 17 RK_FUNC_GPIO &pcfg_pull_down>;
538                 };
539                 vsel2_gpio: vsel2-gpio {
540                         rockchip,pins =
541                                 <1 14 RK_FUNC_GPIO &pcfg_pull_down>;
542                 };
543         };
544
545         usb2 {
546                 host_vbus_drv: host-vbus-drv {
547                         rockchip,pins =
548                                 <4 25 RK_FUNC_GPIO &pcfg_pull_none>;
549                 };
550         };
551
552         fusb30x {
553                 fusb0_int: fusb0-int {
554                         rockchip,pins = <1 2 RK_FUNC_GPIO &pcfg_pull_up>;
555                 };
556
557                 fusb1_int: fusb1-int {
558                         rockchip,pins = <1 24 RK_FUNC_GPIO &pcfg_pull_up>;
559                 };
560         };
561 };
562
563 &pvtm {
564         status = "okay";
565 };
566
567 &pmu_pvtm {
568         status = "okay";
569 };
570
571 &pmu_io_domains {
572         status = "okay";
573         pmu1830-supply = <&vcc1v8_pmu>;
574 };
575