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