1 From 11f692c6b009f36b9a91d5ceb5998ae15e57f18c Mon Sep 17 00:00:00 2001
2 From: Samuel Holland <samuel@sholland.org>
3 Date: Sun, 10 Jul 2022 23:43:49 -0500
4 Subject: [PATCH 033/117] riscv: dts: allwinner: Add ClockworkPi and DevTerm
7 Clockwork Tech manufactures several SoMs for their RasPi CM3-compatible
8 "ClockworkPi" mainboard. Their R-01 SoM features the Allwinner D1 SoC.
9 The R-01 contains only the CPU, DRAM, and always-on voltage regulation;
10 it does not merit a separate devicetree.
12 The ClockworkPi mainboard features analog audio, a MIPI-DSI panel, USB
13 host and peripheral ports, an Ampak AP6256 WiFi/Bluetooth module, and an
14 X-Powers AXP228 PMIC for managing a Li-ion battery.
16 The DevTerm is a complete system which extends the ClockworkPi mainboard
17 with a pair of expansion boards. These expansion boards provide a fan, a
18 keyboard, speakers, and a thermal printer.
20 Signed-off-by: Samuel Holland <samuel@sholland.org>
22 arch/riscv/boot/dts/allwinner/Makefile | 2 +
23 .../allwinner/sun20i-d1-clockworkpi-v3.14.dts | 242 ++++++++++++++++++
24 .../dts/allwinner/sun20i-d1-devterm-v3.14.dts | 37 +++
25 3 files changed, 281 insertions(+)
26 create mode 100644 arch/riscv/boot/dts/allwinner/sun20i-d1-clockworkpi-v3.14.dts
27 create mode 100644 arch/riscv/boot/dts/allwinner/sun20i-d1-devterm-v3.14.dts
29 --- a/arch/riscv/boot/dts/allwinner/Makefile
30 +++ b/arch/riscv/boot/dts/allwinner/Makefile
32 # SPDX-License-Identifier: GPL-2.0
33 +dtb-$(CONFIG_ARCH_SUNXI) += sun20i-d1-clockworkpi-v3.14.dtb
34 +dtb-$(CONFIG_ARCH_SUNXI) += sun20i-d1-devterm-v3.14.dtb
35 dtb-$(CONFIG_ARCH_SUNXI) += sun20i-d1-dongshan-nezha-stu.dtb
36 dtb-$(CONFIG_ARCH_SUNXI) += sun20i-d1-lichee-rv-86-panel-480p.dtb
37 dtb-$(CONFIG_ARCH_SUNXI) += sun20i-d1-lichee-rv-86-panel-720p.dtb
39 +++ b/arch/riscv/boot/dts/allwinner/sun20i-d1-clockworkpi-v3.14.dts
41 +// SPDX-License-Identifier: (GPL-2.0+ or MIT)
42 +// Copyright (C) 2022 Samuel Holland <samuel@sholland.org>
46 +#include <dt-bindings/gpio/gpio.h>
48 +#include "sun20i-d1.dtsi"
49 +#include "sun20i-d1-common-regulators.dtsi"
52 + model = "ClockworkPi v3.14 (R-01)";
53 + compatible = "clockwork,r-01-clockworkpi-v3.14", "allwinner,sun20i-d1";
56 + ethernet0 = &ap6256;
62 + stdout-path = "serial0:115200n8";
66 + * This regulator is PWM-controlled, but the PWM controller is not
67 + * yet supported, so fix the regulator to its default voltage.
69 + reg_vdd_cpu: vdd-cpu {
70 + compatible = "regulator-fixed";
71 + regulator-name = "vdd-cpu";
72 + regulator-min-microvolt = <1100000>;
73 + regulator-max-microvolt = <1100000>;
74 + vin-supply = <®_vcc>;
77 + wifi_pwrseq: wifi-pwrseq {
78 + compatible = "mmc-pwrseq-simple";
79 + reset-gpios = <&pio 6 11 GPIO_ACTIVE_LOW>; /* PG11/GPIO3 */
84 + cpu-supply = <®_vdd_cpu>;
92 + pinctrl-0 = <&i2c0_pb10_pins>;
93 + pinctrl-names = "default";
97 + compatible = "x-powers,axp228", "x-powers,axp221";
99 + interrupt-parent = <&pio>;
100 + interrupts = <4 9 IRQ_TYPE_LEVEL_LOW>; /* PE9/GPIO2 */
101 + interrupt-controller;
102 + #interrupt-cells = <1>;
104 + ac_power_supply: ac-power {
105 + compatible = "x-powers,axp221-ac-power-supply";
109 + compatible = "x-powers,axp221-adc";
110 + #io-channel-cells = <1>;
113 + battery_power_supply: battery-power {
114 + compatible = "x-powers,axp221-battery-power-supply";
118 + x-powers,dcdc-freq = <3000>;
121 + regulator-name = "sys-3v3";
122 + regulator-always-on;
123 + regulator-min-microvolt = <3300000>;
124 + regulator-max-microvolt = <3300000>;
128 + regulator-name = "sys-1v8";
129 + regulator-always-on;
130 + regulator-min-microvolt = <1800000>;
131 + regulator-max-microvolt = <1800000>;
135 + regulator-name = "aud-3v3";
136 + regulator-min-microvolt = <3300000>;
137 + regulator-max-microvolt = <3300000>;
141 + regulator-name = "disp-3v3";
142 + regulator-always-on;
143 + regulator-min-microvolt = <3300000>;
144 + regulator-max-microvolt = <3300000>;
148 + regulator-name = "vdd-wifi";
149 + regulator-min-microvolt = <1800000>;
150 + regulator-max-microvolt = <1800000>;
153 + /* DLDO1 and ELDO1-3 are connected in parallel. */
155 + regulator-name = "vbat-wifi-a";
156 + regulator-always-on;
157 + regulator-min-microvolt = <3300000>;
158 + regulator-max-microvolt = <3300000>;
161 + /* DLDO2-DLDO4 are connected in parallel. */
163 + regulator-name = "vcc-3v3-ext-a";
164 + regulator-always-on;
165 + regulator-min-microvolt = <3300000>;
166 + regulator-max-microvolt = <3300000>;
170 + regulator-name = "vcc-3v3-ext-b";
171 + regulator-always-on;
172 + regulator-min-microvolt = <3300000>;
173 + regulator-max-microvolt = <3300000>;
177 + regulator-name = "vcc-3v3-ext-c";
178 + regulator-always-on;
179 + regulator-min-microvolt = <3300000>;
180 + regulator-max-microvolt = <3300000>;
184 + regulator-name = "vbat-wifi-b";
185 + regulator-always-on;
186 + regulator-min-microvolt = <3300000>;
187 + regulator-max-microvolt = <3300000>;
191 + regulator-name = "vbat-wifi-c";
192 + regulator-always-on;
193 + regulator-min-microvolt = <3300000>;
194 + regulator-max-microvolt = <3300000>;
198 + regulator-name = "vbat-wifi-d";
199 + regulator-always-on;
200 + regulator-min-microvolt = <3300000>;
201 + regulator-max-microvolt = <3300000>;
205 + usb_power_supply: usb-power {
206 + compatible = "x-powers,axp221-usb-power-supply";
207 + status = "disabled";
216 + vmmc-supply = <®_dcdc1>;
217 + vqmmc-supply = <®_vcc_3v3>;
218 + pinctrl-0 = <&mmc0_pins>;
219 + pinctrl-names = "default";
225 + mmc-pwrseq = <&wifi_pwrseq>;
227 + vmmc-supply = <®_dldo1>;
228 + vqmmc-supply = <®_aldo3>;
229 + pinctrl-0 = <&mmc1_pins>;
230 + pinctrl-names = "default";
234 + compatible = "brcm,bcm43456-fmac", "brcm,bcm4329-fmac";
236 + interrupt-parent = <&pio>;
237 + interrupts = <6 10 IRQ_TYPE_LEVEL_LOW>; /* PG10/GPIO4 */
238 + interrupt-names = "host-wake";
247 + vcc-pg-supply = <®_ldoa>;
251 + pinctrl-0 = <&uart0_pb8_pins>;
252 + pinctrl-names = "default";
258 + pinctrl-0 = <&uart1_pg6_pins>, <&uart1_pg8_rts_cts_pins>;
259 + pinctrl-names = "default";
263 + compatible = "brcm,bcm4345c5";
264 + interrupt-parent = <&pio>;
265 + interrupts = <6 17 IRQ_TYPE_LEVEL_HIGH>; /* PG17/GPIO6 */
266 + device-wakeup-gpios = <&pio 6 16 GPIO_ACTIVE_HIGH>; /* PG16/GPIO7 */
267 + shutdown-gpios = <&pio 6 18 GPIO_ACTIVE_HIGH>; /* PG18/GPIO5 */
268 + max-speed = <1500000>;
269 + vbat-supply = <®_dldo1>;
270 + vddio-supply = <®_aldo3>;
275 + dr_mode = "peripheral";
280 + usb0_vbus_power-supply = <&ac_power_supply>;
284 +++ b/arch/riscv/boot/dts/allwinner/sun20i-d1-devterm-v3.14.dts
286 +// SPDX-License-Identifier: (GPL-2.0+ or MIT)
287 +// Copyright (C) 2022 Samuel Holland <samuel@sholland.org>
291 +#include "sun20i-d1-clockworkpi-v3.14.dts"
294 + model = "Clockwork DevTerm (R-01)";
295 + compatible = "clockwork,r-01-devterm-v3.14",
296 + "clockwork,r-01-clockworkpi-v3.14",
297 + "allwinner,sun20i-d1";
300 + compatible = "gpio-fan";
301 + gpios = <&pio 3 10 GPIO_ACTIVE_HIGH>; /* PD10/GPIO41 */
302 + gpio-fan,speed-map = <0 0>,
304 + #cooling-cells = <2>;
308 + compatible = "i2c-gpio";
309 + sda-gpios = <&pio 3 14 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; /* PD14/GPIO44 */
310 + scl-gpios = <&pio 3 15 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; /* PD15/GPIO45 */
311 + #address-cells = <1>;
315 + compatible = "ti,adc101c";
317 + interrupt-parent = <&pio>;
318 + interrupts = <4 12 IRQ_TYPE_LEVEL_LOW>; /* PE12/GPIO35 */
319 + vref-supply = <®_dldo2>;