1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Device Tree Source for the Alt board
4 *
5 * Copyright (C) 2014 Renesas Electronics Corporation
6 */
7
8/dts-v1/;
9#include "r8a7794.dtsi"
10#include <dt-bindings/gpio/gpio.h>
11#include <dt-bindings/input/input.h>
12
13/ {
14	model = "Alt";
15	compatible = "renesas,alt", "renesas,r8a7794";
16
17	aliases {
18		serial0 = &scif2;
19		i2c9 = &gpioi2c1;
20		i2c10 = &gpioi2c4;
21		i2c11 = &i2chdmi;
22		i2c12 = &i2cexio4;
23		mmc0 = &mmcif0;
24		mmc1 = &sdhi0;
25		mmc2 = &sdhi1;
26	};
27
28	chosen {
29		bootargs = "ignore_loglevel rw root=/dev/nfs ip=on";
30		stdout-path = "serial0:115200n8";
31	};
32
33	memory@40000000 {
34		device_type = "memory";
35		reg = <0 0x40000000 0 0x40000000>;
36	};
37
38	d3_3v: regulator-d3-3v {
39		compatible = "regulator-fixed";
40		regulator-name = "D3.3V";
41		regulator-min-microvolt = <3300000>;
42		regulator-max-microvolt = <3300000>;
43		regulator-boot-on;
44		regulator-always-on;
45	};
46
47	vcc_sdhi0: regulator-vcc-sdhi0 {
48		compatible = "regulator-fixed";
49
50		regulator-name = "SDHI0 Vcc";
51		regulator-min-microvolt = <3300000>;
52		regulator-max-microvolt = <3300000>;
53
54		gpio = <&gpio2 26 GPIO_ACTIVE_HIGH>;
55		enable-active-high;
56	};
57
58	vccq_sdhi0: regulator-vccq-sdhi0 {
59		compatible = "regulator-gpio";
60
61		regulator-name = "SDHI0 VccQ";
62		regulator-min-microvolt = <1800000>;
63		regulator-max-microvolt = <3300000>;
64
65		gpios = <&gpio2 29 GPIO_ACTIVE_HIGH>;
66		gpios-states = <1>;
67		states = <3300000 1>, <1800000 0>;
68	};
69
70	vcc_sdhi1: regulator-vcc-sdhi1 {
71		compatible = "regulator-fixed";
72
73		regulator-name = "SDHI1 Vcc";
74		regulator-min-microvolt = <3300000>;
75		regulator-max-microvolt = <3300000>;
76
77		gpio = <&gpio4 26 GPIO_ACTIVE_HIGH>;
78		enable-active-high;
79	};
80
81	vccq_sdhi1: regulator-vccq-sdhi1 {
82		compatible = "regulator-gpio";
83
84		regulator-name = "SDHI1 VccQ";
85		regulator-min-microvolt = <1800000>;
86		regulator-max-microvolt = <3300000>;
87
88		gpios = <&gpio4 29 GPIO_ACTIVE_HIGH>;
89		gpios-states = <1>;
90		states = <3300000 1>, <1800000 0>;
91	};
92
93	keyboard {
94		compatible = "gpio-keys";
95
96		pinctrl-0 = <&keyboard_pins>;
97		pinctrl-names = "default";
98
99		one {
100			linux,code = <KEY_1>;
101			label = "SW2-1";
102			wakeup-source;
103			debounce-interval = <20>;
104			gpios = <&gpio3 9 GPIO_ACTIVE_LOW>;
105		};
106		two {
107			linux,code = <KEY_2>;
108			label = "SW2-2";
109			wakeup-source;
110			debounce-interval = <20>;
111			gpios = <&gpio3 10 GPIO_ACTIVE_LOW>;
112		};
113		three {
114			linux,code = <KEY_3>;
115			label = "SW2-3";
116			wakeup-source;
117			debounce-interval = <20>;
118			gpios = <&gpio3 11 GPIO_ACTIVE_LOW>;
119		};
120		four {
121			linux,code = <KEY_4>;
122			label = "SW2-4";
123			wakeup-source;
124			debounce-interval = <20>;
125			gpios = <&gpio3 12 GPIO_ACTIVE_LOW>;
126		};
127	};
128
129	vga-encoder {
130		compatible = "adi,adv7123";
131
132		ports {
133			#address-cells = <1>;
134			#size-cells = <0>;
135
136			port@0 {
137				reg = <0>;
138				adv7123_in: endpoint {
139					remote-endpoint = <&du_out_rgb1>;
140				};
141			};
142			port@1 {
143				reg = <1>;
144				adv7123_out: endpoint {
145					remote-endpoint = <&vga_in>;
146				};
147			};
148		};
149	};
150
151	vga {
152		compatible = "vga-connector";
153
154		port {
155			vga_in: endpoint {
156				remote-endpoint = <&adv7123_out>;
157			};
158		};
159	};
160
161	x2_clk: x2-clock {
162		compatible = "fixed-clock";
163		#clock-cells = <0>;
164		clock-frequency = <74250000>;
165	};
166
167	x13_clk: x13-clock {
168		compatible = "fixed-clock";
169		#clock-cells = <0>;
170		clock-frequency = <148500000>;
171	};
172
173	gpioi2c1: i2c-9 {
174		#address-cells = <1>;
175		#size-cells = <0>;
176		compatible = "i2c-gpio";
177		status = "disabled";
178		scl-gpios = <&gpio4 0 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
179		sda-gpios = <&gpio4 1 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
180	};
181
182	gpioi2c4: i2c-10 {
183		#address-cells = <1>;
184		#size-cells = <0>;
185		compatible = "i2c-gpio";
186		status = "disabled";
187		scl-gpios = <&gpio4 8 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
188		sda-gpios = <&gpio4 9 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
189		i2c-gpio,delay-us = <5>;
190	};
191
192	/*
193	 * A fallback to GPIO is provided for I2C1.
194	 */
195	i2chdmi: i2c-mux1 {
196		compatible = "i2c-demux-pinctrl";
197		i2c-parent = <&i2c1>, <&gpioi2c1>;
198		i2c-bus-name = "i2c-hdmi";
199		#address-cells = <1>;
200		#size-cells = <0>;
201
202		composite-in@20 {
203			compatible = "adi,adv7180";
204			reg = <0x20>;
205
206			port {
207				adv7180: endpoint {
208					bus-width = <8>;
209					remote-endpoint = <&vin0ep>;
210				};
211			};
212		};
213
214		eeprom@50 {
215			compatible = "renesas,r1ex24002", "atmel,24c02";
216			reg = <0x50>;
217			pagesize = <16>;
218		};
219	};
220
221	/*
222	 * I2C4 is routed to EXIO connector B, pins 73 (SCL) + 74 (SDA).
223	 * A fallback to GPIO is provided.
224	 */
225	i2cexio4: i2c-mux2 {
226		compatible = "i2c-demux-pinctrl";
227		i2c-parent = <&i2c4>, <&gpioi2c4>;
228		i2c-bus-name = "i2c-exio4";
229		#address-cells = <1>;
230		#size-cells = <0>;
231	};
232};
233
234&pci0 {
235	status = "okay";
236	pinctrl-0 = <&usb0_pins>;
237	pinctrl-names = "default";
238};
239
240&pci1 {
241	status = "okay";
242	pinctrl-0 = <&usb1_pins>;
243	pinctrl-names = "default";
244};
245
246&usbphy {
247	status = "okay";
248};
249
250&du {
251	pinctrl-0 = <&du_pins>;
252	pinctrl-names = "default";
253	status = "okay";
254
255	clocks = <&cpg CPG_MOD 724>, <&cpg CPG_MOD 723>,
256		 <&x13_clk>, <&x2_clk>;
257	clock-names = "du.0", "du.1", "dclkin.0", "dclkin.1";
258
259	ports {
260		port@1 {
261			endpoint {
262				remote-endpoint = <&adv7123_in>;
263			};
264		};
265	};
266};
267
268&extal_clk {
269	clock-frequency = <20000000>;
270};
271
272&pfc {
273	pinctrl-0 = <&scif_clk_pins>;
274	pinctrl-names = "default";
275
276	du_pins: du {
277		groups = "du1_rgb666", "du1_sync", "du1_disp", "du1_clk0_out";
278		function = "du1";
279	};
280
281	scif2_pins: scif2 {
282		groups = "scif2_data";
283		function = "scif2";
284	};
285
286	scif_clk_pins: scif_clk {
287		groups = "scif_clk";
288		function = "scif_clk";
289	};
290
291	ether_pins: ether {
292		groups = "eth_link", "eth_mdio", "eth_rmii";
293		function = "eth";
294	};
295
296	phy1_pins: phy1 {
297		groups = "intc_irq8";
298		function = "intc";
299	};
300
301	i2c1_pins: i2c1 {
302		groups = "i2c1";
303		function = "i2c1";
304	};
305
306	i2c4_pins: i2c4 {
307		groups = "i2c4";
308		function = "i2c4";
309	};
310
311	vin0_pins: vin0 {
312		groups = "vin0_data8", "vin0_clk";
313		function = "vin0";
314	};
315
316	mmcif0_pins: mmcif0 {
317		groups = "mmc_data8", "mmc_ctrl";
318		function = "mmc";
319	};
320
321	sdhi0_pins: sd0 {
322		groups = "sdhi0_data4", "sdhi0_ctrl";
323		function = "sdhi0";
324		power-source = <3300>;
325	};
326
327	sdhi0_pins_uhs: sd0_uhs {
328		groups = "sdhi0_data4", "sdhi0_ctrl";
329		function = "sdhi0";
330		power-source = <1800>;
331	};
332
333	sdhi1_pins: sd1 {
334		groups = "sdhi1_data4", "sdhi1_ctrl";
335		function = "sdhi1";
336		power-source = <3300>;
337	};
338
339	sdhi1_pins_uhs: sd1_uhs {
340		groups = "sdhi1_data4", "sdhi1_ctrl";
341		function = "sdhi1";
342		power-source = <1800>;
343	};
344
345	usb0_pins: usb0 {
346		groups = "usb0";
347		function = "usb0";
348	};
349
350	usb1_pins: usb1 {
351		groups = "usb1";
352		function = "usb1";
353	};
354
355	keyboard_pins: keyboard {
356		pins = "GP_3_9", "GP_3_10", "GP_3_11", "GP_3_12";
357		bias-pull-up;
358	};
359};
360
361&cmt0 {
362	status = "okay";
363};
364
365&pfc {
366	qspi_pins: qspi {
367		groups = "qspi_ctrl", "qspi_data4";
368		function = "qspi";
369	};
370};
371
372&ether {
373	pinctrl-0 = <&ether_pins>, <&phy1_pins>;
374	pinctrl-names = "default";
375
376	phy-handle = <&phy1>;
377	renesas,ether-link-active-low;
378	status = "okay";
379
380	phy1: ethernet-phy@1 {
381		compatible = "ethernet-phy-id0022.1537",
382			     "ethernet-phy-ieee802.3-c22";
383		reg = <1>;
384		interrupt-parent = <&irqc0>;
385		interrupts = <8 IRQ_TYPE_LEVEL_LOW>;
386		micrel,led-mode = <1>;
387		reset-gpios = <&gpio1 24 GPIO_ACTIVE_LOW>;
388	};
389};
390
391&mmcif0 {
392	pinctrl-0 = <&mmcif0_pins>;
393	pinctrl-names = "default";
394
395	vmmc-supply = <&d3_3v>;
396	vqmmc-supply = <&d3_3v>;
397	bus-width = <8>;
398	non-removable;
399	status = "okay";
400};
401
402&rwdt {
403	timeout-sec = <60>;
404	status = "okay";
405};
406
407&sdhi0 {
408	pinctrl-0 = <&sdhi0_pins>;
409	pinctrl-1 = <&sdhi0_pins_uhs>;
410	pinctrl-names = "default", "state_uhs";
411
412	vmmc-supply = <&vcc_sdhi0>;
413	vqmmc-supply = <&vccq_sdhi0>;
414	cd-gpios = <&gpio6 6 GPIO_ACTIVE_LOW>;
415	wp-gpios = <&gpio6 7 GPIO_ACTIVE_HIGH>;
416	sd-uhs-sdr50;
417	sd-uhs-sdr104;
418	status = "okay";
419};
420
421&sdhi1 {
422	pinctrl-0 = <&sdhi1_pins>;
423	pinctrl-1 = <&sdhi1_pins_uhs>;
424	pinctrl-names = "default", "state_uhs";
425
426	vmmc-supply = <&vcc_sdhi1>;
427	vqmmc-supply = <&vccq_sdhi1>;
428	cd-gpios = <&gpio6 14 GPIO_ACTIVE_LOW>;
429	wp-gpios = <&gpio6 15 GPIO_ACTIVE_HIGH>;
430	sd-uhs-sdr50;
431	status = "okay";
432};
433
434&i2c1 {
435	pinctrl-0 = <&i2c1_pins>;
436	pinctrl-names = "i2c-hdmi";
437
438	clock-frequency = <400000>;
439};
440
441&i2c4 {
442	pinctrl-0 = <&i2c4_pins>;
443	pinctrl-names = "i2c-exio4";
444};
445
446&i2c7 {
447	status = "okay";
448	clock-frequency = <100000>;
449
450	pmic@58 {
451		compatible = "dlg,da9063";
452		reg = <0x58>;
453		interrupt-parent = <&gpio3>;
454		interrupts = <31 IRQ_TYPE_LEVEL_LOW>;
455		interrupt-controller;
456		#interrupt-cells = <2>;
457
458		rtc {
459			compatible = "dlg,da9063-rtc";
460		};
461
462		watchdog {
463			compatible = "dlg,da9063-watchdog";
464		};
465	};
466};
467
468&vin0 {
469	status = "okay";
470	pinctrl-0 = <&vin0_pins>;
471	pinctrl-names = "default";
472
473	port {
474		vin0ep: endpoint {
475			remote-endpoint = <&adv7180>;
476			bus-width = <8>;
477		};
478	};
479};
480
481&scif2 {
482	pinctrl-0 = <&scif2_pins>;
483	pinctrl-names = "default";
484
485	status = "okay";
486};
487
488&scif_clk {
489	clock-frequency = <14745600>;
490};
491
492&qspi {
493	pinctrl-0 = <&qspi_pins>;
494	pinctrl-names = "default";
495
496	status = "okay";
497
498	flash@0 {
499		compatible = "spansion,s25fl512s", "jedec,spi-nor";
500		reg = <0>;
501		spi-max-frequency = <30000000>;
502		spi-tx-bus-width = <4>;
503		spi-rx-bus-width = <4>;
504		spi-cpol;
505		spi-cpha;
506		m25p,fast-read;
507
508		partitions {
509			compatible = "fixed-partitions";
510			#address-cells = <1>;
511			#size-cells = <1>;
512
513			partition@0 {
514				label = "loader";
515				reg = <0x00000000 0x00040000>;
516				read-only;
517			};
518			partition@40000 {
519				label = "system";
520				reg = <0x00040000 0x00040000>;
521				read-only;
522			};
523			partition@80000 {
524				label = "user";
525				reg = <0x00080000 0x03f80000>;
526			};
527		};
528	};
529};
530