blob: 0230b42f46ac3a026ab32bd2263771d2fcb828e0 [file] [log] [blame]
Marek Vasut16b6e4a2018-01-07 20:17:23 +01001/*
2 * Device Tree Source for the Lager board
3 *
4 * Copyright (C) 2013-2014 Renesas Solutions Corp.
5 * Copyright (C) 2014 Cogent Embedded, Inc.
6 * Copyright (C) 2015-2016 Renesas Electronics Corporation
7 *
8 * SPDX-License-Identifier: GPL-2.0
9 */
10
11/*
12 * SSI-AK4643
13 *
14 * SW1: 1: AK4643
15 * 2: CN22
16 * 3: ADV7511
17 *
18 * This command is required when Playback/Capture
19 *
20 * amixer set "LINEOUT Mixer DACL" on
21 * amixer set "DVC Out" 100%
22 * amixer set "DVC In" 100%
23 *
24 * You can use Mute
25 *
26 * amixer set "DVC Out Mute" on
27 * amixer set "DVC In Mute" on
28 *
29 * You can use Volume Ramp
30 *
31 * amixer set "DVC Out Ramp Up Rate" "0.125 dB/64 steps"
32 * amixer set "DVC Out Ramp Down Rate" "0.125 dB/512 steps"
33 * amixer set "DVC Out Ramp" on
34 * aplay xxx.wav &
35 * amixer set "DVC Out" 80% // Volume Down
36 * amixer set "DVC Out" 100% // Volume Up
37 */
38
39/dts-v1/;
40#include "r8a7790.dtsi"
41#include <dt-bindings/gpio/gpio.h>
42#include <dt-bindings/input/input.h>
43
44/ {
45 model = "Lager";
46 compatible = "renesas,lager", "renesas,r8a7790";
47
48 aliases {
49 serial0 = &scif0;
50 serial1 = &scifa1;
51 i2c8 = &gpioi2c1;
52 i2c10 = &i2cexio0;
53 i2c11 = &i2cexio1;
54 };
55
56 chosen {
57 bootargs = "ignore_loglevel rw root=/dev/nfs ip=dhcp";
58 stdout-path = "serial0:115200n8";
59 };
60
61 memory@40000000 {
62 device_type = "memory";
63 reg = <0 0x40000000 0 0x40000000>;
64 };
65
66 memory@140000000 {
67 device_type = "memory";
68 reg = <1 0x40000000 0 0xc0000000>;
69 };
70
71 lbsc {
72 #address-cells = <1>;
73 #size-cells = <1>;
74 };
75
76 keyboard {
77 compatible = "gpio-keys";
78
79 one {
80 linux,code = <KEY_1>;
81 label = "SW2-1";
82 wakeup-source;
83 debounce-interval = <20>;
84 gpios = <&gpio1 14 GPIO_ACTIVE_LOW>;
85 };
86 two {
87 linux,code = <KEY_2>;
88 label = "SW2-2";
89 wakeup-source;
90 debounce-interval = <20>;
91 gpios = <&gpio1 24 GPIO_ACTIVE_LOW>;
92 };
93 three {
94 linux,code = <KEY_3>;
95 label = "SW2-3";
96 wakeup-source;
97 debounce-interval = <20>;
98 gpios = <&gpio1 26 GPIO_ACTIVE_LOW>;
99 };
100 four {
101 linux,code = <KEY_4>;
102 label = "SW2-4";
103 wakeup-source;
104 debounce-interval = <20>;
105 gpios = <&gpio1 28 GPIO_ACTIVE_LOW>;
106 };
107 };
108
109 leds {
110 compatible = "gpio-leds";
111 led6 {
112 gpios = <&gpio4 22 GPIO_ACTIVE_HIGH>;
113 };
114 led7 {
115 gpios = <&gpio4 23 GPIO_ACTIVE_HIGH>;
116 };
117 led8 {
118 gpios = <&gpio5 17 GPIO_ACTIVE_HIGH>;
119 };
120 };
121
122 fixedregulator3v3: regulator-3v3 {
123 compatible = "regulator-fixed";
124 regulator-name = "fixed-3.3V";
125 regulator-min-microvolt = <3300000>;
126 regulator-max-microvolt = <3300000>;
127 regulator-boot-on;
128 regulator-always-on;
129 };
130
131 vcc_sdhi0: regulator-vcc-sdhi0 {
132 compatible = "regulator-fixed";
133
134 regulator-name = "SDHI0 Vcc";
135 regulator-min-microvolt = <3300000>;
136 regulator-max-microvolt = <3300000>;
137
138 gpio = <&gpio5 24 GPIO_ACTIVE_HIGH>;
139 enable-active-high;
140 };
141
142 vccq_sdhi0: regulator-vccq-sdhi0 {
143 compatible = "regulator-gpio";
144
145 regulator-name = "SDHI0 VccQ";
146 regulator-min-microvolt = <1800000>;
147 regulator-max-microvolt = <3300000>;
148
149 gpios = <&gpio5 29 GPIO_ACTIVE_HIGH>;
150 gpios-states = <1>;
151 states = <3300000 1
152 1800000 0>;
153 };
154
155 vcc_sdhi2: regulator-vcc-sdhi2 {
156 compatible = "regulator-fixed";
157
158 regulator-name = "SDHI2 Vcc";
159 regulator-min-microvolt = <3300000>;
160 regulator-max-microvolt = <3300000>;
161
162 gpio = <&gpio5 25 GPIO_ACTIVE_HIGH>;
163 enable-active-high;
164 };
165
166 vccq_sdhi2: regulator-vccq-sdhi2 {
167 compatible = "regulator-gpio";
168
169 regulator-name = "SDHI2 VccQ";
170 regulator-min-microvolt = <1800000>;
171 regulator-max-microvolt = <3300000>;
172
173 gpios = <&gpio5 30 GPIO_ACTIVE_HIGH>;
174 gpios-states = <1>;
175 states = <3300000 1
176 1800000 0>;
177 };
178
179 audio_clock: audio_clock {
180 compatible = "fixed-clock";
181 #clock-cells = <0>;
182 clock-frequency = <11289600>;
183 };
184
185 rsnd_ak4643: sound {
186 compatible = "simple-audio-card";
187
188 simple-audio-card,format = "left_j";
189 simple-audio-card,bitclock-master = <&sndcodec>;
190 simple-audio-card,frame-master = <&sndcodec>;
191
192 sndcpu: simple-audio-card,cpu {
193 sound-dai = <&rcar_sound>;
194 };
195
196 sndcodec: simple-audio-card,codec {
197 sound-dai = <&ak4643>;
198 clocks = <&audio_clock>;
199 };
200 };
201
202 vga-encoder {
203 compatible = "adi,adv7123";
204
205 ports {
206 #address-cells = <1>;
207 #size-cells = <0>;
208
209 port@0 {
210 reg = <0>;
211 adv7123_in: endpoint {
212 remote-endpoint = <&du_out_rgb>;
213 };
214 };
215 port@1 {
216 reg = <1>;
217 adv7123_out: endpoint {
218 remote-endpoint = <&vga_in>;
219 };
220 };
221 };
222 };
223
224 vga {
225 compatible = "vga-connector";
226
227 port {
228 vga_in: endpoint {
229 remote-endpoint = <&adv7123_out>;
230 };
231 };
232 };
233
234 hdmi-in {
235 compatible = "hdmi-connector";
236 type = "a";
237
238 port {
239 hdmi_con_in: endpoint {
240 remote-endpoint = <&adv7612_in>;
241 };
242 };
243 };
244
245 hdmi-out {
246 compatible = "hdmi-connector";
247 type = "a";
248
249 port {
250 hdmi_con_out: endpoint {
251 remote-endpoint = <&adv7511_out>;
252 };
253 };
254 };
255
256 x2_clk: x2-clock {
257 compatible = "fixed-clock";
258 #clock-cells = <0>;
259 clock-frequency = <148500000>;
260 };
261
262 x13_clk: x13-clock {
263 compatible = "fixed-clock";
264 #clock-cells = <0>;
265 clock-frequency = <148500000>;
266 };
267
268 gpioi2c1: i2c-8 {
269 #address-cells = <1>;
270 #size-cells = <0>;
271 compatible = "i2c-gpio";
272 status = "disabled";
273 gpios = <&gpio1 17 GPIO_ACTIVE_HIGH /* sda */
274 &gpio1 16 GPIO_ACTIVE_HIGH /* scl */
275 >;
276 i2c-gpio,delay-us = <5>;
277 };
278
279 /*
280 * IIC0/I2C0 is routed to EXIO connector A, pins 114 (SCL) + 116 (SDA) only.
281 * We use the I2C demuxer, so the desired IP core can be selected at runtime
282 * depending on the use case (e.g. DMA with IIC0 or slave support with I2C0).
283 * Note: For testing the I2C slave feature, it is convenient to connect this
284 * bus with IIC3 on pins 110 (SCL) + 112 (SDA), select I2C0 at runtime, and
285 * instantiate the slave device at runtime according to the documentation.
286 * You can then communicate with the slave via IIC3.
287 *
288 * IIC0/I2C0 does not appear to support fallback to GPIO.
289 */
290 i2cexio0: i2c-10 {
291 compatible = "i2c-demux-pinctrl";
292 i2c-parent = <&iic0>, <&i2c0>;
293 i2c-bus-name = "i2c-exio0";
294 #address-cells = <1>;
295 #size-cells = <0>;
296 };
297
298 /*
299 * IIC1/I2C1 is routed to EXIO connector A, pins 78 (SCL) + 80 (SDA).
300 * This is similar to the arangement described for i2cexio0 (above)
301 * with a fallback to GPIO also provided.
302 */
303 i2cexio1: i2c-11 {
304 compatible = "i2c-demux-pinctrl";
305 i2c-parent = <&iic1>, <&i2c1>, <&gpioi2c1>;
306 i2c-bus-name = "i2c-exio1";
307 #address-cells = <1>;
308 #size-cells = <0>;
309 };
310};
311
312&du {
313 pinctrl-0 = <&du_pins>;
314 pinctrl-names = "default";
315 status = "okay";
316
317 clocks = <&cpg CPG_MOD 724>, <&cpg CPG_MOD 723>, <&cpg CPG_MOD 722>,
318 <&cpg CPG_MOD 726>, <&cpg CPG_MOD 725>,
319 <&x13_clk>, <&x2_clk>;
320 clock-names = "du.0", "du.1", "du.2", "lvds.0", "lvds.1",
321 "dclkin.0", "dclkin.1";
322
323 ports {
324 port@0 {
325 endpoint {
326 remote-endpoint = <&adv7123_in>;
327 };
328 };
329 port@1 {
330 endpoint {
331 remote-endpoint = <&adv7511_in>;
332 };
333 };
334 port@2 {
335 lvds_connector: endpoint {
336 };
337 };
338 };
339};
340
341&extal_clk {
342 clock-frequency = <20000000>;
343};
344
345&pfc {
346 pinctrl-0 = <&scif_clk_pins>;
347 pinctrl-names = "default";
348
349 du_pins: du {
350 groups = "du_rgb666", "du_sync_1", "du_clk_out_0";
351 function = "du";
352 };
353
354 scif0_pins: scif0 {
355 groups = "scif0_data";
356 function = "scif0";
357 };
358
359 scif_clk_pins: scif_clk {
360 groups = "scif_clk";
361 function = "scif_clk";
362 };
363
364 ether_pins: ether {
365 groups = "eth_link", "eth_mdio", "eth_rmii";
366 function = "eth";
367 };
368
369 phy1_pins: phy1 {
370 groups = "intc_irq0";
371 function = "intc";
372 };
373
374 scifa1_pins: scifa1 {
375 groups = "scifa1_data";
376 function = "scifa1";
377 };
378
379 sdhi0_pins: sd0 {
380 groups = "sdhi0_data4", "sdhi0_ctrl";
381 function = "sdhi0";
382 power-source = <3300>;
383 };
384
385 sdhi0_pins_uhs: sd0_uhs {
386 groups = "sdhi0_data4", "sdhi0_ctrl";
387 function = "sdhi0";
388 power-source = <1800>;
389 };
390
391 sdhi2_pins: sd2 {
392 groups = "sdhi2_data4", "sdhi2_ctrl";
393 function = "sdhi2";
394 power-source = <3300>;
395 };
396
397 sdhi2_pins_uhs: sd2_uhs {
398 groups = "sdhi2_data4", "sdhi2_ctrl";
399 function = "sdhi2";
400 power-source = <1800>;
401 };
402
403 mmc1_pins: mmc1 {
404 groups = "mmc1_data8", "mmc1_ctrl";
405 function = "mmc1";
406 };
407
408 qspi_pins: qspi {
409 groups = "qspi_ctrl", "qspi_data4";
410 function = "qspi";
411 };
412
413 msiof1_pins: msiof1 {
414 groups = "msiof1_clk", "msiof1_sync", "msiof1_rx",
415 "msiof1_tx";
416 function = "msiof1";
417 };
418
419 i2c0_pins: i2c0 {
420 groups = "i2c0";
421 function = "i2c0";
422 };
423
424 iic0_pins: iic0 {
425 groups = "iic0";
426 function = "iic0";
427 };
428
429 i2c1_pins: i2c1 {
430 groups = "i2c1";
431 function = "i2c1";
432 };
433
434 iic1_pins: iic1 {
435 groups = "iic1";
436 function = "iic1";
437 };
438
439 iic2_pins: iic2 {
440 groups = "iic2";
441 function = "iic2";
442 };
443
444 iic3_pins: iic3 {
445 groups = "iic3";
446 function = "iic3";
447 };
448
449 hsusb_pins: hsusb {
450 groups = "usb0_ovc_vbus";
451 function = "usb0";
452 };
453
454 usb0_pins: usb0 {
455 groups = "usb0";
456 function = "usb0";
457 };
458
459 usb1_pins: usb1 {
460 groups = "usb1";
461 function = "usb1";
462 };
463
464 usb2_pins: usb2 {
465 groups = "usb2";
466 function = "usb2";
467 };
468
469 vin0_pins: vin0 {
470 groups = "vin0_data24", "vin0_sync", "vin0_clkenb", "vin0_clk";
471 function = "vin0";
472 };
473
474 vin1_pins: vin1 {
475 groups = "vin1_data8", "vin1_clk";
476 function = "vin1";
477 };
478
479 sound_pins: sound {
480 groups = "ssi0129_ctrl", "ssi0_data", "ssi1_data";
481 function = "ssi";
482 };
483
484 sound_clk_pins: sound_clk {
485 groups = "audio_clk_a";
486 function = "audio_clk";
487 };
488};
489
490&ether {
491 pinctrl-0 = <&ether_pins &phy1_pins>;
492 pinctrl-names = "default";
493
494 phy-handle = <&phy1>;
495 renesas,ether-link-active-low;
496 status = "okay";
497
498 phy1: ethernet-phy@1 {
499 reg = <1>;
500 interrupt-parent = <&irqc0>;
501 interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
502 micrel,led-mode = <1>;
503 };
504};
505
506&cmt0 {
507 status = "okay";
508};
509
510&mmcif1 {
511 pinctrl-0 = <&mmc1_pins>;
512 pinctrl-names = "default";
513
514 vmmc-supply = <&fixedregulator3v3>;
515 bus-width = <8>;
516 non-removable;
517 status = "okay";
518};
519
520&sata1 {
521 status = "okay";
522};
523
524&qspi {
525 pinctrl-0 = <&qspi_pins>;
526 pinctrl-names = "default";
527
528 status = "okay";
529
530 flash: flash@0 {
531 compatible = "spansion,s25fl512s", "jedec,spi-nor";
532 reg = <0>;
533 spi-max-frequency = <30000000>;
534 spi-tx-bus-width = <4>;
535 spi-rx-bus-width = <4>;
536 spi-cpha;
537 spi-cpol;
538 m25p,fast-read;
539
540 partitions {
541 compatible = "fixed-partitions";
542 #address-cells = <1>;
543 #size-cells = <1>;
544
545 partition@0 {
546 label = "loader";
547 reg = <0x00000000 0x00040000>;
548 read-only;
549 };
550 partition@40000 {
551 label = "user";
552 reg = <0x00040000 0x00400000>;
553 read-only;
554 };
555 partition@440000 {
556 label = "flash";
557 reg = <0x00440000 0x03bc0000>;
558 };
559 };
560 };
561};
562
563&scif0 {
564 pinctrl-0 = <&scif0_pins>;
565 pinctrl-names = "default";
566
567 status = "okay";
568};
569
570&scifa1 {
571 pinctrl-0 = <&scifa1_pins>;
572 pinctrl-names = "default";
573
574 status = "okay";
575};
576
577&scif_clk {
578 clock-frequency = <14745600>;
579};
580
581&msiof1 {
582 pinctrl-0 = <&msiof1_pins>;
583 pinctrl-names = "default";
584
585 status = "okay";
586
587 pmic: pmic@0 {
588 compatible = "renesas,r2a11302ft";
589 reg = <0>;
590 spi-max-frequency = <6000000>;
591 spi-cpol;
592 spi-cpha;
593 };
594};
595
596&sdhi0 {
597 pinctrl-0 = <&sdhi0_pins>;
598 pinctrl-1 = <&sdhi0_pins_uhs>;
599 pinctrl-names = "default", "state_uhs";
600
601 vmmc-supply = <&vcc_sdhi0>;
602 vqmmc-supply = <&vccq_sdhi0>;
603 cd-gpios = <&gpio3 6 GPIO_ACTIVE_LOW>;
604 sd-uhs-sdr50;
605 sd-uhs-sdr104;
606 status = "okay";
607};
608
609&sdhi2 {
610 pinctrl-0 = <&sdhi2_pins>;
611 pinctrl-1 = <&sdhi2_pins_uhs>;
612 pinctrl-names = "default", "state_uhs";
613
614 vmmc-supply = <&vcc_sdhi2>;
615 vqmmc-supply = <&vccq_sdhi2>;
616 cd-gpios = <&gpio3 22 GPIO_ACTIVE_LOW>;
617 sd-uhs-sdr50;
618 status = "okay";
619};
620
621&cpu0 {
622 cpu0-supply = <&vdd_dvfs>;
623};
624
625&i2c0 {
626 pinctrl-0 = <&i2c0_pins>;
627 pinctrl-names = "i2c-exio0";
628};
629
630&iic0 {
631 pinctrl-0 = <&iic0_pins>;
632 pinctrl-names = "i2c-exio0";
633};
634
635&i2c1 {
636 pinctrl-0 = <&i2c1_pins>;
637 pinctrl-names = "i2c-exio1";
638};
639
640&iic1 {
641 pinctrl-0 = <&iic1_pins>;
642 pinctrl-names = "i2c-exio1";
643};
644
645&iic2 {
646 status = "okay";
647 pinctrl-0 = <&iic2_pins>;
648 pinctrl-names = "default";
649
650 clock-frequency = <100000>;
651
652 ak4643: codec@12 {
653 compatible = "asahi-kasei,ak4643";
654 #sound-dai-cells = <0>;
655 reg = <0x12>;
656 };
657
658 composite-in@20 {
659 compatible = "adi,adv7180";
660 reg = <0x20>;
661 remote = <&vin1>;
662
663 port {
664 adv7180: endpoint {
665 bus-width = <8>;
666 remote-endpoint = <&vin1ep0>;
667 };
668 };
669 };
670
671 hdmi@39 {
672 compatible = "adi,adv7511w";
673 reg = <0x39>;
674 interrupt-parent = <&gpio1>;
675 interrupts = <15 IRQ_TYPE_LEVEL_LOW>;
676
677 adi,input-depth = <8>;
678 adi,input-colorspace = "rgb";
679 adi,input-clock = "1x";
680 adi,input-style = <1>;
681 adi,input-justification = "evenly";
682
683 ports {
684 #address-cells = <1>;
685 #size-cells = <0>;
686
687 port@0 {
688 reg = <0>;
689 adv7511_in: endpoint {
690 remote-endpoint = <&du_out_lvds0>;
691 };
692 };
693
694 port@1 {
695 reg = <1>;
696 adv7511_out: endpoint {
697 remote-endpoint = <&hdmi_con_out>;
698 };
699 };
700 };
701 };
702
703 hdmi-in@4c {
704 compatible = "adi,adv7612";
705 reg = <0x4c>;
706 interrupt-parent = <&gpio1>;
707 interrupts = <20 IRQ_TYPE_LEVEL_LOW>;
708 default-input = <0>;
709
710 ports {
711 #address-cells = <1>;
712 #size-cells = <0>;
713
714 port@0 {
715 reg = <0>;
716 adv7612_in: endpoint {
717 remote-endpoint = <&hdmi_con_in>;
718 };
719 };
720
721 port@2 {
722 reg = <2>;
723 adv7612_out: endpoint {
724 remote-endpoint = <&vin0ep2>;
725 };
726 };
727 };
728 };
729};
730
731&iic3 {
732 pinctrl-names = "default";
733 pinctrl-0 = <&iic3_pins>;
734 status = "okay";
735
736 pmic@58 {
737 compatible = "dlg,da9063";
738 reg = <0x58>;
739 interrupt-parent = <&irqc0>;
740 interrupts = <2 IRQ_TYPE_LEVEL_LOW>;
741 interrupt-controller;
742
743 rtc {
744 compatible = "dlg,da9063-rtc";
745 };
746
747 wdt {
748 compatible = "dlg,da9063-watchdog";
749 };
750 };
751
752 vdd_dvfs: regulator@68 {
753 compatible = "dlg,da9210";
754 reg = <0x68>;
755 interrupt-parent = <&irqc0>;
756 interrupts = <2 IRQ_TYPE_LEVEL_LOW>;
757
758 regulator-min-microvolt = <1000000>;
759 regulator-max-microvolt = <1000000>;
760 regulator-boot-on;
761 regulator-always-on;
762 };
763};
764
765&pci0 {
766 status = "okay";
767 pinctrl-0 = <&usb0_pins>;
768 pinctrl-names = "default";
769};
770
771&pci1 {
772 status = "okay";
773 pinctrl-0 = <&usb1_pins>;
774 pinctrl-names = "default";
775};
776
777&xhci {
778 status = "okay";
779 pinctrl-0 = <&usb2_pins>;
780 pinctrl-names = "default";
781};
782
783&pci2 {
784 status = "okay";
785 pinctrl-0 = <&usb2_pins>;
786 pinctrl-names = "default";
787};
788
789&hsusb {
790 status = "okay";
791 pinctrl-0 = <&hsusb_pins>;
792 pinctrl-names = "default";
793 renesas,enable-gpio = <&gpio5 18 GPIO_ACTIVE_HIGH>;
794};
795
796&usbphy {
797 status = "okay";
798};
799
800/* HDMI video input */
801&vin0 {
802 pinctrl-0 = <&vin0_pins>;
803 pinctrl-names = "default";
804
805 status = "okay";
806
807 port {
808 vin0ep2: endpoint {
809 remote-endpoint = <&adv7612_out>;
810 bus-width = <24>;
811 hsync-active = <0>;
812 vsync-active = <0>;
813 pclk-sample = <1>;
814 data-active = <1>;
815 };
816 };
817};
818
819/* composite video input */
820&vin1 {
821 pinctrl-0 = <&vin1_pins>;
822 pinctrl-names = "default";
823
824 status = "okay";
825
826 port {
827 #address-cells = <1>;
828 #size-cells = <0>;
829
830 vin1ep0: endpoint {
831 remote-endpoint = <&adv7180>;
832 bus-width = <8>;
833 };
834 };
835};
836
837&rcar_sound {
838 pinctrl-0 = <&sound_pins &sound_clk_pins>;
839 pinctrl-names = "default";
840
841 /* Single DAI */
842 #sound-dai-cells = <0>;
843
844 status = "okay";
845
846 rcar_sound,dai {
847 dai0 {
848 playback = <&ssi0 &src2 &dvc0>;
849 capture = <&ssi1 &src3 &dvc1>;
850 };
851 };
852};
853
854&ssi1 {
855 shared-pin;
856};