Skip to content
This repository was archived by the owner on Nov 8, 2023. It is now read-only.

Commit 0ce1d34

Browse files
smaeulwens
authored andcommitted
riscv: dts: allwinner: Add ClockworkPi and DevTerm devicetrees
Clockwork Tech manufactures several SoMs for their RasPi CM3-compatible "ClockworkPi" mainboard. Their R-01 SoM features the Allwinner D1 SoC. The R-01 contains only the CPU, DRAM, and always-on voltage regulation; it does not merit a separate devicetree. The ClockworkPi mainboard features analog audio, a MIPI-DSI panel, USB host and peripheral ports, an Ampak AP6256 WiFi/Bluetooth module, and an X-Powers AXP228 PMIC for managing a Li-ion battery. The DevTerm is a complete system which extends the ClockworkPi mainboard with a MIPI-DSI panel and a pair of expansion boards. These expansion boards provide a fan, a USB keyboard, speakers, and a thermal printer. Acked-by: Palmer Dabbelt <palmer@rivosinc.com> Signed-off-by: Samuel Holland <samuel@sholland.org> Link: https://lore.kernel.org/r/20240622150731.1105901-4-wens@kernel.org Signed-off-by: Chen-Yu Tsai <wens@csie.org>
1 parent 8f2cf44 commit 0ce1d34

File tree

3 files changed

+290
-0
lines changed

3 files changed

+290
-0
lines changed

arch/riscv/boot/dts/allwinner/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# SPDX-License-Identifier: GPL-2.0
2+
dtb-$(CONFIG_ARCH_SUNXI) += sun20i-d1-clockworkpi-v3.14.dtb
3+
dtb-$(CONFIG_ARCH_SUNXI) += sun20i-d1-devterm-v3.14.dtb
24
dtb-$(CONFIG_ARCH_SUNXI) += sun20i-d1-dongshan-nezha-stu.dtb
35
dtb-$(CONFIG_ARCH_SUNXI) += sun20i-d1-lichee-rv-86-panel-480p.dtb
46
dtb-$(CONFIG_ARCH_SUNXI) += sun20i-d1-lichee-rv-86-panel-720p.dtb
Lines changed: 252 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,252 @@
1+
// SPDX-License-Identifier: (GPL-2.0+ or MIT)
2+
// Copyright (C) 2022 Samuel Holland <samuel@sholland.org>
3+
4+
#include <dt-bindings/gpio/gpio.h>
5+
6+
/dts-v1/;
7+
8+
#include "sun20i-d1.dtsi"
9+
#include "sun20i-common-regulators.dtsi"
10+
11+
/ {
12+
model = "ClockworkPi v3.14 (R-01)";
13+
compatible = "clockwork,r-01-clockworkpi-v3.14", "allwinner,sun20i-d1";
14+
15+
aliases {
16+
ethernet0 = &ap6256;
17+
serial0 = &uart0;
18+
};
19+
20+
chosen {
21+
stdout-path = "serial0:115200n8";
22+
};
23+
24+
/*
25+
* This regulator is PWM-controlled, but the PWM controller is not
26+
* yet supported, so fix the regulator to its default voltage.
27+
*/
28+
reg_vdd_cpu: vdd-cpu {
29+
compatible = "regulator-fixed";
30+
regulator-name = "vdd-cpu";
31+
regulator-min-microvolt = <1100000>;
32+
regulator-max-microvolt = <1100000>;
33+
vin-supply = <&reg_vcc>;
34+
};
35+
36+
wifi_pwrseq: wifi-pwrseq {
37+
compatible = "mmc-pwrseq-simple";
38+
reset-gpios = <&pio 6 11 GPIO_ACTIVE_LOW>; /* PG11/GPIO3 */
39+
};
40+
};
41+
42+
&cpu0 {
43+
cpu-supply = <&reg_vdd_cpu>;
44+
};
45+
46+
&dcxo {
47+
clock-frequency = <24000000>;
48+
};
49+
50+
&ehci1 {
51+
status = "okay";
52+
};
53+
54+
&i2c0 {
55+
pinctrl-0 = <&i2c0_pb10_pins>;
56+
pinctrl-names = "default";
57+
status = "okay";
58+
59+
axp221: pmic@34 {
60+
compatible = "x-powers,axp228", "x-powers,axp221";
61+
reg = <0x34>;
62+
interrupt-parent = <&pio>;
63+
interrupts = <4 9 IRQ_TYPE_LEVEL_LOW>; /* PE9/GPIO2 */
64+
interrupt-controller;
65+
#interrupt-cells = <1>;
66+
67+
ac_power_supply: ac-power {
68+
compatible = "x-powers,axp221-ac-power-supply";
69+
};
70+
71+
axp_adc: adc {
72+
compatible = "x-powers,axp221-adc";
73+
#io-channel-cells = <1>;
74+
};
75+
76+
battery_power_supply: battery-power {
77+
compatible = "x-powers,axp221-battery-power-supply";
78+
};
79+
80+
axp_gpio: gpio {
81+
compatible = "x-powers,axp221-gpio";
82+
gpio-controller;
83+
#gpio-cells = <2>;
84+
};
85+
86+
regulators {
87+
x-powers,dcdc-freq = <3000>;
88+
89+
reg_dcdc1: dcdc1 {
90+
regulator-name = "sys-3v3";
91+
regulator-always-on;
92+
regulator-min-microvolt = <3300000>;
93+
regulator-max-microvolt = <3300000>;
94+
};
95+
96+
reg_dcdc3: dcdc3 {
97+
regulator-name = "sys-1v8";
98+
regulator-always-on;
99+
regulator-min-microvolt = <1800000>;
100+
regulator-max-microvolt = <1800000>;
101+
};
102+
103+
reg_aldo1: aldo1 {
104+
regulator-name = "aud-3v3";
105+
regulator-min-microvolt = <3300000>;
106+
regulator-max-microvolt = <3300000>;
107+
};
108+
109+
reg_aldo2: aldo2 {
110+
regulator-name = "disp-3v3";
111+
regulator-always-on;
112+
regulator-min-microvolt = <3300000>;
113+
regulator-max-microvolt = <3300000>;
114+
};
115+
116+
reg_aldo3: aldo3 {
117+
regulator-name = "vdd-wifi";
118+
regulator-min-microvolt = <1800000>;
119+
regulator-max-microvolt = <1800000>;
120+
};
121+
122+
/* DLDO1 and ELDO1-3 are connected in parallel. */
123+
reg_dldo1: dldo1 {
124+
regulator-name = "vbat-wifi-a";
125+
regulator-always-on;
126+
regulator-min-microvolt = <3300000>;
127+
regulator-max-microvolt = <3300000>;
128+
};
129+
130+
/* DLDO2-DLDO4 are connected in parallel. */
131+
reg_dldo2: dldo2 {
132+
regulator-name = "vcc-3v3-ext-a";
133+
regulator-always-on;
134+
regulator-min-microvolt = <3300000>;
135+
regulator-max-microvolt = <3300000>;
136+
};
137+
138+
reg_dldo3: dldo3 {
139+
regulator-name = "vcc-3v3-ext-b";
140+
regulator-always-on;
141+
regulator-min-microvolt = <3300000>;
142+
regulator-max-microvolt = <3300000>;
143+
};
144+
145+
reg_dldo4: dldo4 {
146+
regulator-name = "vcc-3v3-ext-c";
147+
regulator-always-on;
148+
regulator-min-microvolt = <3300000>;
149+
regulator-max-microvolt = <3300000>;
150+
};
151+
152+
reg_eldo1: eldo1 {
153+
regulator-name = "vbat-wifi-b";
154+
regulator-always-on;
155+
regulator-min-microvolt = <3300000>;
156+
regulator-max-microvolt = <3300000>;
157+
};
158+
159+
reg_eldo2: eldo2 {
160+
regulator-name = "vbat-wifi-c";
161+
regulator-always-on;
162+
regulator-min-microvolt = <3300000>;
163+
regulator-max-microvolt = <3300000>;
164+
};
165+
166+
reg_eldo3: eldo3 {
167+
regulator-name = "vbat-wifi-d";
168+
regulator-always-on;
169+
regulator-min-microvolt = <3300000>;
170+
regulator-max-microvolt = <3300000>;
171+
};
172+
};
173+
174+
usb_power_supply: usb-power {
175+
compatible = "x-powers,axp221-usb-power-supply";
176+
status = "disabled";
177+
};
178+
};
179+
};
180+
181+
&mmc0 {
182+
broken-cd;
183+
bus-width = <4>;
184+
disable-wp;
185+
vmmc-supply = <&reg_dcdc1>;
186+
vqmmc-supply = <&reg_vcc_3v3>;
187+
pinctrl-0 = <&mmc0_pins>;
188+
pinctrl-names = "default";
189+
status = "okay";
190+
};
191+
192+
&mmc1 {
193+
bus-width = <4>;
194+
mmc-pwrseq = <&wifi_pwrseq>;
195+
non-removable;
196+
vmmc-supply = <&reg_dldo1>;
197+
vqmmc-supply = <&reg_aldo3>;
198+
pinctrl-0 = <&mmc1_pins>;
199+
pinctrl-names = "default";
200+
status = "okay";
201+
202+
ap6256: wifi@1 {
203+
compatible = "brcm,bcm43456-fmac", "brcm,bcm4329-fmac";
204+
reg = <1>;
205+
interrupt-parent = <&pio>;
206+
interrupts = <6 10 IRQ_TYPE_LEVEL_LOW>; /* PG10/GPIO4 */
207+
interrupt-names = "host-wake";
208+
};
209+
};
210+
211+
&ohci1 {
212+
status = "okay";
213+
};
214+
215+
&pio {
216+
vcc-pg-supply = <&reg_ldoa>;
217+
};
218+
219+
&uart0 {
220+
pinctrl-0 = <&uart0_pb8_pins>;
221+
pinctrl-names = "default";
222+
status = "okay";
223+
};
224+
225+
&uart1 {
226+
uart-has-rtscts;
227+
pinctrl-0 = <&uart1_pg6_pins>, <&uart1_pg8_rts_cts_pins>;
228+
pinctrl-names = "default";
229+
status = "okay";
230+
231+
bluetooth {
232+
compatible = "brcm,bcm4345c5";
233+
interrupt-parent = <&pio>;
234+
interrupts = <6 17 IRQ_TYPE_LEVEL_HIGH>; /* PG17/GPIO6 */
235+
device-wakeup-gpios = <&pio 6 16 GPIO_ACTIVE_HIGH>; /* PG16/GPIO7 */
236+
shutdown-gpios = <&pio 6 18 GPIO_ACTIVE_HIGH>; /* PG18/GPIO5 */
237+
max-speed = <1500000>;
238+
vbat-supply = <&reg_dldo1>;
239+
vddio-supply = <&reg_aldo3>;
240+
};
241+
};
242+
243+
&usb_otg {
244+
dr_mode = "peripheral";
245+
status = "okay";
246+
};
247+
248+
&usbphy {
249+
usb0_vbus_power-supply = <&ac_power_supply>;
250+
usb1_vbus-supply = <&reg_vcc>;
251+
status = "okay";
252+
};
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
// SPDX-License-Identifier: (GPL-2.0+ or MIT)
2+
// Copyright (C) 2022 Samuel Holland <samuel@sholland.org>
3+
4+
#include "sun20i-d1-clockworkpi-v3.14.dts"
5+
6+
/ {
7+
model = "Clockwork DevTerm (R-01)";
8+
compatible = "clockwork,r-01-devterm-v3.14",
9+
"clockwork,r-01-clockworkpi-v3.14",
10+
"allwinner,sun20i-d1";
11+
12+
fan {
13+
compatible = "gpio-fan";
14+
gpios = <&pio 3 10 GPIO_ACTIVE_HIGH>; /* PD10/GPIO41 */
15+
gpio-fan,speed-map = <0 0>,
16+
<6000 1>;
17+
#cooling-cells = <2>;
18+
};
19+
20+
i2c-gpio-0 {
21+
compatible = "i2c-gpio";
22+
sda-gpios = <&pio 3 14 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; /* PD14/GPIO44 */
23+
scl-gpios = <&pio 3 15 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; /* PD15/GPIO45 */
24+
#address-cells = <1>;
25+
#size-cells = <0>;
26+
27+
adc@54 {
28+
compatible = "ti,adc101c";
29+
reg = <0x54>;
30+
interrupt-parent = <&pio>;
31+
interrupts = <4 12 IRQ_TYPE_LEVEL_LOW>; /* PE12/GPIO35 */
32+
vref-supply = <&reg_dldo2>;
33+
#io-channel-cells = <1>;
34+
};
35+
};
36+
};

0 commit comments

Comments
 (0)