1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2// Copyright (C) 2017 Jagan Teki <jteki@openedev.com>
3
4/dts-v1/;
5
6#include "sun50i-a64.dtsi"
7#include "sun50i-a64-cpu-opp.dtsi"
8
9#include <dt-bindings/gpio/gpio.h>
10
11/ {
12	model = "Olimex A64-Olinuxino";
13	compatible = "olimex,a64-olinuxino", "allwinner,sun50i-a64";
14
15	aliases {
16		ethernet0 = &emac;
17		serial0 = &uart0;
18	};
19
20	chosen {
21		stdout-path = "serial0:115200n8";
22	};
23
24	hdmi-connector {
25		compatible = "hdmi-connector";
26		type = "a";
27
28		port {
29			hdmi_con_in: endpoint {
30				remote-endpoint = <&hdmi_out_con>;
31			};
32		};
33	};
34
35	leds {
36		compatible = "gpio-leds";
37
38		led-0 {
39			label = "a64-olinuxino:red:user";
40			gpios = <&pio 4 17 GPIO_ACTIVE_HIGH>; /* PE17 */
41		};
42	};
43
44	reg_usb1_vbus: usb1-vbus {
45		compatible = "regulator-fixed";
46		regulator-name = "usb1-vbus";
47		regulator-min-microvolt = <5000000>;
48		regulator-max-microvolt = <5000000>;
49		regulator-boot-on;
50		enable-active-high;
51		gpio = <&pio 6 9 GPIO_ACTIVE_HIGH>; /* PG9 */
52		status = "okay";
53	};
54
55	wifi_pwrseq: wifi_pwrseq {
56		compatible = "mmc-pwrseq-simple";
57		reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
58	};
59};
60
61&cpu0 {
62	cpu-supply = <&reg_dcdc2>;
63};
64
65&cpu1 {
66	cpu-supply = <&reg_dcdc2>;
67};
68
69&cpu2 {
70	cpu-supply = <&reg_dcdc2>;
71};
72
73&cpu3 {
74	cpu-supply = <&reg_dcdc2>;
75};
76
77&de {
78	status = "okay";
79};
80
81&ehci0 {
82	status = "okay";
83};
84
85&ehci1 {
86	status = "okay";
87};
88
89&emac {
90	pinctrl-names = "default";
91	pinctrl-0 = <&rgmii_pins>;
92	phy-mode = "rgmii";
93	phy-handle = <&ext_rgmii_phy>;
94	phy-supply = <&reg_dcdc1>;
95	allwinner,tx-delay-ps = <600>;
96	status = "okay";
97};
98
99&hdmi {
100	hvcc-supply = <&reg_dldo1>;
101	status = "okay";
102};
103
104&hdmi_out {
105	hdmi_out_con: endpoint {
106		remote-endpoint = <&hdmi_con_in>;
107	};
108};
109
110&mdio {
111	ext_rgmii_phy: ethernet-phy@1 {
112		compatible = "ethernet-phy-ieee802.3-c22";
113		reg = <1>;
114	};
115};
116
117&mmc0 {
118	pinctrl-names = "default";
119	pinctrl-0 = <&mmc0_pins>;
120	vmmc-supply = <&reg_dcdc1>;
121	cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>;
122	disable-wp;
123	bus-width = <4>;
124	status = "okay";
125};
126
127&mmc1 {
128	pinctrl-names = "default";
129	pinctrl-0 = <&mmc1_pins>;
130	vmmc-supply = <&reg_dcdc1>;
131	vqmmc-supply = <&reg_dldo4>;
132	mmc-pwrseq = <&wifi_pwrseq>;
133	bus-width = <4>;
134	non-removable;
135	status = "okay";
136
137	rtl8723bs: wifi@1 {
138		reg = <1>;
139		interrupt-parent = <&r_pio>;
140		interrupts = <0 3 IRQ_TYPE_LEVEL_LOW>; /* PL3 */
141		interrupt-names = "host-wake";
142	};
143};
144
145&ohci0 {
146	status = "okay";
147};
148
149&ohci1 {
150	status = "okay";
151};
152
153&pio {
154	vcc-pc-supply = <&reg_dcdc1>;
155	vcc-pd-supply = <&reg_dcdc1>;
156	vcc-pe-supply = <&reg_aldo1>;
157	vcc-pg-supply = <&reg_dldo4>;
158};
159
160&r_pio {
161	/*
162	 * FIXME: We can't add that supply for now since it would
163	 * create a circular dependency between pinctrl, the regulator
164	 * and the RSB Bus.
165	 *
166	 * vcc-pl-supply = <&reg_aldo2>;
167	 */
168};
169
170&pio {
171	vcc-pa-supply = <&reg_dcdc1>;
172	vcc-pb-supply = <&reg_dcdc1>;
173	vcc-pc-supply = <&reg_dcdc1>;
174	vcc-pd-supply = <&reg_dcdc1>;
175	vcc-pe-supply = <&reg_aldo1>;
176	vcc-pf-supply = <&reg_dcdc1>;
177	vcc-pg-supply = <&reg_dldo4>;
178	vcc-ph-supply = <&reg_dcdc1>;
179};
180
181&r_rsb {
182	status = "okay";
183
184	axp803: pmic@3a3 {
185		compatible = "x-powers,axp803";
186		reg = <0x3a3>;
187		interrupt-parent = <&r_intc>;
188		interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
189		x-powers,drive-vbus-en;	/* set N_VBUSEN as output pin */
190	};
191};
192
193/* VCC-PL is powered by aldo2 but we cannot add it as the RSB */
194/* interface used to talk to the PMIC in on the PL pins */
195/* &r_pio { */
196/*	vcc-pl-supply = <&reg_aldo2>; */
197/* }; */
198
199#include "axp803.dtsi"
200
201&ac_power_supply {
202	status = "okay";
203};
204
205&battery_power_supply {
206	status = "okay";
207};
208
209&reg_aldo1 {
210	regulator-always-on;
211	regulator-min-microvolt = <2800000>;
212	regulator-max-microvolt = <2800000>;
213	regulator-name = "vcc-pe";
214};
215
216&reg_aldo2 {
217	regulator-always-on;
218	regulator-min-microvolt = <3300000>;
219	regulator-max-microvolt = <3300000>;
220	regulator-name = "vcc-pl";
221};
222
223&reg_aldo3 {
224	regulator-always-on;
225	regulator-min-microvolt = <3000000>;
226	regulator-max-microvolt = <3000000>;
227	regulator-name = "vcc-pll-avcc";
228};
229
230&reg_dcdc1 {
231	regulator-always-on;
232	regulator-min-microvolt = <3300000>;
233	regulator-max-microvolt = <3300000>;
234	regulator-name = "vcc-3v3";
235};
236
237&reg_dcdc2 {
238	regulator-always-on;
239	regulator-min-microvolt = <1040000>;
240	regulator-max-microvolt = <1300000>;
241	regulator-name = "vdd-cpux";
242};
243
244/* DCDC3 is polyphased with DCDC2 */
245
246/*
247 * The board uses DDR3L DRAM chips. 1.36V is the closest to the nominal
248 * 1.35V that the PMIC can drive.
249 */
250&reg_dcdc5 {
251	regulator-always-on;
252	regulator-min-microvolt = <1360000>;
253	regulator-max-microvolt = <1360000>;
254	regulator-name = "vcc-ddr3";
255};
256
257&reg_dcdc6 {
258	regulator-always-on;
259	regulator-min-microvolt = <1100000>;
260	regulator-max-microvolt = <1100000>;
261	regulator-name = "vdd-sys";
262};
263
264&reg_dldo1 {
265	regulator-min-microvolt = <3300000>;
266	regulator-max-microvolt = <3300000>;
267	regulator-name = "vcc-hdmi";
268};
269
270&reg_dldo2 {
271	regulator-min-microvolt = <3300000>;
272	regulator-max-microvolt = <3300000>;
273	regulator-name = "vcc-mipi";
274};
275
276&reg_dldo3 {
277	regulator-min-microvolt = <2800000>;
278	regulator-max-microvolt = <2800000>;
279	regulator-name = "vcc-avdd-csi";
280};
281
282&reg_dldo4 {
283	regulator-min-microvolt = <3300000>;
284	regulator-max-microvolt = <3300000>;
285	regulator-name = "vcc-wifi-io";
286};
287
288&reg_drivevbus {
289	regulator-name = "usb0-vbus";
290	status = "okay";
291};
292
293&reg_eldo1 {
294	regulator-min-microvolt = <1800000>;
295	regulator-max-microvolt = <1800000>;
296	regulator-name = "cpvdd";
297};
298
299&reg_eldo2 {
300	regulator-min-microvolt = <1800000>;
301	regulator-max-microvolt = <1800000>;
302	regulator-name = "vcc-dvdd-csi";
303};
304
305&reg_fldo1 {
306	regulator-min-microvolt = <1200000>;
307	regulator-max-microvolt = <1200000>;
308	regulator-name = "vcc-1v2-hsic";
309};
310
311/*
312 * The A64 chip cannot work without this regulator off, although
313 * it seems to be only driving the AR100 core.
314 * Maybe we don't still know well about CPUs domain.
315 */
316&reg_fldo2 {
317	regulator-always-on;
318	regulator-min-microvolt = <1100000>;
319	regulator-max-microvolt = <1100000>;
320	regulator-name = "vdd-cpus";
321};
322
323&reg_rtc_ldo {
324	regulator-name = "vcc-rtc";
325};
326
327&simplefb_hdmi {
328	vcc-hdmi-supply = <&reg_dldo1>;
329};
330
331&uart0 {
332	pinctrl-names = "default";
333	pinctrl-0 = <&uart0_pb_pins>;
334	status = "okay";
335};
336
337&usb_otg {
338	dr_mode = "otg";
339	status = "okay";
340};
341
342&usbphy {
343	status = "okay";
344	usb0_id_det-gpios = <&pio 7 9 GPIO_ACTIVE_HIGH>; /* PH9 */
345	usb0_vbus-supply = <&reg_drivevbus>;
346	usb1_vbus-supply = <&reg_usb1_vbus>;
347};
348