6de26c855e5c3bdc6e9534d982bf18d6f359b149
[firefly-linux-kernel-4.4.55.git] / arch / arm / boot / dts / rk3288-miqi.dts
1 /*
2  * Copyright 2016 Rockchip, Inc
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 /dts-v1/;
44 #include <dt-bindings/pwm/pwm.h>
45 #include "rk3288.dtsi"
46
47 / {
48         compatible = "rockchip,rk3288-miqi", "rockchip,rk3288";
49
50         memory {
51                 device_type = "memory";
52                 reg = <0x0 0x80000000>;
53         };
54
55         sound {
56                 compatible = "simple-audio-card";
57                 simple-audio-card,format = "i2s";
58                 simple-audio-card,name = "DW-HDMI";
59                 simple-audio-card,mclk-fs = <512>;
60
61                 simple-audio-card,dai-link@0 {  /* I2S - S/PDIF */
62                         format = "i2s";
63                         cpu {
64                                 sound-dai = <&i2s>;
65                         };
66                         codec {
67                                 sound-dai = <&hdmi>;
68                         };
69                 };
70
71                 /*
72                  * If you want to support more cards,
73                  * you can add more dai-link node,
74                  * such as
75                  *
76                  *   simple-audio-card,dai-link@1 {
77                  *       ......
78                  *   }
79                  */
80
81         };
82
83         ext_gmac: external-gmac-clock {
84                 compatible = "fixed-clock";
85                 clock-frequency = <125000000>;
86                 clock-output-names = "ext_gmac";
87                 #clock-cells = <0>;
88         };
89
90         gpio-keys {
91                 compatible = "gpio-keys";
92                 #address-cells = <1>;
93                 #size-cells = <0>;
94                 autorepeat;
95
96                 pinctrl-names = "default";
97                 pinctrl-0 = <&gkey>;
98
99                 button@0 {
100                         gpios = <&gpio7 9 GPIO_ACTIVE_LOW>;
101                         linux,code = <116>;
102                         label = "GPIO Key";
103                         linux,input-type = <1>;
104                         debounce-interval = <100>;
105                 };
106         };
107
108         /* This turns on USB vbus for both host0 (ehci) and host1 (dwc2) */
109         vcc_host: vcc-host-regulator {
110                 compatible = "regulator-fixed";
111                 enable-active-high;
112                 gpio = <&gpio0 14 GPIO_ACTIVE_HIGH>;
113                 pinctrl-names = "default";
114                 pinctrl-0 = <&host_vbus_drv>;
115                 regulator-name = "vcc_host";
116                 regulator-always-on;
117                 regulator-boot-on;
118         };
119
120         vcc_phy: vcc-phy-regulator {
121                 compatible = "regulator-fixed";
122                 enable-active-high;
123                 gpio = <&gpio0 6 GPIO_ACTIVE_HIGH>;
124                 pinctrl-names = "default";
125                 pinctrl-0 = <&eth_phy_pwr>;
126                 regulator-name = "vcc_phy";
127                 regulator-min-microvolt = <3300000>;
128                 regulator-max-microvolt = <3300000>;
129                 regulator-always-on;
130                 regulator-boot-on;
131         };
132
133         vcc_sys: vsys-regulator {
134                 compatible = "regulator-fixed";
135                 regulator-name = "vcc_sys";
136                 regulator-min-microvolt = <5000000>;
137                 regulator-max-microvolt = <5000000>;
138                 regulator-always-on;
139                 regulator-boot-on;
140         };
141
142
143         /*
144          * NOTE: vcc_sd isn't hooked up on v1.0 boards where power comes from
145          * vcc_io directly.  Those boards won't be able to power cycle SD cards
146          * but it shouldn't hurt to toggle this pin there anyway.
147          */
148         vcc_sd: sdmmc-regulator {
149                 compatible = "regulator-fixed";
150                 gpio = <&gpio7 11 GPIO_ACTIVE_LOW>;
151                 pinctrl-names = "default";
152                 pinctrl-0 = <&sdmmc_pwr>;
153                 regulator-name = "vcc_sd";
154                 regulator-min-microvolt = <3300000>;
155                 regulator-max-microvolt = <3300000>;
156                 startup-delay-us = <100000>;
157                 vin-supply = <&vcc_io>;
158         };
159
160         board-leds {
161                         compatible = "gpio-leds";
162                         status = "okay";
163
164                         work {
165                                         label = "System";
166                                         linux,default-trigger = "timer";
167                                         default-state = "on";
168                                         gpios = <&gpio7 2 GPIO_ACTIVE_HIGH>;
169                         };
170
171                         fan {
172                                         label = "Fan";
173                                         linux,default-trigger = "heartbeat";
174                                         default-state = "on";
175                                         gpios = <&gpio0 18 GPIO_ACTIVE_HIGH>;
176                         };
177         };
178 };
179
180 &cpu0 {
181         cpu0-supply = <&vdd_cpu>;
182 };
183
184 &gpu {
185         status = "okay";
186         mali-supply = <&vdd_gpu>;
187 };
188
189 &emmc {
190         bus-width = <8>;
191         cap-mmc-highspeed;
192         disable-wp;
193         non-removable;
194         clock-frequency = <75000000>;
195         num-slots = <1>;
196         pinctrl-names = "default";
197         pinctrl-0 = <&emmc_clk &emmc_cmd &emmc_pwr &emmc_bus8>;
198         status = "okay";
199 };
200
201 &hdmi {
202         #address-cells = <1>;
203         #size-cells = <0>;
204         #sound-dai-cells = <0>;
205         ddc-i2c-bus = <&i2c5>;
206         status = "okay";
207 };
208
209 &hevc_service {
210         status = "okay";
211 };
212
213 &sdmmc {
214         supports-sd;
215         bus-width = <4>;
216         cap-mmc-highspeed;
217         sd-uhs-sdr12;
218         sd-uhs-sdr25;
219         sd-uhs-sdr50;
220         sd-uhs-sdr104;
221         cap-sd-highspeed;
222         card-detect-delay = <200>;
223         disable-wp;                     /* wp not hooked up */
224         num-slots = <1>;
225         pinctrl-names = "default";
226         pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
227         status = "okay";
228         vmmc-supply = <&vcc_sd>;
229         vqmmc-supply = <&vccio_sd>;
230 };
231
232 &gmac {
233         phy-supply = <&vcc_phy>;
234         phy-mode = "rgmii";
235         clock_in_out = "input";
236         snps,reset-gpio = <&gpio4 7 0>;
237         snps,reset-active-low;
238         snps,reset-delays-us = <0 10000 1000000>;
239         assigned-clocks = <&cru SCLK_MAC>;
240         assigned-clock-parents = <&ext_gmac>;
241         pinctrl-names = "default";
242         pinctrl-0 = <&rgmii_pins>;
243         tx_delay = <0x30>;
244         rx_delay = <0x10>;
245         status = "ok";
246 };
247
248 /* ----------------------------------------------------------------------------------
249 I2C
250    0 - PMIC(ACT8846)
251        RTC(HYM8563)
252        SYR827 -> VDD_CPU_FB
253        SYR828 -> VDD_GPU_FB
254    1 - Header-J9
255    2 - Header-J10
256    3 - NC
257    4 - NC
258    5 - HDMI
259 -------------------------------------------------------------------------------------*/
260 &i2c0 {
261         status = "okay";
262
263         clock-frequency = <400000>;
264
265         vdd_cpu: syr827@40 {
266                 compatible = "silergy,syr827";
267                 fcs,suspend-voltage-selector = <1>;
268                 reg = <0x40>;
269                 regulator-name = "vdd_cpu";
270                 regulator-min-microvolt = <712500>;
271                 regulator-max-microvolt = <1500000>;
272                 regulator-always-on;
273                 regulator-boot-on;
274                 regulator-enable-ramp-delay = <300>;
275                 regulator-ramp-delay = <8000>;
276                 vin-supply = <&vcc_sys>;
277         };
278
279         vdd_gpu: syr828@41 {
280                 compatible = "silergy,syr828";
281                 fcs,suspend-voltage-selector = <1>;
282                 reg = <0x41>;
283                 regulator-name = "vdd_gpu";
284                 regulator-min-microvolt = <712500>;
285                 regulator-max-microvolt = <1500000>;
286                 regulator-always-on;
287                 vin-supply = <&vcc_sys>;
288         };
289
290         hym8563@51 {
291                 compatible = "haoyu,hym8563";
292                 reg = <0x51>;
293
294                 interrupt-parent = <&gpio0>;
295                 interrupts = <4 IRQ_TYPE_EDGE_FALLING>;
296
297                 pinctrl-names = "default";
298                 pinctrl-0 = <&pmic_int>;
299
300                 #clock-cells = <0>;
301                 clock-output-names = "xin32k";
302         };
303
304         act8846: act8846@5a {
305                 compatible = "active-semi,act8846";
306                 reg = <0x5a>;
307                 status = "okay";
308
309                 vp1-supply = <&vcc_sys>;
310                 vp2-supply = <&vcc_sys>;
311                 vp3-supply = <&vcc_sys>;
312                 vp4-supply = <&vcc_sys>;
313                 inl1-supply = <&vcc_io>;
314                 inl2-supply = <&vcc_sys>;
315                 inl3-supply = <&vcc_20>;
316
317                 regulators {
318                         vcc_ddr: REG1 {
319                                 regulator-name = "VCC_DDR";
320                                 regulator-min-microvolt = <1200000>;
321                                 regulator-max-microvolt = <1200000>;
322                                 regulator-always-on;
323                         };
324
325                         vcc_io: REG2 {
326                                 regulator-name = "VCC_IO";
327                                 regulator-min-microvolt = <3300000>;
328                                 regulator-max-microvolt = <3300000>;
329                                 regulator-always-on;
330                         };
331
332                         vdd_log: REG3 {
333                                 regulator-name = "VDD_LOG";
334                                 regulator-min-microvolt = <1000000>;
335                                 regulator-max-microvolt = <1000000>;
336                                 regulator-always-on;
337                         };
338
339                         vcc_20: REG4 {
340                                 regulator-name = "VCC_20";
341                                 regulator-min-microvolt = <2000000>;
342                                 regulator-max-microvolt = <2000000>;
343                                 regulator-always-on;
344                         };
345
346                         vccio_sd: REG5 {
347                                 regulator-name = "VCCIO_SD";
348                                 regulator-min-microvolt = <1800000>;
349                                 regulator-max-microvolt = <3300000>;
350                                 regulator-always-on;
351                         };
352
353                         vdd10_lcd: REG6 {
354                                 regulator-name = "VDD10_LCD";
355                                 regulator-min-microvolt = <1000000>;
356                                 regulator-max-microvolt = <1000000>;
357                                 regulator-always-on;
358                         };
359
360                         vcca_codec: REG7 {
361                                 regulator-name = "VCCA_CODEC";
362                                 regulator-min-microvolt = <3300000>;
363                                 regulator-max-microvolt = <3300000>;
364                                 regulator-always-on;
365                         };
366
367                         vcca_tp: REG8 {
368                                 regulator-name = "VCCA_TP";
369                                 regulator-min-microvolt = <3300000>;
370                                 regulator-max-microvolt = <3300000>;
371                                 regulator-always-on;
372                         };
373
374                         vccio_pmu: REG9 {
375                                 regulator-name = "VCCIO_PMU";
376                                 regulator-min-microvolt = <3300000>;
377                                 regulator-max-microvolt = <3300000>;
378                                 regulator-always-on;
379                         };
380
381                         vdd_10: REG10 {
382                                 regulator-name = "VDD_10";
383                                 regulator-min-microvolt = <1000000>;
384                                 regulator-max-microvolt = <1000000>;
385                                 regulator-always-on;
386                         };
387
388                         vcc_18: REG11 {
389                                 regulator-name = "VCC_18";
390                                 regulator-min-microvolt = <1800000>;
391                                 regulator-max-microvolt = <1800000>;
392                                 regulator-always-on;
393                         };
394
395                         vcc18_lcd: REG12 {
396                                 regulator-name = "VCC18_LCD";
397                                 regulator-min-microvolt = <1800000>;
398                                 regulator-max-microvolt = <1800000>;
399                                 regulator-always-on;
400                         };
401                 };
402         };
403 };
404
405 &i2c1 {
406         status = "okay";
407         /* Add more nodes to your requirement, such as i2c0 */
408 };
409
410 &i2c2 {
411         status = "okay";
412         /* Add more nodes to your requirement, such as i2c2 */
413 };
414
415 &i2c5 {
416         status = "okay";
417 };
418
419 &i2s {
420         #sound-dai-cells = <0>;
421         status = "okay";
422 };
423
424 &io_domains {
425         status = "okay";
426
427         sdcard-supply = <&vccio_sd>;
428 };
429
430 &spi2 {
431         status = "okay";
432 };
433
434 &wdt {
435         status = "okay";
436 };
437
438 &pwm0 {
439         status = "okay";
440 };
441
442 &rga {
443         status = "okay";
444 };
445
446 /*
447  * Debug Serial Port
448  */
449 &uart2 {
450         status = "okay";
451 };
452
453 &uart3 {
454         status = "okay";
455 };
456
457 &usbphy {
458         status = "okay";
459 };
460
461 &usb_host0_ehci {
462         status = "okay";
463 };
464
465 &usb_host1 {
466         status = "okay";
467 };
468
469 &vopb {
470         status = "okay";
471 };
472
473 &vopb_mmu {
474         status = "okay";
475 };
476
477 &vopl {
478         status = "okay";
479 };
480
481 &vopl_mmu {
482         status = "okay";
483 };
484
485 &vpu_service {
486         status = "okay";
487 };
488
489 &pinctrl {
490         pcfg_pull_none_drv_8ma: pcfg-pull-none-drv-8ma {
491                 drive-strength = <8>;
492         };
493
494         pcfg_pull_up_drv_8ma: pcfg-pull-up-drv-8ma {
495                 bias-pull-up;
496                 drive-strength = <8>;
497         };
498
499         buttons {
500                 gkey: gkey {
501                         rockchip,pins = <7 9 RK_FUNC_GPIO &pcfg_pull_up>;
502                 };
503         };
504
505         pmic {
506                 pmic_int: pmic-int {
507                         rockchip,pins = <RK_GPIO0 4 RK_FUNC_GPIO &pcfg_pull_up>;
508                 };
509         };
510
511         sdmmc {
512                 /*
513                  * Default drive strength isn't enough to achieve even
514                  * high-speed mode on EVB board so bump up to 8ma.
515                  */
516                 sdmmc_bus4: sdmmc-bus4 {
517                         rockchip,pins = <6 16 RK_FUNC_1 &pcfg_pull_up_drv_8ma>,
518                                         <6 17 RK_FUNC_1 &pcfg_pull_up_drv_8ma>,
519                                         <6 18 RK_FUNC_1 &pcfg_pull_up_drv_8ma>,
520                                         <6 19 RK_FUNC_1 &pcfg_pull_up_drv_8ma>;
521                 };
522
523                 sdmmc_clk: sdmmc-clk {
524                         rockchip,pins = <6 20 RK_FUNC_1 &pcfg_pull_none_drv_8ma>;
525                 };
526
527                 sdmmc_cmd: sdmmc-cmd {
528                         rockchip,pins = <6 21 RK_FUNC_1 &pcfg_pull_up_drv_8ma>;
529                 };
530
531                 sdmmc_pwr: sdmmc-pwr {
532                         rockchip,pins = <7 11 RK_FUNC_GPIO &pcfg_pull_none>;
533                 };
534         };
535
536         usb {
537                 host_vbus_drv: host-vbus-drv {
538                         rockchip,pins = <0 14 RK_FUNC_GPIO &pcfg_pull_none>;
539                 };
540
541                 pwr_3g: pwr-3g {
542                         rockchip,pins = <7 8 RK_FUNC_GPIO &pcfg_pull_none>;
543                 };
544         };
545
546         eth_phy {
547                 eth_phy_pwr: eth-phy-pwr {
548                         rockchip,pins = <0 6 RK_FUNC_GPIO &pcfg_pull_none>;
549                 };
550         };
551
552 };
553