1// SPDX-License-Identifier: (GPL-2.0-only OR MIT) 2/* 3 * Copyright (C) 2025 Chen-Yu Tsai <wens@csie.org> 4 */ 5 6/dts-v1/; 7 8#include "sun55i-a523.dtsi" 9 10#include <dt-bindings/gpio/gpio.h> 11#include <dt-bindings/leds/common.h> 12 13/ { 14 model = "OrangePi 4A"; 15 compatible = "xunlong,orangepi-4a", "allwinner,sun55i-t527"; 16 17 aliases { 18 serial0 = &uart0; 19 }; 20 21 chosen { 22 stdout-path = "serial0:115200n8"; 23 }; 24 25 ext_osc32k: ext-osc32k-clk { 26 #clock-cells = <0>; 27 compatible = "fixed-clock"; 28 clock-frequency = <32768>; 29 clock-output-names = "ext_osc32k"; 30 }; 31 32 leds { 33 compatible = "gpio-leds"; 34 35 /* PWM capable pin, but PWM isn't supported yet. */ 36 led { 37 function = LED_FUNCTION_STATUS; 38 color = <LED_COLOR_ID_GREEN>; 39 gpios = <&pio 3 20 GPIO_ACTIVE_HIGH>; /* PD20 */ 40 }; 41 }; 42 43 wifi_pwrseq: pwrseq { 44 compatible = "mmc-pwrseq-simple"; 45 reset-gpios = <&r_pio 1 1 GPIO_ACTIVE_LOW>; /* PM1 */ 46 clocks = <&rtc CLK_OSC32K_FANOUT>; 47 clock-names = "ext_clock"; 48 }; 49 50 reg_otg_vbus: regulator-otg-vbus { 51 compatible = "regulator-fixed"; 52 regulator-name = "otg-vbus"; 53 regulator-min-microvolt = <5000000>; 54 regulator-max-microvolt = <5000000>; 55 vin-supply = <®_vcc5v>; 56 gpio = <&r_pio 0 4 GPIO_ACTIVE_HIGH>; /* PL4 */ 57 enable-active-high; 58 }; 59 60 reg_pcie_vcc3v3: regulator-pcie-vcc3v3 { 61 compatible = "regulator-fixed"; 62 regulator-name = "vcc-pcie-3v3"; 63 regulator-min-microvolt = <3300000>; 64 regulator-max-microvolt = <3300000>; 65 vin-supply = <®_vcc5v>; 66 gpio = <&r_pio 0 8 GPIO_ACTIVE_HIGH>; /* PL8 */ 67 enable-active-high; 68 }; 69 70 reg_usb_vbus: regulator-usb-vbus { 71 compatible = "regulator-fixed"; 72 regulator-name = "usb-vbus"; 73 regulator-min-microvolt = <5000000>; 74 regulator-max-microvolt = <5000000>; 75 vin-supply = <®_vcc5v>; 76 gpio = <&r_pio 0 12 GPIO_ACTIVE_HIGH>; /* PL12 */ 77 enable-active-high; 78 }; 79 80 reg_vcc5v: regulator-vcc5v { 81 /* board wide 5V supply from USB type-C port */ 82 compatible = "regulator-fixed"; 83 regulator-name = "vcc-5v"; 84 regulator-min-microvolt = <5000000>; 85 regulator-max-microvolt = <5000000>; 86 regulator-always-on; 87 }; 88}; 89 90&ehci0 { 91 status = "okay"; 92}; 93 94&ehci1 { 95 status = "okay"; 96}; 97 98&gpu { 99 mali-supply = <®_dcdc2>; 100 status = "okay"; 101}; 102 103&mmc0 { 104 vmmc-supply = <®_cldo3>; 105 cd-gpios = <&pio 5 6 (GPIO_ACTIVE_LOW | GPIO_PULL_UP)>; /* PF6 */ 106 bus-width = <4>; 107 status = "okay"; 108}; 109 110&mmc1 { 111 bus-width = <4>; 112 mmc-pwrseq = <&wifi_pwrseq>; 113 non-removable; 114 vmmc-supply = <®_dldo1_323>; 115 vqmmc-supply = <®_bldo1>; 116 status = "okay"; 117 118 brcmf: wifi@1 { 119 compatible = "brcm,bcm4329-fmac"; 120 reg = <1>; 121 interrupt-parent = <&r_pio>; 122 interrupts = <1 0 IRQ_TYPE_LEVEL_LOW>; /* PM0 */ 123 interrupt-names = "host-wake"; 124 }; 125}; 126 127&mmc2 { 128 bus-width = <8>; 129 cap-mmc-hw-reset; 130 mmc-ddr-1_8v; 131 mmc-hs200-1_8v; 132 non-removable; 133 vmmc-supply = <®_cldo3>; 134 vqmmc-supply = <®_cldo1>; 135 status = "okay"; 136}; 137 138&ohci0 { 139 status = "okay"; 140}; 141 142&ohci1 { 143 status = "okay"; 144}; 145 146&pio { 147 vcc-pb-supply = <®_cldo3>; /* via VCC-IO */ 148 vcc-pc-supply = <®_cldo1>; 149 vcc-pd-supply = <®_cldo3>; 150 vcc-pe-supply = <®_aldo2>; 151 vcc-pf-supply = <®_cldo3>; /* VCC-IO for 3.3v; VCC-MCSI for 1.8v */ 152 vcc-pg-supply = <®_bldo1>; 153 vcc-ph-supply = <®_cldo3>; /* via VCC-IO */ 154 vcc-pi-supply = <®_cldo3>; 155 vcc-pj-supply = <®_cldo1>; 156 vcc-pk-supply = <®_cldo1>; 157}; 158 159&r_i2c0 { 160 status = "okay"; 161 162 axp717: pmic@35 { 163 compatible = "x-powers,axp717"; 164 reg = <0x35>; 165 interrupt-controller; 166 #interrupt-cells = <1>; 167 interrupts-extended = <&nmi_intc 0 IRQ_TYPE_LEVEL_LOW>; 168 169 vin1-supply = <®_vcc5v>; 170 vin2-supply = <®_vcc5v>; 171 vin3-supply = <®_vcc5v>; 172 vin4-supply = <®_vcc5v>; 173 aldoin-supply = <®_vcc5v>; 174 bldoin-supply = <®_vcc5v>; 175 cldoin-supply = <®_vcc5v>; 176 177 regulators { 178 /* Supplies the "little" cluster (1.4 GHz cores) */ 179 reg_dcdc1: dcdc1 { 180 regulator-always-on; 181 regulator-min-microvolt = <900000>; 182 regulator-max-microvolt = <1160000>; 183 regulator-name = "vdd-cpul"; 184 }; 185 186 reg_dcdc2: dcdc2 { 187 regulator-always-on; 188 regulator-min-microvolt = <920000>; 189 regulator-max-microvolt = <920000>; 190 regulator-name = "vdd-gpu-sys"; 191 }; 192 193 reg_dcdc3: dcdc3 { 194 regulator-always-on; 195 regulator-min-microvolt = <1160000>; 196 regulator-max-microvolt = <1160000>; 197 regulator-name = "vcc-dram"; 198 }; 199 200 reg_dcdc4: dcdc4 { 201 /* feeds 3.3V pin on GPIO header */ 202 regulator-always-on; 203 regulator-min-microvolt = <3300000>; 204 regulator-max-microvolt = <3300000>; 205 regulator-name = "vdd-io"; 206 }; 207 208 aldo1 { 209 /* not actually connected */ 210 regulator-name = "avdd-csi"; 211 }; 212 213 reg_aldo2: aldo2 { 214 regulator-min-microvolt = <1800000>; 215 regulator-max-microvolt = <1800000>; 216 regulator-name = "vcc-pe"; 217 }; 218 219 reg_aldo3: aldo3 { 220 /* supplies the I2C pins for this PMIC */ 221 regulator-always-on; 222 regulator-min-microvolt = <3300000>; 223 regulator-max-microvolt = <3300000>; 224 regulator-name = "vcc-pl-usb"; 225 }; 226 227 reg_aldo4: aldo4 { 228 regulator-always-on; 229 regulator-min-microvolt = <1800000>; 230 regulator-max-microvolt = <1800000>; 231 regulator-name = "vcc-pll-dxco-avcc"; 232 }; 233 234 reg_bldo1: bldo1 { 235 regulator-min-microvolt = <1800000>; 236 regulator-max-microvolt = <1800000>; 237 regulator-name = "vcc-pg-wifi"; 238 }; 239 240 reg_bldo2: bldo2 { 241 regulator-always-on; 242 regulator-min-microvolt = <1800000>; 243 regulator-max-microvolt = <1800000>; 244 regulator-name = "vcc-pm-lpddr"; 245 }; 246 247 bldo3 { 248 /* not actually connected */ 249 regulator-name = "afvcc-csi"; 250 }; 251 252 bldo4 { 253 /* not actually connected */ 254 regulator-name = "dvdd-csi"; 255 }; 256 257 reg_cldo1: cldo1 { 258 regulator-always-on; 259 regulator-min-microvolt = <1800000>; 260 regulator-max-microvolt = <1800000>; 261 regulator-name = "vcc-cvp-pc-lvds-mcsi-pk-efuse-pcie-edp-1v8"; 262 }; 263 264 reg_cldo2: cldo2 { 265 regulator-min-microvolt = <3300000>; 266 regulator-max-microvolt = <3300000>; 267 regulator-name = "vcc3v3-csi"; 268 }; 269 270 reg_cldo3: cldo3 { 271 regulator-always-on; 272 regulator-min-microvolt = <3300000>; 273 regulator-max-microvolt = <3300000>; 274 regulator-name = "vcc-io-mmc-nand-pd-pi-usb"; 275 }; 276 277 reg_cldo4: cldo4 { 278 regulator-min-microvolt = <3300000>; 279 regulator-max-microvolt = <3300000>; 280 regulator-name = "vcc-3v3-phy1-lcd"; 281 }; 282 283 reg_cpusldo: cpusldo { 284 /* supplies the management core */ 285 regulator-always-on; 286 regulator-min-microvolt = <900000>; 287 regulator-max-microvolt = <900000>; 288 regulator-name = "vdd-cpus-usb-0v9"; 289 }; 290 }; 291 }; 292 293 axp323: pmic@36 { 294 compatible = "x-powers,axp323"; 295 reg = <0x36>; 296 #interrupt-cells = <1>; 297 interrupt-controller; 298 status = "okay"; 299 300 vin1-supply = <®_vcc5v>; 301 vin2-supply = <®_vcc5v>; 302 vin3-supply = <®_vcc5v>; 303 304 regulators { 305 reg_aldo1_323: aldo1 { 306 /* less capable and shares load with dldo1 */ 307 regulator-min-microvolt = <3300000>; 308 regulator-max-microvolt = <3300000>; 309 regulator-name = "vcc-wifi"; 310 }; 311 312 reg_dldo1_323: dldo1 { 313 /* more capable and shares load with aldo1 */ 314 regulator-min-microvolt = <3300000>; 315 regulator-max-microvolt = <3300000>; 316 regulator-name = "vcc-wifi2"; 317 }; 318 319 /* Supplies the "big" cluster (1.8 GHz cores) */ 320 reg_dcdc1_323: dcdc1 { 321 regulator-always-on; 322 regulator-min-microvolt = <900000>; 323 regulator-max-microvolt = <1150000>; 324 regulator-name = "vdd-cpub"; 325 }; 326 327 /* DCDC2 is polyphased with DCDC1 */ 328 329 /* Some RISC-V management core related voltage */ 330 reg_dcdc3_323: dcdc3 { 331 regulator-always-on; 332 regulator-min-microvolt = <900000>; 333 regulator-max-microvolt = <900000>; 334 regulator-name = "vdd-dnr"; 335 }; 336 }; 337 }; 338}; 339 340&r_pio { 341/* 342 * Specifying the supply would create a circular dependency. 343 * 344 * vcc-pl-supply = <®_aldo3>; 345 */ 346 vcc-pm-supply = <®_bldo2>; 347}; 348 349&uart0 { 350 pinctrl-names = "default"; 351 pinctrl-0 = <&uart0_pb_pins>; 352 status = "okay"; 353}; 354 355&uart1 { 356 pinctrl-names = "default"; 357 pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>; 358 uart-has-rtscts; 359 status = "okay"; 360 361 bluetooth { 362 compatible = "brcm,bcm4345c5"; 363 clocks = <&rtc CLK_OSC32K_FANOUT>; 364 clock-names = "lpo"; 365 vbat-supply = <®_aldo1_323>; 366 vddio-supply = <®_bldo1>; 367 device-wakeup-gpios = <&r_pio 1 3 GPIO_ACTIVE_HIGH>; /* PM3 */ 368 host-wakeup-gpios = <&r_pio 1 4 GPIO_ACTIVE_HIGH>; /* PM4 */ 369 shutdown-gpios = <&r_pio 1 2 GPIO_ACTIVE_HIGH>; /* PM2 */ 370 }; 371}; 372 373&usb_otg { 374 /* 375 * The OTG controller is connected to one of the type-A ports. 376 * There is a regulator, controlled by a GPIO, to provide VBUS power 377 * to the port, and a VBUSDET GPIO, to detect externally provided 378 * power. But without ID or CC pins there is no real way to do a 379 * runtime role detection. 380 */ 381 dr_mode = "host"; 382 status = "okay"; 383}; 384 385&usbphy { 386 usb0_vbus-supply = <®_otg_vbus>; 387 usb0_vbus_det-gpios = <&r_pio 0 7 GPIO_ACTIVE_HIGH>; /* PL7 */ 388 usb1_vbus-supply = <®_usb_vbus>; 389 status = "okay"; 390}; 391