ARM: dts: rockchip: use hdmi-ddc for ddc bus in rk3288
[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         status = "okay";
162         /* Don't use vopl for HDMI */
163         ports {
164                 hdmi_in: port {
165                         /delete-node/ endpoint@1;
166                 };
167         };
168 };
169
170 &hevc_service {
171         status = "okay";
172 };
173
174 &i2c0 {
175         status = "okay";
176         clock-frequency = <400000>;
177
178         rk808: pmic@1b {
179                 compatible = "rockchip,rk808";
180                 reg = <0x1b>;
181                 interrupt-parent = <&gpio0>;
182                 interrupts = <4 IRQ_TYPE_LEVEL_LOW>;
183                 pinctrl-names = "default";
184                 pinctrl-0 = <&pmic_int &global_pwroff &dvs_1 &dvs_2>;
185                 dvs-gpios = <&gpio0 11 GPIO_ACTIVE_HIGH>,
186                                 <&gpio0 12 GPIO_ACTIVE_HIGH>;
187
188                 rockchip,system-power-controller;
189                 wakeup-source;
190                 #clock-cells = <1>;
191                 clock-output-names = "xin32k", "rk808-clkout2";
192
193                 vcc1-supply = <&vcc_sys>;
194                 vcc2-supply = <&vcc_sys>;
195                 vcc3-supply = <&vcc_sys>;
196                 vcc4-supply = <&vcc_sys>;
197                 vcc6-supply = <&vcc_sys>;
198                 vcc7-supply = <&vcc_sys>;
199                 vcc8-supply = <&vcc_io>;
200                 vcc9-supply = <&vcc_io>;
201                 vcc10-supply = <&vcc_io>;
202                 vcc11-supply = <&vcc_sys>;
203                 vcc12-supply = <&vcc_io>;
204                 vddio-supply = <&vcc_io>;
205
206                 regulators {
207                         vdd_cpu: DCDC_REG1 {
208                                 regulator-always-on;
209                                 regulator-boot-on;
210                                 regulator-min-microvolt = <750000>;
211                                 regulator-max-microvolt = <1350000>;
212                                 regulator-name = "vdd_arm";
213                                 regulator-ramp-delay = <6000>;
214                                 regulator-state-mem {
215                                         regulator-off-in-suspend;
216                                 };
217                         };
218
219                         vdd_gpu: DCDC_REG2 {
220                                 regulator-always-on;
221                                 regulator-boot-on;
222                                 regulator-min-microvolt = <850000>;
223                                 regulator-max-microvolt = <1250000>;
224                                 regulator-name = "vdd_gpu";
225                                 regulator-ramp-delay = <6000>;
226                                 regulator-state-mem {
227                                         regulator-on-in-suspend;
228                                         regulator-suspend-microvolt = <1000000>;
229                                 };
230                         };
231
232                         vcc_ddr: DCDC_REG3 {
233                                 regulator-always-on;
234                                 regulator-boot-on;
235                                 regulator-name = "vcc_ddr";
236                                 regulator-state-mem {
237                                         regulator-on-in-suspend;
238                                 };
239                         };
240
241                         vcc_io: DCDC_REG4 {
242                                 regulator-always-on;
243                                 regulator-boot-on;
244                                 regulator-min-microvolt = <3300000>;
245                                 regulator-max-microvolt = <3300000>;
246                                 regulator-name = "vcc_io";
247                                 regulator-state-mem {
248                                         regulator-on-in-suspend;
249                                         regulator-suspend-microvolt = <3300000>;
250                                 };
251                         };
252
253                         vcc18_ldo1: LDO_REG1 {
254                                 regulator-always-on;
255                                 regulator-boot-on;
256                                 regulator-min-microvolt = <1800000>;
257                                 regulator-max-microvolt = <1800000>;
258                                 regulator-name = "vcc18_ldo1";
259                                 regulator-state-mem {
260                                         regulator-on-in-suspend;
261                                         regulator-suspend-microvolt = <1800000>;
262                                 };
263                         };
264
265                         vcc33_mipi: LDO_REG2 {
266                                 regulator-always-on;
267                                 regulator-boot-on;
268                                 regulator-min-microvolt = <3300000>;
269                                 regulator-max-microvolt = <3300000>;
270                                 regulator-name = "vcc33_mipi";
271                                 regulator-state-mem {
272                                         regulator-off-in-suspend;
273                                 };
274                         };
275
276                         vdd_10: LDO_REG3 {
277                                 regulator-always-on;
278                                 regulator-boot-on;
279                                 regulator-min-microvolt = <1000000>;
280                                 regulator-max-microvolt = <1000000>;
281                                 regulator-name = "vdd_10";
282                                 regulator-state-mem {
283                                         regulator-on-in-suspend;
284                                         regulator-suspend-microvolt = <1000000>;
285                                 };
286                         };
287
288                         vcc18_codec: LDO_REG4 {
289                                 regulator-always-on;
290                                 regulator-boot-on;
291                                 regulator-min-microvolt = <1800000>;
292                                 regulator-max-microvolt = <1800000>;
293                                 regulator-name = "vcc18_codec";
294                                 regulator-state-mem {
295                                         regulator-on-in-suspend;
296                                         regulator-suspend-microvolt = <1800000>;
297                                 };
298                         };
299
300                         vccio_sd: LDO_REG5 {
301                                 regulator-always-on;
302                                 regulator-boot-on;
303                                 regulator-min-microvolt = <1800000>;
304                                 regulator-max-microvolt = <3300000>;
305                                 regulator-name = "vccio_sd";
306                                 regulator-state-mem {
307                                         regulator-on-in-suspend;
308                                         regulator-suspend-microvolt = <3300000>;
309                                 };
310                         };
311
312                         vdd10_lcd: LDO_REG6 {
313                                 regulator-always-on;
314                                 regulator-boot-on;
315                                 regulator-min-microvolt = <1000000>;
316                                 regulator-max-microvolt = <1000000>;
317                                 regulator-name = "vdd10_lcd";
318                                 regulator-state-mem {
319                                         regulator-on-in-suspend;
320                                         regulator-suspend-microvolt = <1000000>;
321                                 };
322                         };
323
324                         vcc_18: LDO_REG7 {
325                                 regulator-always-on;
326                                 regulator-boot-on;
327                                 regulator-min-microvolt = <1800000>;
328                                 regulator-max-microvolt = <1800000>;
329                                 regulator-name = "vcc_18";
330                                 regulator-state-mem {
331                                         regulator-on-in-suspend;
332                                         regulator-suspend-microvolt = <1800000>;
333                                 };
334                         };
335
336                         vcc18_lcd: LDO_REG8 {
337                                 regulator-always-on;
338                                 regulator-boot-on;
339                                 regulator-min-microvolt = <1800000>;
340                                 regulator-max-microvolt = <1800000>;
341                                 regulator-name = "vcc18_lcd";
342                                 regulator-state-mem {
343                                         regulator-on-in-suspend;
344                                         regulator-suspend-microvolt = <1800000>;
345                                 };
346                         };
347
348                         vcc33_sd: SWITCH_REG1 {
349                                 regulator-always-on;
350                                 regulator-boot-on;
351                                 regulator-name = "vcc33_sd";
352                                 regulator-state-mem {
353                                         regulator-on-in-suspend;
354                                 };
355                         };
356
357                         vcc33_lan: SWITCH_REG2 {
358                                 regulator-always-on;
359                                 regulator-boot-on;
360                                 regulator-name = "vcc33_lan";
361                                 regulator-state-mem {
362                                         regulator-on-in-suspend;
363                                 };
364                         };
365                 };
366         };
367 };
368
369 &i2c2 {
370         status = "okay";
371 };
372
373 &i2s {
374         #sound-dai-cells = <0>;
375         status = "okay";
376 };
377
378 &io_domains {
379         status = "okay";
380
381         sdcard-supply = <&vccio_sd>;
382 };
383
384 &pwm0 {
385         status = "okay";
386 };
387
388 &rga {
389         status = "okay";
390 };
391
392 &saradc {
393         vref-supply = <&vcc18_ldo1>;
394         status ="okay";
395 };
396
397 &sdmmc {
398         bus-width = <4>;
399         cap-mmc-highspeed;
400         cap-sd-highspeed;
401         card-detect-delay = <200>;
402         disable-wp;                     /* wp not hooked up */
403         num-slots = <1>;
404         pinctrl-names = "default";
405         pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>;
406         status = "okay";
407         supports-sd;
408         vmmc-supply = <&vcc33_sd>;
409         vqmmc-supply = <&vccio_sd>;
410 };
411
412 &tsadc {
413         rockchip,hw-tshut-mode = <1>; /* tshut mode 0:CRU 1:GPIO */
414         rockchip,hw-tshut-polarity = <1>; /* tshut polarity 0:LOW 1:HIGH */
415         status = "okay";
416 };
417
418 &uart0 {
419         status = "okay";
420 };
421
422 &uart1 {
423         status = "okay";
424 };
425
426 &uart2 {
427         status = "okay";
428 };
429
430 &uart3 {
431         status = "okay";
432 };
433
434 &uart4 {
435         status = "okay";
436 };
437
438 &usbphy {
439         status = "okay";
440 };
441
442 &usb_host0_ehci {
443         no-relinquish-port;
444         status = "okay";
445 };
446
447 &usb_host1 {
448         status = "okay";
449 };
450
451 &usb_otg {
452         status= "okay";
453 };
454
455 &vopb {
456         status = "okay";
457 };
458
459 &vopb_mmu {
460         status = "okay";
461 };
462
463 &vopl {
464         status = "okay";
465         /* Don't use vopl for HDMI */
466         vopl_out: port {
467                 /delete-node/ endpoint@0;
468         };
469 };
470
471 &vopl_mmu {
472         status = "okay";
473 };
474
475 &vpu_service {
476         status = "okay";
477 };
478
479 &wdt {
480         status = "okay";
481 };
482
483 &pinctrl {
484         pcfg_pull_none_drv_8ma: pcfg-pull-none-drv-8ma {
485                 drive-strength = <8>;
486         };
487
488         pcfg_pull_up_drv_8ma: pcfg-pull-up-drv-8ma {
489                 bias-pull-up;
490                 drive-strength = <8>;
491         };
492
493         backlight {
494                 bl_en: bl-en {
495                         rockchip,pins = <7 2 RK_FUNC_GPIO &pcfg_pull_none>;
496                 };
497         };
498
499         buttons {
500                 pwrbtn: pwrbtn {
501                         rockchip,pins = <0 5 RK_FUNC_GPIO &pcfg_pull_up>;
502                 };
503         };
504
505         eth_phy {
506                 eth_phy_pwr: eth-phy-pwr {
507                         rockchip,pins = <0 6 RK_FUNC_GPIO &pcfg_pull_none>;
508                 };
509         };
510
511         pmic {
512                 pmic_int: pmic-int {
513                         rockchip,pins = <RK_GPIO0 4 RK_FUNC_GPIO &pcfg_pull_up>;
514                 };
515
516                 dvs_1: dvs-1 {
517                         rockchip,pins = <RK_GPIO0 11 RK_FUNC_GPIO &pcfg_pull_down>;
518                 };
519
520                 dvs_2: dvs-2 {
521                         rockchip,pins = <RK_GPIO0 12 RK_FUNC_GPIO &pcfg_pull_down>;
522                 };
523         };
524
525         sdmmc {
526                 /*
527                  * Default drive strength isn't enough to achieve even
528                  * high-speed mode on EVB board so bump up to 8ma.
529                  */
530                 sdmmc_bus4: sdmmc-bus4 {
531                         rockchip,pins = <6 16 RK_FUNC_1 &pcfg_pull_up_drv_8ma>,
532                                         <6 17 RK_FUNC_1 &pcfg_pull_up_drv_8ma>,
533                                         <6 18 RK_FUNC_1 &pcfg_pull_up_drv_8ma>,
534                                         <6 19 RK_FUNC_1 &pcfg_pull_up_drv_8ma>;
535                 };
536
537                 sdmmc_clk: sdmmc-clk {
538                         rockchip,pins = <6 20 RK_FUNC_1 &pcfg_pull_none_drv_8ma>;
539                 };
540
541                 sdmmc_cmd: sdmmc-cmd {
542                         rockchip,pins = <6 21 RK_FUNC_1 &pcfg_pull_up_drv_8ma>;
543                 };
544
545                 sdmmc_pwr: sdmmc-pwr {
546                         rockchip,pins = <7 11 RK_FUNC_GPIO &pcfg_pull_none>;
547                 };
548         };
549
550         usb {
551                 host_vbus_drv: host-vbus-drv {
552                         rockchip,pins = <0 14 RK_FUNC_GPIO &pcfg_pull_none>;
553                 };
554
555                 pwr_3g: pwr-3g {
556                         rockchip,pins = <7 8 RK_FUNC_GPIO &pcfg_pull_none>;
557                 };
558         };
559 };