1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Device Tree Source for the Stout board
4 *
5 * Copyright (C) 2018 Marek Vasut <marek.vasut@gmail.com>
6 */
7
8/dts-v1/;
9#include "r8a7790.dtsi"
10#include <dt-bindings/gpio/gpio.h>
11#include <dt-bindings/input/input.h>
12
13/ {
14	model = "Stout";
15	compatible = "renesas,stout", "renesas,r8a7790";
16
17	aliases {
18		serial0 = &scifa0;
19	};
20
21	chosen {
22		bootargs = "ignore_loglevel rw root=/dev/nfs ip=on";
23		stdout-path = "serial0:115200n8";
24	};
25
26	memory@40000000 {
27		device_type = "memory";
28		reg = <0 0x40000000 0 0x40000000>;
29	};
30
31	leds {
32		compatible = "gpio-leds";
33		led1 {
34			gpios = <&gpio4 22 GPIO_ACTIVE_LOW>;
35		};
36		led2 {
37			gpios = <&gpio4 23 GPIO_ACTIVE_LOW>;
38		};
39		led3 {
40			gpios = <&gpio5 17 GPIO_ACTIVE_LOW>;
41		};
42		led5 {
43			gpios = <&gpio4 24 GPIO_ACTIVE_LOW>;
44		};
45	};
46
47	fixedregulator1v8: regulator-1v8 {
48		compatible = "regulator-fixed";
49		regulator-name = "fixed-1.8V";
50		regulator-min-microvolt = <1800000>;
51		regulator-max-microvolt = <1800000>;
52		regulator-boot-on;
53		regulator-always-on;
54	};
55
56	fixedregulator3v3: regulator-3v3 {
57		compatible = "regulator-fixed";
58		regulator-name = "fixed-3.3V";
59		regulator-min-microvolt = <3300000>;
60		regulator-max-microvolt = <3300000>;
61		regulator-boot-on;
62		regulator-always-on;
63	};
64
65	vcc_sdhi0: regulator-vcc-sdhi0 {
66		compatible = "regulator-fixed";
67
68		regulator-name = "SDHI0 Vcc";
69		regulator-min-microvolt = <3300000>;
70		regulator-max-microvolt = <3300000>;
71
72		gpio = <&gpio5 24 GPIO_ACTIVE_HIGH>;
73		enable-active-high;
74	};
75
76	hdmi-out {
77		compatible = "hdmi-connector";
78		type = "a";
79
80		port {
81			hdmi_con_out: endpoint {
82				remote-endpoint = <&adv7511_out>;
83			};
84		};
85	};
86
87	osc1_clk: osc1-clock {
88		compatible = "fixed-clock";
89		#clock-cells = <0>;
90		clock-frequency = <148500000>;
91	};
92
93	osc4_clk: osc4-clock {
94		compatible = "fixed-clock";
95		#clock-cells = <0>;
96		clock-frequency = <12000000>;
97	};
98};
99
100&du {
101	pinctrl-0 = <&du_pins>;
102	pinctrl-names = "default";
103	status = "okay";
104
105	clocks = <&cpg CPG_MOD 724>, <&cpg CPG_MOD 723>, <&cpg CPG_MOD 722>,
106		 <&osc1_clk>;
107	clock-names = "du.0", "du.1", "du.2", "dclkin.0";
108
109	ports {
110		port@0 {
111			endpoint {
112				remote-endpoint = <&adv7511_in>;
113			};
114		};
115	};
116};
117
118&lvds0 {
119	ports {
120		port@1 {
121			lvds_connector0: endpoint {
122			};
123		};
124	};
125};
126
127&lvds1 {
128	ports {
129		port@1 {
130			lvds_connector1: endpoint {
131			};
132		};
133	};
134};
135
136&extal_clk {
137	clock-frequency = <20000000>;
138};
139
140&pfc {
141
142	pinctrl-0 = <&scif_clk_pins>;
143	pinctrl-names = "default";
144
145	du_pins: du {
146		groups = "du_rgb888", "du_sync_1", "du_clk_out_0";
147		function = "du";
148	};
149
150	scifa0_pins: scifa0 {
151		groups = "scifa0_data_b";
152		function = "scifa0";
153	};
154
155	scif_clk_pins: scif_clk {
156		groups = "scif_clk";
157		function = "scif_clk";
158	};
159
160	ether_pins: ether {
161		groups = "eth_link", "eth_mdio", "eth_rmii";
162		function = "eth";
163	};
164
165	phy1_pins: phy1 {
166		groups = "intc_irq1";
167		function = "intc";
168	};
169
170	sdhi0_pins: sd0 {
171		groups = "sdhi0_data4", "sdhi0_ctrl";
172		function = "sdhi0";
173		power-source = <3300>;
174	};
175
176	qspi_pins: qspi {
177		groups = "qspi_ctrl", "qspi_data4";
178		function = "qspi";
179	};
180
181	iic2_pins: iic2 {
182		groups = "iic2_b";
183		function = "iic2";
184	};
185
186	iic3_pins: iic3 {
187		groups = "iic3";
188		function = "iic3";
189	};
190
191	pmic_irq_pins: pmicirq {
192		groups = "intc_irq2";
193		function = "intc";
194	};
195
196	usb0_pins: usb0 {
197		groups = "usb0";
198		function = "usb0";
199	};
200};
201
202&ether {
203	pinctrl-0 = <&ether_pins>, <&phy1_pins>;
204	pinctrl-names = "default";
205
206	phy-handle = <&phy1>;
207	renesas,ether-link-active-low;
208	status = "okay";
209
210	phy1: ethernet-phy@1 {
211		compatible = "ethernet-phy-id0022.1537",
212			     "ethernet-phy-ieee802.3-c22";
213		reg = <1>;
214		interrupts-extended = <&irqc0 1 IRQ_TYPE_LEVEL_LOW>;
215		micrel,led-mode = <1>;
216		reset-gpios = <&gpio3 31 GPIO_ACTIVE_LOW>;
217	};
218};
219
220&cmt0 {
221	status = "okay";
222};
223
224&qspi {
225	pinctrl-0 = <&qspi_pins>;
226	pinctrl-names = "default";
227
228	status = "okay";
229
230	flash: flash@0 {
231		compatible = "spansion,s25fl512s", "jedec,spi-nor";
232		reg = <0>;
233		spi-max-frequency = <30000000>;
234		spi-tx-bus-width = <4>;
235		spi-rx-bus-width = <4>;
236		spi-cpha;
237		spi-cpol;
238		m25p,fast-read;
239
240		partitions {
241			compatible = "fixed-partitions";
242			#address-cells = <1>;
243			#size-cells = <1>;
244
245			partition@0 {
246				label = "loader";
247				reg = <0x00000000 0x00080000>;
248				read-only;
249			};
250			partition@80000 {
251				label = "uboot";
252				reg = <0x00080000 0x00040000>;
253				read-only;
254			};
255			partition@c0000 {
256				label = "uboot-env";
257				reg = <0x000c0000 0x00040000>;
258				read-only;
259			};
260			partition@100000 {
261				label = "flash";
262				reg = <0x00100000 0x03f00000>;
263			};
264		};
265	};
266};
267
268&scifa0 {
269	pinctrl-0 = <&scifa0_pins>;
270	pinctrl-names = "default";
271	bootph-all;
272
273	status = "okay";
274};
275
276&scif_clk {
277	clock-frequency = <14745600>;
278};
279
280&sdhi0 {
281	pinctrl-0 = <&sdhi0_pins>;
282	pinctrl-names = "default";
283
284	vmmc-supply = <&vcc_sdhi0>;
285	cd-gpios = <&gpio3 6 GPIO_ACTIVE_LOW>;
286	status = "okay";
287};
288
289&cpu0 {
290	cpu0-supply = <&vdd_dvfs>;
291};
292
293&iic2	{
294	status = "okay";
295	pinctrl-0 = <&iic2_pins>;
296	pinctrl-names = "default";
297
298	clock-frequency = <100000>;
299
300	hdmi@39 {
301		compatible = "adi,adv7511w";
302		reg = <0x39>;
303		interrupts-extended = <&gpio1 15 IRQ_TYPE_LEVEL_LOW>;
304		clocks = <&osc4_clk>;
305		clock-names = "cec";
306
307		avdd-supply = <&fixedregulator1v8>;
308		dvdd-supply = <&fixedregulator1v8>;
309		pvdd-supply = <&fixedregulator1v8>;
310		dvdd-3v-supply = <&fixedregulator3v3>;
311		bgvdd-supply = <&fixedregulator1v8>;
312
313		adi,input-depth = <8>;
314		adi,input-colorspace = "rgb";
315		adi,input-clock = "1x";
316
317		ports {
318			#address-cells = <1>;
319			#size-cells = <0>;
320
321			port@0 {
322				reg = <0>;
323				adv7511_in: endpoint {
324					remote-endpoint = <&du_out_rgb>;
325				};
326			};
327
328			port@1 {
329				reg = <1>;
330				adv7511_out: endpoint {
331					remote-endpoint = <&hdmi_con_out>;
332				};
333			};
334		};
335	};
336};
337
338&iic3 {
339	pinctrl-names = "default";
340	pinctrl-0 = <&iic3_pins>, <&pmic_irq_pins>;
341	status = "okay";
342
343	pmic@58 {
344		compatible = "dlg,da9063";
345		reg = <0x58>;
346		interrupts-extended = <&irqc0 2 IRQ_TYPE_LEVEL_LOW>;
347		interrupt-controller;
348		#interrupt-cells = <2>;
349
350		onkey {
351			compatible = "dlg,da9063-onkey";
352		};
353
354		rtc {
355			compatible = "dlg,da9063-rtc";
356		};
357
358		watchdog {
359			compatible = "dlg,da9063-watchdog";
360		};
361	};
362
363	vdd_dvfs: regulator@68 {
364		compatible = "dlg,da9210";
365		reg = <0x68>;
366		interrupts-extended = <&irqc0 2 IRQ_TYPE_LEVEL_LOW>;
367
368		regulator-min-microvolt = <1000000>;
369		regulator-max-microvolt = <1000000>;
370		regulator-boot-on;
371		regulator-always-on;
372	};
373
374	vdd: regulator@70 {
375		compatible = "dlg,da9210";
376		reg = <0x70>;
377		interrupts-extended = <&irqc0 2 IRQ_TYPE_LEVEL_LOW>;
378
379		regulator-min-microvolt = <1000000>;
380		regulator-max-microvolt = <1000000>;
381		regulator-boot-on;
382		regulator-always-on;
383	};
384};
385
386&pci0 {
387	status = "okay";
388	pinctrl-0 = <&usb0_pins>;
389	pinctrl-names = "default";
390};
391
392&usbphy {
393	status = "okay";
394};
395