1/*
2 * Copyright (C) Harald Geyer <harald@ccbib.org>
3 * based on sun50i-a64-olinuxino.dts by Jagan Teki <jteki@openedev.com>
4 *
5 * SPDX-License-Identifier: (GPL-2.0 OR MIT)
6 */
7
8/dts-v1/;
9
10#include "sun50i-a64.dtsi"
11
12#include <dt-bindings/gpio/gpio.h>
13#include <dt-bindings/input/input.h>
14#include <dt-bindings/pwm/pwm.h>
15
16/ {
17	model = "Olimex A64 Teres-I";
18	compatible = "olimex,a64-teres-i", "allwinner,sun50i-a64";
19
20	aliases {
21		serial0 = &uart0;
22	};
23
24	chosen {
25		stdout-path = "serial0:115200n8";
26
27		framebuffer-lcd {
28			eDP25-supply = <&reg_dldo2>;
29			eDP12-supply = <&reg_dldo3>;
30		};
31	};
32
33	gpio-keys {
34		compatible = "gpio-keys";
35
36		lid-switch {
37			label = "Lid Switch";
38			gpios = <&r_pio 0 8 GPIO_ACTIVE_LOW>; /* PL8 */
39			linux,input-type = <EV_SW>;
40			linux,code = <SW_LID>;
41		};
42	};
43
44	leds {
45		compatible = "gpio-leds";
46
47		capslock {
48			label = "teres-i:green:capslock";
49			gpios = <&pio 2 7 GPIO_ACTIVE_HIGH>; /* PC7 */
50		};
51
52		numlock {
53			label = "teres-i:green:numlock";
54			gpios = <&pio 2 4 GPIO_ACTIVE_HIGH>; /* PC4 */
55		};
56	};
57
58	reg_usb1_vbus: usb1-vbus {
59		compatible = "regulator-fixed";
60		regulator-name = "usb1-vbus";
61		regulator-min-microvolt = <5000000>;
62		regulator-max-microvolt = <5000000>;
63		enable-active-high;
64		gpio = <&r_pio 0 7 GPIO_ACTIVE_HIGH>; /* PL7 */
65		status = "okay";
66	};
67
68	wifi_pwrseq: wifi_pwrseq {
69		compatible = "mmc-pwrseq-simple";
70		reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
71	};
72};
73
74&ehci1 {
75	status = "okay";
76};
77
78
79/* The ANX6345 eDP-bridge is on i2c0. There is no linux (mainline)
80 * driver for this chip at the moment, the bootloader initializes it.
81 * However it can be accessed with the i2c-dev driver from user space.
82 */
83&i2c0 {
84	clock-frequency = <100000>;
85	pinctrl-names = "default";
86	pinctrl-0 = <&i2c0_pins>;
87	status = "okay";
88};
89
90&mmc0 {
91	pinctrl-names = "default";
92	pinctrl-0 = <&mmc0_pins>;
93	vmmc-supply = <&reg_dcdc1>;
94	cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>;
95	disable-wp;
96	bus-width = <4>;
97	status = "okay";
98};
99
100&mmc1 {
101	pinctrl-names = "default";
102	pinctrl-0 = <&mmc1_pins>;
103	vmmc-supply = <&reg_aldo2>;
104	vqmmc-supply = <&reg_dldo4>;
105	mmc-pwrseq = <&wifi_pwrseq>;
106	bus-width = <4>;
107	non-removable;
108	status = "okay";
109
110	rtl8723bs: wifi@1 {
111		reg = <1>;
112		interrupt-parent = <&r_pio>;
113		interrupts = <0 3 IRQ_TYPE_LEVEL_LOW>; /* PL3 */
114		interrupt-names = "host-wake";
115	};
116};
117
118&mmc2 {
119	pinctrl-names = "default";
120	pinctrl-0 = <&mmc2_pins>;
121	vmmc-supply = <&reg_dcdc1>;
122	vqmmc-supply = <&reg_dcdc1>;
123	bus-width = <8>;
124	non-removable;
125	cap-mmc-hw-reset;
126	status = "okay";
127};
128
129&ohci1 {
130	status = "okay";
131};
132
133&r_rsb {
134	status = "okay";
135
136	axp803: pmic@3a3 {
137		compatible = "x-powers,axp803";
138		reg = <0x3a3>;
139		interrupt-parent = <&r_intc>;
140		interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
141		wakeup-source;
142	};
143};
144
145#include "axp803.dtsi"
146
147&reg_aldo1 {
148	regulator-always-on;
149	regulator-min-microvolt = <2800000>;
150	regulator-max-microvolt = <2800000>;
151	regulator-name = "vcc-pe";
152};
153
154&reg_aldo2 {
155	regulator-always-on;
156	regulator-min-microvolt = <3300000>;
157	regulator-max-microvolt = <3300000>;
158	regulator-name = "vcc-pl";
159};
160
161&reg_aldo3 {
162	regulator-always-on;
163	regulator-min-microvolt = <3000000>;
164	regulator-max-microvolt = <3000000>;
165	regulator-name = "vcc-pll-avcc";
166};
167
168&reg_dcdc1 {
169	regulator-always-on;
170	regulator-min-microvolt = <3300000>;
171	regulator-max-microvolt = <3300000>;
172	regulator-name = "vcc-3v3";
173};
174
175&reg_dcdc2 {
176	regulator-always-on;
177	regulator-min-microvolt = <1040000>;
178	regulator-max-microvolt = <1300000>;
179	regulator-name = "vdd-cpux";
180};
181
182/* DCDC3 is polyphased with DCDC2 */
183
184&reg_dcdc5 {
185	regulator-always-on;
186	regulator-min-microvolt = <1500000>;
187	regulator-max-microvolt = <1500000>;
188	regulator-name = "vcc-ddr3";
189};
190
191&reg_dcdc6 {
192	regulator-always-on;
193	regulator-min-microvolt = <1100000>;
194	regulator-max-microvolt = <1100000>;
195	regulator-name = "vdd-sys";
196};
197
198&reg_dldo1 {
199	regulator-min-microvolt = <3300000>;
200	regulator-max-microvolt = <3300000>;
201	regulator-name = "vcc-hdmi";
202};
203
204&reg_dldo2 {
205	regulator-min-microvolt = <2500000>;
206	regulator-max-microvolt = <2500000>;
207	regulator-name = "vcc-pd";
208};
209
210&reg_dldo3 {
211	regulator-min-microvolt = <1200000>;
212	regulator-max-microvolt = <1200000>;
213	regulator-name = "vdd-edp";
214};
215
216&reg_dldo4 {
217	regulator-min-microvolt = <3300000>;
218	regulator-max-microvolt = <3300000>;
219	regulator-name = "vcc-wifi-io";
220};
221
222&reg_eldo1 {
223	regulator-min-microvolt = <1800000>;
224	regulator-max-microvolt = <1800000>;
225	regulator-name = "cpvdd";
226};
227
228&reg_eldo2 {
229	regulator-min-microvolt = <1800000>;
230	regulator-max-microvolt = <1800000>;
231	regulator-name = "vcc-dvdd-csi";
232};
233
234&reg_fldo1 {
235	regulator-min-microvolt = <1200000>;
236	regulator-max-microvolt = <1200000>;
237	regulator-name = "vcc-1v2-hsic";
238};
239
240/*
241 * The A64 chip cannot work without this regulator off, although
242 * it seems to be only driving the AR100 core.
243 * Maybe we don't still know well about CPUs domain.
244 */
245&reg_fldo2 {
246	regulator-always-on;
247	regulator-min-microvolt = <1100000>;
248	regulator-max-microvolt = <1100000>;
249	regulator-name = "vdd-cpus";
250};
251
252&reg_rtc_ldo {
253	regulator-name = "vcc-rtc";
254};
255
256&uart0 {
257	pinctrl-names = "default";
258	pinctrl-0 = <&uart0_pins_a>;
259	status = "okay";
260};
261
262&usbphy {
263	usb1_vbus-supply = <&reg_usb1_vbus>;
264	status = "okay";
265};
266