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