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