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 diff --git a/arch/riscv/boot/dts/allwinner/Makefile b/arch/riscv/boot/dts/allwinner/Makefile
30 index 530ef8adb8b0..25097da6fdb9 100644
31 --- a/arch/riscv/boot/dts/allwinner/Makefile
32 +++ b/arch/riscv/boot/dts/allwinner/Makefile
34 # SPDX-License-Identifier: GPL-2.0
35 +dtb-$(CONFIG_ARCH_SUNXI) += sun20i-d1-clockworkpi-v3.14.dtb
36 +dtb-$(CONFIG_ARCH_SUNXI) += sun20i-d1-devterm-v3.14.dtb
37 dtb-$(CONFIG_ARCH_SUNXI) += sun20i-d1-dongshan-nezha-stu.dtb
38 dtb-$(CONFIG_ARCH_SUNXI) += sun20i-d1-lichee-rv-86-panel-480p.dtb
39 dtb-$(CONFIG_ARCH_SUNXI) += sun20i-d1-lichee-rv-86-panel-720p.dtb
40 diff --git a/arch/riscv/boot/dts/allwinner/sun20i-d1-clockworkpi-v3.14.dts b/arch/riscv/boot/dts/allwinner/sun20i-d1-clockworkpi-v3.14.dts
42 index 000000000000..74b4b6d8363a
44 +++ b/arch/riscv/boot/dts/allwinner/sun20i-d1-clockworkpi-v3.14.dts
46 +// SPDX-License-Identifier: (GPL-2.0+ or MIT)
47 +// Copyright (C) 2022 Samuel Holland <samuel@sholland.org>
51 +#include <dt-bindings/gpio/gpio.h>
53 +#include "sun20i-d1.dtsi"
54 +#include "sun20i-d1-common-regulators.dtsi"
57 + model = "ClockworkPi v3.14 (R-01)";
58 + compatible = "clockwork,r-01-clockworkpi-v3.14", "allwinner,sun20i-d1";
61 + ethernet0 = &ap6256;
67 + stdout-path = "serial0:115200n8";
71 + * This regulator is PWM-controlled, but the PWM controller is not
72 + * yet supported, so fix the regulator to its default voltage.
74 + reg_vdd_cpu: vdd-cpu {
75 + compatible = "regulator-fixed";
76 + regulator-name = "vdd-cpu";
77 + regulator-min-microvolt = <1100000>;
78 + regulator-max-microvolt = <1100000>;
79 + vin-supply = <®_vcc>;
82 + wifi_pwrseq: wifi-pwrseq {
83 + compatible = "mmc-pwrseq-simple";
84 + reset-gpios = <&pio 6 11 GPIO_ACTIVE_LOW>; /* PG11/GPIO3 */
89 + cpu-supply = <®_vdd_cpu>;
97 + pinctrl-0 = <&i2c0_pb10_pins>;
98 + pinctrl-names = "default";
102 + compatible = "x-powers,axp228", "x-powers,axp221";
104 + interrupt-parent = <&pio>;
105 + interrupts = <4 9 IRQ_TYPE_LEVEL_LOW>; /* PE9/GPIO2 */
106 + interrupt-controller;
107 + #interrupt-cells = <1>;
109 + ac_power_supply: ac-power {
110 + compatible = "x-powers,axp221-ac-power-supply";
114 + compatible = "x-powers,axp221-adc";
115 + #io-channel-cells = <1>;
118 + battery_power_supply: battery-power {
119 + compatible = "x-powers,axp221-battery-power-supply";
123 + x-powers,dcdc-freq = <3000>;
126 + regulator-name = "sys-3v3";
127 + regulator-always-on;
128 + regulator-min-microvolt = <3300000>;
129 + regulator-max-microvolt = <3300000>;
133 + regulator-name = "sys-1v8";
134 + regulator-always-on;
135 + regulator-min-microvolt = <1800000>;
136 + regulator-max-microvolt = <1800000>;
140 + regulator-name = "aud-3v3";
141 + regulator-min-microvolt = <3300000>;
142 + regulator-max-microvolt = <3300000>;
146 + regulator-name = "disp-3v3";
147 + regulator-always-on;
148 + regulator-min-microvolt = <3300000>;
149 + regulator-max-microvolt = <3300000>;
153 + regulator-name = "vdd-wifi";
154 + regulator-min-microvolt = <1800000>;
155 + regulator-max-microvolt = <1800000>;
158 + /* DLDO1 and ELDO1-3 are connected in parallel. */
160 + regulator-name = "vbat-wifi-a";
161 + regulator-always-on;
162 + regulator-min-microvolt = <3300000>;
163 + regulator-max-microvolt = <3300000>;
166 + /* DLDO2-DLDO4 are connected in parallel. */
168 + regulator-name = "vcc-3v3-ext-a";
169 + regulator-always-on;
170 + regulator-min-microvolt = <3300000>;
171 + regulator-max-microvolt = <3300000>;
175 + regulator-name = "vcc-3v3-ext-b";
176 + regulator-always-on;
177 + regulator-min-microvolt = <3300000>;
178 + regulator-max-microvolt = <3300000>;
182 + regulator-name = "vcc-3v3-ext-c";
183 + regulator-always-on;
184 + regulator-min-microvolt = <3300000>;
185 + regulator-max-microvolt = <3300000>;
189 + regulator-name = "vbat-wifi-b";
190 + regulator-always-on;
191 + regulator-min-microvolt = <3300000>;
192 + regulator-max-microvolt = <3300000>;
196 + regulator-name = "vbat-wifi-c";
197 + regulator-always-on;
198 + regulator-min-microvolt = <3300000>;
199 + regulator-max-microvolt = <3300000>;
203 + regulator-name = "vbat-wifi-d";
204 + regulator-always-on;
205 + regulator-min-microvolt = <3300000>;
206 + regulator-max-microvolt = <3300000>;
210 + usb_power_supply: usb-power {
211 + compatible = "x-powers,axp221-usb-power-supply";
212 + status = "disabled";
221 + vmmc-supply = <®_dcdc1>;
222 + vqmmc-supply = <®_vcc_3v3>;
223 + pinctrl-0 = <&mmc0_pins>;
224 + pinctrl-names = "default";
230 + mmc-pwrseq = <&wifi_pwrseq>;
232 + vmmc-supply = <®_dldo1>;
233 + vqmmc-supply = <®_aldo3>;
234 + pinctrl-0 = <&mmc1_pins>;
235 + pinctrl-names = "default";
239 + compatible = "brcm,bcm43456-fmac", "brcm,bcm4329-fmac";
241 + interrupt-parent = <&pio>;
242 + interrupts = <6 10 IRQ_TYPE_LEVEL_LOW>; /* PG10/GPIO4 */
243 + interrupt-names = "host-wake";
252 + vcc-pg-supply = <®_ldoa>;
256 + pinctrl-0 = <&uart0_pb8_pins>;
257 + pinctrl-names = "default";
263 + pinctrl-0 = <&uart1_pg6_pins>, <&uart1_pg8_rts_cts_pins>;
264 + pinctrl-names = "default";
268 + compatible = "brcm,bcm4345c5";
269 + interrupt-parent = <&pio>;
270 + interrupts = <6 17 IRQ_TYPE_LEVEL_HIGH>; /* PG17/GPIO6 */
271 + device-wakeup-gpios = <&pio 6 16 GPIO_ACTIVE_HIGH>; /* PG16/GPIO7 */
272 + shutdown-gpios = <&pio 6 18 GPIO_ACTIVE_HIGH>; /* PG18/GPIO5 */
273 + max-speed = <1500000>;
274 + vbat-supply = <®_dldo1>;
275 + vddio-supply = <®_aldo3>;
280 + dr_mode = "peripheral";
285 + usb0_vbus_power-supply = <&ac_power_supply>;
288 diff --git a/arch/riscv/boot/dts/allwinner/sun20i-d1-devterm-v3.14.dts b/arch/riscv/boot/dts/allwinner/sun20i-d1-devterm-v3.14.dts
290 index 000000000000..690bfa35a548
292 +++ b/arch/riscv/boot/dts/allwinner/sun20i-d1-devterm-v3.14.dts
294 +// SPDX-License-Identifier: (GPL-2.0+ or MIT)
295 +// Copyright (C) 2022 Samuel Holland <samuel@sholland.org>
299 +#include "sun20i-d1-clockworkpi-v3.14.dts"
302 + model = "Clockwork DevTerm (R-01)";
303 + compatible = "clockwork,r-01-devterm-v3.14",
304 + "clockwork,r-01-clockworkpi-v3.14",
305 + "allwinner,sun20i-d1";
308 + compatible = "gpio-fan";
309 + gpios = <&pio 3 10 GPIO_ACTIVE_HIGH>; /* PD10/GPIO41 */
310 + gpio-fan,speed-map = <0 0>,
312 + #cooling-cells = <2>;
316 + compatible = "i2c-gpio";
317 + sda-gpios = <&pio 3 14 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; /* PD14/GPIO44 */
318 + scl-gpios = <&pio 3 15 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>; /* PD15/GPIO45 */
319 + #address-cells = <1>;
323 + compatible = "ti,adc101c";
325 + interrupt-parent = <&pio>;
326 + interrupts = <4 12 IRQ_TYPE_LEVEL_LOW>; /* PE12/GPIO35 */
327 + vref-supply = <®_dldo2>;