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