610304c45dec031b9ff592d61f4daf9bf0ddefab
[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                 simple-audio-card,cpu {
90                         sound-dai = <&i2s>;
91                 };
92                 simple-audio-card,codec {
93                         sound-dai = <&hdmi>;
94                 };
95         };
96
97         vcc_sys: vsys-regulator {
98                 compatible = "regulator-fixed";
99                 regulator-name = "vcc_sys";
100                 regulator-min-microvolt = <5000000>;
101                 regulator-max-microvolt = <5000000>;
102                 regulator-always-on;
103                 regulator-boot-on;
104         };
105
106         vcc_host: usb-host-regulator {
107                 compatible = "regulator-fixed";
108                 enable-active-high;
109                 gpio = <&gpio0 14 GPIO_ACTIVE_HIGH>;
110                 pinctrl-names = "default";
111                 pinctrl-0 = <&host_drv>;
112                 regulator-name = "vcc_host_5v";
113                 regulator-min-microvolt = <5000000>;
114                 regulator-max-microvolt = <5000000>;
115                 regulator-always-on;
116         };
117
118         vcc_otg: usb-otg-regulator {
119                 compatible = "regulator-fixed";
120                 enable-active-high;
121                 gpio = <&gpio0 12 GPIO_ACTIVE_HIGH>;
122                 pinctrl-names = "default";
123                 pinctrl-0 = <&otg_drv>;
124                 regulator-name = "vcc_otg_5v";
125                 regulator-min-microvolt = <5000000>;
126                 regulator-max-microvolt = <5000000>;
127                 regulator-always-on;
128         };
129
130         wireless-wlan {
131                 compatible = "wlan-platdata";
132                 rockchip,grf = <&grf>;
133                 wifi_chip_type = "ap6212";
134                 sdio_vref = <1800>;
135                 WIFI,host_wake_irq = <&gpio4 30 GPIO_ACTIVE_HIGH>;
136                 status = "okay";
137         };
138 };
139
140 &cpu0 {
141         cpu0-supply = <&vdd_cpu>;
142 };
143
144 &emmc {
145         bus-width = <8>;
146         cap-mmc-highspeed;
147         disable-wp;
148         non-removable;
149         num-slots = <1>;
150         pinctrl-names = "default";
151         pinctrl-0 = <&emmc_clk &emmc_cmd &emmc_pwr &emmc_bus8>;
152         status = "okay";
153 };
154
155 &sdmmc {
156         bus-width = <4>;
157         cap-mmc-highspeed;
158         cap-sd-highspeed;
159         card-detect-delay = <200>;
160         disable-wp;
161         num-slots = <1>;
162         pinctrl-names = "default";
163         pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
164         status = "okay";
165         supports-sd;
166         vmmc-supply = <&vcc_sd>;
167         vqmmc-supply = <&vccio_sd>;
168 };
169
170 &gmac {
171         assigned-clocks = <&cru SCLK_MAC>;
172         assigned-clock-parents = <&ext_gmac>;
173         clock_in_out = "input";
174         pinctrl-names = "default";
175         pinctrl-0 = <&rgmii_pins>, <&phy_rst>, <&phy_pmeb>, <&phy_int>;
176         phy-supply = <&vcc_lan>;
177         phy-mode = "rgmii";
178         snps,reset-active-low;
179         snps,reset-delays-us = <0 10000 1000000>;
180         snps,reset-gpio = <&gpio4 8 GPIO_ACTIVE_LOW>;
181         tx_delay = <0x30>;
182         rx_delay = <0x10>;
183         status = "okay";
184 };
185
186 &gpu {
187         mali-supply = <&vdd_gpu>;
188         status = "okay";
189 };
190
191 &hdmi {
192         #address-cells = <1>;
193         #size-cells = <0>;
194         #sound-dai-cells = <0>;
195         ddc-i2c-bus = <&i2c5>;
196         status = "okay";
197 };
198
199 &i2c0 {
200         status = "okay";
201         clock-frequency = <400000>;
202
203         rk808: pmic@1b {
204                 compatible = "rockchip,rk808";
205                 reg = <0x1b>;
206                 interrupt-parent = <&gpio0>;
207                 interrupts = <4 IRQ_TYPE_LEVEL_LOW>;
208                 #clock-cells = <1>;
209                 clock-output-names = "xin32k", "rk808-clkout2";
210                 pinctrl-names = "default";
211                 pinctrl-0 = <&pmic_int &global_pwroff>;
212                 rockchip,system-power-controller;
213                 wakeup-source;
214
215                 vcc1-supply = <&vcc_sys>;
216                 vcc2-supply = <&vcc_sys>;
217                 vcc3-supply = <&vcc_sys>;
218                 vcc4-supply = <&vcc_sys>;
219                 vcc6-supply = <&vcc_sys>;
220                 vcc7-supply = <&vcc_sys>;
221                 vcc8-supply = <&vcc_io>;
222                 vcc9-supply = <&vcc_io>;
223                 vcc10-supply = <&vcc_io>;
224                 vcc11-supply = <&vcc_io>;
225                 vcc12-supply = <&vcc_io>;
226                 vddio-supply = <&vcc_io>;
227
228                 regulators {
229                         vdd_cpu: DCDC_REG1 {
230                                 regulator-always-on;
231                                 regulator-boot-on;
232                                 regulator-min-microvolt = <750000>;
233                                 regulator-max-microvolt = <1350000>;
234                                 regulator-name = "vdd_arm";
235                                 regulator-state-mem {
236                                         regulator-off-in-suspend;
237                                 };
238                         };
239
240                         vdd_gpu: DCDC_REG2 {
241                                 regulator-always-on;
242                                 regulator-boot-on;
243                                 regulator-min-microvolt = <850000>;
244                                 regulator-max-microvolt = <1250000>;
245                                 regulator-name = "vdd_gpu";
246                                 regulator-state-mem {
247                                         regulator-on-in-suspend;
248                                         regulator-suspend-microvolt = <1000000>;
249                                 };
250                         };
251
252                         vcc_ddr: DCDC_REG3 {
253                                 regulator-always-on;
254                                 regulator-boot-on;
255                                 regulator-name = "vcc_ddr";
256                                 regulator-state-mem {
257                                         regulator-on-in-suspend;
258                                 };
259                         };
260
261                         vcc_io: DCDC_REG4 {
262                                 regulator-always-on;
263                                 regulator-boot-on;
264                                 regulator-min-microvolt = <3300000>;
265                                 regulator-max-microvolt = <3300000>;
266                                 regulator-name = "vcc_io";
267                                 regulator-state-mem {
268                                         regulator-on-in-suspend;
269                                         regulator-suspend-microvolt = <3300000>;
270                                 };
271                         };
272
273                         vccio_pmu: LDO_REG1 {
274                                 regulator-always-on;
275                                 regulator-boot-on;
276                                 regulator-min-microvolt = <3300000>;
277                                 regulator-max-microvolt = <3300000>;
278                                 regulator-name = "vccio_pmu";
279                                 regulator-state-mem {
280                                         regulator-on-in-suspend;
281                                         regulator-suspend-microvolt = <3300000>;
282                                 };
283                         };
284
285                         vcca_33: LDO_REG2 {
286                                 regulator-always-on;
287                                 regulator-boot-on;
288                                 regulator-min-microvolt = <3300000>;
289                                 regulator-max-microvolt = <3300000>;
290                                 regulator-name = "vcca_33";
291                                 regulator-state-mem {
292                                         regulator-off-in-suspend;
293                                 };
294                         };
295
296                         vdd_10: LDO_REG3 {
297                                 regulator-always-on;
298                                 regulator-boot-on;
299                                 regulator-min-microvolt = <1000000>;
300                                 regulator-max-microvolt = <1000000>;
301                                 regulator-name = "vdd_10";
302                                 regulator-state-mem {
303                                         regulator-on-in-suspend;
304                                         regulator-suspend-microvolt = <1000000>;
305                                 };
306                         };
307
308                         vcc_wl: LDO_REG4 {
309                                 regulator-always-on;
310                                 regulator-boot-on;
311                                 regulator-min-microvolt = <1800000>;
312                                 regulator-max-microvolt = <1800000>;
313                                 regulator-name = "vcc_wl";
314                                 regulator-state-mem {
315                                         regulator-on-in-suspend;
316                                         regulator-suspend-microvolt = <1800000>;
317                                 };
318                         };
319
320                         vccio_sd: LDO_REG5 {
321                                 regulator-always-on;
322                                 regulator-boot-on;
323                                 regulator-min-microvolt = <1800000>;
324                                 regulator-max-microvolt = <3300000>;
325                                 regulator-name = "vccio_sd";
326                                 regulator-state-mem {
327                                         regulator-on-in-suspend;
328                                         regulator-suspend-microvolt = <3300000>;
329                                 };
330                         };
331
332                         vdd10_lcd: LDO_REG6 {
333                                 regulator-always-on;
334                                 regulator-boot-on;
335                                 regulator-min-microvolt = <1000000>;
336                                 regulator-max-microvolt = <1000000>;
337                                 regulator-name = "vdd10_lcd";
338                                 regulator-state-mem {
339                                         regulator-on-in-suspend;
340                                         regulator-suspend-microvolt = <1000000>;
341                                 };
342                         };
343
344                         vcc_18: LDO_REG7 {
345                                 regulator-always-on;
346                                 regulator-boot-on;
347                                 regulator-min-microvolt = <1800000>;
348                                 regulator-max-microvolt = <1800000>;
349                                 regulator-name = "vcc_18";
350                                 regulator-state-mem {
351                                         regulator-on-in-suspend;
352                                         regulator-suspend-microvolt = <1800000>;
353                                 };
354                         };
355
356                         vcc18_lcd: LDO_REG8 {
357                                 regulator-always-on;
358                                 regulator-boot-on;
359                                 regulator-min-microvolt = <1800000>;
360                                 regulator-max-microvolt = <1800000>;
361                                 regulator-name = "vcc18_lcd";
362                                 regulator-state-mem {
363                                         regulator-on-in-suspend;
364                                         regulator-suspend-microvolt = <1800000>;
365                                 };
366                         };
367
368                         vcc_sd: SWITCH_REG1 {
369                                 regulator-always-on;
370                                 regulator-boot-on;
371                                 regulator-name = "vcc_sd";
372                                 regulator-state-mem {
373                                         regulator-on-in-suspend;
374                                 };
375                         };
376
377                         vcc_lan: SWITCH_REG2 {
378                                 regulator-always-on;
379                                 regulator-boot-on;
380                                 regulator-name = "vcc_lan";
381                                 regulator-state-mem {
382                                         regulator-on-in-suspend;
383                                 };
384                         };
385                 };
386         };
387 };
388
389 &i2c5 {
390         status = "okay";
391 };
392
393 &i2s {
394         #sound-dai-cells = <0>;
395         status = "okay";
396 };
397
398 &sdio0 {
399         status = "okay";
400         clock-frequency = <50000000>;
401         clock-freq-min-max = <200000 50000000>;
402         bus-width = <4>;
403         cap-sd-highspeed;
404         cap-sdio-irq;
405         disable-wp;
406         keep-power-in-suspend;
407         mmc-pwrseq = <&sdio_pwrseq>;
408         non-removable;
409         num-slots = <1>;
410         pinctrl-names = "default";
411         pinctrl-0 = <&sdio0_bus4 &sdio0_cmd &sdio0_clk>;
412         sd-uhs-sdr104;
413         supports-sdio;
414 };
415
416 &pinctrl {
417         pcfg_output_high: pcfg-output-high {
418                 output-high;
419         };
420
421         pcfg_output_low: pcfg-output-low {
422                 output-low;
423         };
424
425         pcfg_pull_none_drv_8ma: pcfg-pull-none-drv-8ma {
426                 drive-strength = <8>;
427         };
428
429         pcfg_pull_up_drv_8ma: pcfg-pull-up-drv-8ma {
430                 bias-pull-up;
431                 drive-strength = <8>;
432         };
433
434         gmac {
435                 phy_int: phy-int {
436                         rockchip,pins = <0 9 RK_FUNC_GPIO &pcfg_pull_up>;
437                 };
438
439                 phy_pmeb: phy-pmeb {
440                         rockchip,pins = <0 8 RK_FUNC_GPIO &pcfg_pull_up>;
441                 };
442
443                 phy_rst: phy-rst {
444                         rockchip,pins = <4 8 RK_FUNC_GPIO &pcfg_output_high>;
445                 };
446         };
447
448         pmic {
449                 pmic_int: pmic-int {
450                         rockchip,pins = <RK_GPIO0 4 RK_FUNC_GPIO &pcfg_pull_up>;
451                 };
452         };
453
454         sdio-pwrseq {
455                 wifi_enable_h: wifi-enable-h {
456                         rockchip,pins = <4 28 RK_FUNC_GPIO &pcfg_pull_none>;
457                 };
458         };
459
460         sdmmc {
461                 sdmmc_bus4: sdmmc-bus4 {
462                         rockchip,pins = <6 16 RK_FUNC_1 &pcfg_pull_up_drv_8ma>,
463                                         <6 17 RK_FUNC_1 &pcfg_pull_up_drv_8ma>,
464                                         <6 18 RK_FUNC_1 &pcfg_pull_up_drv_8ma>,
465                                         <6 19 RK_FUNC_1 &pcfg_pull_up_drv_8ma>;
466                 };
467
468                 sdmmc_clk: sdmmc-clk {
469                         rockchip,pins = <6 20 RK_FUNC_1 &pcfg_pull_none_drv_8ma>;
470                 };
471
472                 sdmmc_cmd: sdmmc-cmd {
473                         rockchip,pins = <6 21 RK_FUNC_1 &pcfg_pull_up_drv_8ma>;
474                 };
475
476                 sdmmc_pwr: sdmmc-pwr {
477                         rockchip,pins = <7 11 RK_FUNC_GPIO &pcfg_pull_none>;
478                 };
479         };
480
481         usb_host {
482                 host_drv: host-drv {
483                         rockchip,pins = <0 14 RK_FUNC_GPIO &pcfg_pull_none>;
484                 };
485         };
486
487         usb_otg {
488                 otg_drv: otg-drv {
489                         rockchip,pins = <0 12 RK_FUNC_GPIO &pcfg_pull_none>;
490                 };
491         };
492 };
493
494 &uart2 {
495         status = "okay";
496 };
497
498 &usbphy {
499         status = "okay";
500 };
501
502 &usb_host0_ehci {
503         status = "okay";
504 };
505
506 &usb_host1 {
507         status = "okay";
508 };
509
510 &usb_otg {
511         status = "okay";
512 };
513
514 &usb_hsic {
515         status = "okay";
516 };
517
518 &vopb {
519         status = "okay";
520 };
521
522 &vopb_mmu {
523         status = "okay";
524 };
525
526 &vopl {
527         status = "okay";
528 };
529
530 &vopl_mmu {
531         status = "okay";
532 };
533
534 &vpu {
535         status = "okay";
536 };