cd039cdcc96b8b6cf3df3780f2f9ac1d93a2d2ae
[firefly-linux-kernel-4.4.55.git] / arch / arm / boot / dts / rk3288-fennec.dts
1 /*
2  * This file is dual-licensed: you can use it either under the terms
3  * of the GPL or the X11 license, at your option. Note that this dual
4  * licensing only applies to this file, and not this project as a
5  * whole.
6  *
7  *  a) This file is free software; you can redistribute it and/or
8  *     modify it under the terms of the GNU General Public License as
9  *     published by the Free Software Foundation; either version 2 of the
10  *     License, or (at your option) any later version.
11  *
12  *     This file is distributed in the hope that it will be useful,
13  *     but WITHOUT ANY WARRANTY; without even the implied warranty of
14  *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  *     GNU General Public License for more details.
16  *
17  * Or, alternatively,
18  *
19  *  b) Permission is hereby granted, free of charge, to any person
20  *     obtaining a copy of this software and associated documentation
21  *     files (the "Software"), to deal in the Software without
22  *     restriction, including without limitation the rights to use,
23  *     copy, modify, merge, publish, distribute, sublicense, and/or
24  *     sell copies of the Software, and to permit persons to whom the
25  *     Software is furnished to do so, subject to the following
26  *     conditions:
27  *
28  *     The above copyright notice and this permission notice shall be
29  *     included in all copies or substantial portions of the Software.
30  *
31  *     THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
32  *     EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
33  *     OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
34  *     NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
35  *     HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
36  *     WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
37  *     FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
38  *     OTHER DEALINGS IN THE SOFTWARE.
39  */
40
41 /dts-v1/;
42
43 #include <dt-bindings/clock/rockchip,rk808.h>
44 #include "rk3288.dtsi"
45
46 / {
47         model = "Rockchip RK3288 Fennec Board";
48         compatible = "rockchip,rk3288-fennec", "rockchip,rk3288";
49
50         memory {
51                 reg = <0x0 0x80000000>;
52                 device_type = "memory";
53         };
54
55         ext_gmac: external-gmac-clock {
56                 compatible = "fixed-clock";
57                 #clock-cells = <0>;
58                 clock-frequency = <125000000>;
59                 clock-output-names = "ext_gmac";
60         };
61
62         io-domains {
63                 compatible = "rockchip,rk3288-io-voltage-domain";
64                 rockchip,grf = <&grf>;
65                 wifi-supply = <&vcc_wl>;
66         };
67
68         sdio_pwrseq: sdio-pwrseq {
69                 compatible = "mmc-pwrseq-simple";
70                 clocks = <&rk808 RK808_CLKOUT1>;
71                 clock-names = "ext_clock";
72                 pinctrl-names = "default";
73                 pinctrl-0 = <&wifi_enable_h>;
74
75                 /*
76                  * On the module itself this is one of these (depending
77                  * on the actual card populated):
78                  * - SDIO_RESET_L_WL_REG_ON
79                  * - PDN (power down when low)
80                  */
81                 reset-gpios = <&gpio4 28 GPIO_ACTIVE_LOW>;
82         };
83
84         sound {
85                 compatible = "simple-audio-card";
86                 simple-audio-card,format = "i2s";
87                 simple-audio-card,name = "rockchip,fennec-codec";
88                 simple-audio-card,mclk-fs = <512>;
89
90                 simple-audio-card,dai-link@0 {
91                         format = "i2s";
92                         cpu {
93                                 sound-dai = <&i2s>;
94                         };
95                         codec {
96                                 sound-dai = <&hdmi>;
97                         };
98
99                 };
100
101                 simple-audio-card,dai-link@1 {
102                         format = "i2s";
103                         cpu {
104                                 sound-dai = <&i2s>;
105                         };
106
107                         codec {
108                                 sound-dai = <&es8323>;
109                         };
110                 };
111         };
112
113         vcc_sys: vsys-regulator {
114                 compatible = "regulator-fixed";
115                 regulator-name = "vcc_sys";
116                 regulator-min-microvolt = <5000000>;
117                 regulator-max-microvolt = <5000000>;
118                 regulator-always-on;
119                 regulator-boot-on;
120         };
121
122         vcc_host: usb-host-regulator {
123                 compatible = "regulator-fixed";
124                 enable-active-high;
125                 gpio = <&gpio0 14 GPIO_ACTIVE_HIGH>;
126                 pinctrl-names = "default";
127                 pinctrl-0 = <&host_drv>;
128                 regulator-name = "vcc_host_5v";
129                 regulator-min-microvolt = <5000000>;
130                 regulator-max-microvolt = <5000000>;
131                 regulator-always-on;
132         };
133
134         vcc_otg: usb-otg-regulator {
135                 compatible = "regulator-fixed";
136                 enable-active-high;
137                 gpio = <&gpio0 12 GPIO_ACTIVE_HIGH>;
138                 pinctrl-names = "default";
139                 pinctrl-0 = <&otg_drv>;
140                 regulator-name = "vcc_otg_5v";
141                 regulator-min-microvolt = <5000000>;
142                 regulator-max-microvolt = <5000000>;
143                 regulator-always-on;
144         };
145
146         wireless-bluetooth {
147                 compatible = "bluetooth-platdata";
148                 uart_rts_gpios = <&gpio4 19 GPIO_ACTIVE_LOW>;
149                 pinctrl-names = "default", "rts_gpio";
150                 pinctrl-0 = <&uart0_rts>;
151                 pinctrl-1 = <&uart0_gpios>;
152                 BT,reset_gpio    = <&gpio4 29 GPIO_ACTIVE_HIGH>;
153                 BT,wake_gpio     = <&gpio4 26 GPIO_ACTIVE_HIGH>;
154                 BT,wake_host_irq = <&gpio4 31 GPIO_ACTIVE_HIGH>;
155                 status = "okay";
156         };
157
158         wireless-wlan {
159                 compatible = "wlan-platdata";
160                 rockchip,grf = <&grf>;
161                 wifi_chip_type = "ap6212";
162                 sdio_vref = <1800>;
163                 WIFI,host_wake_irq = <&gpio4 30 GPIO_ACTIVE_HIGH>;
164                 status = "okay";
165         };
166 };
167
168 &cpu0 {
169         cpu0-supply = <&vdd_cpu>;
170 };
171
172 &emmc {
173         bus-width = <8>;
174         cap-mmc-highspeed;
175         disable-wp;
176         non-removable;
177         num-slots = <1>;
178         pinctrl-names = "default";
179         pinctrl-0 = <&emmc_clk &emmc_cmd &emmc_pwr &emmc_bus8>;
180         status = "okay";
181 };
182
183 &sdmmc {
184         bus-width = <4>;
185         cap-mmc-highspeed;
186         cap-sd-highspeed;
187         card-detect-delay = <200>;
188         disable-wp;
189         num-slots = <1>;
190         pinctrl-names = "default";
191         pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
192         status = "okay";
193         supports-sd;
194         vmmc-supply = <&vcc_sd>;
195         vqmmc-supply = <&vccio_sd>;
196 };
197
198 &gmac {
199         assigned-clocks = <&cru SCLK_MAC>;
200         assigned-clock-parents = <&ext_gmac>;
201         clock_in_out = "input";
202         pinctrl-names = "default";
203         pinctrl-0 = <&rgmii_pins>, <&phy_rst>, <&phy_pmeb>, <&phy_int>;
204         phy-supply = <&vcc_lan>;
205         phy-mode = "rgmii";
206         snps,reset-active-low;
207         snps,reset-delays-us = <0 10000 1000000>;
208         snps,reset-gpio = <&gpio4 8 GPIO_ACTIVE_LOW>;
209         tx_delay = <0x30>;
210         rx_delay = <0x10>;
211         status = "okay";
212 };
213
214 &gpu {
215         mali-supply = <&vdd_gpu>;
216         status = "okay";
217 };
218
219 &hdmi {
220         #address-cells = <1>;
221         #size-cells = <0>;
222         #sound-dai-cells = <0>;
223         ddc-i2c-bus = <&i2c5>;
224         status = "okay";
225 };
226
227 &i2c0 {
228         status = "okay";
229         clock-frequency = <400000>;
230
231         rk808: pmic@1b {
232                 compatible = "rockchip,rk808";
233                 reg = <0x1b>;
234                 interrupt-parent = <&gpio0>;
235                 interrupts = <4 IRQ_TYPE_LEVEL_LOW>;
236                 #clock-cells = <1>;
237                 clock-output-names = "xin32k", "rk808-clkout2";
238                 pinctrl-names = "default";
239                 pinctrl-0 = <&pmic_int &global_pwroff>;
240                 rockchip,system-power-controller;
241                 wakeup-source;
242
243                 vcc1-supply = <&vcc_sys>;
244                 vcc2-supply = <&vcc_sys>;
245                 vcc3-supply = <&vcc_sys>;
246                 vcc4-supply = <&vcc_sys>;
247                 vcc6-supply = <&vcc_sys>;
248                 vcc7-supply = <&vcc_sys>;
249                 vcc8-supply = <&vcc_io>;
250                 vcc9-supply = <&vcc_io>;
251                 vcc10-supply = <&vcc_io>;
252                 vcc11-supply = <&vcc_io>;
253                 vcc12-supply = <&vcc_io>;
254                 vddio-supply = <&vcc_io>;
255
256                 regulators {
257                         vdd_cpu: DCDC_REG1 {
258                                 regulator-always-on;
259                                 regulator-boot-on;
260                                 regulator-min-microvolt = <750000>;
261                                 regulator-max-microvolt = <1350000>;
262                                 regulator-name = "vdd_arm";
263                                 regulator-state-mem {
264                                         regulator-off-in-suspend;
265                                 };
266                         };
267
268                         vdd_gpu: DCDC_REG2 {
269                                 regulator-always-on;
270                                 regulator-boot-on;
271                                 regulator-min-microvolt = <850000>;
272                                 regulator-max-microvolt = <1250000>;
273                                 regulator-name = "vdd_gpu";
274                                 regulator-ramp-delay = <6000>;
275                                 regulator-state-mem {
276                                         regulator-on-in-suspend;
277                                         regulator-suspend-microvolt = <1000000>;
278                                 };
279                         };
280
281                         vcc_ddr: DCDC_REG3 {
282                                 regulator-always-on;
283                                 regulator-boot-on;
284                                 regulator-name = "vcc_ddr";
285                                 regulator-state-mem {
286                                         regulator-on-in-suspend;
287                                 };
288                         };
289
290                         vcc_io: DCDC_REG4 {
291                                 regulator-always-on;
292                                 regulator-boot-on;
293                                 regulator-min-microvolt = <3300000>;
294                                 regulator-max-microvolt = <3300000>;
295                                 regulator-name = "vcc_io";
296                                 regulator-state-mem {
297                                         regulator-on-in-suspend;
298                                         regulator-suspend-microvolt = <3300000>;
299                                 };
300                         };
301
302                         vccio_pmu: LDO_REG1 {
303                                 regulator-always-on;
304                                 regulator-boot-on;
305                                 regulator-min-microvolt = <3300000>;
306                                 regulator-max-microvolt = <3300000>;
307                                 regulator-name = "vccio_pmu";
308                                 regulator-state-mem {
309                                         regulator-on-in-suspend;
310                                         regulator-suspend-microvolt = <3300000>;
311                                 };
312                         };
313
314                         vcca_33: LDO_REG2 {
315                                 regulator-always-on;
316                                 regulator-boot-on;
317                                 regulator-min-microvolt = <3300000>;
318                                 regulator-max-microvolt = <3300000>;
319                                 regulator-name = "vcca_33";
320                                 regulator-state-mem {
321                                         regulator-off-in-suspend;
322                                 };
323                         };
324
325                         vdd_10: LDO_REG3 {
326                                 regulator-always-on;
327                                 regulator-boot-on;
328                                 regulator-min-microvolt = <1000000>;
329                                 regulator-max-microvolt = <1000000>;
330                                 regulator-name = "vdd_10";
331                                 regulator-state-mem {
332                                         regulator-on-in-suspend;
333                                         regulator-suspend-microvolt = <1000000>;
334                                 };
335                         };
336
337                         vcc_wl: LDO_REG4 {
338                                 regulator-always-on;
339                                 regulator-boot-on;
340                                 regulator-min-microvolt = <1800000>;
341                                 regulator-max-microvolt = <1800000>;
342                                 regulator-name = "vcc_wl";
343                                 regulator-state-mem {
344                                         regulator-on-in-suspend;
345                                         regulator-suspend-microvolt = <1800000>;
346                                 };
347                         };
348
349                         vccio_sd: LDO_REG5 {
350                                 regulator-always-on;
351                                 regulator-boot-on;
352                                 regulator-min-microvolt = <1800000>;
353                                 regulator-max-microvolt = <3300000>;
354                                 regulator-name = "vccio_sd";
355                                 regulator-state-mem {
356                                         regulator-on-in-suspend;
357                                         regulator-suspend-microvolt = <3300000>;
358                                 };
359                         };
360
361                         vdd10_lcd: LDO_REG6 {
362                                 regulator-always-on;
363                                 regulator-boot-on;
364                                 regulator-min-microvolt = <1000000>;
365                                 regulator-max-microvolt = <1000000>;
366                                 regulator-name = "vdd10_lcd";
367                                 regulator-state-mem {
368                                         regulator-on-in-suspend;
369                                         regulator-suspend-microvolt = <1000000>;
370                                 };
371                         };
372
373                         vcc_18: LDO_REG7 {
374                                 regulator-always-on;
375                                 regulator-boot-on;
376                                 regulator-min-microvolt = <1800000>;
377                                 regulator-max-microvolt = <1800000>;
378                                 regulator-name = "vcc_18";
379                                 regulator-state-mem {
380                                         regulator-on-in-suspend;
381                                         regulator-suspend-microvolt = <1800000>;
382                                 };
383                         };
384
385                         vcc18_lcd: LDO_REG8 {
386                                 regulator-always-on;
387                                 regulator-boot-on;
388                                 regulator-min-microvolt = <1800000>;
389                                 regulator-max-microvolt = <1800000>;
390                                 regulator-name = "vcc18_lcd";
391                                 regulator-state-mem {
392                                         regulator-on-in-suspend;
393                                         regulator-suspend-microvolt = <1800000>;
394                                 };
395                         };
396
397                         vcc_sd: SWITCH_REG1 {
398                                 regulator-always-on;
399                                 regulator-boot-on;
400                                 regulator-name = "vcc_sd";
401                                 regulator-state-mem {
402                                         regulator-on-in-suspend;
403                                 };
404                         };
405
406                         vcc_lan: SWITCH_REG2 {
407                                 regulator-always-on;
408                                 regulator-boot-on;
409                                 regulator-name = "vcc_lan";
410                                 regulator-state-mem {
411                                         regulator-on-in-suspend;
412                                 };
413                         };
414                 };
415         };
416 };
417
418 &i2c2 {
419         status = "okay";
420
421         es8323: es8323@10 {
422                 compatible = "everest,es8323";
423                 reg = <0x10>;
424                 hp-det-gpio = <&gpio5 19 GPIO_ACTIVE_HIGH>;
425                 clock-names = "mclk";
426                 clocks = <&cru SCLK_I2S0_OUT>;
427                 #sound-dai-cells = <0>;
428         };
429 };
430
431 &i2c5 {
432         status = "okay";
433 };
434
435 &i2s {
436         #sound-dai-cells = <0>;
437         status = "okay";
438 };
439
440 &sdio0 {
441         status = "okay";
442         clock-frequency = <50000000>;
443         clock-freq-min-max = <200000 50000000>;
444         bus-width = <4>;
445         cap-sd-highspeed;
446         cap-sdio-irq;
447         disable-wp;
448         keep-power-in-suspend;
449         mmc-pwrseq = <&sdio_pwrseq>;
450         non-removable;
451         num-slots = <1>;
452         pinctrl-names = "default";
453         pinctrl-0 = <&sdio0_bus4 &sdio0_cmd &sdio0_clk>;
454         sd-uhs-sdr104;
455         supports-sdio;
456 };
457
458 &tsadc {
459         rockchip,hw-tshut-mode = <0>; /* tshut mode 0:CRU 1:GPIO */
460         rockchip,hw-tshut-polarity = <0>; /* tshut polarity 0:LOW 1:HIGH */
461         status = "okay";
462 };
463
464 &uart0 {
465         pinctrl-names = "default";
466         pinctrl-0 = <&uart0_xfer &uart0_cts>;
467         status = "okay";
468 };
469
470 &uart2 {
471         status = "okay";
472 };
473
474 &usbphy {
475         status = "okay";
476 };
477
478 &usb_host0_ehci {
479         status = "okay";
480 };
481
482 &usb_host1 {
483         status = "okay";
484 };
485
486 &usb_otg {
487         status = "okay";
488 };
489
490 &usb_hsic {
491         status = "okay";
492 };
493
494 &vopb {
495         status = "okay";
496 };
497
498 &vopb_mmu {
499         status = "okay";
500 };
501
502 &vopl {
503         status = "okay";
504 };
505
506 &vopl_mmu {
507         status = "okay";
508 };
509
510 &vpu {
511         status = "okay";
512 };
513
514 &pinctrl {
515         pcfg_output_high: pcfg-output-high {
516                 output-high;
517         };
518
519         pcfg_output_low: pcfg-output-low {
520                 output-low;
521         };
522
523         pcfg_pull_none_drv_8ma: pcfg-pull-none-drv-8ma {
524                 drive-strength = <8>;
525         };
526
527         pcfg_pull_up_drv_8ma: pcfg-pull-up-drv-8ma {
528                 bias-pull-up;
529                 drive-strength = <8>;
530         };
531
532         gmac {
533                 phy_int: phy-int {
534                         rockchip,pins = <0 9 RK_FUNC_GPIO &pcfg_pull_up>;
535                 };
536
537                 phy_pmeb: phy-pmeb {
538                         rockchip,pins = <0 8 RK_FUNC_GPIO &pcfg_pull_up>;
539                 };
540
541                 phy_rst: phy-rst {
542                         rockchip,pins = <4 8 RK_FUNC_GPIO &pcfg_output_high>;
543                 };
544         };
545
546         pmic {
547                 pmic_int: pmic-int {
548                         rockchip,pins = <RK_GPIO0 4 RK_FUNC_GPIO &pcfg_pull_up>;
549                 };
550         };
551
552         sdio-pwrseq {
553                 wifi_enable_h: wifi-enable-h {
554                         rockchip,pins = <4 28 RK_FUNC_GPIO &pcfg_pull_none>;
555                 };
556         };
557
558         sdmmc {
559                 sdmmc_bus4: sdmmc-bus4 {
560                         rockchip,pins = <6 16 RK_FUNC_1 &pcfg_pull_up_drv_8ma>,
561                                         <6 17 RK_FUNC_1 &pcfg_pull_up_drv_8ma>,
562                                         <6 18 RK_FUNC_1 &pcfg_pull_up_drv_8ma>,
563                                         <6 19 RK_FUNC_1 &pcfg_pull_up_drv_8ma>;
564                 };
565
566                 sdmmc_clk: sdmmc-clk {
567                         rockchip,pins = <6 20 RK_FUNC_1 &pcfg_pull_none_drv_8ma>;
568                 };
569
570                 sdmmc_cmd: sdmmc-cmd {
571                         rockchip,pins = <6 21 RK_FUNC_1 &pcfg_pull_up_drv_8ma>;
572                 };
573
574                 sdmmc_pwr: sdmmc-pwr {
575                         rockchip,pins = <7 11 RK_FUNC_GPIO &pcfg_pull_none>;
576                 };
577         };
578
579         usb_host {
580                 host_drv: host-drv {
581                         rockchip,pins = <0 14 RK_FUNC_GPIO &pcfg_pull_none>;
582                 };
583         };
584
585         usb_otg {
586                 otg_drv: otg-drv {
587                         rockchip,pins = <0 12 RK_FUNC_GPIO &pcfg_pull_none>;
588                 };
589         };
590
591         wireless-bluetooth {
592                 uart0_gpios: uart0-gpios {
593                         rockchip,pins = <4 19 RK_FUNC_GPIO &pcfg_pull_none>;
594                 };
595         };
596 };