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>;
4148f3e7bfSIcenowy Zheng			wakeup-source;
42c916eb95SHarald Geyer		};
43c916eb95SHarald Geyer	};
44c916eb95SHarald Geyer
45c916eb95SHarald Geyer	leds {
46c916eb95SHarald Geyer		compatible = "gpio-leds";
47c916eb95SHarald Geyer
48c916eb95SHarald Geyer		capslock {
49c916eb95SHarald Geyer			label = "teres-i:green:capslock";
50c916eb95SHarald Geyer			gpios = <&pio 2 7 GPIO_ACTIVE_HIGH>; /* PC7 */
51c916eb95SHarald Geyer		};
52c916eb95SHarald Geyer
53c916eb95SHarald Geyer		numlock {
54c916eb95SHarald Geyer			label = "teres-i:green:numlock";
55c916eb95SHarald Geyer			gpios = <&pio 2 4 GPIO_ACTIVE_HIGH>; /* PC4 */
56c916eb95SHarald Geyer		};
57c916eb95SHarald Geyer	};
58c916eb95SHarald Geyer
59c916eb95SHarald Geyer	reg_usb1_vbus: usb1-vbus {
60c916eb95SHarald Geyer		compatible = "regulator-fixed";
61c916eb95SHarald Geyer		regulator-name = "usb1-vbus";
62c916eb95SHarald Geyer		regulator-min-microvolt = <5000000>;
63c916eb95SHarald Geyer		regulator-max-microvolt = <5000000>;
64c916eb95SHarald Geyer		enable-active-high;
65c916eb95SHarald Geyer		gpio = <&r_pio 0 7 GPIO_ACTIVE_HIGH>; /* PL7 */
66c916eb95SHarald Geyer		status = "okay";
67c916eb95SHarald Geyer	};
68c916eb95SHarald Geyer
69c916eb95SHarald Geyer	wifi_pwrseq: wifi_pwrseq {
70c916eb95SHarald Geyer		compatible = "mmc-pwrseq-simple";
71c916eb95SHarald Geyer		reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
72c916eb95SHarald Geyer	};
73c916eb95SHarald Geyer};
74c916eb95SHarald Geyer
75c916eb95SHarald Geyer&ehci1 {
76c916eb95SHarald Geyer	status = "okay";
77c916eb95SHarald Geyer};
78c916eb95SHarald Geyer
79c916eb95SHarald Geyer
80c916eb95SHarald Geyer/* The ANX6345 eDP-bridge is on i2c0. There is no linux (mainline)
81c916eb95SHarald Geyer * driver for this chip at the moment, the bootloader initializes it.
82c916eb95SHarald Geyer * However it can be accessed with the i2c-dev driver from user space.
83c916eb95SHarald Geyer */
84c916eb95SHarald Geyer&i2c0 {
85c916eb95SHarald Geyer	clock-frequency = <100000>;
86c916eb95SHarald Geyer	pinctrl-names = "default";
87c916eb95SHarald Geyer	pinctrl-0 = <&i2c0_pins>;
88c916eb95SHarald Geyer	status = "okay";
89c916eb95SHarald Geyer};
90c916eb95SHarald Geyer
91c916eb95SHarald Geyer&mmc0 {
92c916eb95SHarald Geyer	pinctrl-names = "default";
93c916eb95SHarald Geyer	pinctrl-0 = <&mmc0_pins>;
94c916eb95SHarald Geyer	vmmc-supply = <&reg_dcdc1>;
95c916eb95SHarald Geyer	cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>;
96c916eb95SHarald Geyer	disable-wp;
97c916eb95SHarald Geyer	bus-width = <4>;
98c916eb95SHarald Geyer	status = "okay";
99c916eb95SHarald Geyer};
100c916eb95SHarald Geyer
101c916eb95SHarald Geyer&mmc1 {
102c916eb95SHarald Geyer	pinctrl-names = "default";
103c916eb95SHarald Geyer	pinctrl-0 = <&mmc1_pins>;
104c916eb95SHarald Geyer	vmmc-supply = <&reg_aldo2>;
105c916eb95SHarald Geyer	vqmmc-supply = <&reg_dldo4>;
106c916eb95SHarald Geyer	mmc-pwrseq = <&wifi_pwrseq>;
107c916eb95SHarald Geyer	bus-width = <4>;
108c916eb95SHarald Geyer	non-removable;
109c916eb95SHarald Geyer	status = "okay";
110c916eb95SHarald Geyer
111c916eb95SHarald Geyer	rtl8723bs: wifi@1 {
112c916eb95SHarald Geyer		reg = <1>;
113c916eb95SHarald Geyer		interrupt-parent = <&r_pio>;
114c916eb95SHarald Geyer		interrupts = <0 3 IRQ_TYPE_LEVEL_LOW>; /* PL3 */
115c916eb95SHarald Geyer		interrupt-names = "host-wake";
116c916eb95SHarald Geyer	};
117c916eb95SHarald Geyer};
118c916eb95SHarald Geyer
119c916eb95SHarald Geyer&mmc2 {
120c916eb95SHarald Geyer	pinctrl-names = "default";
121c916eb95SHarald Geyer	pinctrl-0 = <&mmc2_pins>;
122c916eb95SHarald Geyer	vmmc-supply = <&reg_dcdc1>;
123c916eb95SHarald Geyer	vqmmc-supply = <&reg_dcdc1>;
124c916eb95SHarald Geyer	bus-width = <8>;
125c916eb95SHarald Geyer	non-removable;
126c916eb95SHarald Geyer	cap-mmc-hw-reset;
127c916eb95SHarald Geyer	status = "okay";
128c916eb95SHarald Geyer};
129c916eb95SHarald Geyer
130c916eb95SHarald Geyer&ohci1 {
131c916eb95SHarald Geyer	status = "okay";
132c916eb95SHarald Geyer};
133c916eb95SHarald Geyer
134c916eb95SHarald Geyer&r_rsb {
135c916eb95SHarald Geyer	status = "okay";
136c916eb95SHarald Geyer
137c916eb95SHarald Geyer	axp803: pmic@3a3 {
138c916eb95SHarald Geyer		compatible = "x-powers,axp803";
139c916eb95SHarald Geyer		reg = <0x3a3>;
140c916eb95SHarald Geyer		interrupt-parent = <&r_intc>;
141c916eb95SHarald Geyer		interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
142c916eb95SHarald Geyer		wakeup-source;
143c916eb95SHarald Geyer	};
144c916eb95SHarald Geyer};
145c916eb95SHarald Geyer
146c916eb95SHarald Geyer#include "axp803.dtsi"
147c916eb95SHarald Geyer
148c916eb95SHarald Geyer&reg_aldo1 {
149c916eb95SHarald Geyer	regulator-always-on;
150c916eb95SHarald Geyer	regulator-min-microvolt = <2800000>;
151c916eb95SHarald Geyer	regulator-max-microvolt = <2800000>;
152c916eb95SHarald Geyer	regulator-name = "vcc-pe";
153c916eb95SHarald Geyer};
154c916eb95SHarald Geyer
155c916eb95SHarald Geyer&reg_aldo2 {
156c916eb95SHarald Geyer	regulator-always-on;
157c916eb95SHarald Geyer	regulator-min-microvolt = <3300000>;
158c916eb95SHarald Geyer	regulator-max-microvolt = <3300000>;
159c916eb95SHarald Geyer	regulator-name = "vcc-pl";
160c916eb95SHarald Geyer};
161c916eb95SHarald Geyer
162c916eb95SHarald Geyer&reg_aldo3 {
163c916eb95SHarald Geyer	regulator-always-on;
164c916eb95SHarald Geyer	regulator-min-microvolt = <3000000>;
165c916eb95SHarald Geyer	regulator-max-microvolt = <3000000>;
166c916eb95SHarald Geyer	regulator-name = "vcc-pll-avcc";
167c916eb95SHarald Geyer};
168c916eb95SHarald Geyer
169c916eb95SHarald Geyer&reg_dcdc1 {
170c916eb95SHarald Geyer	regulator-always-on;
171c916eb95SHarald Geyer	regulator-min-microvolt = <3300000>;
172c916eb95SHarald Geyer	regulator-max-microvolt = <3300000>;
173c916eb95SHarald Geyer	regulator-name = "vcc-3v3";
174c916eb95SHarald Geyer};
175c916eb95SHarald Geyer
176c916eb95SHarald Geyer&reg_dcdc2 {
177c916eb95SHarald Geyer	regulator-always-on;
178c916eb95SHarald Geyer	regulator-min-microvolt = <1040000>;
179c916eb95SHarald Geyer	regulator-max-microvolt = <1300000>;
180c916eb95SHarald Geyer	regulator-name = "vdd-cpux";
181c916eb95SHarald Geyer};
182c916eb95SHarald Geyer
183c916eb95SHarald Geyer/* DCDC3 is polyphased with DCDC2 */
184c916eb95SHarald Geyer
185c916eb95SHarald Geyer&reg_dcdc5 {
186c916eb95SHarald Geyer	regulator-always-on;
187c916eb95SHarald Geyer	regulator-min-microvolt = <1500000>;
188c916eb95SHarald Geyer	regulator-max-microvolt = <1500000>;
189c916eb95SHarald Geyer	regulator-name = "vcc-ddr3";
190c916eb95SHarald Geyer};
191c916eb95SHarald Geyer
192c916eb95SHarald Geyer&reg_dcdc6 {
193c916eb95SHarald Geyer	regulator-always-on;
194c916eb95SHarald Geyer	regulator-min-microvolt = <1100000>;
195c916eb95SHarald Geyer	regulator-max-microvolt = <1100000>;
196c916eb95SHarald Geyer	regulator-name = "vdd-sys";
197c916eb95SHarald Geyer};
198c916eb95SHarald Geyer
199c916eb95SHarald Geyer&reg_dldo1 {
200c916eb95SHarald Geyer	regulator-min-microvolt = <3300000>;
201c916eb95SHarald Geyer	regulator-max-microvolt = <3300000>;
202c916eb95SHarald Geyer	regulator-name = "vcc-hdmi";
203c916eb95SHarald Geyer};
204c916eb95SHarald Geyer
205c916eb95SHarald Geyer&reg_dldo2 {
206c916eb95SHarald Geyer	regulator-min-microvolt = <2500000>;
207c916eb95SHarald Geyer	regulator-max-microvolt = <2500000>;
208c916eb95SHarald Geyer	regulator-name = "vcc-pd";
209c916eb95SHarald Geyer};
210c916eb95SHarald Geyer
211c916eb95SHarald Geyer&reg_dldo3 {
212c916eb95SHarald Geyer	regulator-min-microvolt = <1200000>;
213c916eb95SHarald Geyer	regulator-max-microvolt = <1200000>;
214e4357c82SIcenowy Zheng	regulator-name = "vdd-edp";
215c916eb95SHarald Geyer};
216c916eb95SHarald Geyer
217c916eb95SHarald Geyer&reg_dldo4 {
218c916eb95SHarald Geyer	regulator-min-microvolt = <3300000>;
219c916eb95SHarald Geyer	regulator-max-microvolt = <3300000>;
220c916eb95SHarald Geyer	regulator-name = "vcc-wifi-io";
221c916eb95SHarald Geyer};
222c916eb95SHarald Geyer
223c916eb95SHarald Geyer&reg_eldo1 {
224c916eb95SHarald Geyer	regulator-min-microvolt = <1800000>;
225c916eb95SHarald Geyer	regulator-max-microvolt = <1800000>;
226c916eb95SHarald Geyer	regulator-name = "cpvdd";
227c916eb95SHarald Geyer};
228c916eb95SHarald Geyer
229c916eb95SHarald Geyer&reg_eldo2 {
230c916eb95SHarald Geyer	regulator-min-microvolt = <1800000>;
231c916eb95SHarald Geyer	regulator-max-microvolt = <1800000>;
232c916eb95SHarald Geyer	regulator-name = "vcc-dvdd-csi";
233c916eb95SHarald Geyer};
234c916eb95SHarald Geyer
235c916eb95SHarald Geyer&reg_fldo1 {
236c916eb95SHarald Geyer	regulator-min-microvolt = <1200000>;
237c916eb95SHarald Geyer	regulator-max-microvolt = <1200000>;
238c916eb95SHarald Geyer	regulator-name = "vcc-1v2-hsic";
239c916eb95SHarald Geyer};
240c916eb95SHarald Geyer
241c916eb95SHarald Geyer/*
242062904f2SJonathan Neuschäfer * The A64 chip cannot work with this regulator off, although
243c916eb95SHarald Geyer * it seems to be only driving the AR100 core.
244c916eb95SHarald Geyer * Maybe we don't still know well about CPUs domain.
245c916eb95SHarald Geyer */
246c916eb95SHarald Geyer&reg_fldo2 {
247c916eb95SHarald Geyer	regulator-always-on;
248c916eb95SHarald Geyer	regulator-min-microvolt = <1100000>;
249c916eb95SHarald Geyer	regulator-max-microvolt = <1100000>;
250c916eb95SHarald Geyer	regulator-name = "vdd-cpus";
251c916eb95SHarald Geyer};
252c916eb95SHarald Geyer
253c916eb95SHarald Geyer&reg_rtc_ldo {
254c916eb95SHarald Geyer	regulator-name = "vcc-rtc";
255c916eb95SHarald Geyer};
256c916eb95SHarald Geyer
2575cbef9f9SIcenowy Zheng&simplefb_hdmi {
2585cbef9f9SIcenowy Zheng	vcc-hdmi-supply = <&reg_dldo1>;
2595cbef9f9SIcenowy Zheng};
2605cbef9f9SIcenowy Zheng
261c916eb95SHarald Geyer&uart0 {
262c916eb95SHarald Geyer	pinctrl-names = "default";
263d91ebb95SChen-Yu Tsai	pinctrl-0 = <&uart0_pb_pins>;
264c916eb95SHarald Geyer	status = "okay";
265c916eb95SHarald Geyer};
266c916eb95SHarald Geyer
267c916eb95SHarald Geyer&usbphy {
268c916eb95SHarald Geyer	usb1_vbus-supply = <&reg_usb1_vbus>;
269c916eb95SHarald Geyer	status = "okay";
270c916eb95SHarald Geyer};
271