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