1// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2/*
3 * Copyright (C) 2018 Amarula Solutions B.V.
4 * Author: Jagan Teki <jagan@amarulasolutions.com>
5 */
6
7/dts-v1/;
8
9#include "sun50i-a64.dtsi"
10
11#include <dt-bindings/gpio/gpio.h>
12
13/ {
14	model = "Amarula A64-Relic";
15	compatible = "amarula,a64-relic", "allwinner,sun50i-a64";
16
17	aliases {
18		serial0 = &uart0;
19	};
20
21	chosen {
22		stdout-path = "serial0:115200n8";
23	};
24};
25
26&ehci0 {
27	status = "okay";
28};
29
30&mmc2 {
31	pinctrl-names = "default";
32	pinctrl-0 = <&mmc2_pins>;
33	vmmc-supply = <&reg_dcdc1>;
34	bus-width = <8>;
35	non-removable;
36	cap-mmc-hw-reset;
37	status = "okay";
38};
39
40&ohci0 {
41	status = "okay";
42};
43
44&r_rsb {
45	status = "okay";
46
47	axp803: pmic@3a3 {
48		compatible = "x-powers,axp803";
49		reg = <0x3a3>;
50		interrupt-parent = <&r_intc>;
51		interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
52		x-powers,drive-vbus-en; /* set N_VBUSEN as output pin */
53	};
54};
55
56#include "axp803.dtsi"
57
58&reg_aldo1 {
59	regulator-always-on;
60	regulator-min-microvolt = <2800000>;
61	regulator-max-microvolt = <2800000>;
62	regulator-name = "avdd-csi";
63};
64
65&reg_aldo2 {
66	regulator-always-on;
67	regulator-min-microvolt = <1800000>;
68	regulator-max-microvolt = <3300000>;
69	regulator-name = "vcc-pl";
70};
71
72&reg_aldo3 {
73	regulator-always-on;
74	regulator-min-microvolt = <3000000>;
75	regulator-max-microvolt = <3000000>;
76	regulator-name = "vcc-pll-avcc";
77};
78
79&reg_dcdc1 {
80	regulator-always-on;
81	regulator-min-microvolt = <3300000>;
82	regulator-max-microvolt = <3300000>;
83	regulator-name = "vcc-3v3";
84};
85
86&reg_dcdc2 {
87	regulator-always-on;
88	regulator-min-microvolt = <1040000>;
89	regulator-max-microvolt = <1300000>;
90	regulator-name = "vdd-cpux";
91};
92
93/* DCDC3 is polyphased with DCDC2 */
94
95&reg_dcdc5 {
96	regulator-always-on;
97	regulator-min-microvolt = <1500000>;
98	regulator-max-microvolt = <1500000>;
99	regulator-name = "vcc-dram";
100};
101
102&reg_dcdc6 {
103	regulator-always-on;
104	regulator-min-microvolt = <1100000>;
105	regulator-max-microvolt = <1100000>;
106	regulator-name = "vdd-sys";
107};
108
109&reg_dldo1 {
110	regulator-min-microvolt = <3300000>;
111	regulator-max-microvolt = <3300000>;
112	regulator-name = "vcc-hdmi-dsi-sensor";
113};
114
115&reg_dldo2 {
116	regulator-min-microvolt = <3300000>;
117	regulator-max-microvolt = <3300000>;
118	regulator-name = "vcc-mipi";
119};
120
121&reg_dldo3 {
122	regulator-min-microvolt = <2800000>;
123	regulator-max-microvolt = <2800000>;
124	regulator-name = "dovdd-csi";
125};
126
127&reg_dldo4 {
128	regulator-min-microvolt = <3300000>;
129	regulator-max-microvolt = <3300000>;
130	regulator-name = "vcc-wifi-io";
131};
132
133&reg_drivevbus {
134	regulator-name = "usb0-vbus";
135	status = "okay";
136};
137
138&reg_eldo1 {
139	regulator-always-on;
140	regulator-min-microvolt = <1800000>;
141	regulator-max-microvolt = <1800000>;
142	regulator-name = "cpvdd";
143};
144
145&reg_eldo3 {
146	regulator-min-microvolt = <1800000>;
147	regulator-max-microvolt = <1800000>;
148	regulator-name = "dvdd-csi";
149};
150
151&reg_fldo1 {
152	regulator-min-microvolt = <1200000>;
153	regulator-max-microvolt = <1200000>;
154	regulator-name = "vcc-1v2-hsic";
155};
156
157/*
158 * The A64 chip cannot work without this regulator off, although
159 * it seems to be only driving the AR100 core.
160 * Maybe we don't still know well about CPUs domain.
161 */
162&reg_fldo2 {
163	regulator-always-on;
164	regulator-min-microvolt = <1100000>;
165	regulator-max-microvolt = <1100000>;
166	regulator-name = "vdd-cpus";
167};
168
169&reg_rtc_ldo {
170	regulator-name = "vcc-rtc";
171};
172
173&uart0 {
174	pinctrl-names = "default";
175	pinctrl-0 = <&uart0_pins_a>;
176	status = "okay";
177};
178
179&usb_otg {
180	dr_mode = "otg";
181	status = "okay";
182};
183
184&usbphy {
185	usb0_id_det-gpios = <&pio 7 9 GPIO_ACTIVE_HIGH>; /* PH9 */
186	usb0_vbus-supply = <&reg_drivevbus>;
187	status = "okay";
188};
189