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 = <®_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 = <®_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 = <®_dcdc1>; 186 vqmmc-supply = <®_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 = <®_dldo1>; 197 vqmmc-supply = <®_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 = <®_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 = <®_dldo1>; 239 vddio-supply = <®_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 = <®_vcc>; 251 status = "okay"; 252}; 253