1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Device Tree Source for the Wheat board
4 *
5 * Copyright (C) 2016 Renesas Electronics Corporation
6 * Copyright (C) 2016 Cogent  Embedded, Inc.
7 */
8
9/dts-v1/;
10#include "r8a7792.dtsi"
11#include <dt-bindings/gpio/gpio.h>
12#include <dt-bindings/input/input.h>
13
14/ {
15	model = "Wheat";
16	compatible = "renesas,wheat", "renesas,r8a7792";
17
18	aliases {
19		serial0 = &scif0;
20	};
21
22	chosen {
23		bootargs = "ignore_loglevel rw root=/dev/nfs ip=on";
24		stdout-path = "serial0:115200n8";
25	};
26
27	memory@40000000 {
28		device_type = "memory";
29		reg = <0 0x40000000 0 0x40000000>;
30	};
31
32	d3_3v: regulator-3v3 {
33		compatible = "regulator-fixed";
34		regulator-name = "D3.3V";
35		regulator-min-microvolt = <3300000>;
36		regulator-max-microvolt = <3300000>;
37		regulator-boot-on;
38		regulator-always-on;
39	};
40
41	ethernet@18000000 {
42		compatible = "smsc,lan89218", "smsc,lan9115";
43		reg = <0 0x18000000 0 0x100>;
44		phy-mode = "mii";
45		interrupt-parent = <&irqc>;
46		interrupts = <0 IRQ_TYPE_EDGE_FALLING>;
47		smsc,irq-push-pull;
48		smsc,save-mac-address;
49		reg-io-width = <4>;
50		vddvario-supply = <&d3_3v>;
51		vdd33a-supply = <&d3_3v>;
52
53		pinctrl-0 = <&lan89218_pins>;
54		pinctrl-names = "default";
55	};
56
57	keyboard {
58		compatible = "gpio-keys";
59
60		key-a {
61			linux,code = <KEY_A>;
62			label = "SW2";
63			wakeup-source;
64			debounce-interval = <20>;
65			gpios = <&gpio3 20 GPIO_ACTIVE_LOW>;
66		};
67		key-b {
68			linux,code = <KEY_B>;
69			label = "SW3";
70			wakeup-source;
71			debounce-interval = <20>;
72			gpios = <&gpio11 2 GPIO_ACTIVE_LOW>;
73		};
74	};
75
76	vcc_sdhi0: regulator-vcc-sdhi0 {
77		compatible = "regulator-fixed";
78
79		regulator-name = "SDHI0 Vcc";
80		regulator-min-microvolt = <3300000>;
81		regulator-max-microvolt = <3300000>;
82
83		gpio = <&gpio11 12 GPIO_ACTIVE_HIGH>;
84		enable-active-high;
85	};
86
87	hdmi-out0 {
88		compatible = "hdmi-connector";
89		type = "a";
90
91		port {
92			hdmi_con0: endpoint {
93				remote-endpoint = <&adv7513_0_out>;
94			};
95		};
96	};
97
98	hdmi-out1 {
99		compatible = "hdmi-connector";
100		type = "a";
101
102		port {
103			hdmi_con1: endpoint {
104				remote-endpoint = <&adv7513_1_out>;
105			};
106		};
107	};
108
109	osc2_clk: osc2 {
110		compatible = "fixed-clock";
111		#clock-cells = <0>;
112		clock-frequency = <74250000>;
113	};
114};
115
116&extal_clk {
117	clock-frequency = <20000000>;
118};
119
120&pfc {
121	scif0_pins: scif0 {
122		groups = "scif0_data";
123		function = "scif0";
124	};
125
126	lan89218_pins: lan89218 {
127		intc {
128			groups = "intc_irq0";
129			function = "intc";
130		};
131		lbsc {
132			groups = "lbsc_ex_cs0";
133			function = "lbsc";
134		};
135	};
136
137	can0_pins: can0 {
138		groups = "can0_data";
139		function = "can0";
140	};
141
142	can1_pins: can1 {
143		groups = "can1_data";
144		function = "can1";
145	};
146
147	sdhi0_pins: sdhi0 {
148		groups = "sdhi0_data4", "sdhi0_ctrl";
149		function = "sdhi0";
150	};
151
152	qspi_pins: qspi {
153		groups = "qspi_ctrl", "qspi_data4";
154		function = "qspi";
155	};
156
157	du0_pins: du0 {
158		groups = "du0_rgb888", "du0_sync", "du0_disp";
159		function = "du0";
160	};
161
162	du1_pins: du1 {
163		groups = "du1_rgb666", "du1_sync", "du1_disp";
164		function = "du1";
165	};
166};
167
168&rwdt {
169	timeout-sec = <60>;
170	status = "okay";
171};
172
173&scif0 {
174	pinctrl-0 = <&scif0_pins>;
175	pinctrl-names = "default";
176
177	status = "okay";
178};
179
180&can0 {
181	pinctrl-0 = <&can0_pins>;
182	pinctrl-names = "default";
183
184	status = "okay";
185};
186
187&can1 {
188	pinctrl-0 = <&can1_pins>;
189	pinctrl-names = "default";
190
191	status = "okay";
192};
193
194&sdhi0 {
195	pinctrl-0 = <&sdhi0_pins>;
196	pinctrl-names = "default";
197
198	vmmc-supply = <&vcc_sdhi0>;
199	cd-gpios = <&gpio11 11 GPIO_ACTIVE_LOW>;
200	status = "okay";
201};
202
203&qspi {
204	pinctrl-0 = <&qspi_pins>;
205	pinctrl-names = "default";
206	status = "okay";
207
208	flash@0 {
209		compatible = "spansion,s25fl512s", "jedec,spi-nor";
210		reg = <0>;
211		spi-max-frequency = <30000000>;
212		spi-tx-bus-width = <4>;
213		spi-rx-bus-width = <4>;
214		spi-cpol;
215		spi-cpha;
216		m25p,fast-read;
217
218		partitions {
219			compatible = "fixed-partitions";
220			#address-cells = <1>;
221			#size-cells = <1>;
222
223			partition@0 {
224				label = "loader";
225				reg = <0x00000000 0x00040000>;
226				read-only;
227			};
228			partition@40000 {
229				label = "user";
230				reg = <0x00040000 0x00400000>;
231				read-only;
232			};
233			partition@440000 {
234				label = "flash";
235				reg = <0x00440000 0x03bc0000>;
236			};
237		};
238	};
239};
240
241&i2c4 {
242	status = "okay";
243	clock-frequency = <400000>;
244
245	/*
246	 * The adv75xx resets its addresses to defaults during low power mode.
247	 * Because we have two ADV7513 devices on the same bus, we must change
248	 * both of them away from the defaults so that they do not conflict.
249	 */
250	hdmi@3d {
251		compatible = "adi,adv7513";
252		reg = <0x3d>, <0x4d>, <0x2d>, <0x5d>;
253		reg-names = "main", "edid", "cec", "packet";
254
255		adi,input-depth = <8>;
256		adi,input-colorspace = "rgb";
257		adi,input-clock = "1x";
258
259		ports {
260			#address-cells = <1>;
261			#size-cells = <0>;
262
263			port@0 {
264				reg = <0>;
265				adv7513_0_in: endpoint {
266					remote-endpoint = <&du_out_rgb0>;
267				};
268			};
269
270			port@1 {
271				reg = <1>;
272				adv7513_0_out: endpoint {
273					remote-endpoint = <&hdmi_con0>;
274				};
275			};
276		};
277	};
278
279	hdmi@39 {
280		compatible = "adi,adv7513";
281		reg = <0x39>, <0x49>, <0x29>, <0x59>;
282		reg-names = "main", "edid", "cec", "packet";
283
284		adi,input-depth = <8>;
285		adi,input-colorspace = "rgb";
286		adi,input-clock = "1x";
287
288		ports {
289			#address-cells = <1>;
290			#size-cells = <0>;
291
292			port@0 {
293				reg = <0>;
294				adv7513_1_in: endpoint {
295					remote-endpoint = <&du_out_rgb1>;
296				};
297			};
298
299			port@1 {
300				reg = <1>;
301				adv7513_1_out: endpoint {
302					remote-endpoint = <&hdmi_con1>;
303				};
304			};
305		};
306	};
307};
308
309&du {
310	pinctrl-0 = <&du0_pins>, <&du1_pins>;
311	pinctrl-names = "default";
312
313	clocks = <&cpg CPG_MOD 724>, <&cpg CPG_MOD 723>, <&osc2_clk>;
314	clock-names = "du.0", "du.1", "dclkin.0";
315	status = "okay";
316
317	ports {
318		port@0 {
319			endpoint {
320				remote-endpoint = <&adv7513_0_in>;
321			};
322		};
323		port@1 {
324			endpoint {
325				remote-endpoint = <&adv7513_1_in>;
326			};
327		};
328	};
329};
330