xref: /linux/arch/arm64/boot/dts/renesas/r8a779h0-gray-hawk-single.dts (revision 1200525fbc958a045e71e986ee7542739542d767)
1// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2/*
3 * Device Tree Source for the R-Car V4M Gray Hawk Single board
4 *
5 * Copyright (C) 2023 Renesas Electronics Corp.
6 * Copyright (C) 2024 Glider bv
7 */
8/*
9 * [How to use Sound]
10 *
11 * Because R-Car V4M has only 1 SSI, it cannot handle both Playback/Capture
12 * at the same time. You need to switch the direction which is controlled
13 * by the GP0_01 pin via amixer.
14 *
15 * Playback (CN9500)
16 *	> amixer set "MUX" "Playback"	// for GP0_01
17 *	> amixer set "DAC 1" 85%
18 *	> aplay xxx.wav
19 *
20 * Capture (CN9501)
21 *	> amixer set "MUX" "Capture"	// for GP0_01
22 *	> amixer set "Mic 1" 80%
23 *	> amixer set "ADC 1" on
24 *	> amixer set 'ADC 1' 80%
25 *	> arecord xxx hoge.wav
26 */
27
28/dts-v1/;
29
30#include <dt-bindings/gpio/gpio.h>
31#include <dt-bindings/input/input.h>
32#include <dt-bindings/leds/common.h>
33
34#include "r8a779h0.dtsi"
35
36/ {
37	model = "Renesas Gray Hawk Single board based on r8a779h0";
38	compatible = "renesas,gray-hawk-single", "renesas,r8a779h0";
39
40	aliases {
41		i2c0 = &i2c0;
42		i2c1 = &i2c1;
43		i2c2 = &i2c2;
44		i2c3 = &i2c3;
45		serial0 = &hscif0;
46		serial1 = &hscif2;
47		ethernet0 = &avb0;
48	};
49
50	chosen {
51		bootargs = "ignore_loglevel rw root=/dev/nfs ip=on";
52		stdout-path = "serial0:921600n8";
53	};
54
55	keys {
56		compatible = "gpio-keys";
57
58		pinctrl-0 = <&keys_pins>;
59		pinctrl-names = "default";
60
61		key-1 {
62			gpios = <&gpio5 0 GPIO_ACTIVE_LOW>;
63			linux,code = <KEY_1>;
64			label = "SW47";
65			wakeup-source;
66			debounce-interval = <20>;
67		};
68
69		key-2 {
70			gpios = <&gpio5 1 GPIO_ACTIVE_LOW>;
71			linux,code = <KEY_2>;
72			label = "SW48";
73			wakeup-source;
74			debounce-interval = <20>;
75		};
76
77		key-3 {
78			gpios = <&gpio5 2 GPIO_ACTIVE_LOW>;
79			linux,code = <KEY_3>;
80			label = "SW49";
81			wakeup-source;
82			debounce-interval = <20>;
83		};
84	};
85
86	leds {
87		compatible = "gpio-leds";
88
89		led-1 {
90			gpios = <&gpio7 0 GPIO_ACTIVE_HIGH>;
91			color = <LED_COLOR_ID_GREEN>;
92			function = LED_FUNCTION_INDICATOR;
93			function-enumerator = <1>;
94		};
95
96		led-2 {
97			gpios = <&gpio7 1 GPIO_ACTIVE_HIGH>;
98			color = <LED_COLOR_ID_GREEN>;
99			function = LED_FUNCTION_INDICATOR;
100			function-enumerator = <2>;
101		};
102
103		led-3 {
104			gpios = <&gpio7 2 GPIO_ACTIVE_HIGH>;
105			color = <LED_COLOR_ID_GREEN>;
106			function = LED_FUNCTION_INDICATOR;
107			function-enumerator = <3>;
108		};
109	};
110
111	memory@48000000 {
112		device_type = "memory";
113		/* first 128MB is reserved for secure area. */
114		reg = <0x0 0x48000000 0x0 0x78000000>;
115	};
116
117	memory@480000000 {
118		device_type = "memory";
119		reg = <0x4 0x80000000 0x1 0x80000000>;
120	};
121
122	reg_1p8v: regulator-1p8v {
123			compatible = "regulator-fixed";
124			regulator-name = "fixed-1.8V";
125			regulator-min-microvolt = <1800000>;
126			regulator-max-microvolt = <1800000>;
127			regulator-boot-on;
128			regulator-always-on;
129	};
130
131	reg_3p3v: regulator-3p3v {
132			compatible = "regulator-fixed";
133			regulator-name = "fixed-3.3V";
134			regulator-min-microvolt = <3300000>;
135			regulator-max-microvolt = <3300000>;
136			regulator-boot-on;
137			regulator-always-on;
138	};
139
140	sound_mux: sound-mux {
141		compatible = "simple-audio-mux";
142		mux-gpios = <&gpio0 1 GPIO_ACTIVE_HIGH>;
143		state-labels = "Playback", "Capture";
144	};
145
146	sound_card: sound {
147		compatible = "audio-graph-card2";
148		label = "rcar-sound";
149		aux-devs = <&sound_mux>; // for GP0_01
150
151		links = <&rsnd_port>; // AK4619 Audio Codec
152	};
153};
154
155&audio_clkin {
156	clock-frequency = <24576000>;
157};
158
159&avb0 {
160	pinctrl-0 = <&avb0_pins>;
161	pinctrl-names = "default";
162	phy-handle = <&phy0>;
163	tx-internal-delay-ps = <2000>;
164	status = "okay";
165
166	phy0: ethernet-phy@0 {
167		compatible = "ethernet-phy-id0022.1622",
168			     "ethernet-phy-ieee802.3-c22";
169		rxc-skew-ps = <1500>;
170		reg = <0>;
171		interrupt-parent = <&gpio7>;
172		interrupts = <5 IRQ_TYPE_LEVEL_LOW>;
173		reset-gpios = <&gpio7 10 GPIO_ACTIVE_LOW>;
174	};
175};
176
177&extal_clk {
178	clock-frequency = <16666666>;
179};
180
181&extalr_clk {
182	clock-frequency = <32768>;
183};
184
185&gpio1 {
186	audio-power-hog {
187		gpio-hog;
188		gpios = <8 GPIO_ACTIVE_HIGH>;
189		output-high;
190		line-name = "Audio-Power";
191	};
192};
193
194&hscif0 {
195	pinctrl-0 = <&hscif0_pins>;
196	pinctrl-names = "default";
197
198	uart-has-rtscts;
199	status = "okay";
200};
201
202&hscif2 {
203	pinctrl-0 = <&hscif2_pins>;
204	pinctrl-names = "default";
205
206	uart-has-rtscts;
207	status = "okay";
208};
209
210&i2c0 {
211	pinctrl-0 = <&i2c0_pins>;
212	pinctrl-names = "default";
213
214	status = "okay";
215	clock-frequency = <400000>;
216
217	eeprom@50 {
218		compatible = "rohm,br24g01", "atmel,24c01";
219		label = "cpu-board";
220		reg = <0x50>;
221		pagesize = <8>;
222	};
223
224	eeprom@51 {
225		compatible = "rohm,br24g01", "atmel,24c01";
226		label = "breakout-board";
227		reg = <0x51>;
228		pagesize = <8>;
229	};
230
231	eeprom@52 {
232		compatible = "rohm,br24g01", "atmel,24c01";
233		label = "csi-dsi-sub-board-id";
234		reg = <0x52>;
235		pagesize = <8>;
236	};
237
238	eeprom@53 {
239		compatible = "rohm,br24g01", "atmel,24c01";
240		label = "ethernet-sub-board-id";
241		reg = <0x53>;
242		pagesize = <8>;
243	};
244};
245
246&i2c3 {
247	pinctrl-0 = <&i2c3_pins>;
248	pinctrl-names = "default";
249
250	status = "okay";
251	clock-frequency = <400000>;
252
253	codec@10 {
254		compatible = "asahi-kasei,ak4619";
255		reg = <0x10>;
256
257		clocks = <&rcar_sound>;
258		clock-names = "mclk";
259
260		#sound-dai-cells = <0>;
261		port {
262			ak4619_endpoint: endpoint {
263				remote-endpoint = <&rsnd_endpoint>;
264			};
265		};
266	};
267};
268
269&mmc0 {
270	pinctrl-0 = <&mmc_pins>;
271	pinctrl-1 = <&mmc_pins>;
272	pinctrl-names = "default", "state_uhs";
273
274	vmmc-supply = <&reg_3p3v>;
275	vqmmc-supply = <&reg_1p8v>;
276	mmc-hs200-1_8v;
277	mmc-hs400-1_8v;
278	bus-width = <8>;
279	no-sd;
280	no-sdio;
281	non-removable;
282	full-pwr-cycle-in-suspend;
283	status = "okay";
284};
285
286&pfc {
287	pinctrl-0 = <&scif_clk_pins>, <&scif_clk2_pins>;
288	pinctrl-names = "default";
289
290	avb0_pins: avb0 {
291		mux {
292			groups = "avb0_link", "avb0_mdio", "avb0_rgmii",
293				 "avb0_txcrefclk";
294			function = "avb0";
295		};
296
297		pins_mdio {
298			groups = "avb0_mdio";
299			drive-strength = <21>;
300		};
301
302		pins_mii {
303			groups = "avb0_rgmii";
304			drive-strength = <21>;
305		};
306	};
307
308	hscif0_pins: hscif0 {
309		groups = "hscif0_data", "hscif0_ctrl";
310		function = "hscif0";
311	};
312
313	hscif2_pins: hscif2 {
314		groups = "hscif2_data", "hscif2_ctrl";
315		function = "hscif2";
316	};
317
318	i2c0_pins: i2c0 {
319		groups = "i2c0";
320		function = "i2c0";
321	};
322
323	i2c3_pins: i2c3 {
324		groups = "i2c3";
325		function = "i2c3";
326	};
327
328	keys_pins: keys {
329		pins = "GP_5_0", "GP_5_1", "GP_5_2";
330		bias-pull-up;
331	};
332
333	mmc_pins: mmc {
334		groups = "mmc_data8", "mmc_ctrl", "mmc_ds";
335		function = "mmc";
336		power-source = <1800>;
337	};
338
339	qspi0_pins: qspi0 {
340		groups = "qspi0_ctrl", "qspi0_data4";
341		function = "qspi0";
342	};
343
344	scif_clk_pins: scif-clk {
345		groups = "scif_clk";
346		function = "scif_clk";
347	};
348
349	scif_clk2_pins: scif-clk2 {
350		groups = "scif_clk2";
351		function = "scif_clk2";
352	};
353
354	sound_clk_pins: sound_clk {
355		groups = "audio_clkin", "audio_clkout";
356		function = "audio_clk";
357	};
358
359	sound_pins: sound {
360		groups = "ssi_ctrl", "ssi_data";
361		function = "ssi";
362	};
363};
364
365&rcar_sound {
366	pinctrl-0 = <&sound_clk_pins>, <&sound_pins>;
367	pinctrl-names = "default";
368
369	status = "okay";
370
371	/* audio_clkout */
372	clock-frequency = <12288000>;
373
374	ports {
375		rsnd_port: port {
376			rsnd_endpoint: endpoint {
377				remote-endpoint = <&ak4619_endpoint>;
378				bitclock-master;
379				frame-master;
380
381				/* see above [How to use Sound] */
382				playback = <&ssi0>;
383				capture  = <&ssi0>;
384			};
385		};
386	};
387};
388
389&rpc {
390	pinctrl-0 = <&qspi0_pins>;
391	pinctrl-names = "default";
392
393	status = "okay";
394
395	flash@0 {
396		compatible = "spansion,s25fs512s", "jedec,spi-nor";
397		reg = <0>;
398		spi-max-frequency = <40000000>;
399		spi-rx-bus-width = <4>;
400
401		partitions {
402			compatible = "fixed-partitions";
403			#address-cells = <1>;
404			#size-cells = <1>;
405
406			boot@0 {
407				reg = <0x0 0x1200000>;
408				read-only;
409			};
410			user@1200000 {
411				reg = <0x1200000 0x2e00000>;
412			};
413		};
414	};
415};
416
417&rwdt {
418	timeout-sec = <60>;
419	status = "okay";
420};
421
422&scif_clk {
423	clock-frequency = <24000000>;
424};
425
426&scif_clk2 {
427	clock-frequency = <24000000>;
428};
429