1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Device Tree Source for the Silicon Linux RZ/G2E 96board platform (CAT874)
4 *
5 * Copyright (C) 2019 Renesas Electronics Corp.
6 */
7
8/dts-v1/;
9#include "r8a774c0.dtsi"
10#include <dt-bindings/gpio/gpio.h>
11#include <dt-bindings/display/tda998x.h>
12
13/ {
14	model = "Silicon Linux RZ/G2E 96board platform (CAT874)";
15	compatible = "si-linux,cat874", "renesas,r8a774c0";
16
17	aliases {
18		serial0 = &scif2;
19		serial1 = &hscif2;
20	};
21
22	chosen {
23		bootargs = "ignore_loglevel rw root=/dev/nfs ip=on";
24		stdout-path = "serial0:115200n8";
25	};
26
27	hdmi-out {
28		compatible = "hdmi-connector";
29		type = "a";
30
31		port {
32			hdmi_con_out: endpoint {
33				remote-endpoint = <&tda19988_out>;
34			};
35		};
36	};
37
38	leds {
39		compatible = "gpio-leds";
40
41		led0 {
42			gpios = <&gpio5 19 GPIO_ACTIVE_HIGH>;
43			label = "LED0";
44		};
45
46		led1 {
47			gpios = <&gpio3 14 GPIO_ACTIVE_HIGH>;
48			label = "LED1";
49		};
50
51		led2 {
52			gpios = <&gpio4 10 GPIO_ACTIVE_HIGH>;
53			label = "LED2";
54		};
55
56		led3 {
57			gpios = <&gpio6 4 GPIO_ACTIVE_HIGH>;
58			label = "LED3";
59		};
60	};
61
62	memory@48000000 {
63		device_type = "memory";
64		/* first 128MB is reserved for secure area. */
65		reg = <0x0 0x48000000 0x0 0x78000000>;
66	};
67
68	reg_12p0v: regulator-12p0v {
69		compatible = "regulator-fixed";
70		regulator-name = "D12.0V";
71		regulator-min-microvolt = <12000000>;
72		regulator-max-microvolt = <12000000>;
73		regulator-boot-on;
74		regulator-always-on;
75	};
76
77	sound: sound {
78		compatible = "simple-audio-card";
79
80		simple-audio-card,name = "CAT874 HDMI sound";
81		simple-audio-card,format = "i2s";
82		simple-audio-card,bitclock-master = <&sndcpu>;
83		simple-audio-card,frame-master = <&sndcpu>;
84
85		sndcodec: simple-audio-card,codec {
86			sound-dai = <&tda19988>;
87		};
88
89		sndcpu: simple-audio-card,cpu {
90			sound-dai = <&rcar_sound>;
91		};
92	};
93
94	vcc_sdhi0: regulator-vcc-sdhi0 {
95		compatible = "regulator-fixed";
96
97		regulator-name = "SDHI0 Vcc";
98		regulator-min-microvolt = <3300000>;
99		regulator-max-microvolt = <3300000>;
100		regulator-always-on;
101		regulator-boot-on;
102	};
103
104	vccq_sdhi0: regulator-vccq-sdhi0 {
105		compatible = "regulator-gpio";
106
107		regulator-name = "SDHI0 VccQ";
108		regulator-min-microvolt = <1800000>;
109		regulator-max-microvolt = <3300000>;
110
111		gpios = <&gpio3 13 GPIO_ACTIVE_HIGH>;
112		gpios-states = <1>;
113		states = <3300000 1>, <1800000 0>;
114	};
115
116	wlan_en_reg: fixedregulator {
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 = <&gpio2 25 GPIO_ACTIVE_HIGH>;
124		enable-active-high;
125	};
126
127	x13_clk: x13 {
128		compatible = "fixed-clock";
129		#clock-cells = <0>;
130		clock-frequency = <74250000>;
131	};
132};
133
134&audio_clk_a {
135	clock-frequency = <22579200>;
136};
137
138&du {
139	pinctrl-0 = <&du_pins>;
140	pinctrl-names = "default";
141	status = "okay";
142
143	clocks = <&cpg CPG_MOD 724>,
144		 <&cpg CPG_MOD 723>,
145		 <&x13_clk>;
146	clock-names = "du.0", "du.1", "dclkin.0";
147
148	ports {
149		port@0 {
150			endpoint {
151				remote-endpoint = <&tda19988_in>;
152			};
153		};
154	};
155};
156
157&ehci0 {
158	dr_mode = "host";
159	status = "okay";
160};
161
162&extal_clk {
163	clock-frequency = <48000000>;
164};
165
166&hscif2 {
167	pinctrl-0 = <&hscif2_pins>;
168	pinctrl-names = "default";
169
170	uart-has-rtscts;
171	status = "okay";
172
173	bluetooth {
174		compatible = "ti,wl1837-st";
175		enable-gpios = <&gpio4 6 GPIO_ACTIVE_HIGH>;
176	};
177};
178
179&i2c0 {
180	status = "okay";
181	clock-frequency = <100000>;
182
183	hd3ss3220@47 {
184		compatible = "ti,hd3ss3220";
185		reg = <0x47>;
186		interrupt-parent = <&gpio6>;
187		interrupts = <3 IRQ_TYPE_LEVEL_LOW>;
188
189		connector {
190			compatible = "usb-c-connector";
191			label = "USB-C";
192			data-role = "dual";
193
194			ports {
195				#address-cells = <1>;
196				#size-cells = <0>;
197
198				port@1 {
199					reg = <1>;
200					hd3ss3220_ep: endpoint {
201						remote-endpoint = <&usb3_role_switch>;
202					};
203				};
204			};
205		};
206	};
207
208	tda19988: tda19988@70 {
209		compatible = "nxp,tda998x";
210		reg = <0x70>;
211		interrupt-parent = <&gpio1>;
212		interrupts = <1 IRQ_TYPE_LEVEL_LOW>;
213
214		video-ports = <0x234501>;
215
216		#sound-dai-cells = <0>;
217		audio-ports = <TDA998x_I2S 0x03>;
218		clocks = <&rcar_sound 1>;
219
220		ports {
221			#address-cells = <1>;
222			#size-cells = <0>;
223
224			port@0 {
225				reg = <0>;
226				tda19988_in: endpoint {
227					remote-endpoint = <&du_out_rgb>;
228				};
229			};
230
231			port@1 {
232				reg = <1>;
233				tda19988_out: endpoint {
234					remote-endpoint = <&hdmi_con_out>;
235				};
236			};
237		};
238	};
239};
240
241&i2c1 {
242	pinctrl-0 = <&i2c1_pins>;
243	pinctrl-names = "default";
244
245	status = "okay";
246	clock-frequency = <400000>;
247
248	rtc@32 {
249		compatible = "epson,rx8571";
250		reg = <0x32>;
251	};
252};
253
254&lvds0 {
255	status = "okay";
256
257	clocks = <&cpg CPG_MOD 727>, <&x13_clk>, <&extal_clk>;
258	clock-names = "fck", "dclkin.0", "extal";
259};
260
261&ohci0 {
262	dr_mode = "host";
263	status = "okay";
264};
265
266&pcie_bus_clk {
267	clock-frequency = <100000000>;
268};
269
270&pciec0 {
271	/* Map all possible DDR as inbound ranges */
272	dma-ranges = <0x42000000 0 0x40000000 0 0x40000000 0 0x80000000>;
273};
274
275&pfc {
276	du_pins: du {
277		groups = "du_rgb888", "du_clk_out_0", "du_sync", "du_disp",
278			 "du_clk_in_0";
279		function = "du";
280	};
281
282	hscif2_pins: hscif2 {
283		groups = "hscif2_data_a", "hscif2_ctrl_a";
284		function = "hscif2";
285	};
286
287	i2c1_pins: i2c1 {
288		groups = "i2c1_b";
289		function = "i2c1";
290	};
291
292	scif2_pins: scif2 {
293		groups = "scif2_data_a";
294		function = "scif2";
295	};
296
297	sdhi0_pins: sd0 {
298		groups = "sdhi0_data4", "sdhi0_ctrl";
299		function = "sdhi0";
300		power-source = <3300>;
301	};
302
303	sdhi0_pins_uhs: sd0_uhs {
304		groups = "sdhi0_data4", "sdhi0_ctrl";
305		function = "sdhi0";
306		power-source = <1800>;
307	};
308
309	sdhi3_pins: sd3 {
310		groups = "sdhi3_data4", "sdhi3_ctrl";
311		function = "sdhi3";
312		power-source = <1800>;
313	};
314
315	sound_clk_pins: sound_clk {
316		groups = "audio_clkout1_a";
317		function = "audio_clk";
318	};
319
320	sound_pins: sound {
321		groups = "ssi01239_ctrl", "ssi0_data";
322		function = "ssi";
323	};
324
325	usb30_pins: usb30 {
326		groups = "usb30", "usb30_id";
327		function = "usb30";
328	};
329};
330
331&rcar_sound {
332	pinctrl-0 = <&sound_pins &sound_clk_pins>;
333	pinctrl-names = "default";
334
335	/* Single DAI */
336	#sound-dai-cells = <0>;
337
338	/* audio_clkout0/1/2/3 */
339	#clock-cells = <1>;
340	clock-frequency = <11289600>;
341
342	status = "okay";
343
344	rcar_sound,dai {
345		dai0 {
346			playback = <&ssi0 &src0 &dvc0>;
347		};
348	};
349};
350
351&rwdt {
352	timeout-sec = <60>;
353	status = "okay";
354};
355
356&scif2 {
357	pinctrl-0 = <&scif2_pins>;
358	pinctrl-names = "default";
359
360	status = "okay";
361};
362
363&sdhi0 {
364	pinctrl-0 = <&sdhi0_pins>;
365	pinctrl-1 = <&sdhi0_pins_uhs>;
366	pinctrl-names = "default", "state_uhs";
367
368	vmmc-supply = <&vcc_sdhi0>;
369	vqmmc-supply = <&vccq_sdhi0>;
370	cd-gpios = <&gpio3 12 GPIO_ACTIVE_LOW>;
371	bus-width = <4>;
372	sd-uhs-sdr50;
373	sd-uhs-sdr104;
374	status = "okay";
375};
376
377&sdhi3 {
378	status = "okay";
379	pinctrl-0 = <&sdhi3_pins>;
380	pinctrl-names = "default";
381
382	vmmc-supply = <&wlan_en_reg>;
383	bus-width = <4>;
384	non-removable;
385	cap-power-off-card;
386	keep-power-in-suspend;
387
388	#address-cells = <1>;
389	#size-cells = <0>;
390	wlcore: wlcore@2 {
391		compatible = "ti,wl1837";
392		reg = <2>;
393		interrupt-parent = <&gpio1>;
394		interrupts = <0 IRQ_TYPE_LEVEL_HIGH>;
395	};
396};
397
398&usb2_phy0 {
399	renesas,no-otg-pins;
400	status = "okay";
401};
402
403&usb3_peri0 {
404	companion = <&xhci0>;
405	status = "okay";
406	usb-role-switch;
407
408	port {
409		usb3_role_switch: endpoint {
410			remote-endpoint = <&hd3ss3220_ep>;
411		};
412	};
413};
414
415&xhci0 {
416	pinctrl-0 = <&usb30_pins>;
417	pinctrl-names = "default";
418
419	status = "okay";
420};
421