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>, <1800000 0>;
113	};
114
115	wlan_en_reg: regulator-wlan_en {
116		compatible = "regulator-fixed";
117		regulator-name = "wlan-en-regulator";
118		regulator-min-microvolt = <1800000>;
119		regulator-max-microvolt = <1800000>;
120		startup-delay-us = <70000>;
121
122		gpio = <&gpio_expander 1 GPIO_ACTIVE_HIGH>;
123		enable-active-high;
124	};
125
126	x302_clk: x302-clock {
127		compatible = "fixed-clock";
128		#clock-cells = <0>;
129		clock-frequency = <33000000>;
130	};
131
132	x304_clk: x304-clock {
133		compatible = "fixed-clock";
134		#clock-cells = <0>;
135		clock-frequency = <25000000>;
136	};
137};
138
139&audio_clk_a {
140	clock-frequency = <22579200>;
141};
142
143&du {
144	status = "okay";
145};
146
147&ehci0 {
148	status = "okay";
149};
150
151&ehci1 {
152	status = "okay";
153};
154
155&extal_clk {
156	clock-frequency = <16666666>;
157};
158
159&extalr_clk {
160	clock-frequency = <32768>;
161};
162
163&gpio6 {
164	usb1-reset {
165		gpio-hog;
166		gpios = <10 GPIO_ACTIVE_LOW>;
167		output-low;
168		line-name = "usb1-reset";
169	};
170};
171
172&hdmi0 {
173	status = "okay";
174
175	ports {
176		port@1 {
177			reg = <1>;
178			rcar_dw_hdmi0_out: endpoint {
179				remote-endpoint = <&hdmi0_con>;
180			};
181		};
182		port@2 {
183			reg = <2>;
184			dw_hdmi0_snd_in: endpoint {
185				remote-endpoint = <&rsnd_endpoint>;
186			};
187		};
188	};
189};
190
191&hscif0 {
192	pinctrl-0 = <&hscif0_pins>;
193	pinctrl-names = "default";
194
195	uart-has-rtscts;
196	status = "okay";
197
198	bluetooth {
199		compatible = "ti,wl1837-st";
200		enable-gpios = <&gpio_expander 2 GPIO_ACTIVE_HIGH>;
201	};
202};
203
204&hsusb {
205	dr_mode = "otg";
206	status = "okay";
207};
208
209&i2c4 {
210	clock-frequency = <400000>;
211	status = "okay";
212
213	gpio_expander: gpio@20 {
214		compatible = "onnn,pca9654";
215		reg = <0x20>;
216		gpio-controller;
217		#gpio-cells = <2>;
218	};
219
220	versaclock5: clock-generator@6a {
221		compatible = "idt,5p49v5923";
222		reg = <0x6a>;
223		#clock-cells = <1>;
224		clocks = <&x304_clk>;
225		clock-names = "xin";
226	};
227};
228
229&ohci0 {
230	status = "okay";
231};
232
233&ohci1 {
234	status = "okay";
235};
236
237&pcie_bus_clk {
238	clock-frequency = <100000000>;
239};
240
241&pfc {
242	pinctrl-0 = <&scif_clk_pins>;
243	pinctrl-names = "default";
244
245	hscif0_pins: hscif0 {
246		groups = "hscif0_data", "hscif0_ctrl";
247		function = "hscif0";
248	};
249
250	scif2_pins: scif2 {
251		groups = "scif2_data_a";
252		function = "scif2";
253	};
254
255	scif_clk_pins: scif_clk {
256		groups = "scif_clk_a";
257		function = "scif_clk";
258	};
259
260	sdhi0_pins: sd0 {
261		groups = "sdhi0_data4", "sdhi0_ctrl";
262		function = "sdhi0";
263		power-source = <3300>;
264	};
265
266	sdhi0_pins_uhs: sd0_uhs {
267		groups = "sdhi0_data4", "sdhi0_ctrl";
268		function = "sdhi0";
269		power-source = <1800>;
270	};
271
272	sdhi2_pins: sd2 {
273		groups = "sdhi2_data4", "sdhi2_ctrl";
274		function = "sdhi2";
275		power-source = <1800>;
276	};
277
278	sdhi3_pins: sd3 {
279		groups = "sdhi3_data8", "sdhi3_ctrl", "sdhi3_ds";
280		function = "sdhi3";
281		power-source = <1800>;
282	};
283
284	sound_clk_pins: sound_clk {
285		groups = "audio_clk_a_a";
286		function = "audio_clk";
287	};
288
289	usb0_pins: usb0 {
290		groups = "usb0";
291		function = "usb0";
292	};
293
294	usb1_pins: usb1 {
295		mux {
296			groups = "usb1";
297			function = "usb1";
298		};
299
300		ovc {
301			pins = "GP_6_27";
302			bias-pull-up;
303		};
304	};
305
306	usb30_pins: usb30 {
307		groups = "usb30";
308		function = "usb30";
309	};
310};
311
312&rcar_sound {
313	pinctrl-0 = <&sound_clk_pins>;
314	pinctrl-names = "default";
315
316	status = "okay";
317
318	/* Single DAI */
319	#sound-dai-cells = <0>;
320
321	rsnd_port: port {
322		rsnd_endpoint: endpoint {
323			remote-endpoint = <&dw_hdmi0_snd_in>;
324
325			dai-format = "i2s";
326			bitclock-master = <&rsnd_endpoint>;
327			frame-master = <&rsnd_endpoint>;
328
329			playback = <&ssi2>;
330		};
331	};
332};
333
334&rwdt {
335	timeout-sec = <60>;
336	status = "okay";
337};
338
339&scif2 {
340	pinctrl-0 = <&scif2_pins>;
341	pinctrl-names = "default";
342
343	status = "okay";
344};
345
346&scif_clk {
347	clock-frequency = <14745600>;
348};
349
350&sdhi0 {
351	pinctrl-0 = <&sdhi0_pins>;
352	pinctrl-1 = <&sdhi0_pins_uhs>;
353	pinctrl-names = "default", "state_uhs";
354
355	vmmc-supply = <&reg_3p3v>;
356	vqmmc-supply = <&vccq_sdhi0>;
357	cd-gpios = <&gpio3 12 GPIO_ACTIVE_LOW>;
358	bus-width = <4>;
359	sd-uhs-sdr50;
360	sd-uhs-sdr104;
361	status = "okay";
362};
363
364&sdhi2 {
365	status = "okay";
366	pinctrl-0 = <&sdhi2_pins>;
367	pinctrl-names = "default";
368
369	vmmc-supply = <&wlan_en_reg>;
370	bus-width = <4>;
371	non-removable;
372	cap-power-off-card;
373	keep-power-in-suspend;
374
375	#address-cells = <1>;
376	#size-cells = <0>;
377	wlcore: wlcore@2 {
378		compatible = "ti,wl1837";
379		reg = <2>;
380		interrupt-parent = <&gpio2>;
381		interrupts = <5 IRQ_TYPE_LEVEL_HIGH>;
382	};
383};
384
385&sdhi3 {
386	pinctrl-0 = <&sdhi3_pins>;
387	pinctrl-1 = <&sdhi3_pins>;
388	pinctrl-names = "default", "state_uhs";
389
390	vmmc-supply = <&reg_3p3v>;
391	vqmmc-supply = <&reg_1p8v>;
392	bus-width = <8>;
393	mmc-hs200-1_8v;
394	non-removable;
395	fixed-emmc-driver-type = <1>;
396	status = "okay";
397};
398
399&usb_extal_clk {
400	clock-frequency = <50000000>;
401};
402
403&usb2_phy0 {
404	pinctrl-0 = <&usb0_pins>;
405	pinctrl-names = "default";
406
407	vbus-supply = <&vbus0_usb2>;
408	status = "okay";
409};
410
411&usb2_phy1 {
412	pinctrl-0 = <&usb1_pins>;
413	pinctrl-names = "default";
414
415	status = "okay";
416};
417
418&usb3_peri0 {
419	phys = <&usb3_phy0>;
420	phy-names = "usb";
421
422	companion = <&xhci0>;
423
424	status = "okay";
425};
426
427&usb3_phy0 {
428	status = "okay";
429};
430
431&usb3s0_clk {
432	clock-frequency = <100000000>;
433};
434
435&xhci0 {
436	pinctrl-0 = <&usb30_pins>;
437	pinctrl-names = "default";
438
439	status = "okay";
440};
441