1// SPDX-License-Identifier: (GPL-2.0 OR BSD-3-Clause)
2/*
3 * Copyright (C) 2022 Marek Vasut <marex@denx.de>
4 */
5
6/ {
7	aliases {
8		ethernet0 = &ethernet0;
9		ethernet1 = &ksz8851;
10		mmc0 = &sdmmc1;
11		rtc0 = &hwrtc;
12		rtc1 = &rtc;
13		serial0 = &uart4;
14		serial1 = &uart8;
15		serial2 = &usart3;
16		serial3 = &uart5;
17		spi0 = &qspi;
18	};
19
20	chosen {
21		stdout-path = "serial0:115200n8";
22	};
23
24	led {
25		compatible = "gpio-leds";
26		led1 {
27			label = "yellow:user0";
28			gpios = <&gpioz 6 GPIO_ACTIVE_LOW>;
29			default-state = "off";
30		};
31
32		led2 {
33			label = "red:user1";
34			gpios = <&gpioz 3 GPIO_ACTIVE_LOW>;
35			default-state = "off";
36		};
37	};
38
39	ethernet_vio: vioregulator {
40		compatible = "regulator-fixed";
41		regulator-name = "vio";
42		regulator-min-microvolt = <3300000>;
43		regulator-max-microvolt = <3300000>;
44		gpio = <&gpioh 2 GPIO_ACTIVE_LOW>;
45		regulator-always-on;
46		regulator-boot-on;
47		vin-supply = <&vdd>;
48	};
49};
50
51&adc {	/* X11 ADC inputs */
52	pinctrl-names = "default";
53	pinctrl-0 = <&adc12_ain_pins_b>;
54	vdd-supply = <&vdd>;
55	vdda-supply = <&vdda>;
56	vref-supply = <&vdda>;
57	status = "okay";
58
59	adc1: adc@0 {
60		status = "okay";
61		channel@0 {
62			reg = <0>;
63			st,min-sample-time-ns = <5000>;
64		};
65		channel@1 {
66			reg = <1>;
67			st,min-sample-time-ns = <5000>;
68		};
69		channel@6 {
70			reg = <6>;
71			st,min-sample-time-ns = <5000>;
72		};
73	};
74
75	adc2: adc@100 {
76		status = "okay";
77		channel@0 {
78			reg = <0>;
79			st,min-sample-time-ns = <5000>;
80		};
81		channel@1 {
82			reg = <1>;
83			st,min-sample-time-ns = <5000>;
84		};
85		channel@2 {
86			reg = <2>;
87			st,min-sample-time-ns = <5000>;
88		};
89	};
90};
91
92&ethernet0 {
93	status = "okay";
94	pinctrl-0 = <&ethernet0_rgmii_pins_c>;
95	pinctrl-1 = <&ethernet0_rgmii_sleep_pins_c>;
96	pinctrl-names = "default", "sleep";
97	phy-mode = "rgmii";
98	max-speed = <1000>;
99	phy-handle = <&phy0>;
100
101	mdio {
102		#address-cells = <1>;
103		#size-cells = <0>;
104		compatible = "snps,dwmac-mdio";
105		reset-gpios = <&gpioz 2 GPIO_ACTIVE_LOW>;
106		reset-delay-us = <1000>;
107		reset-post-delay-us = <1000>;
108
109		phy0: ethernet-phy@7 {
110			reg = <7>;
111
112			rxc-skew-ps = <1500>;
113			rxdv-skew-ps = <540>;
114			rxd0-skew-ps = <420>;
115			rxd1-skew-ps = <420>;
116			rxd2-skew-ps = <420>;
117			rxd3-skew-ps = <420>;
118
119			txc-skew-ps = <1440>;
120			txen-skew-ps = <540>;
121			txd0-skew-ps = <420>;
122			txd1-skew-ps = <420>;
123			txd2-skew-ps = <420>;
124			txd3-skew-ps = <420>;
125		};
126	};
127};
128
129&fmc {
130	pinctrl-names = "default", "sleep";
131	pinctrl-0 = <&fmc_pins_b>;
132	pinctrl-1 = <&fmc_sleep_pins_b>;
133	status = "okay";
134
135	ksz8851: ethernet@1,0 {
136		compatible = "micrel,ks8851-mll";
137		reg = <1 0x0 0x2>, <1 0x2 0x20000>;
138		interrupt-parent = <&gpioc>;
139		interrupts = <3 IRQ_TYPE_LEVEL_LOW>;
140		bank-width = <2>;
141
142		/* Timing values are in nS */
143		st,fmc2-ebi-cs-mux-enable;
144		st,fmc2-ebi-cs-transaction-type = <4>;
145		st,fmc2-ebi-cs-buswidth = <16>;
146		st,fmc2-ebi-cs-address-setup-ns = <5>;
147		st,fmc2-ebi-cs-address-hold-ns = <5>;
148		st,fmc2-ebi-cs-bus-turnaround-ns = <5>;
149		st,fmc2-ebi-cs-data-setup-ns = <45>;
150		st,fmc2-ebi-cs-data-hold-ns = <1>;
151		st,fmc2-ebi-cs-write-address-setup-ns = <5>;
152		st,fmc2-ebi-cs-write-address-hold-ns = <5>;
153		st,fmc2-ebi-cs-write-bus-turnaround-ns = <5>;
154		st,fmc2-ebi-cs-write-data-setup-ns = <45>;
155		st,fmc2-ebi-cs-write-data-hold-ns = <1>;
156	};
157};
158
159&gpioa {
160	gpio-line-names = "", "", "", "",
161			  "DRCC-VAR2", "", "", "",
162			  "", "", "", "",
163			  "", "", "", "";
164};
165
166&gpioe {
167	gpio-line-names = "", "", "", "",
168			  "", "DRCC-GPIO0", "", "",
169			  "", "", "", "",
170			  "", "", "", "";
171};
172
173&gpiog {
174	gpio-line-names = "", "", "", "",
175			  "", "", "", "",
176			  "", "", "", "",
177			  "DRCC-GPIO5", "", "", "";
178};
179
180&gpioh {
181	gpio-line-names = "", "", "", "DRCC-HW2",
182			  "DRCC-GPIO4", "", "", "",
183			  "DRCC-HW1", "DRCC-HW0", "", "DRCC-VAR1",
184			  "DRCC-VAR0", "", "", "DRCC-GPIO6";
185};
186
187&gpioi {
188	gpio-line-names = "", "", "", "",
189			  "", "", "", "DRCC-GPIO2",
190			  "", "DRCC-GPIO1", "", "",
191			  "", "", "", "";
192};
193
194&i2c1 {	/* X11 I2C1 */
195	pinctrl-names = "default";
196	pinctrl-0 = <&i2c1_pins_b>;
197	i2c-scl-rising-time-ns = <185>;
198	i2c-scl-falling-time-ns = <20>;
199	status = "okay";
200	/delete-property/dmas;
201	/delete-property/dma-names;
202};
203
204&i2c4 {
205	hwrtc: rtc@32 {
206		compatible = "microcrystal,rv8803";
207		reg = <0x32>;
208	};
209
210	eeprom@50 {
211		compatible = "atmel,24c04";
212		reg = <0x50>;
213		pagesize = <16>;
214	};
215
216	dh_mac_eeprom: eeprom@53 {
217		compatible = "atmel,24c02";
218		reg = <0x53>;
219		pagesize = <16>;
220	};
221};
222
223&sdmmc1 {	/* MicroSD */
224	pinctrl-names = "default", "opendrain", "sleep";
225	pinctrl-0 = <&sdmmc1_b4_pins_a>;
226	pinctrl-1 = <&sdmmc1_b4_od_pins_a>;
227	pinctrl-2 = <&sdmmc1_b4_sleep_pins_a>;
228	cd-gpios = <&gpioi 8 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>;
229	disable-wp;
230	st,neg-edge;
231	bus-width = <4>;
232	vmmc-supply = <&vdd>;
233	vqmmc-supply = <&vdd>;
234	status = "okay";
235};
236
237&sdmmc2 {	/* eMMC */
238	pinctrl-names = "default", "opendrain", "sleep";
239	pinctrl-0 = <&sdmmc2_b4_pins_a &sdmmc2_d47_pins_c>;
240	pinctrl-1 = <&sdmmc2_b4_od_pins_a &sdmmc2_d47_pins_c>;
241	pinctrl-2 = <&sdmmc2_b4_sleep_pins_a &sdmmc2_d47_sleep_pins_c>;
242	bus-width = <8>;
243	no-sd;
244	no-sdio;
245	non-removable;
246	st,neg-edge;
247	vmmc-supply = <&v3v3>;
248	vqmmc-supply = <&vdd>;
249	status = "okay";
250};
251
252&sdmmc3 {	/* SDIO Wi-Fi */
253	pinctrl-names = "default", "opendrain", "sleep";
254	pinctrl-0 = <&sdmmc3_b4_pins_a>;
255	pinctrl-1 = <&sdmmc3_b4_od_pins_a>;
256	pinctrl-2 = <&sdmmc3_b4_sleep_pins_a>;
257	broken-cd;
258	bus-width = <4>;
259	mmc-ddr-3_3v;
260	st,neg-edge;
261	vmmc-supply = <&v3v3>;
262	vqmmc-supply = <&v3v3>;
263	status = "okay";
264};
265
266&spi2 {	/* X11 SPI */
267	pinctrl-names = "default";
268	pinctrl-0 = <&spi2_pins_b>;
269	cs-gpios = <&gpioi 0 0>;
270	status = "disabled";
271	/delete-property/dmas;
272	/delete-property/dma-names;
273};
274
275&uart4 {
276	label = "UART0";
277	pinctrl-names = "default";
278	pinctrl-0 = <&uart4_pins_d>;
279	/delete-property/dmas;
280	/delete-property/dma-names;
281	status = "okay";
282};
283
284&uart5 {	/* X11 UART */
285	label = "X11-UART5";
286	pinctrl-names = "default";
287	pinctrl-0 = <&uart5_pins_a>;
288	/delete-property/dmas;
289	/delete-property/dma-names;
290	status = "okay";
291};
292
293&uart8 {
294	label = "RS485-1";
295	pinctrl-names = "default";
296	pinctrl-0 = <&uart8_pins_a &uart8_rtscts_pins_a>;
297	uart-has-rtscts;
298	/delete-property/dmas;
299	/delete-property/dma-names;
300	status = "okay";
301};
302
303&usart3 {	/* RS485 or RS232 */
304	label = "RS485-2";
305	pinctrl-names = "default", "sleep";
306	pinctrl-0 = <&usart3_pins_e>;
307	pinctrl-1 = <&usart3_sleep_pins_e>;
308	uart-has-rtscts;
309	/delete-property/dmas;
310	/delete-property/dma-names;
311	status = "okay";
312};
313
314&usbh_ehci {
315	phys = <&usbphyc_port0>;
316	status = "okay";
317};
318
319&usbh_ohci {
320	phys = <&usbphyc_port0>;
321	status = "okay";
322};
323
324&usbotg_hs {
325	dr_mode = "otg";
326	pinctrl-0 = <&usbotg_hs_pins_a>;
327	pinctrl-names = "default";
328	phy-names = "usb2-phy";
329	phys = <&usbphyc_port1 0>;
330	vbus-supply = <&vbus_otg>;
331	status = "okay";
332};
333
334&usbphyc {
335	status = "okay";
336};
337
338&usbphyc_port0 {
339	phy-supply = <&vdd_usb>;
340	connector {
341		compatible = "usb-a-connector";
342		vbus-supply = <&vbus_sw>;
343	};
344};
345
346&usbphyc_port1 {
347	phy-supply = <&vdd_usb>;
348};
349