xref: /linux/arch/arm64/boot/dts/renesas/r8a779h0-gray-hawk-single.dts (revision fcc79e1714e8c2b8e216dc3149812edd37884eef)
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	can_transceiver0: can-phy0 {
51		compatible = "nxp,tjr1443";
52		#phy-cells = <0>;
53		enable-gpios = <&gpio1 3 GPIO_ACTIVE_HIGH>;
54		max-bitrate = <5000000>;
55	};
56
57	chosen {
58		bootargs = "ignore_loglevel rw root=/dev/nfs ip=on";
59		stdout-path = "serial0:921600n8";
60	};
61
62	keys {
63		compatible = "gpio-keys";
64
65		pinctrl-0 = <&keys_pins>;
66		pinctrl-names = "default";
67
68		key-1 {
69			gpios = <&gpio5 0 GPIO_ACTIVE_LOW>;
70			linux,code = <KEY_1>;
71			label = "SW47";
72			wakeup-source;
73			debounce-interval = <20>;
74		};
75
76		key-2 {
77			gpios = <&gpio5 1 GPIO_ACTIVE_LOW>;
78			linux,code = <KEY_2>;
79			label = "SW48";
80			wakeup-source;
81			debounce-interval = <20>;
82		};
83
84		key-3 {
85			gpios = <&gpio5 2 GPIO_ACTIVE_LOW>;
86			linux,code = <KEY_3>;
87			label = "SW49";
88			wakeup-source;
89			debounce-interval = <20>;
90		};
91	};
92
93	leds {
94		compatible = "gpio-leds";
95
96		led-1 {
97			gpios = <&gpio7 0 GPIO_ACTIVE_HIGH>;
98			color = <LED_COLOR_ID_GREEN>;
99			function = LED_FUNCTION_INDICATOR;
100			function-enumerator = <1>;
101		};
102
103		led-2 {
104			gpios = <&gpio7 1 GPIO_ACTIVE_HIGH>;
105			color = <LED_COLOR_ID_GREEN>;
106			function = LED_FUNCTION_INDICATOR;
107			function-enumerator = <2>;
108		};
109
110		led-3 {
111			gpios = <&gpio7 2 GPIO_ACTIVE_HIGH>;
112			color = <LED_COLOR_ID_GREEN>;
113			function = LED_FUNCTION_INDICATOR;
114			function-enumerator = <3>;
115		};
116	};
117
118	memory@48000000 {
119		device_type = "memory";
120		/* first 128MB is reserved for secure area. */
121		reg = <0x0 0x48000000 0x0 0x78000000>;
122	};
123
124	memory@480000000 {
125		device_type = "memory";
126		reg = <0x4 0x80000000 0x1 0x80000000>;
127	};
128
129	pcie_clk: clk-9fgv0841-pci {
130		compatible = "fixed-clock";
131		clock-frequency = <100000000>;
132		#clock-cells = <0>;
133	};
134
135	reg_1p8v: regulator-1p8v {
136			compatible = "regulator-fixed";
137			regulator-name = "fixed-1.8V";
138			regulator-min-microvolt = <1800000>;
139			regulator-max-microvolt = <1800000>;
140			regulator-boot-on;
141			regulator-always-on;
142	};
143
144	reg_3p3v: regulator-3p3v {
145			compatible = "regulator-fixed";
146			regulator-name = "fixed-3.3V";
147			regulator-min-microvolt = <3300000>;
148			regulator-max-microvolt = <3300000>;
149			regulator-boot-on;
150			regulator-always-on;
151	};
152
153	sound_mux: sound-mux {
154		compatible = "simple-audio-mux";
155		mux-gpios = <&gpio0 1 GPIO_ACTIVE_HIGH>;
156		state-labels = "Playback", "Capture";
157	};
158
159	sound_card: sound {
160		compatible = "audio-graph-card2";
161		label = "rcar-sound";
162		aux-devs = <&sound_mux>; // for GP0_01
163
164		links = <&rsnd_port>; // AK4619 Audio Codec
165	};
166};
167
168&audio_clkin {
169	clock-frequency = <24576000>;
170};
171
172&avb0 {
173	pinctrl-0 = <&avb0_pins>;
174	pinctrl-names = "default";
175	phy-handle = <&phy0>;
176	tx-internal-delay-ps = <2000>;
177	status = "okay";
178
179	phy0: ethernet-phy@0 {
180		compatible = "ethernet-phy-id0022.1622",
181			     "ethernet-phy-ieee802.3-c22";
182		rxc-skew-ps = <1500>;
183		reg = <0>;
184		interrupts-extended = <&gpio7 5 IRQ_TYPE_LEVEL_LOW>;
185		reset-gpios = <&gpio7 10 GPIO_ACTIVE_LOW>;
186	};
187};
188
189&can_clk {
190	clock-frequency = <40000000>;
191};
192
193&canfd {
194	pinctrl-0 = <&canfd0_pins>, <&canfd1_pins>, <&can_clk_pins>;
195	pinctrl-names = "default";
196	status = "okay";
197
198	channel0 {
199		status = "okay";
200		phys = <&can_transceiver0>;
201	};
202
203	channel1 {
204		status = "okay";
205	};
206};
207
208&extal_clk {
209	clock-frequency = <16666666>;
210};
211
212&extalr_clk {
213	clock-frequency = <32768>;
214};
215
216&gpio1 {
217	audio-power-hog {
218		gpio-hog;
219		gpios = <8 GPIO_ACTIVE_HIGH>;
220		output-high;
221		line-name = "Audio-Power";
222	};
223};
224
225&hscif0 {
226	pinctrl-0 = <&hscif0_pins>;
227	pinctrl-names = "default";
228
229	uart-has-rtscts;
230	status = "okay";
231};
232
233&hscif2 {
234	pinctrl-0 = <&hscif2_pins>;
235	pinctrl-names = "default";
236
237	uart-has-rtscts;
238	status = "okay";
239};
240
241&i2c0 {
242	pinctrl-0 = <&i2c0_pins>;
243	pinctrl-names = "default";
244
245	status = "okay";
246	clock-frequency = <400000>;
247
248	io_expander_a: gpio@20 {
249		compatible = "onnn,pca9654";
250		reg = <0x20>;
251		interrupts-extended = <&gpio0 0 IRQ_TYPE_LEVEL_LOW>;
252		gpio-controller;
253		#gpio-cells = <2>;
254		interrupt-controller;
255		#interrupt-cells = <2>;
256	};
257
258	eeprom@50 {
259		compatible = "rohm,br24g01", "atmel,24c01";
260		label = "cpu-board";
261		reg = <0x50>;
262		pagesize = <8>;
263	};
264
265	eeprom@51 {
266		compatible = "rohm,br24g01", "atmel,24c01";
267		label = "breakout-board";
268		reg = <0x51>;
269		pagesize = <8>;
270	};
271
272	eeprom@52 {
273		compatible = "rohm,br24g01", "atmel,24c01";
274		label = "csi-dsi-sub-board-id";
275		reg = <0x52>;
276		pagesize = <8>;
277	};
278
279	eeprom@53 {
280		compatible = "rohm,br24g01", "atmel,24c01";
281		label = "ethernet-sub-board-id";
282		reg = <0x53>;
283		pagesize = <8>;
284	};
285};
286
287&i2c3 {
288	pinctrl-0 = <&i2c3_pins>;
289	pinctrl-names = "default";
290
291	status = "okay";
292	clock-frequency = <400000>;
293
294	codec@10 {
295		compatible = "asahi-kasei,ak4619";
296		reg = <0x10>;
297
298		clocks = <&rcar_sound>;
299		clock-names = "mclk";
300
301		#sound-dai-cells = <0>;
302		port {
303			ak4619_endpoint: endpoint {
304				remote-endpoint = <&rsnd_endpoint>;
305			};
306		};
307	};
308};
309
310&mmc0 {
311	pinctrl-0 = <&mmc_pins>;
312	pinctrl-1 = <&mmc_pins>;
313	pinctrl-names = "default", "state_uhs";
314
315	vmmc-supply = <&reg_3p3v>;
316	vqmmc-supply = <&reg_1p8v>;
317	mmc-hs200-1_8v;
318	mmc-hs400-1_8v;
319	bus-width = <8>;
320	no-sd;
321	no-sdio;
322	non-removable;
323	full-pwr-cycle-in-suspend;
324	status = "okay";
325};
326
327&pcie0_clkref {
328	compatible = "gpio-gate-clock";
329	clocks = <&pcie_clk>;
330	enable-gpios = <&gpio4 21 GPIO_ACTIVE_LOW>;
331	/delete-property/ clock-frequency;
332};
333
334&pciec0 {
335	reset-gpios = <&io_expander_a 0 GPIO_ACTIVE_LOW>;
336	status = "okay";
337};
338
339&pfc {
340	pinctrl-0 = <&scif_clk_pins>, <&scif_clk2_pins>;
341	pinctrl-names = "default";
342
343	avb0_pins: avb0 {
344		mux {
345			groups = "avb0_link", "avb0_mdio", "avb0_rgmii",
346				 "avb0_txcrefclk";
347			function = "avb0";
348		};
349
350		pins_mdio {
351			groups = "avb0_mdio";
352			drive-strength = <21>;
353		};
354
355		pins_mii {
356			groups = "avb0_rgmii";
357			drive-strength = <21>;
358		};
359	};
360
361	can_clk_pins: can-clk {
362		groups = "can_clk";
363		function = "can_clk";
364	};
365
366	canfd0_pins: canfd0 {
367		groups = "canfd0_data";
368		function = "canfd0";
369	};
370
371	canfd1_pins: canfd1 {
372		groups = "canfd1_data";
373		function = "canfd1";
374	};
375
376	hscif0_pins: hscif0 {
377		groups = "hscif0_data", "hscif0_ctrl";
378		function = "hscif0";
379	};
380
381	hscif2_pins: hscif2 {
382		groups = "hscif2_data", "hscif2_ctrl";
383		function = "hscif2";
384	};
385
386	i2c0_pins: i2c0 {
387		groups = "i2c0";
388		function = "i2c0";
389	};
390
391	i2c3_pins: i2c3 {
392		groups = "i2c3";
393		function = "i2c3";
394	};
395
396	keys_pins: keys {
397		pins = "GP_5_0", "GP_5_1", "GP_5_2";
398		bias-pull-up;
399	};
400
401	mmc_pins: mmc {
402		groups = "mmc_data8", "mmc_ctrl", "mmc_ds";
403		function = "mmc";
404		power-source = <1800>;
405	};
406
407	qspi0_pins: qspi0 {
408		groups = "qspi0_ctrl", "qspi0_data4";
409		function = "qspi0";
410	};
411
412	scif_clk_pins: scif-clk {
413		groups = "scif_clk";
414		function = "scif_clk";
415	};
416
417	scif_clk2_pins: scif-clk2 {
418		groups = "scif_clk2";
419		function = "scif_clk2";
420	};
421
422	sound_clk_pins: sound_clk {
423		groups = "audio_clkin", "audio_clkout";
424		function = "audio_clk";
425	};
426
427	sound_pins: sound {
428		groups = "ssi_ctrl", "ssi_data";
429		function = "ssi";
430	};
431};
432
433&rcar_sound {
434	pinctrl-0 = <&sound_clk_pins>, <&sound_pins>;
435	pinctrl-names = "default";
436
437	status = "okay";
438
439	/* audio_clkout */
440	clock-frequency = <12288000>;
441
442	ports {
443		rsnd_port: port {
444			rsnd_endpoint: endpoint {
445				remote-endpoint = <&ak4619_endpoint>;
446				bitclock-master;
447				frame-master;
448
449				/* see above [How to use Sound] */
450				playback = <&ssi0>;
451				capture  = <&ssi0>;
452			};
453		};
454	};
455};
456
457&rpc {
458	pinctrl-0 = <&qspi0_pins>;
459	pinctrl-names = "default";
460
461	status = "okay";
462
463	flash@0 {
464		compatible = "spansion,s25fs512s", "jedec,spi-nor";
465		reg = <0>;
466		spi-max-frequency = <40000000>;
467		spi-rx-bus-width = <4>;
468
469		partitions {
470			compatible = "fixed-partitions";
471			#address-cells = <1>;
472			#size-cells = <1>;
473
474			boot@0 {
475				reg = <0x0 0x1200000>;
476				read-only;
477			};
478			user@1200000 {
479				reg = <0x1200000 0x2e00000>;
480			};
481		};
482	};
483};
484
485&rwdt {
486	timeout-sec = <60>;
487	status = "okay";
488};
489
490&scif_clk {
491	clock-frequency = <24000000>;
492};
493
494&scif_clk2 {
495	clock-frequency = <24000000>;
496};
497