xref: /linux/arch/arm64/boot/dts/renesas/rzg3s-smarc.dtsi (revision 6589b3d76db2d6adbf8f2084c303fb24252a0dc6)
1// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2/*
3 * Device Tree Source for the RZ SMARC Carrier-II Board.
4 *
5 * Copyright (C) 2023 Renesas Electronics Corp.
6 */
7
8#include <dt-bindings/gpio/gpio.h>
9#include <dt-bindings/input/input.h>
10#include <dt-bindings/pinctrl/rzg2l-pinctrl.h>
11
12/ {
13	aliases {
14		i2c0 = &i2c0;
15		serial0 = &scif1;
16		serial1 = &scif3;
17		serial3 = &scif0;
18		mmc1 = &sdhi1;
19	};
20
21	chosen {
22		bootargs = "ignore_loglevel";
23		stdout-path = "serial3:115200n8";
24	};
25
26	keys {
27		compatible = "gpio-keys";
28
29		key-1 {
30			interrupts-extended = <&pinctrl RZG2L_GPIO(18, 0) IRQ_TYPE_EDGE_FALLING>;
31			linux,code = <KEY_1>;
32			label = "USER_SW1";
33			wakeup-source;
34			debounce-interval = <20>;
35		};
36
37		key-2 {
38			interrupts-extended = <&pinctrl RZG2L_GPIO(0, 1) IRQ_TYPE_EDGE_FALLING>;
39			linux,code = <KEY_2>;
40			label = "USER_SW2";
41			wakeup-source;
42			debounce-interval = <20>;
43		};
44
45		key-3 {
46			interrupts-extended = <&pinctrl RZG2L_GPIO(0, 3) IRQ_TYPE_EDGE_FALLING>;
47			linux,code = <KEY_3>;
48			label = "USER_SW3";
49			wakeup-source;
50			debounce-interval = <20>;
51		};
52	};
53
54	snd_rzg3s: sound {
55		compatible = "simple-audio-card";
56		simple-audio-card,format = "i2s";
57		simple-audio-card,bitclock-master = <&cpu_dai>;
58		simple-audio-card,frame-master = <&cpu_dai>;
59		simple-audio-card,mclk-fs = <256>;
60
61		cpu_dai: simple-audio-card,cpu {
62			sound-dai = <&ssi3>;
63		};
64
65		codec_dai: simple-audio-card,codec {
66			sound-dai = <&da7212>;
67			clocks = <&versa3 1>;
68		};
69	};
70
71	vcc_sdhi1: regulator-vcc-sdhi1 {
72		compatible = "regulator-fixed";
73		regulator-name = "SDHI1 Vcc";
74		regulator-min-microvolt = <3300000>;
75		regulator-max-microvolt = <3300000>;
76		gpios = <&pinctrl RZG2L_GPIO(2, 3) GPIO_ACTIVE_HIGH>;
77		enable-active-high;
78	};
79
80	vccq_sdhi1: regulator-vccq-sdhi1 {
81		compatible = "regulator-gpio";
82		regulator-name = "SDHI1 VccQ";
83		regulator-min-microvolt = <1800000>;
84		regulator-max-microvolt = <3300000>;
85		gpios = <&pinctrl RZG2L_GPIO(4, 2) GPIO_ACTIVE_HIGH>;
86		gpios-states = <1>;
87		states = <3300000 1>, <1800000 0>;
88	};
89};
90
91&audio_clk2 {
92	clock-frequency = <12288000>;
93};
94
95&ehci0 {
96	dr_mode = "otg";
97	status = "okay";
98};
99
100&ehci1 {
101	status = "okay";
102};
103
104&hsusb {
105	dr_mode = "otg";
106	status = "okay";
107};
108
109&i2c0 {
110	status = "okay";
111
112	clock-frequency = <1000000>;
113
114	da7212: codec@1a {
115		compatible = "dlg,da7212";
116		reg = <0x1a>;
117
118		clocks = <&versa3 1>;
119		clock-names = "mclk";
120
121		#sound-dai-cells = <0>;
122
123		dlg,micbias1-lvl = <2500>;
124		dlg,micbias2-lvl = <2500>;
125		dlg,dmic-data-sel = "lrise_rfall";
126		dlg,dmic-samplephase = "between_clkedge";
127		dlg,dmic-clkrate = <3000000>;
128
129		VDDA-supply = <&reg_1p8v>;
130		VDDSP-supply = <&reg_3p3v>;
131		VDDMIC-supply = <&reg_3p3v>;
132		VDDIO-supply = <&reg_1p8v>;
133	};
134};
135
136&i2c1 {
137	status = "okay";
138
139	clock-frequency = <400000>;
140
141	power-monitor@44 {
142		compatible = "renesas,isl28022";
143		reg = <0x44>;
144		shunt-resistor-micro-ohms = <8000>;
145		renesas,average-samples = <32>;
146	};
147};
148
149&ohci0 {
150	dr_mode = "otg";
151	status = "okay";
152};
153
154&ohci1 {
155	status = "okay";
156};
157
158&pcie {
159	pinctrl-0 = <&pcie_pins>;
160	pinctrl-names = "default";
161	status = "okay";
162};
163
164&phyrst {
165	status = "okay";
166};
167
168&pinctrl {
169	audio_clock_pins: audio-clock {
170		pins = "AUDIO_CLK1", "AUDIO_CLK2";
171		input-enable;
172	};
173
174	key-1-gpio-hog {
175		gpio-hog;
176		gpios = <RZG2L_GPIO(18, 0) GPIO_ACTIVE_LOW>;
177		input;
178		line-name = "key-1-gpio-irq";
179	};
180
181	key-2-gpio-hog {
182		gpio-hog;
183		gpios = <RZG2L_GPIO(0, 1) GPIO_ACTIVE_LOW>;
184		input;
185		line-name = "key-2-gpio-irq";
186	};
187
188	key-3-gpio-hog {
189		gpio-hog;
190		gpios = <RZG2L_GPIO(0, 3) GPIO_ACTIVE_LOW>;
191		input;
192		line-name = "key-3-gpio-irq";
193	};
194
195	pcie_pins: pcie {
196		pinmux = <RZG2L_PORT_PINMUX(13, 2, 2)>, /* PCIE_RST_OUT_B */
197			 <RZG2L_PORT_PINMUX(13, 3, 2)>; /* PCIE_CLKREQ_B */
198	};
199
200	scif0_pins: scif0 {
201		pinmux = <RZG2L_PORT_PINMUX(6, 3, 1)>, /* RXD */
202			 <RZG2L_PORT_PINMUX(6, 4, 1)>; /* TXD */
203	};
204
205	scif3_pins: scif3 {
206		pinmux = <RZG2L_PORT_PINMUX(17, 2, 7)>, /* RXD */
207			 <RZG2L_PORT_PINMUX(17, 3, 7)>; /* TXD */
208	};
209
210	sdhi1_pins: sd1 {
211		data {
212			pins = "SD1_DATA0", "SD1_DATA1", "SD1_DATA2", "SD1_DATA3";
213			power-source = <3300>;
214		};
215
216		ctrl {
217			pins = "SD1_CLK", "SD1_CMD";
218			power-source = <3300>;
219		};
220
221		cd {
222			pinmux = <RZG2L_PORT_PINMUX(0, 2, 1)>; /* SD1_CD */
223		};
224	};
225
226	sdhi1_pins_uhs: sd1-uhs {
227		data {
228			pins = "SD1_DATA0", "SD1_DATA1", "SD1_DATA2", "SD1_DATA3";
229			power-source = <1800>;
230		};
231
232		ctrl {
233			pins = "SD1_CLK", "SD1_CMD";
234			power-source = <1800>;
235		};
236
237		cd {
238			pinmux = <RZG2L_PORT_PINMUX(0, 2, 1)>; /* SD1_CD */
239		};
240	};
241
242	ssi3_pins: ssi3 {
243		pinmux = <RZG2L_PORT_PINMUX(18, 2, 8)>, /* BCK */
244			 <RZG2L_PORT_PINMUX(18, 3, 8)>, /* RCK */
245			 <RZG2L_PORT_PINMUX(18, 4, 8)>, /* TXD */
246			 <RZG2L_PORT_PINMUX(18, 5, 8)>; /* RXD */
247	};
248
249	usb0_pins: usb0 {
250		peri {
251			pinmux = <RZG2L_PORT_PINMUX(5, 0, 1)>, /* VBUS */
252				 <RZG2L_PORT_PINMUX(5, 2, 1)>; /* OVC */
253		};
254
255		otg {
256			pinmux = <RZG2L_PORT_PINMUX(5, 3, 1)>; /* OTG_ID */
257			bias-pull-up;
258		};
259	};
260
261	usb1_pins: usb1 {
262		pinmux = <RZG2L_PORT_PINMUX(5, 4, 5)>, /* OVC */
263			 <RZG2L_PORT_PINMUX(6, 0, 1)>; /* VBUS */
264	};
265};
266
267&scif0 {
268	pinctrl-names = "default";
269	pinctrl-0 = <&scif0_pins>;
270	status = "okay";
271};
272
273&scif3 {
274	pinctrl-names = "default";
275	pinctrl-0 = <&scif3_pins>;
276	status = "okay";
277};
278
279&sdhi1 {
280	pinctrl-0 = <&sdhi1_pins>;
281	pinctrl-1 = <&sdhi1_pins_uhs>;
282	pinctrl-names = "default", "state_uhs";
283	vmmc-supply = <&vcc_sdhi1>;
284	vqmmc-supply = <&vccq_sdhi1>;
285	bus-width = <4>;
286	sd-uhs-sdr50;
287	sd-uhs-sdr104;
288	max-frequency = <125000000>;
289	status = "okay";
290};
291
292&ssi3 {
293	clocks = <&cpg CPG_MOD R9A08G045_SSI3_PCLK2>,
294		 <&cpg CPG_MOD R9A08G045_SSI3_PCLK_SFR>,
295		 <&versa3 2>, <&audio_clk2>;
296	pinctrl-names = "default";
297	pinctrl-0 = <&ssi3_pins>, <&audio_clock_pins>;
298	status = "okay";
299};
300
301&usb2_phy0 {
302	pinctrl-0 = <&usb0_pins>;
303	pinctrl-names = "default";
304	vbus-supply = <&usb0_vbus_otg>;
305	status = "okay";
306};
307
308&usb2_phy1 {
309	pinctrl-0 = <&usb1_pins>;
310	pinctrl-names = "default";
311	status = "okay";
312};
313