1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/*
3 * Device Tree Source for A20-SOM204-EVB Board
4 *
5 * Copyright (C) 2018 Olimex Ltd.
6 *   Author: Stefan Mavrodiev <stefan@olimex.com>
7 */
8
9/dts-v1/;
10#include "sun7i-a20.dtsi"
11#include "sunxi-common-regulators.dtsi"
12
13
14#include <dt-bindings/gpio/gpio.h>
15#include <dt-bindings/interrupt-controller/irq.h>
16#include <dt-bindings/pwm/pwm.h>
17
18/ {
19	model = "Olimex A20-SOM204-EVB";
20	compatible = "olimex,a20-olimex-som204-evb", "allwinner,sun7i-a20";
21
22	aliases {
23		serial0 = &uart0;
24		serial1 = &uart4;
25		serial2 = &uart7;
26		spi0 = &spi1;
27		spi1 = &spi2;
28		ethernet1 = &rtl8723bs;
29	};
30
31	chosen {
32		stdout-path = "serial0:115200n8";
33	};
34
35	hdmi-connector {
36		compatible = "hdmi-connector";
37		type = "a";
38
39		port {
40			hdmi_con_in: endpoint {
41				remote-endpoint = <&hdmi_out_con>;
42			};
43		};
44	};
45
46	leds {
47		compatible = "gpio-leds";
48
49		stat {
50			label = "a20-som204-evb:green:stat";
51			gpios = <&pio 8 0 GPIO_ACTIVE_HIGH>;
52			default-state = "on";
53		};
54
55		led1 {
56			label = "a20-som204-evb:green:led1";
57			gpios = <&pio 8 10 GPIO_ACTIVE_HIGH>;
58			default-state = "on";
59		};
60
61		led2 {
62			label = "a20-som204-evb:yellow:led2";
63			gpios = <&pio 8 11 GPIO_ACTIVE_HIGH>;
64			default-state = "on";
65		};
66	};
67
68	rtl_pwrseq: rtl_pwrseq {
69		compatible = "mmc-pwrseq-simple";
70		reset-gpios = <&pio 6 9 GPIO_ACTIVE_LOW>;
71	};
72};
73
74&ahci {
75	target-supply = <&reg_ahci_5v>;
76	status = "okay";
77};
78
79&can0 {
80	pinctrl-names = "default";
81	pinctrl-0 = <&can_ph_pins>;
82	status = "okay";
83};
84
85&codec {
86	status = "okay";
87};
88
89&cpu0 {
90	cpu-supply = <&reg_dcdc2>;
91};
92
93&de {
94	status = "okay";
95};
96
97&ehci0 {
98	status = "okay";
99};
100
101&ehci1 {
102	status = "okay";
103};
104
105&gmac {
106	pinctrl-names = "default";
107	pinctrl-0 = <&gmac_rgmii_pins>;
108	phy = <&phy3>;
109	phy-mode = "rgmii";
110	phy-supply = <&reg_vcc3v3>;
111
112	snps,reset-gpio = <&pio 0 17 GPIO_ACTIVE_HIGH>;
113	snps,reset-active-low;
114	snps,reset-delays-us = <0 10000 1000000>;
115	status = "okay";
116
117	phy3: ethernet-phy@3 {
118		reg = <3>;
119	};
120};
121
122&hdmi {
123	status = "okay";
124};
125
126&hdmi_out {
127	hdmi_out_con: endpoint {
128		remote-endpoint = <&hdmi_con_in>;
129	};
130};
131
132&i2c0 {
133	status = "okay";
134
135	axp209: pmic@34 {
136		reg = <0x34>;
137		interrupt-parent = <&nmi_intc>;
138		interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
139	};
140};
141
142/* Exposed to UEXT1 */
143&i2c1 {
144	status = "okay";
145
146	eeprom: eeprom@50 {
147		compatible = "atmel,24c16";
148		reg = <0x50>;
149		pagesize = <16>;
150	};
151};
152
153/* Exposed to UEXT2 */
154&i2c2 {
155	status = "okay";
156};
157
158&ir0 {
159	pinctrl-names = "default";
160	pinctrl-0 = <&ir0_rx_pin>;
161	status = "okay";
162};
163
164&mmc0 {
165	vmmc-supply = <&reg_vcc3v3>;
166	bus-width = <4>;
167	cd-gpios = <&pio 7 1 GPIO_ACTIVE_LOW>;
168	status = "okay";
169};
170
171&mmc3 {
172	vmmc-supply = <&reg_vcc3v3>;
173	mmc-pwrseq = <&rtl_pwrseq>;
174	bus-width = <4>;
175	non-removable;
176	status = "okay";
177
178	rtl8723bs: sdio_wifi@1 {
179		reg = <1>;
180	};
181};
182
183&ohci0 {
184	status = "okay";
185};
186
187&ohci1 {
188	status = "okay";
189};
190
191&otg_sram {
192	status = "okay";
193};
194
195&pio {
196	uart3_rts_pin: uart3-rts-pin {
197		pins = "PG8";
198		function = "uart3";
199	};
200};
201
202#include "axp209.dtsi"
203
204&ac_power_supply {
205	status = "okay";
206};
207
208&battery_power_supply {
209	status = "okay";
210};
211
212&reg_ahci_5v {
213	gpio = <&pio 2 3 GPIO_ACTIVE_HIGH>;
214	status = "okay";
215};
216
217&reg_dcdc2 {
218	regulator-always-on;
219	regulator-min-microvolt = <1000000>;
220	regulator-max-microvolt = <1400000>;
221	regulator-name = "vdd-cpu";
222};
223
224&reg_dcdc3 {
225	regulator-always-on;
226	regulator-min-microvolt = <1000000>;
227	regulator-max-microvolt = <1400000>;
228	regulator-name = "vdd-int-dll";
229};
230
231&reg_ldo1 {
232	regulator-always-on;
233	regulator-min-microvolt = <1300000>;
234	regulator-max-microvolt = <1300000>;
235	regulator-name = "vdd-rtc";
236};
237
238&reg_ldo2 {
239	regulator-always-on;
240	regulator-min-microvolt = <3000000>;
241	regulator-max-microvolt = <3000000>;
242	regulator-name = "avcc";
243};
244
245&reg_ldo4 {
246	regulator-min-microvolt = <3300000>;
247	regulator-max-microvolt = <3300000>;
248	regulator-name = "vcc-pg";
249};
250
251&reg_usb0_vbus {
252	gpio = <&pio 2 17 GPIO_ACTIVE_HIGH>;
253	status = "okay";
254};
255
256&reg_usb1_vbus {
257	status = "okay";
258};
259
260&reg_usb2_vbus {
261	status = "okay";
262};
263
264/* Exposed to UEXT1 */
265&spi1 {
266	pinctrl-names = "default";
267	pinctrl-0 = <&spi1_pi_pins>,
268		    <&spi1_cs0_pi_pin>;
269	status = "okay";
270};
271
272/* Exposed to UEXT2 */
273&spi2 {
274	pinctrl-names = "default";
275	pinctrl-0 = <&spi2_pc_pins>,
276		    <&spi2_cs0_pc_pin>;
277	status = "okay";
278};
279
280&uart0 {
281	pinctrl-names = "default";
282	pinctrl-0 = <&uart0_pb_pins>;
283	status = "okay";
284};
285
286/* Used for RTL8723BS bluetooth */
287&uart3 {
288	pinctrl-names = "default";
289	pinctrl-0 = <&uart3_pg_pins>, <&uart3_rts_pin>;
290	status = "okay";
291};
292
293/* Exposed to UEXT1 */
294&uart4 {
295	pinctrl-names = "default";
296	pinctrl-0 = <&uart4_pg_pins>;
297	status = "okay";
298};
299
300/* Exposed to UEXT2 */
301&uart7 {
302	pinctrl-names = "default";
303	pinctrl-0 = <&uart7_pi_pins>;
304	status = "okay";
305};
306
307&usb_otg {
308	dr_mode = "otg";
309	status = "okay";
310};
311
312&usb_power_supply {
313	status = "okay";
314};
315
316&usbphy {
317	usb0_id_det-gpio = <&pio 7 4 GPIO_ACTIVE_HIGH>; /* PH4 */
318	usb0_vbus_det-gpio = <&pio 7 5 GPIO_ACTIVE_HIGH>; /* PH5 */
319	usb0_vbus_power-supply = <&usb_power_supply>;
320	usb0_vbus-supply = <&reg_usb0_vbus>;
321	usb1_vbus-supply = <&reg_usb1_vbus>;
322	usb2_vbus-supply = <&reg_usb2_vbus>;
323	status = "okay";
324};
325