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