1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Device Tree Source for the R-Car H1 (R8A77790) Marzen board
4 *
5 * Copyright (C) 2013 Renesas Solutions Corp.
6 * Copyright (C) 2013 Simon Horman
7 */
8
9/dts-v1/;
10#include "r8a7779.dtsi"
11#include <dt-bindings/gpio/gpio.h>
12#include <dt-bindings/input/input.h>
13#include <dt-bindings/interrupt-controller/irq.h>
14
15/ {
16	model = "marzen";
17	compatible = "renesas,marzen", "renesas,r8a7779";
18
19	aliases {
20		serial0 = &scif2;
21		serial1 = &scif4;
22	};
23
24	chosen {
25		bootargs = "ignore_loglevel rw root=/dev/nfs ip=on";
26		stdout-path = "serial0:115200n8";
27	};
28
29	memory@60000000 {
30		device_type = "memory";
31		reg = <0x60000000 0x40000000>;
32	};
33
34	fixedregulator3v3: regulator-3v3 {
35		compatible = "regulator-fixed";
36		regulator-name = "fixed-3.3V";
37		regulator-min-microvolt = <3300000>;
38		regulator-max-microvolt = <3300000>;
39		regulator-boot-on;
40		regulator-always-on;
41	};
42
43	vccq_sdhi0: regulator-vccq-sdhi0 {
44		compatible = "regulator-gpio";
45
46		regulator-name = "SDHI0 VccQ";
47		regulator-min-microvolt = <1800000>;
48		regulator-max-microvolt = <3300000>;
49
50		gpios = <&gpio3 20 GPIO_ACTIVE_HIGH>;
51		gpios-states = <1>;
52		states = <3300000 1>, <1800000 0>;
53	};
54
55	ethernet@18000000 {
56		compatible = "smsc,lan89218", "smsc,lan9115";
57		reg = <0x18000000 0x100>;
58		pinctrl-0 = <&ethernet_pins>;
59		pinctrl-names = "default";
60
61		phy-mode = "mii";
62		interrupt-parent = <&irqpin0>;
63		interrupts = <1 IRQ_TYPE_EDGE_FALLING>;
64		smsc,irq-push-pull;
65		reg-io-width = <4>;
66		vddvario-supply = <&fixedregulator3v3>;
67		vdd33a-supply = <&fixedregulator3v3>;
68	};
69
70	keyboard-irq {
71		compatible = "gpio-keys";
72
73		pinctrl-0 = <&keyboard_irq_pins>;
74		pinctrl-names = "default";
75
76		interrupt-parent = <&gpio0>;
77
78		key-1 {
79			interrupts = <17 IRQ_TYPE_EDGE_FALLING>;
80			linux,code = <KEY_1>;
81			label = "SW1-1";
82			wakeup-source;
83			debounce-interval = <20>;
84		};
85		key-2 {
86			interrupts = <18 IRQ_TYPE_EDGE_FALLING>;
87			linux,code = <KEY_2>;
88			label = "SW1-2";
89			wakeup-source;
90			debounce-interval = <20>;
91		};
92	};
93
94	keyboard-gpio {
95		compatible = "gpio-keys-polled";
96		poll-interval = <50>;
97
98		pinctrl-0 = <&keyboard_gpio_pins>;
99		pinctrl-names = "default";
100
101		key-3 {
102			gpios = <&gpio0 19 GPIO_ACTIVE_LOW>;
103			linux,code = <KEY_3>;
104			label = "SW1-3";
105			debounce-interval = <20>;
106		};
107		key-4 {
108			gpios = <&gpio0 20 GPIO_ACTIVE_LOW>;
109			linux,code = <KEY_4>;
110			label = "SW1-4";
111			debounce-interval = <20>;
112		};
113	};
114
115	leds {
116		compatible = "gpio-leds";
117		led2 {
118			gpios = <&gpio4 29 GPIO_ACTIVE_HIGH>;
119		};
120		led3 {
121			gpios = <&gpio4 30 GPIO_ACTIVE_HIGH>;
122		};
123		led4 {
124			gpios = <&gpio4 31 GPIO_ACTIVE_HIGH>;
125		};
126	};
127
128	vga-encoder {
129		compatible = "adi,adv7123";
130
131		ports {
132			#address-cells = <1>;
133			#size-cells = <0>;
134
135			port@0 {
136				reg = <0>;
137				vga_enc_in: endpoint {
138					remote-endpoint = <&du_out_rgb0>;
139				};
140			};
141			port@1 {
142				reg = <1>;
143				vga_enc_out: endpoint {
144					remote-endpoint = <&vga_in>;
145				};
146			};
147		};
148	};
149
150	vga {
151		compatible = "vga-connector";
152
153		port {
154			vga_in: endpoint {
155				remote-endpoint = <&vga_enc_out>;
156			};
157		};
158	};
159
160	lvds-encoder {
161		compatible = "thine,thc63lvdm83d";
162
163		ports {
164			#address-cells = <1>;
165			#size-cells = <0>;
166
167			port@0 {
168				reg = <0>;
169				lvds_enc_in: endpoint {
170					remote-endpoint = <&du_out_rgb1>;
171				};
172			};
173			port@1 {
174				reg = <1>;
175				lvds_connector: endpoint {
176				};
177			};
178		};
179	};
180
181	x3_clk: x3-clock {
182		compatible = "fixed-clock";
183		#clock-cells = <0>;
184		clock-frequency = <65000000>;
185	};
186};
187
188&du {
189	pinctrl-0 = <&du_pins>;
190	pinctrl-names = "default";
191	status = "okay";
192
193	clocks = <&mstp1_clks R8A7779_CLK_DU>, <&x3_clk>;
194	clock-names = "du.0", "dclkin.0";
195
196	ports {
197		port@0 {
198			endpoint {
199				remote-endpoint = <&vga_enc_in>;
200			};
201		};
202		port@1 {
203			endpoint {
204				remote-endpoint = <&lvds_enc_in>;
205			};
206		};
207	};
208};
209
210&gpio0 {
211	keyboard-irq-hog {
212		gpio-hog;
213		gpios = <17 GPIO_ACTIVE_LOW>, <18 GPIO_ACTIVE_LOW>;
214		input;
215	};
216};
217
218&i2c0 {
219	status = "okay";
220
221	clock-frequency = <100000>;
222};
223
224&irqpin0 {
225	status = "okay";
226};
227
228&extal_clk {
229	clock-frequency = <31250000>;
230};
231
232&tmu0 {
233	status = "okay";
234};
235
236&pfc {
237	pinctrl-0 = <&scif_clk_pins>;
238	pinctrl-names = "default";
239
240	du_pins: du {
241		du0 {
242			groups = "du0_rgb888", "du0_sync_1", "du0_clk_out_0", "du0_clk_in";
243			function = "du0";
244		};
245		du1 {
246			groups = "du1_rgb666", "du1_sync_1", "du1_clk_out";
247			function = "du1";
248		};
249	};
250
251	scif_clk_pins: scif_clk {
252		groups = "scif_clk_b";
253		function = "scif_clk";
254	};
255
256	ethernet_pins: ethernet {
257		intc {
258			groups = "intc_irq1_b";
259			function = "intc";
260		};
261		lbsc {
262			groups = "lbsc_ex_cs0";
263			function = "lbsc";
264		};
265	};
266
267	scif2_pins: scif2 {
268		groups = "scif2_data_c";
269		function = "scif2";
270	};
271
272	scif4_pins: scif4 {
273		groups = "scif4_data";
274		function = "scif4";
275	};
276
277	sdhi0_pins: sd0 {
278		groups = "sdhi0_data4", "sdhi0_ctrl", "sdhi0_cd";
279		function = "sdhi0";
280	};
281
282	hspi0_pins: hspi0 {
283		groups = "hspi0";
284		function = "hspi0";
285	};
286
287	keyboard_irq_pins: keyboard-irq {
288		pins = "GP_0_17", "GP_0_18";
289		bias-pull-up;
290	};
291	keyboard_gpio_pins: keyboard-gpio {
292		pins = "GP_0_19", "GP_0_20";
293		bias-pull-up;
294	};
295};
296
297&sata {
298	status = "okay";
299};
300
301&scif2 {
302	pinctrl-0 = <&scif2_pins>;
303	pinctrl-names = "default";
304
305	status = "okay";
306};
307
308&scif4 {
309	pinctrl-0 = <&scif4_pins>;
310	pinctrl-names = "default";
311
312	status = "okay";
313};
314
315&scif_clk {
316	clock-frequency = <14745600>;
317};
318
319&sdhi0 {
320	pinctrl-0 = <&sdhi0_pins>;
321	pinctrl-names = "default";
322
323	vmmc-supply = <&fixedregulator3v3>;
324	vqmmc-supply = <&vccq_sdhi0>;
325	bus-width = <4>;
326	status = "okay";
327};
328
329&hspi0 {
330	pinctrl-0 = <&hspi0_pins>;
331	pinctrl-names = "default";
332	status = "okay";
333};
334