summaryrefslogtreecommitdiff
path: root/arch/arm64/boot/dts/allwinner/sun55i-a527-cubie-a5e.dts
blob: bfdf1728cd14b61b371180acd4ab6b631efa73b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
// SPDX-License-Identifier: (GPL-2.0-only OR MIT)
// Copyright (C) 2025 Arm Ltd.

/dts-v1/;

#include "sun55i-a523.dtsi"

#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/leds/common.h>

/ {
	model = "Radxa Cubie A5E";
	compatible = "radxa,cubie-a5e", "allwinner,sun55i-a527";

	aliases {
		ethernet0 = &gmac0;
		ethernet1 = &gmac1;
		serial0 = &uart0;
	};

	chosen {
		stdout-path = "serial0:115200n8";
	};

	leds {
		compatible = "gpio-leds";

		power-led {
			function = LED_FUNCTION_POWER;
			color = <LED_COLOR_ID_GREEN>;
			gpios = <&r_pio 0 4 GPIO_ACTIVE_LOW>; /* PL4 */
			default-state = "on";
			linux,default-trigger = "heartbeat";
		};

		use-led {
			function = LED_FUNCTION_ACTIVITY;
			color = <LED_COLOR_ID_BLUE>;
			gpios = <&r_pio 0 5 GPIO_ACTIVE_LOW>; /* PL5 */
		};
	};

	iio-hwmon {
		compatible = "iio-hwmon";
		io-channels = <&axp717_adc 3>, /* vsys_v */
			      <&axp717_adc 4>; /* pmic_temp */
	};

	reg_vcc5v: vcc5v {
		/* board wide 5V supply from the USB-C connector */
		compatible = "regulator-fixed";
		regulator-name = "vcc-5v";
		regulator-min-microvolt = <5000000>;
		regulator-max-microvolt = <5000000>;
		regulator-always-on;
	};

	reg_usb_vbus: vbus {
		compatible = "regulator-fixed";
		regulator-name = "usb-vbus";
		regulator-min-microvolt = <5000000>;
		regulator-max-microvolt = <5000000>;
		vin-supply = <&reg_vcc5v>;
		gpio = <&r_pio 0 8 GPIO_ACTIVE_HIGH>;	/* PL8 */
		enable-active-high;
	};
};

&ehci0 {
	status = "okay";
};

&ehci1 {
	status = "okay";
};

&gmac0 {
	phy-mode = "rgmii-id";
	phy-handle = <&ext_rgmii0_phy>;
	phy-supply = <&reg_cldo3>;

	allwinner,tx-delay-ps = <300>;
	allwinner,rx-delay-ps = <400>;

	status = "okay";
};

&gmac1 {
	phy-mode = "rgmii-id";
	phy-handle = <&ext_rgmii1_phy>;
	phy-supply = <&reg_cldo4>;

	tx-internal-delay-ps = <300>;
	rx-internal-delay-ps = <400>;

	status = "okay";
};

&gpu {
	mali-supply = <&reg_dcdc2>;
	status = "okay";
};

&mdio0 {
	ext_rgmii0_phy: ethernet-phy@1 {
		compatible = "ethernet-phy-ieee802.3-c22";
		reg = <1>;
		reset-gpios = <&pio 7 8 GPIO_ACTIVE_LOW>; /* PH8 */
		reset-assert-us = <10000>;
		reset-deassert-us = <150000>;
	};
};

&mdio1 {
	ext_rgmii1_phy: ethernet-phy@1 {
		compatible = "ethernet-phy-ieee802.3-c22";
		reg = <1>;
		reset-gpios = <&pio 9 16 GPIO_ACTIVE_LOW>; /* PJ16 */
		reset-assert-us = <10000>;
		reset-deassert-us = <150000>;
	};
};

&mmc0 {
	vmmc-supply = <&reg_cldo3>;
	cd-gpios = <&pio 5 6 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /* PF6 */
	bus-width = <4>;
	status = "okay";
};

&ohci0 {
	status = "okay";
};

&ohci1 {
	status = "okay";
};

&pio {
	vcc-pb-supply = <&reg_cldo3>;	/* via VCC-IO */
	vcc-pc-supply = <&reg_cldo1>;
	vcc-pd-supply = <&reg_cldo3>;
	vcc-pe-supply = <&reg_aldo2>;
	vcc-pf-supply = <&reg_cldo3>;	/* actually switchable */
	vcc-pg-supply = <&reg_bldo1>;
	vcc-ph-supply = <&reg_cldo3>;	/* via VCC-IO */
	vcc-pi-supply = <&reg_cldo3>;
	vcc-pj-supply = <&reg_cldo4>;
	vcc-pk-supply = <&reg_cldo1>;
};

&r_i2c0 {
	status = "okay";

	axp717: pmic@34 {
		compatible = "x-powers,axp717";
		reg = <0x34>;
		interrupt-controller;
		#interrupt-cells = <1>;
		interrupt-parent = <&nmi_intc>;
		interrupts = <0 IRQ_TYPE_LEVEL_LOW>;

		vin1-supply = <&reg_vcc5v>;
		vin2-supply = <&reg_vcc5v>;
		vin3-supply = <&reg_vcc5v>;
		vin4-supply = <&reg_vcc5v>;
		aldoin-supply = <&reg_vcc5v>;
		bldoin-supply = <&reg_vcc5v>;
		cldoin-supply = <&reg_vcc5v>;

		axp717_adc: adc {
			compatible = "x-powers,axp717-adc";
			#io-channel-cells = <1>;
		};

		battery-power {
			compatible = "x-powers,axp717-battery-power-supply";
			/* charger mode design but has no battery terminal */
			status = "disabled";
		};

		regulators {
			/* Supplies the "little" cluster (1.4 GHz cores) */
			reg_dcdc1: dcdc1 {
				regulator-always-on;
				regulator-min-microvolt = <900000>;
				regulator-max-microvolt = <1160000>;
				regulator-name = "vdd-cpul";
			};

			reg_dcdc2: dcdc2 {
				regulator-always-on;
				regulator-min-microvolt = <920000>;
				regulator-max-microvolt = <920000>;
				regulator-name = "vdd-gpu-sys";
			};

			reg_dcdc3: dcdc3 {
				regulator-always-on;
				regulator-min-microvolt = <1100000>;
				regulator-max-microvolt = <1100000>;
				regulator-name = "vdd-dram";
			};

			reg_aldo1: aldo1 {
				/* not connected */
			};

			reg_aldo2: aldo2 {
				regulator-min-microvolt = <1800000>;
				regulator-max-microvolt = <1800000>;
				regulator-name = "vcc-pe";
			};

			reg_aldo3: aldo3 {
				/* supplies the I2C pins for this PMIC */
				regulator-always-on;
				regulator-min-microvolt = <3300000>;
				regulator-max-microvolt = <3300000>;
				regulator-name = "vcc-pl-usb";
			};

			reg_aldo4: aldo4 {
				regulator-always-on;
				regulator-min-microvolt = <1800000>;
				regulator-max-microvolt = <1800000>;
				regulator-name = "vcc-pll-dxco-avcc";
			};

			reg_bldo1: bldo1 {
				regulator-min-microvolt = <1800000>;
				regulator-max-microvolt = <1800000>;
				regulator-name = "vcc-pg-iowifi";
			};

			reg_bldo2: bldo2 {
				regulator-always-on;
				regulator-min-microvolt = <1800000>;
				regulator-max-microvolt = <1800000>;
				regulator-name = "vcc-pm-lpddr4";
			};

			reg_bldo3: bldo3 {
				regulator-min-microvolt = <3300000>;
				regulator-max-microvolt = <3300000>;
				regulator-name = "vcc-mipi-cam";
			};

			reg_bldo4: bldo4 {
				/* not connected */
			};

			reg_cldo1: cldo1 {
				regulator-min-microvolt = <1800000>;
				regulator-max-microvolt = <1800000>;
				regulator-name = "vcc-pc-and-their-dog";
			};

			reg_cldo2: cldo2 {
				/* not connected */
			};

			reg_cldo3: cldo3 {
				/* IO, USB-2, 3V3, card, NAND, sensor, PI */
				regulator-always-on;
				regulator-min-microvolt = <3300000>;
				regulator-max-microvolt = <3300000>;
				regulator-name = "vcc-io-mmc-spi-ana";
			};

			reg_cldo4: cldo4 {
				regulator-min-microvolt = <3300000>;
				regulator-max-microvolt = <3300000>;
				regulator-name = "vcc-pj-phy";
				/* enough time for the PHY to fully power on */
				regulator-enable-ramp-delay = <150000>;
			};

			reg_cpusldo: cpusldo {
				/* supplies the management core */
				regulator-always-on;
				regulator-min-microvolt = <900000>;
				regulator-max-microvolt = <900000>;
				regulator-name = "vdd-cpus";
			};
		};

		usb-power {
			compatible = "x-powers,axp717-usb-power-supply";
		};
	};

	axp323: pmic@36 {
		compatible = "x-powers,axp323";
		reg = <0x36>;
		#interrupt-cells = <1>;
		interrupt-controller;
		interrupt-parent = <&nmi_intc>;
		interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
		status = "okay";

		vin1-supply = <&reg_vcc5v>;
		vin2-supply = <&reg_vcc5v>;
		vin3-supply = <&reg_vcc5v>;

		regulators {
			aldo1 {
				regulator-min-microvolt = <1800000>;
				regulator-max-microvolt = <1800000>;
				regulator-name = "vcc-mipi-dsi";
			};

			dldo1 {
				/* not connected */
			};

			/* Supplies the "big" cluster (1.8 GHz cores) */
			reg_dcdc1_323: dcdc1 {
				regulator-always-on;
				regulator-min-microvolt = <900000>;
				regulator-max-microvolt = <1160000>;
				regulator-name = "vdd-cpub";
			};

			/* DCDC2 is polyphased with DCDC1 */

			/* RISC-V management core supply */
			reg_dcdc3_323: dcdc3 {
				regulator-always-on;
				regulator-min-microvolt = <900000>;
				regulator-max-microvolt = <900000>;
				regulator-name = "vdd-dnr";
			};
		};
	};
};

&r_pio {
/*
 * Specifying the supply would create a circular dependency.
 *
 *	vcc-pl-supply = <&reg_aldo3>;
 */
	vcc-pm-supply = <&reg_aldo3>;
};

&uart0 {
	pinctrl-names = "default";
	pinctrl-0 = <&uart0_pb_pins>;
	status = "okay";
};

&usb_otg {
	/*
	 * The USB-C port is the primary power supply, so in this configuration
	 * relies on the other end of the USB cable to supply the VBUS power.
	 * So use this port in peripheral mode.
	 * It is possible to supply the board with the 5V pins on the GPIO
	 * header, and since the DCIN_5V line is hardwired to the USB-C VBUS
	 * pins, the port turns into a host port, unconditionally supplying
	 * power. The dr_mode property should be changed to "host" here, if
	 * users choose this setup.
	 */
	dr_mode = "peripheral";
	status = "okay";
};

/*
 * The schematic describes USB0_ID (PL10), measuring VBUS_5V, which looks to
 * be always on. Also there is USB-VBUSDET (PL2), which is measuring the same
 * VBUS_5V. There is also DCIN_DET, which measures DCIN_5V, so the power
 * input rail.
 * None of them seem to make any sense in relation to detecting USB devices
 * or whether there is power provided via any USB pins: they would always
 * report high, otherwise the system wouldn't be running.
 * The AXP717C provides proper USB-C CC pin functionality, but the PMIC is
 * not connected to those pins of the USB-C connector.
 */
&usbphy {
	usb0_vbus-supply = <&reg_vcc5v>;
	usb1_vbus-supply = <&reg_usb_vbus>;
	status = "okay";
};