1// SPDX-License-Identifier: (GPL-2.0-only OR MIT) 2// Copyright (C) 2025 Arm Ltd. 3 4/dts-v1/; 5 6#include "sun55i-a523.dtsi" 7 8#include <dt-bindings/gpio/gpio.h> 9 10/ { 11 model = "Radxa Cubie A5E"; 12 compatible = "radxa,cubie-a5e", "allwinner,sun55i-a527"; 13 14 aliases { 15 ethernet0 = &gmac0; 16 serial0 = &uart0; 17 }; 18 19 chosen { 20 stdout-path = "serial0:115200n8"; 21 }; 22 23 ext_osc32k: ext-osc32k-clk { 24 #clock-cells = <0>; 25 compatible = "fixed-clock"; 26 clock-frequency = <32768>; 27 clock-output-names = "ext_osc32k"; 28 }; 29 30 reg_vcc5v: vcc5v { 31 /* board wide 5V supply from the USB-C connector */ 32 compatible = "regulator-fixed"; 33 regulator-name = "vcc-5v"; 34 regulator-min-microvolt = <5000000>; 35 regulator-max-microvolt = <5000000>; 36 regulator-always-on; 37 }; 38 39 reg_usb_vbus: vbus { 40 compatible = "regulator-fixed"; 41 regulator-name = "usb-vbus"; 42 regulator-min-microvolt = <5000000>; 43 regulator-max-microvolt = <5000000>; 44 vin-supply = <®_vcc5v>; 45 gpio = <&r_pio 0 8 GPIO_ACTIVE_HIGH>; /* PL8 */ 46 enable-active-high; 47 }; 48}; 49 50&ehci0 { 51 status = "okay"; 52}; 53 54&ehci1 { 55 status = "okay"; 56}; 57 58&gmac0 { 59 phy-mode = "rgmii-id"; 60 phy-handle = <&ext_rgmii_phy>; 61 phy-supply = <®_cldo3>; 62 63 allwinner,tx-delay-ps = <300>; 64 allwinner,rx-delay-ps = <400>; 65 66 status = "okay"; 67}; 68 69&gpu { 70 mali-supply = <®_dcdc2>; 71 status = "okay"; 72}; 73 74&mdio0 { 75 ext_rgmii_phy: ethernet-phy@1 { 76 compatible = "ethernet-phy-ieee802.3-c22"; 77 reg = <1>; 78 }; 79}; 80 81&mmc0 { 82 vmmc-supply = <®_cldo3>; 83 cd-gpios = <&pio 5 6 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /* PF6 */ 84 bus-width = <4>; 85 status = "okay"; 86}; 87 88&ohci0 { 89 status = "okay"; 90}; 91 92&ohci1 { 93 status = "okay"; 94}; 95 96&pio { 97 vcc-pb-supply = <®_cldo3>; /* via VCC-IO */ 98 vcc-pc-supply = <®_cldo1>; 99 vcc-pd-supply = <®_cldo3>; 100 vcc-pe-supply = <®_aldo2>; 101 vcc-pf-supply = <®_cldo3>; /* actually switchable */ 102 vcc-pg-supply = <®_bldo1>; 103 vcc-ph-supply = <®_cldo3>; /* via VCC-IO */ 104 vcc-pi-supply = <®_cldo3>; 105 vcc-pj-supply = <®_cldo4>; 106 vcc-pk-supply = <®_cldo1>; 107}; 108 109&r_i2c0 { 110 status = "okay"; 111 112 axp717: pmic@34 { 113 compatible = "x-powers,axp717"; 114 reg = <0x34>; 115 interrupt-controller; 116 #interrupt-cells = <1>; 117 interrupt-parent = <&nmi_intc>; 118 interrupts = <0 IRQ_TYPE_LEVEL_LOW>; 119 120 vin1-supply = <®_vcc5v>; 121 vin2-supply = <®_vcc5v>; 122 vin3-supply = <®_vcc5v>; 123 vin4-supply = <®_vcc5v>; 124 aldoin-supply = <®_vcc5v>; 125 bldoin-supply = <®_vcc5v>; 126 cldoin-supply = <®_vcc5v>; 127 128 regulators { 129 /* Supplies the "little" cluster (1.4 GHz cores) */ 130 reg_dcdc1: dcdc1 { 131 regulator-always-on; 132 regulator-min-microvolt = <900000>; 133 regulator-max-microvolt = <1160000>; 134 regulator-name = "vdd-cpul"; 135 }; 136 137 reg_dcdc2: dcdc2 { 138 regulator-always-on; 139 regulator-min-microvolt = <920000>; 140 regulator-max-microvolt = <920000>; 141 regulator-name = "vdd-gpu-sys"; 142 }; 143 144 reg_dcdc3: dcdc3 { 145 regulator-always-on; 146 regulator-min-microvolt = <1100000>; 147 regulator-max-microvolt = <1100000>; 148 regulator-name = "vdd-dram"; 149 }; 150 151 reg_aldo1: aldo1 { 152 /* not connected */ 153 }; 154 155 reg_aldo2: aldo2 { 156 regulator-min-microvolt = <1800000>; 157 regulator-max-microvolt = <1800000>; 158 regulator-name = "vcc-pe"; 159 }; 160 161 reg_aldo3: aldo3 { 162 /* supplies the I2C pins for this PMIC */ 163 regulator-always-on; 164 regulator-min-microvolt = <3300000>; 165 regulator-max-microvolt = <3300000>; 166 regulator-name = "vcc-pl-usb"; 167 }; 168 169 reg_aldo4: aldo4 { 170 regulator-always-on; 171 regulator-min-microvolt = <1800000>; 172 regulator-max-microvolt = <1800000>; 173 regulator-name = "vcc-pll-dxco-avcc"; 174 }; 175 176 reg_bldo1: bldo1 { 177 regulator-min-microvolt = <1800000>; 178 regulator-max-microvolt = <1800000>; 179 regulator-name = "vcc-pg-iowifi"; 180 }; 181 182 reg_bldo2: bldo2 { 183 regulator-always-on; 184 regulator-min-microvolt = <1800000>; 185 regulator-max-microvolt = <1800000>; 186 regulator-name = "vcc-pm-lpddr4"; 187 }; 188 189 reg_bldo3: bldo3 { 190 regulator-min-microvolt = <3300000>; 191 regulator-max-microvolt = <3300000>; 192 regulator-name = "vcc-mipi-cam"; 193 }; 194 195 reg_bldo4: bldo4 { 196 /* not connected */ 197 }; 198 199 reg_cldo1: cldo1 { 200 regulator-min-microvolt = <1800000>; 201 regulator-max-microvolt = <1800000>; 202 regulator-name = "vcc-pc-and-their-dog"; 203 }; 204 205 reg_cldo2: cldo2 { 206 /* not connected */ 207 }; 208 209 reg_cldo3: cldo3 { 210 /* IO, USB-2, 3V3, card, NAND, sensor, PI */ 211 regulator-always-on; 212 regulator-min-microvolt = <3300000>; 213 regulator-max-microvolt = <3300000>; 214 regulator-name = "vcc-io-mmc-spi-ana"; 215 }; 216 217 reg_cldo4: cldo4 { 218 regulator-min-microvolt = <3300000>; 219 regulator-max-microvolt = <3300000>; 220 regulator-name = "vcc-pj-phy"; 221 }; 222 223 reg_cpusldo: cpusldo { 224 /* supplies the management core */ 225 regulator-always-on; 226 regulator-min-microvolt = <900000>; 227 regulator-max-microvolt = <900000>; 228 regulator-name = "vdd-cpus"; 229 }; 230 }; 231 }; 232 233 axp323: pmic@36 { 234 compatible = "x-powers,axp323"; 235 reg = <0x36>; 236 #interrupt-cells = <1>; 237 interrupt-controller; 238 interrupt-parent = <&nmi_intc>; 239 interrupts = <0 IRQ_TYPE_LEVEL_LOW>; 240 status = "okay"; 241 242 vin1-supply = <®_vcc5v>; 243 vin2-supply = <®_vcc5v>; 244 vin3-supply = <®_vcc5v>; 245 246 regulators { 247 aldo1 { 248 regulator-min-microvolt = <1800000>; 249 regulator-max-microvolt = <1800000>; 250 regulator-name = "vcc-mipi-dsi"; 251 }; 252 253 dldo1 { 254 /* not connected */ 255 }; 256 257 /* Supplies the "big" cluster (1.8 GHz cores) */ 258 reg_dcdc1_323: dcdc1 { 259 regulator-always-on; 260 regulator-min-microvolt = <900000>; 261 regulator-max-microvolt = <1160000>; 262 regulator-name = "vdd-cpub"; 263 }; 264 265 /* DCDC2 is polyphased with DCDC1 */ 266 267 /* RISC-V management core supply */ 268 reg_dcdc3_323: dcdc3 { 269 regulator-always-on; 270 regulator-min-microvolt = <900000>; 271 regulator-max-microvolt = <900000>; 272 regulator-name = "vdd-dnr"; 273 }; 274 }; 275 }; 276}; 277 278&r_pio { 279/* 280 * Specifying the supply would create a circular dependency. 281 * 282 * vcc-pl-supply = <®_aldo3>; 283 */ 284 vcc-pm-supply = <®_aldo3>; 285}; 286 287&uart0 { 288 pinctrl-names = "default"; 289 pinctrl-0 = <&uart0_pb_pins>; 290 status = "okay"; 291}; 292 293&usb_otg { 294 /* 295 * The USB-C port is the primary power supply, so in this configuration 296 * relies on the other end of the USB cable to supply the VBUS power. 297 * So use this port in peripheral mode. 298 * It is possible to supply the board with the 5V pins on the GPIO 299 * header, and since the DCIN_5V line is hardwired to the USB-C VBUS 300 * pins, the port turns into a host port, unconditionally supplying 301 * power. The dr_mode property should be changed to "host" here, if 302 * users choose this setup. 303 */ 304 dr_mode = "peripheral"; 305 status = "okay"; 306}; 307 308/* 309 * The schematic describes USB0_ID (PL10), measuring VBUS_5V, which looks to 310 * be always on. Also there is USB-VBUSDET (PL2), which is measuring the same 311 * VBUS_5V. There is also DCIN_DET, which measures DCIN_5V, so the power 312 * input rail. 313 * None of them seem to make any sense in relation to detecting USB devices 314 * or whether there is power provided via any USB pins: they would always 315 * report high, otherwise the system wouldn't be running. 316 * The AXP717C provides proper USB-C CC pin functionality, but the PMIC is 317 * not connected to those pins of the USB-C connector. 318 */ 319&usbphy { 320 usb0_vbus-supply = <®_vcc5v>; 321 usb1_vbus-supply = <®_usb_vbus>; 322 status = "okay"; 323}; 324