1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Device Tree Source for the HiHope RZ/G2[MN] main board common parts
4 *
5 * Copyright (C) 2019 Renesas Electronics Corp.
6 */
7
8#include <dt-bindings/gpio/gpio.h>
9
10/ {
11	aliases {
12		serial0 = &scif2;
13		serial1 = &hscif0;
14	};
15
16	chosen {
17		bootargs = "ignore_loglevel";
18		stdout-path = "serial0:115200n8";
19	};
20
21	hdmi0-out {
22		compatible = "hdmi-connector";
23		type = "a";
24
25		port {
26			hdmi0_con: endpoint {
27				remote-endpoint = <&rcar_dw_hdmi0_out>;
28			};
29		};
30	};
31
32	leds {
33		compatible = "gpio-leds";
34
35		bt_active_led {
36			label = "blue:bt";
37			gpios = <&gpio7  0 GPIO_ACTIVE_HIGH>;
38			linux,default-trigger = "hci0-power";
39			default-state = "off";
40		};
41
42		led0 {
43			gpios = <&gpio6 11 GPIO_ACTIVE_HIGH>;
44		};
45
46		led1 {
47			gpios = <&gpio6 12 GPIO_ACTIVE_HIGH>;
48		};
49
50		led2 {
51			gpios = <&gpio6 13 GPIO_ACTIVE_HIGH>;
52		};
53
54		led3 {
55			gpios = <&gpio0  0 GPIO_ACTIVE_HIGH>;
56		};
57
58		wlan_active_led {
59			label = "yellow:wlan";
60			gpios = <&gpio7  1 GPIO_ACTIVE_HIGH>;
61			linux,default-trigger = "phy0tx";
62			default-state = "off";
63		};
64	};
65
66	reg_1p8v: regulator0 {
67		compatible = "regulator-fixed";
68		regulator-name = "fixed-1.8V";
69		regulator-min-microvolt = <1800000>;
70		regulator-max-microvolt = <1800000>;
71		regulator-boot-on;
72		regulator-always-on;
73	};
74
75	reg_3p3v: regulator1 {
76		compatible = "regulator-fixed";
77		regulator-name = "fixed-3.3V";
78		regulator-min-microvolt = <3300000>;
79		regulator-max-microvolt = <3300000>;
80		regulator-boot-on;
81		regulator-always-on;
82	};
83
84	sound_card: sound {
85		compatible = "audio-graph-card";
86
87		label = "rcar-sound";
88
89		dais = <&rsnd_port>;
90	};
91
92	vbus0_usb2: regulator-vbus0-usb2 {
93		compatible = "regulator-fixed";
94
95		regulator-name = "USB20_VBUS0";
96		regulator-min-microvolt = <5000000>;
97		regulator-max-microvolt = <5000000>;
98
99		gpio = <&gpio6 16 GPIO_ACTIVE_HIGH>;
100		enable-active-high;
101	};
102
103	vccq_sdhi0: regulator-vccq-sdhi0 {
104		compatible = "regulator-gpio";
105
106		regulator-name = "SDHI0 VccQ";
107		regulator-min-microvolt = <1800000>;
108		regulator-max-microvolt = <3300000>;
109
110		gpios = <&gpio6 30 GPIO_ACTIVE_HIGH>;
111		gpios-states = <1>;
112		states = <3300000 1
113			  1800000 0>;
114	};
115
116	wlan_en_reg: regulator-wlan_en {
117		compatible = "regulator-fixed";
118		regulator-name = "wlan-en-regulator";
119		regulator-min-microvolt = <1800000>;
120		regulator-max-microvolt = <1800000>;
121		startup-delay-us = <70000>;
122
123		gpio = <&gpio_expander 1 GPIO_ACTIVE_HIGH>;
124		enable-active-high;
125	};
126
127	x302_clk: x302-clock {
128		compatible = "fixed-clock";
129		#clock-cells = <0>;
130		clock-frequency = <33000000>;
131	};
132
133	x304_clk: x304-clock {
134		compatible = "fixed-clock";
135		#clock-cells = <0>;
136		clock-frequency = <25000000>;
137	};
138};
139
140&audio_clk_a {
141	clock-frequency = <22579200>;
142};
143
144&du {
145	status = "okay";
146};
147
148&ehci0 {
149	status = "okay";
150};
151
152&ehci1 {
153	status = "okay";
154};
155
156&extal_clk {
157	clock-frequency = <16666666>;
158};
159
160&extalr_clk {
161	clock-frequency = <32768>;
162};
163
164&gpio6 {
165	usb1-reset {
166		gpio-hog;
167		gpios = <10 GPIO_ACTIVE_LOW>;
168		output-low;
169		line-name = "usb1-reset";
170	};
171};
172
173&hdmi0 {
174	status = "okay";
175
176	ports {
177		port@1 {
178			reg = <1>;
179			rcar_dw_hdmi0_out: endpoint {
180				remote-endpoint = <&hdmi0_con>;
181			};
182		};
183		port@2 {
184			reg = <2>;
185			dw_hdmi0_snd_in: endpoint {
186				remote-endpoint = <&rsnd_endpoint>;
187			};
188		};
189	};
190};
191
192&hscif0 {
193	pinctrl-0 = <&hscif0_pins>;
194	pinctrl-names = "default";
195
196	uart-has-rtscts;
197	status = "okay";
198
199	bluetooth {
200		compatible = "ti,wl1837-st";
201		enable-gpios = <&gpio_expander 2 GPIO_ACTIVE_HIGH>;
202	};
203};
204
205&hsusb {
206	dr_mode = "otg";
207	status = "okay";
208};
209
210&i2c4 {
211	clock-frequency = <400000>;
212	status = "okay";
213
214	gpio_expander: gpio@20 {
215		compatible = "onnn,pca9654";
216		reg = <0x20>;
217		gpio-controller;
218		#gpio-cells = <2>;
219	};
220
221	versaclock5: clock-generator@6a {
222		compatible = "idt,5p49v5923";
223		reg = <0x6a>;
224		#clock-cells = <1>;
225		clocks = <&x304_clk>;
226		clock-names = "xin";
227	};
228};
229
230&ohci0 {
231	status = "okay";
232};
233
234&ohci1 {
235	status = "okay";
236};
237
238&pcie_bus_clk {
239	clock-frequency = <100000000>;
240};
241
242&pfc {
243	pinctrl-0 = <&scif_clk_pins>;
244	pinctrl-names = "default";
245
246	hscif0_pins: hscif0 {
247		groups = "hscif0_data", "hscif0_ctrl";
248		function = "hscif0";
249	};
250
251	scif2_pins: scif2 {
252		groups = "scif2_data_a";
253		function = "scif2";
254	};
255
256	scif_clk_pins: scif_clk {
257		groups = "scif_clk_a";
258		function = "scif_clk";
259	};
260
261	sdhi0_pins: sd0 {
262		groups = "sdhi0_data4", "sdhi0_ctrl";
263		function = "sdhi0";
264		power-source = <3300>;
265	};
266
267	sdhi0_pins_uhs: sd0_uhs {
268		groups = "sdhi0_data4", "sdhi0_ctrl";
269		function = "sdhi0";
270		power-source = <1800>;
271	};
272
273	sdhi2_pins: sd2 {
274		groups = "sdhi2_data4", "sdhi2_ctrl";
275		function = "sdhi2";
276		power-source = <1800>;
277	};
278
279	sdhi3_pins: sd3 {
280		groups = "sdhi3_data8", "sdhi3_ctrl", "sdhi3_ds";
281		function = "sdhi3";
282		power-source = <1800>;
283	};
284
285	sound_clk_pins: sound_clk {
286		groups = "audio_clk_a_a";
287		function = "audio_clk";
288	};
289
290	usb0_pins: usb0 {
291		groups = "usb0";
292		function = "usb0";
293	};
294
295	usb1_pins: usb1 {
296		mux {
297			groups = "usb1";
298			function = "usb1";
299		};
300
301		ovc {
302			pins = "GP_6_27";
303			bias-pull-up;
304		};
305	};
306
307	usb30_pins: usb30 {
308		groups = "usb30";
309		function = "usb30";
310	};
311};
312
313&rcar_sound {
314	pinctrl-0 = <&sound_clk_pins>;
315	pinctrl-names = "default";
316
317	status = "okay";
318
319	/* Single DAI */
320	#sound-dai-cells = <0>;
321
322	rsnd_port: port {
323		rsnd_endpoint: endpoint {
324			remote-endpoint = <&dw_hdmi0_snd_in>;
325
326			dai-format = "i2s";
327			bitclock-master = <&rsnd_endpoint>;
328			frame-master = <&rsnd_endpoint>;
329
330			playback = <&ssi2>;
331		};
332	};
333};
334
335&rwdt {
336	timeout-sec = <60>;
337	status = "okay";
338};
339
340&scif2 {
341	pinctrl-0 = <&scif2_pins>;
342	pinctrl-names = "default";
343
344	status = "okay";
345};
346
347&scif_clk {
348	clock-frequency = <14745600>;
349};
350
351&sdhi0 {
352	pinctrl-0 = <&sdhi0_pins>;
353	pinctrl-1 = <&sdhi0_pins_uhs>;
354	pinctrl-names = "default", "state_uhs";
355
356	vmmc-supply = <&reg_3p3v>;
357	vqmmc-supply = <&vccq_sdhi0>;
358	cd-gpios = <&gpio3 12 GPIO_ACTIVE_LOW>;
359	bus-width = <4>;
360	sd-uhs-sdr50;
361	sd-uhs-sdr104;
362	status = "okay";
363};
364
365&sdhi2 {
366	status = "okay";
367	pinctrl-0 = <&sdhi2_pins>;
368	pinctrl-names = "default";
369
370	vmmc-supply = <&wlan_en_reg>;
371	bus-width = <4>;
372	non-removable;
373	cap-power-off-card;
374	keep-power-in-suspend;
375
376	#address-cells = <1>;
377	#size-cells = <0>;
378	wlcore: wlcore@2 {
379		compatible = "ti,wl1837";
380		reg = <2>;
381		interrupt-parent = <&gpio2>;
382		interrupts = <5 IRQ_TYPE_LEVEL_HIGH>;
383	};
384};
385
386&sdhi3 {
387	pinctrl-0 = <&sdhi3_pins>;
388	pinctrl-1 = <&sdhi3_pins>;
389	pinctrl-names = "default", "state_uhs";
390
391	vmmc-supply = <&reg_3p3v>;
392	vqmmc-supply = <&reg_1p8v>;
393	bus-width = <8>;
394	mmc-hs200-1_8v;
395	non-removable;
396	fixed-emmc-driver-type = <1>;
397	status = "okay";
398};
399
400&usb_extal_clk {
401	clock-frequency = <50000000>;
402};
403
404&usb2_phy0 {
405	pinctrl-0 = <&usb0_pins>;
406	pinctrl-names = "default";
407
408	vbus-supply = <&vbus0_usb2>;
409	status = "okay";
410};
411
412&usb2_phy1 {
413	pinctrl-0 = <&usb1_pins>;
414	pinctrl-names = "default";
415
416	status = "okay";
417};
418
419&usb3_peri0 {
420	phys = <&usb3_phy0>;
421	phy-names = "usb";
422
423	companion = <&xhci0>;
424
425	status = "okay";
426};
427
428&usb3_phy0 {
429	status = "okay";
430};
431
432&usb3s0_clk {
433	clock-frequency = <100000000>;
434};
435
436&xhci0 {
437	pinctrl-0 = <&usb30_pins>;
438	pinctrl-names = "default";
439
440	status = "okay";
441};
442