[PATCH net-next v5 0/5] net: phy: add X-Powers AC200/AC300 EPHY support

From: James Hilliard

Date: Sun Aug 09 2026 - 16:30:14 EST


The AC200 and AC300 contain compatible Fast Ethernet link PHYs which
report the same Clause 22 identifier and use the same link-side register
layout. The link endpoint is inaccessible until package-specific control
registers have powered and configured it.

Version 2 represented those control ranges as separate devices. Version 3
instead modeled each variant as a standard Ethernet PHY package with one
forced-ID link-PHY child. The package reg value is the link address.
AC300's control range is a fixed package-relative offset of 16 and is
accessed with the PHY package helpers; it has no separate DT node or MDIO
driver. AC200 references its I2C MFD because the corresponding control
registers reside in that multi-function device.

This revision retains that package model and publishes the AC200 regmap
through syscon. It adds managed registration for externally created
syscon regmaps so a removable provider can withdraw its entry before the
regmap is released. The PHY establishes a managed device link to the AC200
I2C device before looking up the regmap through its firmware reference,
which keeps the supplier bound until its PHY consumer has unbound.

Fixed hardware uses an AC200- or AC300-specific package compatible. Systems
which can contain either package use the ACx00 package compatible and one
packed SID configuration field. Bits 3 through 0 carry the analog
calibration, bit 8 selects AC300, and bit 9 selects its low-calibration
tuning. The driver chooses the backend before acquiring any
backend-specific resource, so an AC300 system does not instantiate or
access the AC200 I2C device.

One xpowers-acx00 PHY module binds the link child, joins the parent package
and runs the selected AC200 or AC300 backend. Only the link PHY registers a
driver. The common implementation and the private backends live in an
X-Powers subdirectory and are linked into the same module. Thus the PHY
driver owns the complete Ethernet PHY while the AC200 MFD owns the shared
mixed-signal chip and its regmap.

The package node owns a common vcc-supply, connected to EPHY_VCC on AC200
and VCC1 on AC300. The PHY driver manages that function supply and can turn
it off while the PHY is suspended. The AC200 MFD keeps ownership of the
chip-wide system input clock.

The series contains no CONFIG_OF_DYNAMIC code and no generic MDIO
reconfiguration. Firmware must make the selected AC200 provider path
available before the PHY probes.

The common link implementation performs the vendor analog initialization,
supports MII and RMII, preserves automatic MDI/MDI-X, and restores package
state across suspend and resume. It preserves standard MAC-managed EEE
advertisement while disabling only the vendor PHY-autonomous Intelligent
EEE mode.

The five patches add the minimal AC200 MFD binding, managed registration
for external syscon regmaps, the AC200 regmap provider, the AC200/AC300
PHY package binding and the combined PHY driver. Board Device Trees and
optional PHY features remain outside this initial series.

The AC200 portions build on earlier work by Jernej Skrabec and Andre
Przywara:

https://github.com/jernejsk/linux-1/commits/ac200-v4

Public AC200 and AC300 documentation is linked from:

https://linux-sunxi.org/AC200

Validation completed for v5:

- arm64 defconfig vmlinux and module builds with W=1;
- x86_64 allmodconfig object builds with W=1;
- a built-in AC300-only configuration with I2C and MFD_SYSCON disabled;
- dt_binding_check for both new schemas;
- strict checkpatch checks for all five patches, with only the generic
FILE_PATH_CHANGES prompt ignored; and
- managed syscon registration, lookup, supplier removal and re-registration
on the running kernel.

The final AC200 path was hardware-tested on an H616 board. The packed
configuration was 0x001, selecting AC200. The MFD reported revision 0x101
in package 1, the PHY obtained its regmap through syscon after establishing
the supplier device link, and the link PHY bound at address 0. It applied
RMII mode, negotiated a 100 Mbps full-duplex link and passed eight MiB of
traffic in each direction and 100 consecutive pings without loss.

An administrative link down/up cycle dropped the package regulator
consumer count from one to zero, restored it and renegotiated the same link
mode. With the link administratively down, unbinding the AC200 supplier
unbound the PHY consumer before removing the syscon regmap. Rebinding the
supplier re-registered the regmap; rebinding the PHY then restored the
device link and the 100 Mbps full-duplex link.

The final AC300 path was hardware-tested on the connected H616 board. The
driver read the packed SID field as 0x106, selected AC300 without enabling
the AC200 I2C path, accessed the control range at package base plus 16,
bound the link PHY at address 0, applied RMII mode and negotiated a
100 Mbps full-duplex link after a cold boot. Eight MiB of traffic passed
in each direction. An administrative link down/up cycle disabled and
restored the package regulator and renegotiated the same link mode.

Assisted-by: OpenAI Codex (gpt-5.6-sol, max)
Signed-off-by: James Hilliard <james.hilliard1@xxxxxxxxx>
---
Changes v2 -> v3:
- model AC200 and AC300 as standard Ethernet PHY packages
- remove the standalone AC200 and AC300 control bindings and drivers
- put the common link implementation and both private backends in one
xpowers-acx00 module
- access the AC300 control range at package base plus 16 with PHY package
helpers
- access AC200 package registers through its referenced MFD regmap and a
managed device link
- add an ACx00 package compatible which selects the backend from one
packed SID configuration field
- combine calibration, package selection and AC300 tuning into that field
- optionally activate only a selected fail-needs-probe AC200 path when
CONFIG_OF_DYNAMIC is available
- preserve standard MAC-managed EEE advertisement and disable only the
PHY-autonomous Intelligent EEE mode
- reduce the series from eight patches to four
- Link to v2:
https://patch.msgid.link/20260804-submit-acx00-of-dynamic-v1-v2-0-3eef49ff1d8c@xxxxxxxxx

Changes v3 -> v4:
- rebase onto current net-next
- always restore the PHY page and release the MDIO bus lock after a
page-selection error
- preserve AC300 external-VDD configuration until package status
identifies the supply arrangement
- remove the unsupported AC300 MDIO-error clear/readback sequence,
which is absent from the BSP initialization
- remove AC200 post-reset waits not required by its documentation or
hardware testing
- report the failing AC200 control register
- follow MFD subject and driver-data naming conventions
- use the AC200 teardown callback directly, follow reverse Christmas-tree
declaration ordering and use a named I2C ID initializer
- use named input-clock rates and simplify MII/RMII selection
- avoid blocking on the AC200 supplier lock while checking driver
readiness
- Link to v3:
https://patch.msgid.link/20260805-submit-acx00-of-dynamic-v1-v3-0-32c3210a6f25@xxxxxxxxx

Changes v4 -> v5:
- remove CONFIG_OF_DYNAMIC path activation from the submitted series
- publish the AC200 regmap through syscon and add managed registration
for externally created regmaps
- resolve the AC200 regmap through its phandle after establishing a
managed device link to the I2C supplier
- move EPHY_VCC and VCC1 ownership to a common PHY-package vcc-supply and
manage it across suspend and resume
- move the four PHY source files into an X-Powers subdirectory
- remove private backend mutexes because phylib serializes these
lifecycle callbacks and neither backend has an independent worker or
interrupt path
- rebase onto current net-next
- Link to v4:
https://patch.msgid.link/20260806-submit-acx00-of-dynamic-v1-v4-0-9bf2f7441632@xxxxxxxxx

To: Lee Jones <lee@xxxxxxxxxx>
To: Rob Herring <robh@xxxxxxxxxx>
To: Krzysztof Kozlowski <krzk+dt@xxxxxxxxxx>
To: Conor Dooley <conor+dt@xxxxxxxxxx>
To: James Hilliard <james.hilliard1@xxxxxxxxx>
To: Arnd Bergmann <arnd@xxxxxxxx>
To: Andrew Lunn <andrew+netdev@xxxxxxx>
To: "David S. Miller" <davem@xxxxxxxxxxxxx>
To: Eric Dumazet <edumazet@xxxxxxxxxx>
To: Jakub Kicinski <kuba@xxxxxxxxxx>
To: Paolo Abeni <pabeni@xxxxxxxxxx>
To: Andrew Lunn <andrew@xxxxxxx>
To: Heiner Kallweit <hkallweit1@xxxxxxxxx>
To: Russell King <linux@xxxxxxxxxxxxxxx>
Cc: mfd@xxxxxxxxxxxxxxx
Cc: devicetree@xxxxxxxxxxxxxxx
Cc: linux-kernel@xxxxxxxxxxxxxxx
Cc: netdev@xxxxxxxxxxxxxxx

---
James Hilliard (5):
dt-bindings: mfd: x-powers: Add AC200
mfd: syscon: Add managed registration for external regmaps
mfd: ac200: Add X-Powers AC200 support
dt-bindings: net: x-powers: add AC200/AC300 EPHY packages
net: phy: add X-Powers AC200/AC300 EPHY driver

.../devicetree/bindings/mfd/x-powers,ac200.yaml | 49 ++
.../bindings/net/x-powers,acx00-ephy-package.yaml | 207 ++++++++
drivers/mfd/Kconfig | 12 +
drivers/mfd/Makefile | 1 +
drivers/mfd/ac200.c | 170 +++++++
drivers/mfd/syscon.c | 87 +++-
drivers/net/phy/Kconfig | 11 +
drivers/net/phy/Makefile | 1 +
drivers/net/phy/xpowers/Makefile | 3 +
drivers/net/phy/xpowers/ac200.c | 315 ++++++++++++
drivers/net/phy/xpowers/ac300.c | 387 +++++++++++++++
drivers/net/phy/xpowers/acx00.c | 536 +++++++++++++++++++++
drivers/net/phy/xpowers/acx00.h | 28 ++
include/linux/mfd/syscon.h | 12 +
14 files changed, 1797 insertions(+), 22 deletions(-)
---
base-commit: 001b5d347d8ba39b2dccaefcc57967b18caec8fe
change-id: 20260802-submit-acx00-of-dynamic-v1-94a0dc15f282

Best regards,
--
James Hilliard <james.hilliard1@xxxxxxxxx>