xref: /freebsd/sys/contrib/device-tree/src/arm/allwinner/sun8i-a33-vstar.dts (revision 5f62a964e9f8abc6a05d8338273fadd154f0a206)
1*5f62a964SEmmanuel Vadot// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
2*5f62a964SEmmanuel Vadot/*
3*5f62a964SEmmanuel Vadot * Copyright (C) 2024 Icenowy Zheng <uwu@icenowy.me>
4*5f62a964SEmmanuel Vadot */
5*5f62a964SEmmanuel Vadot
6*5f62a964SEmmanuel Vadot/dts-v1/;
7*5f62a964SEmmanuel Vadot#include "sun8i-a33-vstar-core1.dtsi"
8*5f62a964SEmmanuel Vadot
9*5f62a964SEmmanuel Vadot#include <dt-bindings/gpio/gpio.h>
10*5f62a964SEmmanuel Vadot#include <dt-bindings/input/input.h>
11*5f62a964SEmmanuel Vadot
12*5f62a964SEmmanuel Vadot/ {
13*5f62a964SEmmanuel Vadot	model = "Rervision A33-Vstar";
14*5f62a964SEmmanuel Vadot	compatible = "rervision,a33-vstar",
15*5f62a964SEmmanuel Vadot		     "rervision,a33-core1",
16*5f62a964SEmmanuel Vadot		     "allwinner,sun8i-a33";
17*5f62a964SEmmanuel Vadot
18*5f62a964SEmmanuel Vadot	aliases {
19*5f62a964SEmmanuel Vadot		serial0 = &uart0;
20*5f62a964SEmmanuel Vadot		ethernet0 = &r8152;
21*5f62a964SEmmanuel Vadot	};
22*5f62a964SEmmanuel Vadot
23*5f62a964SEmmanuel Vadot	chosen {
24*5f62a964SEmmanuel Vadot		stdout-path = "serial0:115200n8";
25*5f62a964SEmmanuel Vadot	};
26*5f62a964SEmmanuel Vadot
27*5f62a964SEmmanuel Vadot	reg_usb1_vbus: regulator-usb1-vbus {
28*5f62a964SEmmanuel Vadot		compatible = "regulator-fixed";
29*5f62a964SEmmanuel Vadot		regulator-name = "usb1-vbus";
30*5f62a964SEmmanuel Vadot		regulator-min-microvolt = <5000000>;
31*5f62a964SEmmanuel Vadot		regulator-max-microvolt = <5000000>;
32*5f62a964SEmmanuel Vadot		regulator-boot-on;
33*5f62a964SEmmanuel Vadot		enable-active-high;
34*5f62a964SEmmanuel Vadot		gpio = <&pio 1 2 GPIO_ACTIVE_HIGH>; /* PB2 */
35*5f62a964SEmmanuel Vadot	};
36*5f62a964SEmmanuel Vadot
37*5f62a964SEmmanuel Vadot	wifi_pwrseq: pwrseq {
38*5f62a964SEmmanuel Vadot		compatible = "mmc-pwrseq-simple";
39*5f62a964SEmmanuel Vadot		reset-gpios = <&r_pio 0 6 GPIO_ACTIVE_LOW>; /* PL6 */
40*5f62a964SEmmanuel Vadot		clocks = <&rtc CLK_OSC32K_FANOUT>;
41*5f62a964SEmmanuel Vadot		clock-names = "ext_clock";
42*5f62a964SEmmanuel Vadot	};
43*5f62a964SEmmanuel Vadot};
44*5f62a964SEmmanuel Vadot
45*5f62a964SEmmanuel Vadot&ac_power_supply {
46*5f62a964SEmmanuel Vadot	status = "okay";
47*5f62a964SEmmanuel Vadot};
48*5f62a964SEmmanuel Vadot
49*5f62a964SEmmanuel Vadot&codec {
50*5f62a964SEmmanuel Vadot	status = "okay";
51*5f62a964SEmmanuel Vadot};
52*5f62a964SEmmanuel Vadot
53*5f62a964SEmmanuel Vadot&dai {
54*5f62a964SEmmanuel Vadot	status = "okay";
55*5f62a964SEmmanuel Vadot};
56*5f62a964SEmmanuel Vadot
57*5f62a964SEmmanuel Vadot&ehci0 {
58*5f62a964SEmmanuel Vadot	#address-cells = <1>;
59*5f62a964SEmmanuel Vadot	#size-cells = <0>;
60*5f62a964SEmmanuel Vadot	status = "okay";
61*5f62a964SEmmanuel Vadot
62*5f62a964SEmmanuel Vadot	hub@1 {
63*5f62a964SEmmanuel Vadot		/* Onboard GL850G hub which needs no extra power sequence */
64*5f62a964SEmmanuel Vadot		compatible = "usb5e3,608";
65*5f62a964SEmmanuel Vadot		reg = <1>;
66*5f62a964SEmmanuel Vadot		#address-cells = <1>;
67*5f62a964SEmmanuel Vadot		#size-cells = <0>;
68*5f62a964SEmmanuel Vadot
69*5f62a964SEmmanuel Vadot		r8152: ethernet@4 {
70*5f62a964SEmmanuel Vadot			/*
71*5f62a964SEmmanuel Vadot			 * Onboard Realtek RTL8152 USB Ethernet,
72*5f62a964SEmmanuel Vadot			 * with no MAC address programmed
73*5f62a964SEmmanuel Vadot			 */
74*5f62a964SEmmanuel Vadot			compatible = "usbbda,8152";
75*5f62a964SEmmanuel Vadot			reg = <4>;
76*5f62a964SEmmanuel Vadot		};
77*5f62a964SEmmanuel Vadot	};
78*5f62a964SEmmanuel Vadot};
79*5f62a964SEmmanuel Vadot
80*5f62a964SEmmanuel Vadot&lradc {
81*5f62a964SEmmanuel Vadot	vref-supply = <&reg_aldo3>;
82*5f62a964SEmmanuel Vadot	status = "okay";
83*5f62a964SEmmanuel Vadot
84*5f62a964SEmmanuel Vadot	button-191 {
85*5f62a964SEmmanuel Vadot		label = "V+";
86*5f62a964SEmmanuel Vadot		linux,code = <KEY_VOLUMEUP>;
87*5f62a964SEmmanuel Vadot		channel = <0>;
88*5f62a964SEmmanuel Vadot		voltage = <191011>;
89*5f62a964SEmmanuel Vadot	};
90*5f62a964SEmmanuel Vadot
91*5f62a964SEmmanuel Vadot	button-391 {
92*5f62a964SEmmanuel Vadot		label = "V-";
93*5f62a964SEmmanuel Vadot		linux,code = <KEY_VOLUMEDOWN>;
94*5f62a964SEmmanuel Vadot		channel = <0>;
95*5f62a964SEmmanuel Vadot		voltage = <391304>;
96*5f62a964SEmmanuel Vadot	};
97*5f62a964SEmmanuel Vadot
98*5f62a964SEmmanuel Vadot	button-600 {
99*5f62a964SEmmanuel Vadot		label = "BACK";
100*5f62a964SEmmanuel Vadot		linux,code = <KEY_BACK>;
101*5f62a964SEmmanuel Vadot		channel = <0>;
102*5f62a964SEmmanuel Vadot		voltage = <600000>;
103*5f62a964SEmmanuel Vadot	};
104*5f62a964SEmmanuel Vadot};
105*5f62a964SEmmanuel Vadot
106*5f62a964SEmmanuel Vadot&mmc0 {
107*5f62a964SEmmanuel Vadot	vmmc-supply = <&reg_dcdc1>;
108*5f62a964SEmmanuel Vadot	bus-width = <4>;
109*5f62a964SEmmanuel Vadot	cd-gpios = <&pio 1 4 GPIO_ACTIVE_LOW>; /* PB4 */
110*5f62a964SEmmanuel Vadot	status = "okay";
111*5f62a964SEmmanuel Vadot};
112*5f62a964SEmmanuel Vadot
113*5f62a964SEmmanuel Vadot&mmc1 {
114*5f62a964SEmmanuel Vadot	pinctrl-names = "default";
115*5f62a964SEmmanuel Vadot	pinctrl-0 = <&mmc1_pg_pins>;
116*5f62a964SEmmanuel Vadot	vmmc-supply = <&reg_dldo1>;
117*5f62a964SEmmanuel Vadot	mmc-pwrseq = <&wifi_pwrseq>;
118*5f62a964SEmmanuel Vadot	bus-width = <4>;
119*5f62a964SEmmanuel Vadot	non-removable;
120*5f62a964SEmmanuel Vadot	status = "okay";
121*5f62a964SEmmanuel Vadot
122*5f62a964SEmmanuel Vadot	brcmf: wifi@1 {
123*5f62a964SEmmanuel Vadot		reg = <1>;
124*5f62a964SEmmanuel Vadot		compatible = "brcm,bcm4329-fmac";
125*5f62a964SEmmanuel Vadot		interrupt-parent = <&r_pio>;
126*5f62a964SEmmanuel Vadot		interrupts = <0 7 IRQ_TYPE_LEVEL_LOW>; /* PL7 */
127*5f62a964SEmmanuel Vadot		interrupt-names = "host-wake";
128*5f62a964SEmmanuel Vadot	};
129*5f62a964SEmmanuel Vadot};
130*5f62a964SEmmanuel Vadot
131*5f62a964SEmmanuel Vadot/*
132*5f62a964SEmmanuel Vadot * Our WiFi chip needs both DLDO1 and DLDO2 to be powered at the same
133*5f62a964SEmmanuel Vadot * time, with the two being in sync. Since this is not really
134*5f62a964SEmmanuel Vadot * supported right now, just use the two as always on, and we will fix
135*5f62a964SEmmanuel Vadot * it later.
136*5f62a964SEmmanuel Vadot */
137*5f62a964SEmmanuel Vadot&reg_dldo1 {
138*5f62a964SEmmanuel Vadot	regulator-always-on;
139*5f62a964SEmmanuel Vadot	regulator-min-microvolt = <3300000>;
140*5f62a964SEmmanuel Vadot	regulator-max-microvolt = <3300000>;
141*5f62a964SEmmanuel Vadot	regulator-name = "vcc-wifi0";
142*5f62a964SEmmanuel Vadot};
143*5f62a964SEmmanuel Vadot
144*5f62a964SEmmanuel Vadot&reg_dldo2 {
145*5f62a964SEmmanuel Vadot	regulator-always-on;
146*5f62a964SEmmanuel Vadot	regulator-min-microvolt = <3300000>;
147*5f62a964SEmmanuel Vadot	regulator-max-microvolt = <3300000>;
148*5f62a964SEmmanuel Vadot	regulator-name = "vcc-wifi1";
149*5f62a964SEmmanuel Vadot};
150*5f62a964SEmmanuel Vadot
151*5f62a964SEmmanuel Vadot&reg_drivevbus {
152*5f62a964SEmmanuel Vadot	regulator-name = "usb0-vbus";
153*5f62a964SEmmanuel Vadot	status = "okay";
154*5f62a964SEmmanuel Vadot};
155*5f62a964SEmmanuel Vadot
156*5f62a964SEmmanuel Vadot&sound {
157*5f62a964SEmmanuel Vadot	/* TODO: on-board microphone */
158*5f62a964SEmmanuel Vadot
159*5f62a964SEmmanuel Vadot	simple-audio-card,widgets = "Headphone", "Headphone Jack";
160*5f62a964SEmmanuel Vadot	simple-audio-card,routing =
161*5f62a964SEmmanuel Vadot		"Left DAC", "DACL",
162*5f62a964SEmmanuel Vadot		"Right DAC", "DACR",
163*5f62a964SEmmanuel Vadot		"Headphone Jack", "HP";
164*5f62a964SEmmanuel Vadot	status = "okay";
165*5f62a964SEmmanuel Vadot};
166*5f62a964SEmmanuel Vadot
167*5f62a964SEmmanuel Vadot&uart0 {
168*5f62a964SEmmanuel Vadot	pinctrl-names = "default";
169*5f62a964SEmmanuel Vadot	pinctrl-0 = <&uart0_pb_pins>;
170*5f62a964SEmmanuel Vadot	status = "okay";
171*5f62a964SEmmanuel Vadot};
172*5f62a964SEmmanuel Vadot
173*5f62a964SEmmanuel Vadot&uart1 {
174*5f62a964SEmmanuel Vadot	pinctrl-names = "default";
175*5f62a964SEmmanuel Vadot	pinctrl-0 = <&uart1_pg_pins>, <&uart1_cts_rts_pg_pins>;
176*5f62a964SEmmanuel Vadot	uart-has-rtscts;
177*5f62a964SEmmanuel Vadot	status = "okay";
178*5f62a964SEmmanuel Vadot
179*5f62a964SEmmanuel Vadot	bluetooth {
180*5f62a964SEmmanuel Vadot		compatible = "brcm,bcm43438-bt";
181*5f62a964SEmmanuel Vadot		clocks = <&rtc CLK_OSC32K_FANOUT>;
182*5f62a964SEmmanuel Vadot		clock-names = "lpo";
183*5f62a964SEmmanuel Vadot		vbat-supply = <&reg_dldo1>;
184*5f62a964SEmmanuel Vadot		device-wakeup-gpios = <&r_pio 0 10 GPIO_ACTIVE_HIGH>; /* PL10 */
185*5f62a964SEmmanuel Vadot		host-wakeup-gpios = <&r_pio 0 9 GPIO_ACTIVE_HIGH>; /* PL9 */
186*5f62a964SEmmanuel Vadot		shutdown-gpios = <&r_pio 0 8 GPIO_ACTIVE_HIGH>; /* PL8 */
187*5f62a964SEmmanuel Vadot	};
188*5f62a964SEmmanuel Vadot};
189*5f62a964SEmmanuel Vadot
190*5f62a964SEmmanuel Vadot&usb_otg {
191*5f62a964SEmmanuel Vadot	dr_mode = "otg";
192*5f62a964SEmmanuel Vadot	status = "okay";
193*5f62a964SEmmanuel Vadot};
194*5f62a964SEmmanuel Vadot
195*5f62a964SEmmanuel Vadot&usb_power_supply {
196*5f62a964SEmmanuel Vadot	status = "okay";
197*5f62a964SEmmanuel Vadot};
198*5f62a964SEmmanuel Vadot
199*5f62a964SEmmanuel Vadot&usbphy {
200*5f62a964SEmmanuel Vadot	usb0_id_det-gpios = <&pio 7 8 GPIO_ACTIVE_HIGH>; /* PH8 */
201*5f62a964SEmmanuel Vadot	usb0_vbus_power-supply = <&usb_power_supply>;
202*5f62a964SEmmanuel Vadot	usb0_vbus-supply = <&reg_drivevbus>;
203*5f62a964SEmmanuel Vadot	usb1_vbus-supply = <&reg_usb1_vbus>;
204*5f62a964SEmmanuel Vadot	status = "okay";
205*5f62a964SEmmanuel Vadot};
206