xref: /freebsd/sys/contrib/device-tree/src/arm64/allwinner/sun55i-t527-avaota-a1.dts (revision 833e5d42ab135b0238e61c5b3c19b8619677cbfa)
1// SPDX-License-Identifier: (GPL-2.0-only OR MIT)
2// Copyright (C) 2024 Arm Ltd.
3
4/dts-v1/;
5
6#include "sun55i-a523.dtsi"
7
8#include <dt-bindings/gpio/gpio.h>
9
10/ {
11	model = "Avaota A1";
12	compatible = "yuzukihd,avaota-a1", "allwinner,sun55i-t527";
13
14	aliases {
15		ethernet0 = &gmac0;
16		serial0 = &uart0;
17	};
18
19	chosen {
20		stdout-path = "serial0:115200n8";
21	};
22
23	ext_osc32k: ext-osc32k-clk {
24		#clock-cells = <0>;
25		compatible = "fixed-clock";
26		clock-frequency = <32768>;
27		clock-output-names = "ext_osc32k";
28	};
29
30	reg_vcc12v: vcc12v {
31		/* DC input jack */
32		compatible = "regulator-fixed";
33		regulator-name = "vcc-12v";
34		regulator-min-microvolt = <12000000>;
35		regulator-max-microvolt = <12000000>;
36		regulator-always-on;
37	};
38
39	reg_vcc5v: vcc5v {
40		/* board wide 5V supply from the 12V->5V regulator */
41		compatible = "regulator-fixed";
42		regulator-name = "vcc-5v";
43		regulator-min-microvolt = <5000000>;
44		regulator-max-microvolt = <5000000>;
45		vin-supply = <&reg_vcc12v>;
46		regulator-always-on;
47	};
48
49	reg_usb_vbus: vbus {
50		compatible = "regulator-fixed";
51		regulator-name = "usb-vbus";
52		regulator-min-microvolt = <5000000>;
53		regulator-max-microvolt = <5000000>;
54		vin-supply = <&reg_vcc5v>;
55		gpio = <&pio 8 12 GPIO_ACTIVE_HIGH>;	/* PI12 */
56		enable-active-high;
57	};
58};
59
60&ehci0 {
61	status = "okay";
62};
63
64&ehci1 {
65	status = "okay";
66};
67
68&gmac0 {
69	phy-mode = "rgmii-id";
70	phy-handle = <&ext_rgmii_phy>;
71	phy-supply = <&reg_dcdc4>;
72
73	allwinner,tx-delay-ps = <100>;
74	allwinner,rx-delay-ps = <300>;
75
76	status = "okay";
77};
78
79&gpu {
80	mali-supply = <&reg_dcdc2>;
81	status = "okay";
82};
83
84&mdio0 {
85	ext_rgmii_phy: ethernet-phy@1 {
86		compatible = "ethernet-phy-ieee802.3-c22";
87		reg = <1>;
88	};
89};
90
91&mmc0 {
92	vmmc-supply = <&reg_cldo3>;
93	cd-gpios = <&pio 5 6 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /* PF6 */
94	bus-width = <4>;
95	status = "okay";
96};
97
98&mmc2 {
99	bus-width = <8>;
100	cap-mmc-hw-reset;
101	mmc-ddr-1_8v;
102	mmc-hs200-1_8v;
103	non-removable;
104	vmmc-supply = <&reg_cldo3>;
105	vqmmc-supply = <&reg_cldo1>;
106	status = "okay";
107};
108
109&ohci0 {
110	status = "okay";
111};
112
113&ohci1 {
114	status = "okay";
115};
116
117&pio {
118	vcc-pb-supply = <&reg_cldo3>;	/* via VCC-IO */
119	vcc-pc-supply = <&reg_cldo1>;
120	vcc-pd-supply = <&reg_dcdc4>;
121	vcc-pe-supply = <&reg_dcdc4>;
122	vcc-pf-supply = <&reg_cldo3>;	/* actually switchable */
123	vcc-pg-supply = <&reg_bldo1>;
124	vcc-ph-supply = <&reg_cldo3>;	/* via VCC-IO */
125	vcc-pi-supply = <&reg_dcdc4>;
126	vcc-pj-supply = <&reg_dcdc4>;
127	vcc-pk-supply = <&reg_bldo3>;
128};
129
130&r_i2c0 {
131	status = "okay";
132
133	axp717: pmic@35 {
134		compatible = "x-powers,axp717";
135		reg = <0x35>;
136		interrupt-controller;
137		#interrupt-cells = <1>;
138		interrupt-parent = <&nmi_intc>;
139		interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
140
141		vin1-supply = <&reg_vcc5v>;
142		vin2-supply = <&reg_vcc5v>;
143		vin3-supply = <&reg_vcc5v>;
144		vin4-supply = <&reg_vcc5v>;
145		aldoin-supply = <&reg_vcc5v>;
146		bldoin-supply = <&reg_vcc5v>;
147		cldoin-supply = <&reg_vcc5v>;
148
149		regulators {
150			/* Supplies the "little" cluster (1.4 GHz cores) */
151			reg_dcdc1: dcdc1 {
152				regulator-always-on;
153				regulator-min-microvolt = <900000>;
154				regulator-max-microvolt = <1160000>;
155				regulator-name = "vdd-cpul";
156			};
157
158			reg_dcdc2: dcdc2 {
159				regulator-always-on;
160				regulator-min-microvolt = <920000>;
161				regulator-max-microvolt = <920000>;
162				regulator-name = "vdd-gpu-sys";
163			};
164
165			reg_dcdc3: dcdc3 {
166				regulator-always-on;
167				regulator-min-microvolt = <1160000>;
168				regulator-max-microvolt = <1160000>;
169				regulator-name = "vdd-dram";
170			};
171
172			reg_dcdc4: dcdc4 {
173				regulator-always-on;
174				regulator-min-microvolt = <3300000>;
175				regulator-max-microvolt = <3300000>;
176				regulator-name = "vdd-io";
177			};
178
179			reg_aldo1: aldo1 {
180				/* not connected */
181			};
182
183			reg_aldo2: aldo2 {
184				/* not connected */
185			};
186
187			reg_aldo3: aldo3 {
188				/* supplies the I2C pins for this PMIC */
189				regulator-always-on;
190				regulator-min-microvolt = <3300000>;
191				regulator-max-microvolt = <3300000>;
192				regulator-name = "vcc-pl-pm";
193			};
194
195			reg_aldo4: aldo4 {
196				regulator-always-on;
197				regulator-min-microvolt = <1800000>;
198				regulator-max-microvolt = <1800000>;
199				regulator-name = "vcc-pll-dxco-avcc";
200			};
201
202			reg_bldo1: bldo1 {
203				regulator-min-microvolt = <1800000>;
204				regulator-max-microvolt = <1800000>;
205				regulator-name = "vcc-pg-wifi-lvds";
206			};
207
208			reg_bldo2: bldo2 {
209				regulator-always-on;
210				regulator-min-microvolt = <1800000>;
211				regulator-max-microvolt = <1800000>;
212				regulator-name = "vcc-dram-1v8";
213			};
214
215			reg_bldo3: bldo3 {
216				regulator-min-microvolt = <1800000>;
217				regulator-max-microvolt = <1800000>;
218				regulator-name = "vcc-cvp-pk-vid1v8";
219			};
220
221			reg_bldo4: bldo4 {
222				/* not connected */
223			};
224
225			reg_cldo1: cldo1 {
226				regulator-min-microvolt = <1800000>;
227				regulator-max-microvolt = <1800000>;
228				regulator-name = "vcc-pc";
229			};
230
231			reg_cldo2: cldo2 {
232				regulator-min-microvolt = <1800000>;
233				regulator-max-microvolt = <1800000>;
234				regulator-name = "vcc-efuse";
235			};
236
237			reg_cldo3: cldo3 {
238				regulator-min-microvolt = <3300000>;
239				regulator-max-microvolt = <3300000>;
240				regulator-name = "vcc-io-mmc-spi-ana";
241			};
242
243			reg_cldo4: cldo4 {
244				/* not connected */
245			};
246
247			reg_cpusldo: cpusldo {
248				/* supplies the management core */
249				regulator-always-on;
250				regulator-min-microvolt = <900000>;
251				regulator-max-microvolt = <900000>;
252				regulator-name = "vdd-cpus";
253			};
254		};
255	};
256
257	axp323: pmic@36 {
258		compatible = "x-powers,axp323";
259		reg = <0x36>;
260		#interrupt-cells = <1>;
261		interrupt-controller;
262		interrupt-parent = <&nmi_intc>;
263		interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
264		status = "okay";
265
266		vin1-supply = <&reg_vcc5v>;
267		vin2-supply = <&reg_vcc5v>;
268		vin3-supply = <&reg_vcc5v>;
269
270		regulators {
271			aldo1 {
272				/* not connected */
273			};
274
275			dldo1 {
276				/* not connected */
277			};
278
279			/* Supplies the "big" cluster (1.8 GHz cores) */
280			reg_dcdc1_323: dcdc1 {
281				regulator-always-on;
282				regulator-min-microvolt = <900000>;
283				regulator-max-microvolt = <1160000>;
284				regulator-name = "vdd-cpub";
285			};
286
287			/* DCDC2 is polyphased with DCDC1 */
288
289			/* Some RISC-V management core related voltage */
290			reg_dcdc3_323: dcdc3 {
291				regulator-always-on;
292				regulator-min-microvolt = <900000>;
293				regulator-max-microvolt = <900000>;
294				regulator-name = "vdd-dnr";
295			};
296		};
297	};
298};
299
300&r_pio {
301/*
302 * Specifying the supply would create a circular dependency.
303 *
304 *	vcc-pl-supply = <&reg_aldo3>;
305 */
306	vcc-pm-supply = <&reg_aldo3>;
307};
308
309&uart0 {
310	pinctrl-names = "default";
311	pinctrl-0 = <&uart0_pb_pins>;
312	status = "okay";
313};
314
315&usb_otg {
316	 /*
317	  * The CC pins of the USB-C port have two pull-down resistors
318	  * connected to GND, which fixes this port to a peripheral role.
319	  * There is a regulator, controlled by a GPIO, to provide VBUS power
320	  * to the port, and a VBUSDET GPIO, to detect externally provided
321	  * power, but without the CC pins there is no real way to do a
322	  * runtime role detection.
323	  */
324	dr_mode = "peripheral";
325	status = "okay";
326};
327
328&usbphy {
329	usb0_vbus-supply = <&reg_usb_vbus>;
330	usb0_vbus_det-gpios = <&pio 8 13 GPIO_ACTIVE_HIGH>; /* PI13 */
331	status = "okay";
332};
333