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