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