• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Device Tree Source for the Koelsch board
3 *
4 * Copyright (C) 2013 Renesas Electronics Corporation
5 * Copyright (C) 2013-2014 Renesas Solutions Corp.
6 * Copyright (C) 2014 Cogent Embedded, Inc.
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 "r8a7791.dtsi"
43#include <dt-bindings/gpio/gpio.h>
44#include <dt-bindings/input/input.h>
45
46/ {
47	model = "Koelsch";
48	compatible = "renesas,koelsch", "renesas,r8a7791";
49
50	aliases {
51		serial0 = &scif0;
52		serial1 = &scif1;
53		i2c9 = &gpioi2c1;
54		i2c12 = &i2cexio1;
55	};
56
57	chosen {
58		bootargs = "ignore_loglevel rw root=/dev/nfs ip=dhcp";
59		stdout-path = "serial0:115200n8";
60	};
61
62	memory@40000000 {
63		device_type = "memory";
64		reg = <0 0x40000000 0 0x40000000>;
65	};
66
67	memory@200000000 {
68		device_type = "memory";
69		reg = <2 0x00000000 0 0x40000000>;
70	};
71
72	lbsc {
73		#address-cells = <1>;
74		#size-cells = <1>;
75	};
76
77	keyboard {
78		compatible = "gpio-keys";
79
80		key-1 {
81			gpios = <&gpio5 0 GPIO_ACTIVE_LOW>;
82			linux,code = <KEY_1>;
83			label = "SW2-1";
84			wakeup-source;
85			debounce-interval = <20>;
86		};
87		key-2 {
88			gpios = <&gpio5 1 GPIO_ACTIVE_LOW>;
89			linux,code = <KEY_2>;
90			label = "SW2-2";
91			wakeup-source;
92			debounce-interval = <20>;
93		};
94		key-3 {
95			gpios = <&gpio5 2 GPIO_ACTIVE_LOW>;
96			linux,code = <KEY_3>;
97			label = "SW2-3";
98			wakeup-source;
99			debounce-interval = <20>;
100		};
101		key-4 {
102			gpios = <&gpio5 3 GPIO_ACTIVE_LOW>;
103			linux,code = <KEY_4>;
104			label = "SW2-4";
105			wakeup-source;
106			debounce-interval = <20>;
107		};
108		key-a {
109			gpios = <&gpio7 0 GPIO_ACTIVE_LOW>;
110			linux,code = <KEY_A>;
111			label = "SW30";
112			wakeup-source;
113			debounce-interval = <20>;
114		};
115		key-b {
116			gpios = <&gpio7 1 GPIO_ACTIVE_LOW>;
117			linux,code = <KEY_B>;
118			label = "SW31";
119			wakeup-source;
120			debounce-interval = <20>;
121		};
122		key-c {
123			gpios = <&gpio7 2 GPIO_ACTIVE_LOW>;
124			linux,code = <KEY_C>;
125			label = "SW32";
126			wakeup-source;
127			debounce-interval = <20>;
128		};
129		key-d {
130			gpios = <&gpio7 3 GPIO_ACTIVE_LOW>;
131			linux,code = <KEY_D>;
132			label = "SW33";
133			wakeup-source;
134			debounce-interval = <20>;
135		};
136		key-e {
137			gpios = <&gpio7 4 GPIO_ACTIVE_LOW>;
138			linux,code = <KEY_E>;
139			label = "SW34";
140			wakeup-source;
141			debounce-interval = <20>;
142		};
143		key-f {
144			gpios = <&gpio7 5 GPIO_ACTIVE_LOW>;
145			linux,code = <KEY_F>;
146			label = "SW35";
147			wakeup-source;
148			debounce-interval = <20>;
149		};
150		key-g {
151			gpios = <&gpio7 6 GPIO_ACTIVE_LOW>;
152			linux,code = <KEY_G>;
153			label = "SW36";
154			wakeup-source;
155			debounce-interval = <20>;
156		};
157	};
158
159	leds {
160		compatible = "gpio-leds";
161		led6 {
162			gpios = <&gpio2 19 GPIO_ACTIVE_HIGH>;
163			label = "LED6";
164		};
165		led7 {
166			gpios = <&gpio2 20 GPIO_ACTIVE_HIGH>;
167			label = "LED7";
168		};
169		led8 {
170			gpios = <&gpio2 21 GPIO_ACTIVE_HIGH>;
171			label = "LED8";
172		};
173	};
174
175	vcc_sdhi0: regulator-vcc-sdhi0 {
176		compatible = "regulator-fixed";
177
178		regulator-name = "SDHI0 Vcc";
179		regulator-min-microvolt = <3300000>;
180		regulator-max-microvolt = <3300000>;
181
182		gpio = <&gpio7 17 GPIO_ACTIVE_HIGH>;
183		enable-active-high;
184	};
185
186	vccq_sdhi0: regulator-vccq-sdhi0 {
187		compatible = "regulator-gpio";
188
189		regulator-name = "SDHI0 VccQ";
190		regulator-min-microvolt = <1800000>;
191		regulator-max-microvolt = <3300000>;
192
193		gpios = <&gpio2 12 GPIO_ACTIVE_HIGH>;
194		gpios-states = <1>;
195		states = <3300000 1
196			  1800000 0>;
197	};
198
199	vcc_sdhi1: regulator-vcc-sdhi1 {
200		compatible = "regulator-fixed";
201
202		regulator-name = "SDHI1 Vcc";
203		regulator-min-microvolt = <3300000>;
204		regulator-max-microvolt = <3300000>;
205
206		gpio = <&gpio7 18 GPIO_ACTIVE_HIGH>;
207		enable-active-high;
208	};
209
210	vccq_sdhi1: regulator-vccq-sdhi1 {
211		compatible = "regulator-gpio";
212
213		regulator-name = "SDHI1 VccQ";
214		regulator-min-microvolt = <1800000>;
215		regulator-max-microvolt = <3300000>;
216
217		gpios = <&gpio2 13 GPIO_ACTIVE_HIGH>;
218		gpios-states = <1>;
219		states = <3300000 1
220			  1800000 0>;
221	};
222
223	vcc_sdhi2: regulator-vcc-sdhi2 {
224		compatible = "regulator-fixed";
225
226		regulator-name = "SDHI2 Vcc";
227		regulator-min-microvolt = <3300000>;
228		regulator-max-microvolt = <3300000>;
229
230		gpio = <&gpio7 19 GPIO_ACTIVE_HIGH>;
231		enable-active-high;
232	};
233
234	vccq_sdhi2: regulator-vccq-sdhi2 {
235		compatible = "regulator-gpio";
236
237		regulator-name = "SDHI2 VccQ";
238		regulator-min-microvolt = <1800000>;
239		regulator-max-microvolt = <3300000>;
240
241		gpios = <&gpio2 26 GPIO_ACTIVE_HIGH>;
242		gpios-states = <1>;
243		states = <3300000 1
244			  1800000 0>;
245	};
246
247	audio_clock: audio_clock {
248		compatible = "fixed-clock";
249		#clock-cells = <0>;
250		clock-frequency = <11289600>;
251	};
252
253	rsnd_ak4643: sound {
254		compatible = "simple-audio-card";
255
256		simple-audio-card,format = "left_j";
257		simple-audio-card,bitclock-master = <&sndcodec>;
258		simple-audio-card,frame-master = <&sndcodec>;
259
260		sndcpu: simple-audio-card,cpu {
261			sound-dai = <&rcar_sound>;
262		};
263
264		sndcodec: simple-audio-card,codec {
265			sound-dai = <&ak4643>;
266			clocks = <&audio_clock>;
267		};
268	};
269
270	hdmi-in {
271		compatible = "hdmi-connector";
272		type = "a";
273
274		port {
275			hdmi_con_in: endpoint {
276				remote-endpoint = <&adv7612_in>;
277			};
278		};
279	};
280
281	cec_clock: cec-clock {
282		compatible = "fixed-clock";
283		#clock-cells = <0>;
284		clock-frequency = <12000000>;
285	};
286
287	hdmi-out {
288		compatible = "hdmi-connector";
289		type = "a";
290
291		port {
292			hdmi_con_out: endpoint {
293				remote-endpoint = <&adv7511_out>;
294			};
295		};
296	};
297
298	x2_clk: x2-clock {
299		compatible = "fixed-clock";
300		#clock-cells = <0>;
301		clock-frequency = <74250000>;
302	};
303
304	x13_clk: x13-clock {
305		compatible = "fixed-clock";
306		#clock-cells = <0>;
307		clock-frequency = <148500000>;
308	};
309
310	gpioi2c1: i2c-9 {
311		#address-cells = <1>;
312		#size-cells = <0>;
313		compatible = "i2c-gpio";
314		status = "disabled";
315		gpios = <&gpio7 16 GPIO_ACTIVE_HIGH /* sda */
316			 &gpio7 15 GPIO_ACTIVE_HIGH /* scl */
317			>;
318		i2c-gpio,delay-us = <5>;
319	};
320
321	/*
322	 * I2C1 is routed to EXIO connector B, pins 64 (SCL) + 66 (SDA).
323	 * A fallback to GPIO is provided.
324	 */
325	i2cexio1: i2c-12 {
326		compatible = "i2c-demux-pinctrl";
327		i2c-parent = <&i2c1>, <&gpioi2c1>;
328		i2c-bus-name = "i2c-exio1";
329		#address-cells = <1>;
330		#size-cells = <0>;
331	};
332};
333
334&du {
335	pinctrl-0 = <&du_pins>;
336	pinctrl-names = "default";
337	status = "okay";
338
339	clocks = <&mstp7_clks R8A7791_CLK_DU0>,
340		 <&mstp7_clks R8A7791_CLK_DU1>,
341		 <&mstp7_clks R8A7791_CLK_LVDS0>,
342		 <&x13_clk>, <&x2_clk>;
343	clock-names = "du.0", "du.1", "lvds.0",
344		      "dclkin.0", "dclkin.1";
345
346	ports {
347		port@0 {
348			endpoint {
349				remote-endpoint = <&adv7511_in>;
350			};
351		};
352		port@1 {
353			lvds_connector: endpoint {
354			};
355		};
356	};
357};
358
359&extal_clk {
360	clock-frequency = <20000000>;
361};
362
363&pfc {
364	pinctrl-0 = <&scif_clk_pins>;
365	pinctrl-names = "default";
366
367	i2c1_pins: i2c1 {
368		groups = "i2c1";
369		function = "i2c1";
370	};
371
372	i2c2_pins: i2c2 {
373		groups = "i2c2";
374		function = "i2c2";
375	};
376
377	du_pins: du {
378		groups = "du_rgb888", "du_sync", "du_disp", "du_clk_out_0";
379		function = "du";
380	};
381
382	scif0_pins: scif0 {
383		groups = "scif0_data_d";
384		function = "scif0";
385	};
386
387	scif1_pins: scif1 {
388		groups = "scif1_data_d";
389		function = "scif1";
390	};
391
392	scif_clk_pins: scif_clk {
393		groups = "scif_clk";
394		function = "scif_clk";
395	};
396
397	ether_pins: ether {
398		groups = "eth_link", "eth_mdio", "eth_rmii";
399		function = "eth";
400	};
401
402	phy1_pins: phy1 {
403		groups = "intc_irq0";
404		function = "intc";
405	};
406
407	sdhi0_pins: sd0 {
408		groups = "sdhi0_data4", "sdhi0_ctrl";
409		function = "sdhi0";
410		power-source = <3300>;
411	};
412
413	sdhi0_pins_uhs: sd0_uhs {
414		groups = "sdhi0_data4", "sdhi0_ctrl";
415		function = "sdhi0";
416		power-source = <1800>;
417	};
418
419	sdhi1_pins: sd1 {
420		groups = "sdhi1_data4", "sdhi1_ctrl";
421		function = "sdhi1";
422		power-source = <3300>;
423	};
424
425	sdhi1_pins_uhs: sd1_uhs {
426		groups = "sdhi1_data4", "sdhi1_ctrl";
427		function = "sdhi1";
428		power-source = <1800>;
429	};
430
431	sdhi2_pins: sd2 {
432		groups = "sdhi2_data4", "sdhi2_ctrl";
433		function = "sdhi2";
434		power-source = <3300>;
435	};
436
437	sdhi2_pins_uhs: sd2_uhs {
438		groups = "sdhi2_data4", "sdhi2_ctrl";
439		function = "sdhi2";
440		power-source = <1800>;
441	};
442
443	qspi_pins: qspi {
444		groups = "qspi_ctrl", "qspi_data4";
445		function = "qspi";
446	};
447
448	msiof0_pins: msiof0 {
449		groups = "msiof0_clk", "msiof0_sync", "msiof0_rx",
450				 "msiof0_tx";
451		function = "msiof0";
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	vin0_pins: vin0 {
465		groups = "vin0_data24", "vin0_sync", "vin0_clkenb", "vin0_clk";
466		function = "vin0";
467	};
468
469	vin1_pins: vin1 {
470		groups = "vin1_data8", "vin1_clk";
471		function = "vin1";
472	};
473
474	sound_pins: sound {
475		groups = "ssi0129_ctrl", "ssi0_data", "ssi1_data";
476		function = "ssi";
477	};
478
479	sound_clk_pins: sound_clk {
480		groups = "audio_clk_a";
481		function = "audio_clk";
482	};
483};
484
485&ether {
486	pinctrl-0 = <&ether_pins &phy1_pins>;
487	pinctrl-names = "default";
488
489	phy-handle = <&phy1>;
490	renesas,ether-link-active-low;
491	status = "okay";
492
493	phy1: ethernet-phy@1 {
494		reg = <1>;
495		interrupt-parent = <&irqc0>;
496		interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
497		micrel,led-mode = <1>;
498	};
499};
500
501&cmt0 {
502	status = "okay";
503};
504
505&sata0 {
506	status = "okay";
507};
508
509&scif0 {
510	pinctrl-0 = <&scif0_pins>;
511	pinctrl-names = "default";
512
513	status = "okay";
514};
515
516&scif1 {
517	pinctrl-0 = <&scif1_pins>;
518	pinctrl-names = "default";
519
520	status = "okay";
521};
522
523&scif_clk {
524	clock-frequency = <14745600>;
525};
526
527&sdhi0 {
528	pinctrl-0 = <&sdhi0_pins>;
529	pinctrl-1 = <&sdhi0_pins_uhs>;
530	pinctrl-names = "default", "state_uhs";
531
532	vmmc-supply = <&vcc_sdhi0>;
533	vqmmc-supply = <&vccq_sdhi0>;
534	cd-gpios = <&gpio6 6 GPIO_ACTIVE_LOW>;
535	wp-gpios = <&gpio6 7 GPIO_ACTIVE_HIGH>;
536	sd-uhs-sdr50;
537	sd-uhs-sdr104;
538	status = "okay";
539};
540
541&sdhi1 {
542	pinctrl-0 = <&sdhi1_pins>;
543	pinctrl-1 = <&sdhi1_pins_uhs>;
544	pinctrl-names = "default", "state_uhs";
545
546	vmmc-supply = <&vcc_sdhi1>;
547	vqmmc-supply = <&vccq_sdhi1>;
548	cd-gpios = <&gpio6 14 GPIO_ACTIVE_LOW>;
549	wp-gpios = <&gpio6 15 GPIO_ACTIVE_HIGH>;
550	sd-uhs-sdr50;
551	status = "okay";
552};
553
554&sdhi2 {
555	pinctrl-0 = <&sdhi2_pins>;
556	pinctrl-1 = <&sdhi2_pins_uhs>;
557	pinctrl-names = "default", "state_uhs";
558
559	vmmc-supply = <&vcc_sdhi2>;
560	vqmmc-supply = <&vccq_sdhi2>;
561	cd-gpios = <&gpio6 22 GPIO_ACTIVE_LOW>;
562	sd-uhs-sdr50;
563	status = "okay";
564};
565
566&qspi {
567	pinctrl-0 = <&qspi_pins>;
568	pinctrl-names = "default";
569
570	status = "okay";
571
572	flash: flash@0 {
573		compatible = "spansion,s25fl512s", "jedec,spi-nor";
574		reg = <0>;
575		spi-max-frequency = <30000000>;
576		spi-tx-bus-width = <4>;
577		spi-rx-bus-width = <4>;
578		spi-cpha;
579		spi-cpol;
580		m25p,fast-read;
581
582		partitions {
583			compatible = "fixed-partitions";
584			#address-cells = <1>;
585			#size-cells = <1>;
586
587			partition@0 {
588				label = "loader";
589				reg = <0x00000000 0x00080000>;
590				read-only;
591			};
592			partition@80000 {
593				label = "user";
594				reg = <0x00080000 0x00580000>;
595				read-only;
596			};
597			partition@600000 {
598				label = "flash";
599				reg = <0x00600000 0x03a00000>;
600			};
601		};
602	};
603};
604
605&msiof0 {
606	pinctrl-0 = <&msiof0_pins>;
607	pinctrl-names = "default";
608
609	status = "okay";
610
611	pmic: pmic@0 {
612		compatible = "renesas,r2a11302ft";
613		reg = <0>;
614		spi-max-frequency = <6000000>;
615		spi-cpol;
616		spi-cpha;
617	};
618};
619
620&i2c1 {
621	pinctrl-0 = <&i2c1_pins>;
622	pinctrl-names = "i2c-exio1";
623};
624
625&i2c2 {
626	pinctrl-0 = <&i2c2_pins>;
627	pinctrl-names = "default";
628
629	status = "okay";
630	clock-frequency = <100000>;
631
632	ak4643: codec@12 {
633		compatible = "asahi-kasei,ak4643";
634		#sound-dai-cells = <0>;
635		reg = <0x12>;
636	};
637
638	composite-in@20 {
639		compatible = "adi,adv7180";
640		reg = <0x20>;
641		remote = <&vin1>;
642
643		port {
644			adv7180: endpoint {
645				bus-width = <8>;
646				remote-endpoint = <&vin1ep>;
647			};
648		};
649	};
650
651	hdmi@39 {
652		compatible = "adi,adv7511w";
653		reg = <0x39>;
654		interrupt-parent = <&gpio3>;
655		interrupts = <29 IRQ_TYPE_LEVEL_LOW>;
656		clocks = <&cec_clock>;
657		clock-names = "cec";
658
659		adi,input-depth = <8>;
660		adi,input-colorspace = "rgb";
661		adi,input-clock = "1x";
662		adi,input-style = <1>;
663		adi,input-justification = "evenly";
664
665		ports {
666			#address-cells = <1>;
667			#size-cells = <0>;
668
669			port@0 {
670				reg = <0>;
671				adv7511_in: endpoint {
672					remote-endpoint = <&du_out_rgb>;
673				};
674			};
675
676			port@1 {
677				reg = <1>;
678				adv7511_out: endpoint {
679					remote-endpoint = <&hdmi_con_out>;
680				};
681			};
682		};
683	};
684
685	hdmi-in@4c {
686		compatible = "adi,adv7612";
687		reg = <0x4c>;
688		interrupt-parent = <&gpio4>;
689		interrupts = <2 IRQ_TYPE_LEVEL_LOW>;
690		default-input = <0>;
691
692		ports {
693			#address-cells = <1>;
694			#size-cells = <0>;
695
696			port@0 {
697				reg = <0>;
698				adv7612_in: endpoint {
699					remote-endpoint = <&hdmi_con_in>;
700				};
701			};
702
703			port@2 {
704				reg = <2>;
705				adv7612_out: endpoint {
706					remote-endpoint = <&vin0ep2>;
707				};
708			};
709		};
710	};
711
712	eeprom@50 {
713		compatible = "renesas,24c02", "atmel,24c02";
714		reg = <0x50>;
715		pagesize = <16>;
716	};
717};
718
719&i2c6 {
720	status = "okay";
721	clock-frequency = <100000>;
722
723	pmic@58 {
724		compatible = "dlg,da9063";
725		reg = <0x58>;
726		interrupt-parent = <&irqc0>;
727		interrupts = <2 IRQ_TYPE_LEVEL_LOW>;
728		interrupt-controller;
729
730		rtc {
731			compatible = "dlg,da9063-rtc";
732		};
733
734		wdt {
735			compatible = "dlg,da9063-watchdog";
736		};
737	};
738
739	vdd_dvfs: regulator@68 {
740		compatible = "dlg,da9210";
741		reg = <0x68>;
742		interrupt-parent = <&irqc0>;
743		interrupts = <2 IRQ_TYPE_LEVEL_LOW>;
744
745		regulator-min-microvolt = <1000000>;
746		regulator-max-microvolt = <1000000>;
747		regulator-boot-on;
748		regulator-always-on;
749	};
750};
751
752&pci0 {
753	status = "okay";
754	pinctrl-0 = <&usb0_pins>;
755	pinctrl-names = "default";
756};
757
758&pci1 {
759	status = "okay";
760	pinctrl-0 = <&usb1_pins>;
761	pinctrl-names = "default";
762};
763
764&hsusb {
765	status = "okay";
766	pinctrl-0 = <&usb0_pins>;
767	pinctrl-names = "default";
768	renesas,enable-gpio = <&gpio5 31 GPIO_ACTIVE_HIGH>;
769};
770
771&usbphy {
772	status = "okay";
773};
774
775&pcie_bus_clk {
776	clock-frequency = <100000000>;
777};
778
779&pciec {
780	status = "okay";
781};
782
783&cpu0 {
784	cpu0-supply = <&vdd_dvfs>;
785};
786
787/* HDMI video input */
788&vin0 {
789	status = "okay";
790	pinctrl-0 = <&vin0_pins>;
791	pinctrl-names = "default";
792
793	port {
794		#address-cells = <1>;
795		#size-cells = <0>;
796
797		vin0ep2: endpoint {
798			remote-endpoint = <&adv7612_out>;
799			bus-width = <24>;
800			hsync-active = <0>;
801			vsync-active = <0>;
802			pclk-sample = <1>;
803			data-active = <1>;
804		};
805	};
806};
807
808/* composite video input */
809&vin1 {
810	status = "okay";
811	pinctrl-0 = <&vin1_pins>;
812	pinctrl-names = "default";
813
814	port {
815		#address-cells = <1>;
816		#size-cells = <0>;
817
818		vin1ep: endpoint {
819			remote-endpoint = <&adv7180>;
820			bus-width = <8>;
821		};
822	};
823};
824
825&rcar_sound {
826	pinctrl-0 = <&sound_pins &sound_clk_pins>;
827	pinctrl-names = "default";
828
829	/* Single DAI */
830	#sound-dai-cells = <0>;
831
832	status = "okay";
833
834	rcar_sound,dai {
835		dai0 {
836			playback = <&ssi0 &src2 &dvc0>;
837			capture  = <&ssi1 &src3 &dvc1>;
838		};
839	};
840};
841
842&ssi1 {
843	shared-pin;
844};
845