UPSTREAM: ARM: dts: rockchip: move rk3288 io-domain nodes to the grf
[firefly-linux-kernel-4.4.55.git] / arch / arm / boot / dts / rk3288-miniarm.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 #include "rk3288.dtsi"
43
44 / {
45         compatible = "rockchip,rk3288-miniarm", "rockchip,rk3288";
46
47         memory {
48                 device_type = "memory";
49                 reg = <0x0 0x80000000>;
50         };
51
52         ext_gmac: external-gmac-clock {
53                 compatible = "fixed-clock";
54                 clock-frequency = <125000000>;
55                 clock-output-names = "ext_gmac";
56                 #clock-cells = <0>;
57         };
58
59         gpio-keys {
60                 compatible = "gpio-keys";
61                 #address-cells = <1>;
62                 #size-cells = <0>;
63                 autorepeat;
64
65                 pinctrl-names = "default";
66                 pinctrl-0 = <&pwrbtn>;
67
68                 button@0 {
69                         gpios = <&gpio0 5 GPIO_ACTIVE_LOW>;
70                         linux,code = <116>;
71                         label = "GPIO Key Power";
72                         linux,input-type = <1>;
73                         gpio-key,wakeup = <1>;
74                         debounce-interval = <100>;
75                 };
76         };
77
78         gpio-leds {
79                 compatible = "gpio-leds";
80
81                 pwr-led {
82                         gpios = <&gpio2 2 GPIO_ACTIVE_HIGH>;
83                         linux,default-trigger = "default-on";
84                 };
85
86                 act-led {
87                         gpios=<&gpio2 3 GPIO_ACTIVE_LOW>;
88                         linux,default-trigger="mmc0";
89                 };
90         };
91
92         sound {
93                 compatible = "simple-audio-card";
94                 simple-audio-card,format = "i2s";
95                 simple-audio-card,name = "rockchip,miniarm-codec";
96                 simple-audio-card,mclk-fs = <512>;
97                 simple-audio-card,cpu {
98                         sound-dai = <&i2s>;
99                 };
100                 simple-audio-card,codec {
101                         sound-dai = <&hdmi>;
102                 };
103         };
104
105         vcc_sys: vsys-regulator {
106                 compatible = "regulator-fixed";
107                 regulator-name = "vcc_sys";
108                 regulator-min-microvolt = <5000000>;
109                 regulator-max-microvolt = <5000000>;
110                 regulator-always-on;
111                 regulator-boot-on;
112         };
113
114         /*
115          * NOTE: vcc_sd isn't hooked up on v1.0 boards where power comes from
116          * vcc_io directly.  Those boards won't be able to power cycle SD cards
117          * but it shouldn't hurt to toggle this pin there anyway.
118          */
119         vcc_sd: sdmmc-regulator {
120                 compatible = "regulator-fixed";
121                 gpio = <&gpio7 11 GPIO_ACTIVE_LOW>;
122                 pinctrl-names = "default";
123                 pinctrl-0 = <&sdmmc_pwr>;
124                 regulator-name = "vcc_sd";
125                 regulator-min-microvolt = <3300000>;
126                 regulator-max-microvolt = <3300000>;
127                 startup-delay-us = <100000>;
128                 vin-supply = <&vcc_io>;
129         };
130 };
131
132 &cpu0 {
133         cpu0-supply = <&vdd_cpu>;
134 };
135
136 &gmac {
137         phy-supply = <&vcc33_lan>;
138         phy-mode = "rgmii";
139         clock_in_out = "input";
140         snps,reset-gpio = <&gpio4 7 0>;
141         snps,reset-active-low;
142         snps,reset-delays-us = <0 10000 1000000>;
143         assigned-clocks = <&cru SCLK_MAC>;
144         assigned-clock-parents = <&ext_gmac>;
145         pinctrl-names = "default";
146         pinctrl-0 = <&rgmii_pins>;
147         tx_delay = <0x30>;
148         rx_delay = <0x10>;
149         status = "ok";
150 };
151
152 &gpu {
153         mali-supply = <&vdd_gpu>;
154         status = "okay";
155 };
156
157 &hdmi {
158         #address-cells = <1>;
159         #size-cells = <0>;
160         #sound-dai-cells = <0>;
161         ddc-i2c-bus = <&i2c5>;
162         status = "okay";
163         /* Don't use vopl for HDMI */
164         ports {
165                 hdmi_in: port {
166                         /delete-node/ endpoint@1;
167                 };
168         };
169 };
170
171 &i2c0 {
172         status = "okay";
173         clock-frequency = <400000>;
174
175         rk808: pmic@1b {
176                 compatible = "rockchip,rk808";
177                 reg = <0x1b>;
178                 interrupt-parent = <&gpio0>;
179                 interrupts = <4 IRQ_TYPE_LEVEL_LOW>;
180                 pinctrl-names = "default";
181                 pinctrl-0 = <&pmic_int &global_pwroff>;
182                 rockchip,system-power-controller;
183                 wakeup-source;
184                 #clock-cells = <1>;
185                 clock-output-names = "xin32k", "rk808-clkout2";
186
187                 vcc1-supply = <&vcc_sys>;
188                 vcc2-supply = <&vcc_sys>;
189                 vcc3-supply = <&vcc_sys>;
190                 vcc4-supply = <&vcc_sys>;
191                 vcc6-supply = <&vcc_sys>;
192                 vcc7-supply = <&vcc_sys>;
193                 vcc8-supply = <&vcc_18>;
194                 vcc9-supply = <&vcc_io>;
195                 vcc10-supply = <&vcc_io>;
196                 vcc11-supply = <&vcc_sys>;
197                 vcc12-supply = <&vcc_io>;
198                 vddio-supply = <&vcc18_ldo1>;
199
200                 regulators {
201                         vdd_cpu: DCDC_REG1 {
202                                 regulator-always-on;
203                                 regulator-boot-on;
204                                 regulator-min-microvolt = <750000>;
205                                 regulator-max-microvolt = <1350000>;
206                                 regulator-name = "vdd_arm";
207                                 regulator-state-mem {
208                                         regulator-off-in-suspend;
209                                 };
210                         };
211
212                         vdd_gpu: DCDC_REG2 {
213                                 regulator-always-on;
214                                 regulator-boot-on;
215                                 regulator-min-microvolt = <850000>;
216                                 regulator-max-microvolt = <1250000>;
217                                 regulator-name = "vdd_gpu";
218                                 regulator-ramp-delay = <6000>;
219                                 regulator-state-mem {
220                                         regulator-on-in-suspend;
221                                         regulator-suspend-microvolt = <1000000>;
222                                 };
223                         };
224
225                         vcc_ddr: DCDC_REG3 {
226                                 regulator-always-on;
227                                 regulator-boot-on;
228                                 regulator-name = "vcc_ddr";
229                                 regulator-state-mem {
230                                         regulator-on-in-suspend;
231                                 };
232                         };
233
234                         vcc_io: DCDC_REG4 {
235                                 regulator-always-on;
236                                 regulator-boot-on;
237                                 regulator-min-microvolt = <3300000>;
238                                 regulator-max-microvolt = <3300000>;
239                                 regulator-name = "vcc_io";
240                                 regulator-state-mem {
241                                         regulator-on-in-suspend;
242                                         regulator-suspend-microvolt = <3300000>;
243                                 };
244                         };
245
246                         vcc18_ldo1: LDO_REG1 {
247                                 regulator-always-on;
248                                 regulator-boot-on;
249                                 regulator-min-microvolt = <1800000>;
250                                 regulator-max-microvolt = <1800000>;
251                                 regulator-name = "vcc18_ldo1";
252                                 regulator-state-mem {
253                                         regulator-on-in-suspend;
254                                         regulator-suspend-microvolt = <1800000>;
255                                 };
256                         };
257
258                         vcc33_mipi: LDO_REG2 {
259                                 regulator-always-on;
260                                 regulator-boot-on;
261                                 regulator-min-microvolt = <3300000>;
262                                 regulator-max-microvolt = <3300000>;
263                                 regulator-name = "vcc33_mipi";
264                                 regulator-state-mem {
265                                         regulator-off-in-suspend;
266                                 };
267                         };
268
269                         vdd_10: LDO_REG3 {
270                                 regulator-always-on;
271                                 regulator-boot-on;
272                                 regulator-min-microvolt = <1000000>;
273                                 regulator-max-microvolt = <1000000>;
274                                 regulator-name = "vdd_10";
275                                 regulator-state-mem {
276                                         regulator-on-in-suspend;
277                                         regulator-suspend-microvolt = <1000000>;
278                                 };
279                         };
280
281                         vcc18_codec: LDO_REG4 {
282                                 regulator-always-on;
283                                 regulator-boot-on;
284                                 regulator-min-microvolt = <1800000>;
285                                 regulator-max-microvolt = <1800000>;
286                                 regulator-name = "vcc18_codec";
287                                 regulator-state-mem {
288                                         regulator-on-in-suspend;
289                                         regulator-suspend-microvolt = <1800000>;
290                                 };
291                         };
292
293                         vccio_sd: LDO_REG5 {
294                                 regulator-always-on;
295                                 regulator-boot-on;
296                                 regulator-min-microvolt = <1800000>;
297                                 regulator-max-microvolt = <3300000>;
298                                 regulator-name = "vccio_sd";
299                                 regulator-state-mem {
300                                         regulator-on-in-suspend;
301                                         regulator-suspend-microvolt = <3300000>;
302                                 };
303                         };
304
305                         vdd10_lcd: LDO_REG6 {
306                                 regulator-always-on;
307                                 regulator-boot-on;
308                                 regulator-min-microvolt = <1000000>;
309                                 regulator-max-microvolt = <1000000>;
310                                 regulator-name = "vdd10_lcd";
311                                 regulator-state-mem {
312                                         regulator-on-in-suspend;
313                                         regulator-suspend-microvolt = <1000000>;
314                                 };
315                         };
316
317                         vcc_18: LDO_REG7 {
318                                 regulator-always-on;
319                                 regulator-boot-on;
320                                 regulator-min-microvolt = <1800000>;
321                                 regulator-max-microvolt = <1800000>;
322                                 regulator-name = "vcc_18";
323                                 regulator-state-mem {
324                                         regulator-on-in-suspend;
325                                         regulator-suspend-microvolt = <1800000>;
326                                 };
327                         };
328
329                         vcc18_lcd: LDO_REG8 {
330                                 regulator-always-on;
331                                 regulator-boot-on;
332                                 regulator-min-microvolt = <1800000>;
333                                 regulator-max-microvolt = <1800000>;
334                                 regulator-name = "vcc18_lcd";
335                                 regulator-state-mem {
336                                         regulator-on-in-suspend;
337                                         regulator-suspend-microvolt = <1800000>;
338                                 };
339                         };
340
341                         vcc33_sd: SWITCH_REG1 {
342                                 regulator-always-on;
343                                 regulator-boot-on;
344                                 regulator-name = "vcc33_sd";
345                                 regulator-state-mem {
346                                         regulator-on-in-suspend;
347                                 };
348                         };
349
350                         vcc33_lan: SWITCH_REG2 {
351                                 regulator-always-on;
352                                 regulator-boot-on;
353                                 regulator-name = "vcc33_lan";
354                                 regulator-state-mem {
355                                         regulator-on-in-suspend;
356                                 };
357                         };
358                 };
359         };
360 };
361
362 &i2c2 {
363         status = "okay";
364 };
365
366 &i2c5 {
367         status = "okay";
368 };
369
370 &i2s {
371         #sound-dai-cells = <0>;
372         status = "okay";
373 };
374
375 &io_domains {
376         status = "okay";
377
378         sdcard-supply = <&vccio_sd>;
379 };
380
381 &pwm0 {
382         status = "okay";
383 };
384
385 &saradc {
386         vref-supply = <&vcc18_ldo1>;
387         status ="okay";
388 };
389
390 &sdmmc {
391         bus-width = <4>;
392         cap-mmc-highspeed;
393         cap-sd-highspeed;
394         card-detect-delay = <200>;
395         disable-wp;                     /* wp not hooked up */
396         num-slots = <1>;
397         pinctrl-names = "default";
398         pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
399         status = "okay";
400         supports-sd;
401         vmmc-supply = <&vcc_sd>;
402         vqmmc-supply = <&vccio_sd>;
403 };
404
405 &tsadc {
406         rockchip,hw-tshut-mode = <1>; /* tshut mode 0:CRU 1:GPIO */
407         rockchip,hw-tshut-polarity = <1>; /* tshut polarity 0:LOW 1:HIGH */
408         status = "okay";
409 };
410
411 &uart0 {
412         status = "okay";
413 };
414
415 &uart1 {
416         status = "okay";
417 };
418
419 &uart2 {
420         status = "okay";
421 };
422
423 &uart3 {
424         status = "okay";
425 };
426
427 &uart4 {
428         status = "okay";
429 };
430
431 &usbphy {
432         status = "okay";
433 };
434
435 &usb_host0_ehci {
436         no-relinquish-port;
437         status = "okay";
438 };
439
440 &usb_host1 {
441         status = "okay";
442 };
443
444 &usb_otg {
445         status= "okay";
446 };
447
448 &vopb {
449         status = "okay";
450 };
451
452 &vopb_mmu {
453         status = "okay";
454 };
455
456 &vopl {
457         status = "okay";
458         /* Don't use vopl for HDMI */
459         vopl_out: port {
460                 /delete-node/ endpoint@0;
461         };
462 };
463
464 &vopl_mmu {
465         status = "okay";
466 };
467
468 &hevc_service {
469         status = "okay";
470 };
471
472 &vpu_service {
473         status = "okay";
474 };
475
476 &wdt {
477         status = "okay";
478 };
479
480 &pinctrl {
481         pcfg_pull_none_drv_8ma: pcfg-pull-none-drv-8ma {
482                 drive-strength = <8>;
483         };
484
485         pcfg_pull_up_drv_8ma: pcfg-pull-up-drv-8ma {
486                 bias-pull-up;
487                 drive-strength = <8>;
488         };
489
490         backlight {
491                 bl_en: bl-en {
492                         rockchip,pins = <7 2 RK_FUNC_GPIO &pcfg_pull_none>;
493                 };
494         };
495
496         buttons {
497                 pwrbtn: pwrbtn {
498                         rockchip,pins = <0 5 RK_FUNC_GPIO &pcfg_pull_up>;
499                 };
500         };
501
502         eth_phy {
503                 eth_phy_pwr: eth-phy-pwr {
504                         rockchip,pins = <0 6 RK_FUNC_GPIO &pcfg_pull_none>;
505                 };
506         };
507
508         pmic {
509                 pmic_int: pmic-int {
510                         rockchip,pins = <RK_GPIO0 4 RK_FUNC_GPIO &pcfg_pull_up>;
511                 };
512         };
513
514         sdmmc {
515                 /*
516                  * Default drive strength isn't enough to achieve even
517                  * high-speed mode on EVB board so bump up to 8ma.
518                  */
519                 sdmmc_bus4: sdmmc-bus4 {
520                         rockchip,pins = <6 16 RK_FUNC_1 &pcfg_pull_up_drv_8ma>,
521                                         <6 17 RK_FUNC_1 &pcfg_pull_up_drv_8ma>,
522                                         <6 18 RK_FUNC_1 &pcfg_pull_up_drv_8ma>,
523                                         <6 19 RK_FUNC_1 &pcfg_pull_up_drv_8ma>;
524                 };
525
526                 sdmmc_clk: sdmmc-clk {
527                         rockchip,pins = <6 20 RK_FUNC_1 &pcfg_pull_none_drv_8ma>;
528                 };
529
530                 sdmmc_cmd: sdmmc-cmd {
531                         rockchip,pins = <6 21 RK_FUNC_1 &pcfg_pull_up_drv_8ma>;
532                 };
533
534                 sdmmc_pwr: sdmmc-pwr {
535                         rockchip,pins = <7 11 RK_FUNC_GPIO &pcfg_pull_none>;
536                 };
537         };
538
539         usb {
540                 host_vbus_drv: host-vbus-drv {
541                         rockchip,pins = <0 14 RK_FUNC_GPIO &pcfg_pull_none>;
542                 };
543
544                 pwr_3g: pwr-3g {
545                         rockchip,pins = <7 8 RK_FUNC_GPIO &pcfg_pull_none>;
546                 };
547         };
548 };