1// SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2/*
3 * Device Tree Source for the RZ/V2M (r9a09g011) Evaluation Kit Board
4 *
5 * Copyright (C) 2022 Renesas Electronics Corp.
6 */
7
8/dts-v1/;
9#include "r9a09g011.dtsi"
10#include <dt-bindings/gpio/gpio.h>
11#include <dt-bindings/pinctrl/rzv2m-pinctrl.h>
12
13/ {
14	model = "RZ/V2M Evaluation Kit 2.0";
15	compatible = "renesas,rzv2mevk2", "renesas,r9a09g011";
16
17	aliases {
18		serial0 = &uart0;
19		ethernet0 = &avb;
20	};
21
22	chosen {
23		stdout-path = "serial0:115200n8";
24	};
25
26	connector {
27		compatible = "usb-c-connector";
28		label = "USB-C";
29		data-role = "dual";
30
31		ports {
32			#address-cells = <1>;
33			#size-cells = <0>;
34
35			port@0 {
36				reg = <0>;
37				hs_ep: endpoint {
38					remote-endpoint = <&usb3_hs_ep>;
39				};
40			};
41
42			port@1 {
43				reg = <1>;
44				ss_ep: endpoint {
45					remote-endpoint = <&hd3ss3220_in_ep>;
46				};
47			};
48		};
49	};
50
51	memory@58000000 {
52		device_type = "memory";
53		/*
54		 * first 1.25GiB is reserved for ISP Firmware,
55		 * next 128MiB is reserved for secure area.
56		 */
57		reg = <0x0 0x58000000 0x0 0x28000000>;
58	};
59
60	memory@180000000 {
61		device_type = "memory";
62		reg = <0x1 0x80000000 0x0 0x80000000>;
63	};
64
65	reg_1v8: regulator-1v8 {
66		compatible = "regulator-fixed";
67		regulator-name = "fixed-1.8V";
68		regulator-min-microvolt = <1800000>;
69		regulator-max-microvolt = <1800000>;
70		regulator-boot-on;
71		regulator-always-on;
72	};
73
74	reg_3v3: regulator-3v3 {
75		compatible = "regulator-fixed";
76		regulator-name = "fixed-3.3V";
77		regulator-min-microvolt = <3300000>;
78		regulator-max-microvolt = <3300000>;
79		regulator-boot-on;
80		regulator-always-on;
81	};
82
83	vccq_sdhi0: regulator-vccq-sdhi0 {
84		compatible = "regulator-gpio";
85
86		regulator-name = "SDHI0 VccQ";
87		regulator-min-microvolt = <1800000>;
88		regulator-max-microvolt = <3300000>;
89
90		gpios = <&pwc 0 GPIO_ACTIVE_HIGH>;
91		gpios-states = <1>;
92		states = <3300000 0>, <1800000 1>;
93	};
94};
95
96&avb {
97	renesas,no-ether-link;
98	phy-handle = <&phy0>;
99	phy-mode = "gmii";
100	status = "okay";
101
102	phy0: ethernet-phy@0 {
103		compatible = "ethernet-phy-id001c.c916",
104			     "ethernet-phy-ieee802.3-c22";
105		reg = <0>;
106	};
107};
108
109&emmc {
110	pinctrl-0 = <&emmc_pins>;
111	pinctrl-1 = <&emmc_pins>;
112	pinctrl-names = "default", "state_uhs";
113
114	vmmc-supply = <&reg_3v3>;
115	vqmmc-supply = <&reg_1v8>;
116	bus-width = <8>;
117	mmc-hs200-1_8v;
118	no-sd;
119	no-sdio;
120	non-removable;
121	fixed-emmc-driver-type = <1>;
122	max-frequency = <200000000>;
123	status = "okay";
124};
125
126&extal_clk {
127	clock-frequency = <48000000>;
128};
129
130&i2c0 {
131	pinctrl-0 = <&i2c0_pins>;
132	pinctrl-names = "default";
133	clock-frequency = <400000>;
134	status = "okay";
135
136	hd3ss3220@47 {
137		compatible = "ti,hd3ss3220";
138		reg = <0x47>;
139
140		ports {
141			#address-cells = <1>;
142			#size-cells = <0>;
143
144			port@0 {
145				reg = <0>;
146				hd3ss3220_in_ep: endpoint {
147					remote-endpoint = <&ss_ep>;
148				};
149			};
150
151			port@1 {
152				reg = <1>;
153				hd3ss3220_out_ep: endpoint {
154					remote-endpoint = <&usb3_role_switch>;
155				};
156			};
157		};
158	};
159};
160
161&i2c2 {
162	pinctrl-0 = <&i2c2_pins>;
163	pinctrl-names = "default";
164	clock-frequency = <100000>;
165	status = "okay";
166};
167
168&pinctrl {
169	emmc_pins: emmc {
170		data {
171			pinmux = <RZV2M_PORT_PINMUX(0, 0, 2)>, /* MMDAT0 */
172				 <RZV2M_PORT_PINMUX(0, 1, 2)>, /* MMDAT1 */
173				 <RZV2M_PORT_PINMUX(0, 2, 2)>, /* MMDAT2 */
174				 <RZV2M_PORT_PINMUX(0, 3, 2)>, /* MMDAT3 */
175				 <RZV2M_PORT_PINMUX(0, 4, 2)>, /* MMDAT4 */
176				 <RZV2M_PORT_PINMUX(0, 5, 2)>, /* MMDAT5 */
177				 <RZV2M_PORT_PINMUX(0, 6, 2)>, /* MMDAT6 */
178				 <RZV2M_PORT_PINMUX(0, 7, 2)>; /* MMDAT7 */
179			power-source = <1800>;
180		};
181
182		ctrl {
183			pinmux = <RZV2M_PORT_PINMUX(0, 10, 2)>, /* MMCMD */
184				 <RZV2M_PORT_PINMUX(0, 11, 2)>; /* MMCLK */
185			power-source = <1800>;
186		};
187	};
188
189	i2c0_pins: i2c0 {
190		pinmux = <RZV2M_PORT_PINMUX(5, 0, 2)>, /* SDA */
191			 <RZV2M_PORT_PINMUX(5, 1, 2)>; /* SCL */
192	};
193
194	i2c2_pins: i2c2 {
195		pinmux = <RZV2M_PORT_PINMUX(3, 8, 2)>, /* SDA */
196			 <RZV2M_PORT_PINMUX(3, 9, 2)>; /* SCL */
197	};
198
199	sdhi0_pins: sd0 {
200		data {
201			pinmux = <RZV2M_PORT_PINMUX(8, 2, 1)>, /* SD0DAT0 */
202				 <RZV2M_PORT_PINMUX(8, 3, 1)>, /* SD0DAT1 */
203				 <RZV2M_PORT_PINMUX(8, 4, 1)>, /* SD0DAT2 */
204				 <RZV2M_PORT_PINMUX(8, 5, 1)>; /* SD0DAT3 */
205			power-source = <3300>;
206		};
207
208		ctrl {
209			pinmux = <RZV2M_PORT_PINMUX(8, 0, 1)>, /* SD0CMD */
210				 <RZV2M_PORT_PINMUX(8, 1, 1)>; /* SD0CLK */
211			power-source = <3300>;
212		};
213
214		cd {
215			pinmux = <RZV2M_PORT_PINMUX(8, 7, 1)>; /* SD0CD */
216			power-source = <3300>;
217		};
218	};
219
220	sdhi0_pins_uhs: sd0-uhs {
221		data {
222			pinmux = <RZV2M_PORT_PINMUX(8, 2, 1)>, /* SD0DAT0 */
223				 <RZV2M_PORT_PINMUX(8, 3, 1)>, /* SD0DAT1 */
224				 <RZV2M_PORT_PINMUX(8, 4, 1)>, /* SD0DAT2 */
225				 <RZV2M_PORT_PINMUX(8, 5, 1)>; /* SD0DAT3 */
226			power-source = <1800>;
227		};
228
229		ctrl {
230			pinmux = <RZV2M_PORT_PINMUX(8, 0, 1)>, /* SD0CMD */
231				 <RZV2M_PORT_PINMUX(8, 1, 1)>; /* SD0CLK */
232			power-source = <1800>;
233		};
234
235		cd {
236			pinmux = <RZV2M_PORT_PINMUX(8, 7, 1)>; /* SD0CD */
237			power-source = <1800>;
238		};
239	};
240
241	uart0_pins: uart0 {
242		pinmux = <RZV2M_PORT_PINMUX(3, 0, 2)>, /* UATX0 */
243			 <RZV2M_PORT_PINMUX(3, 1, 2)>, /* UARX0 */
244			 <RZV2M_PORT_PINMUX(3, 2, 2)>, /* UACTS0N */
245			 <RZV2M_PORT_PINMUX(3, 3, 2)>; /* UARTS0N */
246	};
247};
248
249&pwc {
250	renesas,rzv2m-pwc-power;
251	status = "okay";
252};
253
254&sdhi0 {
255	pinctrl-0 = <&sdhi0_pins>;
256	pinctrl-1 = <&sdhi0_pins_uhs>;
257	pinctrl-names = "default", "state_uhs";
258
259	vmmc-supply = <&reg_3v3>;
260	vqmmc-supply = <&vccq_sdhi0>;
261	bus-width = <4>;
262	sd-uhs-sdr50;
263	sd-uhs-sdr104;
264	status = "okay";
265};
266
267&uart0 {
268	pinctrl-0 = <&uart0_pins>;
269	pinctrl-names = "default";
270
271	uart-has-rtscts;
272	status = "okay";
273};
274
275&usb3drd {
276	status = "okay";
277};
278
279&usb3host {
280	status = "okay";
281};
282
283&usb3peri {
284	companion = <&usb3host>;
285	status = "okay";
286	usb-role-switch;
287
288	ports {
289		#address-cells = <1>;
290		#size-cells = <0>;
291
292		port@0 {
293			reg = <0>;
294			usb3_hs_ep: endpoint {
295				remote-endpoint = <&hs_ep>;
296			};
297		};
298
299		port@1 {
300			reg = <1>;
301			usb3_role_switch: endpoint {
302				remote-endpoint = <&hd3ss3220_out_ep>;
303			};
304		};
305	};
306};
307
308&wdt0 {
309	status = "okay";
310};
311