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
2424bd5d2cSHarald Geyer	backlight: backlight {
2524bd5d2cSHarald Geyer		compatible = "pwm-backlight";
2624bd5d2cSHarald Geyer		pwms = <&pwm 0 50000 0>;
2724bd5d2cSHarald Geyer		power-supply = <&reg_dcdc1>;
2824bd5d2cSHarald Geyer		brightness-levels = <0 5 7 10 14 20 28 40 56 80 112>;
2924bd5d2cSHarald Geyer		default-brightness-level = <5>;
3024bd5d2cSHarald Geyer		enable-gpios = <&pio 3 23 GPIO_ACTIVE_HIGH>; /* PD23 */
3124bd5d2cSHarald Geyer	};
3224bd5d2cSHarald Geyer
33c916eb95SHarald Geyer	chosen {
34c916eb95SHarald Geyer		stdout-path = "serial0:115200n8";
35c916eb95SHarald Geyer
36c916eb95SHarald Geyer		framebuffer-lcd {
37c916eb95SHarald Geyer			eDP25-supply = <&reg_dldo2>;
38c916eb95SHarald Geyer			eDP12-supply = <&reg_dldo3>;
39c916eb95SHarald Geyer		};
40c916eb95SHarald Geyer	};
41c916eb95SHarald Geyer
42c916eb95SHarald Geyer	gpio-keys {
43c916eb95SHarald Geyer		compatible = "gpio-keys";
44c916eb95SHarald Geyer
45c916eb95SHarald Geyer		lid-switch {
46c916eb95SHarald Geyer			label = "Lid Switch";
47c916eb95SHarald Geyer			gpios = <&r_pio 0 8 GPIO_ACTIVE_LOW>; /* PL8 */
48c916eb95SHarald Geyer			linux,input-type = <EV_SW>;
49c916eb95SHarald Geyer			linux,code = <SW_LID>;
5048f3e7bfSIcenowy Zheng			wakeup-source;
51c916eb95SHarald Geyer		};
52c916eb95SHarald Geyer	};
53c916eb95SHarald Geyer
54c916eb95SHarald Geyer	leds {
55c916eb95SHarald Geyer		compatible = "gpio-leds";
56c916eb95SHarald Geyer
57c916eb95SHarald Geyer		capslock {
58c916eb95SHarald Geyer			label = "teres-i:green:capslock";
59c916eb95SHarald Geyer			gpios = <&pio 2 7 GPIO_ACTIVE_HIGH>; /* PC7 */
60c916eb95SHarald Geyer		};
61c916eb95SHarald Geyer
62c916eb95SHarald Geyer		numlock {
63c916eb95SHarald Geyer			label = "teres-i:green:numlock";
64c916eb95SHarald Geyer			gpios = <&pio 2 4 GPIO_ACTIVE_HIGH>; /* PC4 */
65c916eb95SHarald Geyer		};
66c916eb95SHarald Geyer	};
67c916eb95SHarald Geyer
68c916eb95SHarald Geyer	reg_usb1_vbus: usb1-vbus {
69c916eb95SHarald Geyer		compatible = "regulator-fixed";
70c916eb95SHarald Geyer		regulator-name = "usb1-vbus";
71c916eb95SHarald Geyer		regulator-min-microvolt = <5000000>;
72c916eb95SHarald Geyer		regulator-max-microvolt = <5000000>;
73c916eb95SHarald Geyer		enable-active-high;
74c916eb95SHarald Geyer		gpio = <&r_pio 0 7 GPIO_ACTIVE_HIGH>; /* PL7 */
75c916eb95SHarald Geyer		status = "okay";
76c916eb95SHarald Geyer	};
77c916eb95SHarald Geyer
78c916eb95SHarald Geyer	wifi_pwrseq: wifi_pwrseq {
79c916eb95SHarald Geyer		compatible = "mmc-pwrseq-simple";
80c916eb95SHarald Geyer		reset-gpios = <&r_pio 0 2 GPIO_ACTIVE_LOW>; /* PL2 */
81c916eb95SHarald Geyer	};
82439152aeSHarald Geyer
83439152aeSHarald Geyer	speaker_amp: audio-amplifier {
84439152aeSHarald Geyer		compatible = "simple-audio-amplifier";
85439152aeSHarald Geyer		enable-gpios = <&r_pio 0 12 GPIO_ACTIVE_HIGH>; /* PL12 */
86439152aeSHarald Geyer		sound-name-prefix = "Speaker Amp";
87439152aeSHarald Geyer	};
88439152aeSHarald Geyer};
89439152aeSHarald Geyer
90439152aeSHarald Geyer&codec {
91439152aeSHarald Geyer	status = "okay";
92439152aeSHarald Geyer};
93439152aeSHarald Geyer
94439152aeSHarald Geyer&codec_analog {
95439152aeSHarald Geyer	cpvdd-supply = <&reg_eldo1>;
96439152aeSHarald Geyer	status = "okay";
97439152aeSHarald Geyer};
98439152aeSHarald Geyer
99439152aeSHarald Geyer&dai {
100439152aeSHarald Geyer	status = "okay";
101c916eb95SHarald Geyer};
102c916eb95SHarald Geyer
103c916eb95SHarald Geyer&ehci1 {
104c916eb95SHarald Geyer	status = "okay";
105c916eb95SHarald Geyer};
106c916eb95SHarald Geyer
107c916eb95SHarald Geyer
108c916eb95SHarald Geyer/* The ANX6345 eDP-bridge is on i2c0. There is no linux (mainline)
109c916eb95SHarald Geyer * driver for this chip at the moment, the bootloader initializes it.
110c916eb95SHarald Geyer * However it can be accessed with the i2c-dev driver from user space.
111c916eb95SHarald Geyer */
112c916eb95SHarald Geyer&i2c0 {
113c916eb95SHarald Geyer	clock-frequency = <100000>;
114c916eb95SHarald Geyer	status = "okay";
115c916eb95SHarald Geyer};
116c916eb95SHarald Geyer
117c916eb95SHarald Geyer&mmc0 {
118c916eb95SHarald Geyer	pinctrl-names = "default";
119c916eb95SHarald Geyer	pinctrl-0 = <&mmc0_pins>;
120c916eb95SHarald Geyer	vmmc-supply = <&reg_dcdc1>;
121c916eb95SHarald Geyer	cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>;
122c916eb95SHarald Geyer	disable-wp;
123c916eb95SHarald Geyer	bus-width = <4>;
124c916eb95SHarald Geyer	status = "okay";
125c916eb95SHarald Geyer};
126c916eb95SHarald Geyer
127c916eb95SHarald Geyer&mmc1 {
128c916eb95SHarald Geyer	pinctrl-names = "default";
129c916eb95SHarald Geyer	pinctrl-0 = <&mmc1_pins>;
130c916eb95SHarald Geyer	vmmc-supply = <&reg_aldo2>;
131c916eb95SHarald Geyer	vqmmc-supply = <&reg_dldo4>;
132c916eb95SHarald Geyer	mmc-pwrseq = <&wifi_pwrseq>;
133c916eb95SHarald Geyer	bus-width = <4>;
134c916eb95SHarald Geyer	non-removable;
135c916eb95SHarald Geyer	status = "okay";
136c916eb95SHarald Geyer
137c916eb95SHarald Geyer	rtl8723bs: wifi@1 {
138c916eb95SHarald Geyer		reg = <1>;
139c916eb95SHarald Geyer		interrupt-parent = <&r_pio>;
140c916eb95SHarald Geyer		interrupts = <0 3 IRQ_TYPE_LEVEL_LOW>; /* PL3 */
141c916eb95SHarald Geyer		interrupt-names = "host-wake";
142c916eb95SHarald Geyer	};
143c916eb95SHarald Geyer};
144c916eb95SHarald Geyer
145c916eb95SHarald Geyer&mmc2 {
146c916eb95SHarald Geyer	pinctrl-names = "default";
147c916eb95SHarald Geyer	pinctrl-0 = <&mmc2_pins>;
148c916eb95SHarald Geyer	vmmc-supply = <&reg_dcdc1>;
149c916eb95SHarald Geyer	vqmmc-supply = <&reg_dcdc1>;
150c916eb95SHarald Geyer	bus-width = <8>;
151c916eb95SHarald Geyer	non-removable;
152c916eb95SHarald Geyer	cap-mmc-hw-reset;
153c916eb95SHarald Geyer	status = "okay";
154c916eb95SHarald Geyer};
155c916eb95SHarald Geyer
156c916eb95SHarald Geyer&ohci1 {
157c916eb95SHarald Geyer	status = "okay";
158c916eb95SHarald Geyer};
159c916eb95SHarald Geyer
16024bd5d2cSHarald Geyer&pwm {
16124bd5d2cSHarald Geyer	status = "okay";
16224bd5d2cSHarald Geyer};
16324bd5d2cSHarald Geyer
164c916eb95SHarald Geyer&r_rsb {
165c916eb95SHarald Geyer	status = "okay";
166c916eb95SHarald Geyer
167c916eb95SHarald Geyer	axp803: pmic@3a3 {
168c916eb95SHarald Geyer		compatible = "x-powers,axp803";
169c916eb95SHarald Geyer		reg = <0x3a3>;
170c916eb95SHarald Geyer		interrupt-parent = <&r_intc>;
171c916eb95SHarald Geyer		interrupts = <0 IRQ_TYPE_LEVEL_LOW>;
172c916eb95SHarald Geyer		wakeup-source;
173c916eb95SHarald Geyer	};
174c916eb95SHarald Geyer};
175c916eb95SHarald Geyer
176c916eb95SHarald Geyer#include "axp803.dtsi"
177c916eb95SHarald Geyer
17825f6f54fSHarald Geyer&ac_power_supply {
17925f6f54fSHarald Geyer	status = "okay";
18025f6f54fSHarald Geyer};
18125f6f54fSHarald Geyer
18225f6f54fSHarald Geyer&battery_power_supply {
18325f6f54fSHarald Geyer	status = "okay";
18425f6f54fSHarald Geyer};
18525f6f54fSHarald Geyer
186c916eb95SHarald Geyer&reg_aldo1 {
187c916eb95SHarald Geyer	regulator-always-on;
188c916eb95SHarald Geyer	regulator-min-microvolt = <2800000>;
189c916eb95SHarald Geyer	regulator-max-microvolt = <2800000>;
190c916eb95SHarald Geyer	regulator-name = "vcc-pe";
191c916eb95SHarald Geyer};
192c916eb95SHarald Geyer
193c916eb95SHarald Geyer&reg_aldo2 {
194c916eb95SHarald Geyer	regulator-always-on;
195c916eb95SHarald Geyer	regulator-min-microvolt = <3300000>;
196c916eb95SHarald Geyer	regulator-max-microvolt = <3300000>;
197c916eb95SHarald Geyer	regulator-name = "vcc-pl";
198c916eb95SHarald Geyer};
199c916eb95SHarald Geyer
200c916eb95SHarald Geyer&reg_aldo3 {
201c916eb95SHarald Geyer	regulator-always-on;
202c916eb95SHarald Geyer	regulator-min-microvolt = <3000000>;
203c916eb95SHarald Geyer	regulator-max-microvolt = <3000000>;
204c916eb95SHarald Geyer	regulator-name = "vcc-pll-avcc";
205c916eb95SHarald Geyer};
206c916eb95SHarald Geyer
207c916eb95SHarald Geyer&reg_dcdc1 {
208c916eb95SHarald Geyer	regulator-always-on;
209c916eb95SHarald Geyer	regulator-min-microvolt = <3300000>;
210c916eb95SHarald Geyer	regulator-max-microvolt = <3300000>;
211c916eb95SHarald Geyer	regulator-name = "vcc-3v3";
212c916eb95SHarald Geyer};
213c916eb95SHarald Geyer
214c916eb95SHarald Geyer&reg_dcdc2 {
215c916eb95SHarald Geyer	regulator-always-on;
216c916eb95SHarald Geyer	regulator-min-microvolt = <1040000>;
217c916eb95SHarald Geyer	regulator-max-microvolt = <1300000>;
218c916eb95SHarald Geyer	regulator-name = "vdd-cpux";
219c916eb95SHarald Geyer};
220c916eb95SHarald Geyer
221c916eb95SHarald Geyer/* DCDC3 is polyphased with DCDC2 */
222c916eb95SHarald Geyer
223c916eb95SHarald Geyer&reg_dcdc5 {
224c916eb95SHarald Geyer	regulator-always-on;
225c916eb95SHarald Geyer	regulator-min-microvolt = <1500000>;
226c916eb95SHarald Geyer	regulator-max-microvolt = <1500000>;
227c916eb95SHarald Geyer	regulator-name = "vcc-ddr3";
228c916eb95SHarald Geyer};
229c916eb95SHarald Geyer
230c916eb95SHarald Geyer&reg_dcdc6 {
231c916eb95SHarald Geyer	regulator-always-on;
232c916eb95SHarald Geyer	regulator-min-microvolt = <1100000>;
233c916eb95SHarald Geyer	regulator-max-microvolt = <1100000>;
234c916eb95SHarald Geyer	regulator-name = "vdd-sys";
235c916eb95SHarald Geyer};
236c916eb95SHarald Geyer
237c916eb95SHarald Geyer&reg_dldo1 {
238c916eb95SHarald Geyer	regulator-min-microvolt = <3300000>;
239c916eb95SHarald Geyer	regulator-max-microvolt = <3300000>;
240c916eb95SHarald Geyer	regulator-name = "vcc-hdmi";
241c916eb95SHarald Geyer};
242c916eb95SHarald Geyer
243c916eb95SHarald Geyer&reg_dldo2 {
244c916eb95SHarald Geyer	regulator-min-microvolt = <2500000>;
245c916eb95SHarald Geyer	regulator-max-microvolt = <2500000>;
246c916eb95SHarald Geyer	regulator-name = "vcc-pd";
247c916eb95SHarald Geyer};
248c916eb95SHarald Geyer
249c916eb95SHarald Geyer&reg_dldo3 {
250c916eb95SHarald Geyer	regulator-min-microvolt = <1200000>;
251c916eb95SHarald Geyer	regulator-max-microvolt = <1200000>;
252e4357c82SIcenowy Zheng	regulator-name = "vdd-edp";
253c916eb95SHarald Geyer};
254c916eb95SHarald Geyer
255c916eb95SHarald Geyer&reg_dldo4 {
256c916eb95SHarald Geyer	regulator-min-microvolt = <3300000>;
257c916eb95SHarald Geyer	regulator-max-microvolt = <3300000>;
258c916eb95SHarald Geyer	regulator-name = "vcc-wifi-io";
259c916eb95SHarald Geyer};
260c916eb95SHarald Geyer
261c916eb95SHarald Geyer&reg_eldo1 {
262c916eb95SHarald Geyer	regulator-min-microvolt = <1800000>;
263c916eb95SHarald Geyer	regulator-max-microvolt = <1800000>;
264c916eb95SHarald Geyer	regulator-name = "cpvdd";
265c916eb95SHarald Geyer};
266c916eb95SHarald Geyer
267c916eb95SHarald Geyer&reg_eldo2 {
268c916eb95SHarald Geyer	regulator-min-microvolt = <1800000>;
269c916eb95SHarald Geyer	regulator-max-microvolt = <1800000>;
270c916eb95SHarald Geyer	regulator-name = "vcc-dvdd-csi";
271c916eb95SHarald Geyer};
272c916eb95SHarald Geyer
273c916eb95SHarald Geyer&reg_fldo1 {
274c916eb95SHarald Geyer	regulator-min-microvolt = <1200000>;
275c916eb95SHarald Geyer	regulator-max-microvolt = <1200000>;
276c916eb95SHarald Geyer	regulator-name = "vcc-1v2-hsic";
277c916eb95SHarald Geyer};
278c916eb95SHarald Geyer
279c916eb95SHarald Geyer/*
280062904f2SJonathan Neuschäfer * The A64 chip cannot work with this regulator off, although
281c916eb95SHarald Geyer * it seems to be only driving the AR100 core.
282c916eb95SHarald Geyer * Maybe we don't still know well about CPUs domain.
283c916eb95SHarald Geyer */
284c916eb95SHarald Geyer&reg_fldo2 {
285c916eb95SHarald Geyer	regulator-always-on;
286c916eb95SHarald Geyer	regulator-min-microvolt = <1100000>;
287c916eb95SHarald Geyer	regulator-max-microvolt = <1100000>;
288c916eb95SHarald Geyer	regulator-name = "vdd-cpus";
289c916eb95SHarald Geyer};
290c916eb95SHarald Geyer
291c916eb95SHarald Geyer&reg_rtc_ldo {
292c916eb95SHarald Geyer	regulator-name = "vcc-rtc";
293c916eb95SHarald Geyer};
294c916eb95SHarald Geyer
2955cbef9f9SIcenowy Zheng&simplefb_hdmi {
2965cbef9f9SIcenowy Zheng	vcc-hdmi-supply = <&reg_dldo1>;
2975cbef9f9SIcenowy Zheng};
2985cbef9f9SIcenowy Zheng
299439152aeSHarald Geyer&sound {
300439152aeSHarald Geyer	simple-audio-card,aux-devs = <&codec_analog>, <&speaker_amp>;
301439152aeSHarald Geyer	simple-audio-card,widgets = "Headphone", "Headphone Jack",
302439152aeSHarald Geyer				    "Microphone", "Headset Microphone",
303439152aeSHarald Geyer				    "Microphone", "Internal Microphone",
304439152aeSHarald Geyer				    "Speaker", "Internal Speaker";
305439152aeSHarald Geyer	simple-audio-card,routing =
306439152aeSHarald Geyer			"Left DAC", "AIF1 Slot 0 Left",
307439152aeSHarald Geyer			"Right DAC", "AIF1 Slot 0 Right",
308439152aeSHarald Geyer			"AIF1 Slot 0 Left ADC", "Left ADC",
309439152aeSHarald Geyer			"AIF1 Slot 0 Right ADC", "Right ADC",
310439152aeSHarald Geyer			"Headphone Jack", "HP",
311439152aeSHarald Geyer			"Speaker Amp INL", "LINEOUT",
312439152aeSHarald Geyer			"Speaker Amp INR", "LINEOUT",
313439152aeSHarald Geyer			"Internal Speaker", "Speaker Amp OUTL",
314439152aeSHarald Geyer			"Internal Speaker", "Speaker Amp OUTR",
315439152aeSHarald Geyer			"Internal Microphone", "MBIAS",
316439152aeSHarald Geyer			"MIC1", "Internal Microphone",
317439152aeSHarald Geyer			"Headset Microphone", "HBIAS",
318439152aeSHarald Geyer			"MIC2", "Headset Microphone";
319439152aeSHarald Geyer	status = "okay";
320439152aeSHarald Geyer};
321439152aeSHarald Geyer
322c916eb95SHarald Geyer&uart0 {
323c916eb95SHarald Geyer	pinctrl-names = "default";
324d91ebb95SChen-Yu Tsai	pinctrl-0 = <&uart0_pb_pins>;
325c916eb95SHarald Geyer	status = "okay";
326c916eb95SHarald Geyer};
327c916eb95SHarald Geyer
328c916eb95SHarald Geyer&usbphy {
329c916eb95SHarald Geyer	usb1_vbus-supply = <&reg_usb1_vbus>;
330c916eb95SHarald Geyer	status = "okay";
331c916eb95SHarald Geyer};
332