net: phy: add X-Powers AC200/AC300 EPHY support
Subsystems (5)
v11 cover net: phy: add X-Powers AC200/AC300 EPHY support
This submission contains only the networking binding and PHY driver and is intended for net-next. The AC200 I2C register provider was submitted separately for the MFD tree:
https://patch.msgid.link/[email protected]
The two series can build and be merged independently. AC300 needs only the networking series. The AC200 runtime path additionally needs the separately submitted MFD provider and binding. Their shared design point is the DT
representation: the MDIO PHY-package node references the AC200 I2C node for access to package-control registers.
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.
Both variants are modeled as standard Ethernet PHY packages 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. AC200 reaches its control registers through a phandle to the companion IC's I2C register interface.
For AC200, the driver resolves the referenced I2C device, establishes a managed device link, and takes the supplier device lock before checking that the provider is fully bound and retrieving the regmap attached to that device. It waits for transient lock holders instead of treating lock contention as a missing dependency. The link then keeps the provider bound until the PHY consumer has unbound. This uses the generic device and regmap interfaces and supports multiple AC200 instances without syscon or a private cross-subsystem API.
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.
One xpowers-acx00 module binds the link child, joins the parent package and runs the selected backend. It manages the package supply, MII or RMII mode, vendor analog initialization and package state across suspend and resume. The common link implementation preserves automatic MDI/MDI-X and standard MAC-managed EEE advertisement while disabling only the vendor PHY-autonomous Intelligent EEE mode. A private mutex serializes package state across phylib callback contexts, while suspend recovery also holds the phylib lock.
The two patches add the AC200/AC300 PHY-package binding and 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:
---
Changes in v11:
- rebase onto current net-next
- document the little-endian NVMEM configuration format and require
two returned bytes for AC300 and selectable ACx00 packages, while
retaining one-byte calibration cells for fixed AC200 packages
- restore standard advertisement or forced speed/duplex after a failed
package suspend, in addition to the vendor settings
- power down again if suspend recovery fails, retaining the original
suspend error and the existing phylib and package-state locking
- update the companion MFD reference to the submitted AC200 v11 series
- Link to v10: https://patch.msgid.link/[email protected]
Changes in v10:
- rebase onto current net-next after the merge-window deferral
- release the MDIO bus lock when selecting a vendor register page fails,
preserving the error and allowing package shutdown to access the bus
- update the companion MFD reference to the submitted AC200 v10 series
- Link to v9: https://patch.msgid.link/[email protected]
Changes in v9:
- serialize package state and multi-register power sequences across phylib
callback contexts
- hold the phylib lock while recovering from suspend failures
- unwind package power after reset, resume or configuration failures
- restart autonegotiation when restoring EEE advertisement changes it
- propagate page-selection errors instead of an uninitialized result
- constrain AC300-capable child PHY addresses to the valid 0 through 7
range
- clarify the AC200 runtime dependency and provider-owned, rate-locked
clock
- document why the AC200 control sequence needs no AC300-style delay
- rebase onto current net-next
- Link to v8: https://patch.msgid.link/[email protected]
Changes in v8:
- replace the AC200 supplier trylock/defer path with a blocking device lock
- add Krzysztof's Reviewed-by tag to the PHY-package binding
- rebase onto current net-next
- Link to v7: https://patch.msgid.link/[email protected]
Changes in v7:
- link to the separately submitted MFD v7 series:
https://patch.msgid.link/[email protected]
- replace syscon publication and lookup with direct AC200 device/regmap
lookup
- require the referenced AC200 provider to be fully bound under its device
lock
- keep teardown ordered with the managed device link
- rebase onto current net-next
- Link to v6: https://patch.msgid.link/[email protected]
Changes in v6:
- split the networking work from the independently mergeable MFD series
- add the posting link for the separately submitted MFD series
- remove the redundant explicit schema selector
- describe the AC200 phandle in hardware terms and state its purpose
- simplify the clock description and keep only the needed NVMEM dependency
- reduce the binding examples to one
- rebase onto current net-next
- Link to v5: https://patch.msgid.link/[email protected]
To: James Hilliard <[email protected]>
To: Andrew Lunn <[email protected]>
To: "David S. Miller" <[email protected]>
To: Eric Dumazet <[email protected]>
To: Jakub Kicinski <[email protected]>
To: Paolo Abeni <[email protected]>
To: Rob Herring <[email protected]>
To: Krzysztof Kozlowski <[email protected]>
To: Conor Dooley <[email protected]>
To: Andrew Lunn <[email protected]>
To: Heiner Kallweit <[email protected]>
To: Russell King <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
---
James Hilliard (2):
dt-bindings: net: x-powers: add AC200/AC300 EPHY packages
net: phy: add X-Powers AC200/AC300 EPHY driver
.../bindings/net/x-powers,acx00-ephy-package.yaml | 170 ++++++ drivers/net/phy/Kconfig | 11 + drivers/net/phy/Makefile | 1 + drivers/net/phy/xpowers/Makefile | 3 + drivers/net/phy/xpowers/ac200.c | 314 ++++++++++ drivers/net/phy/xpowers/ac300.c | 387 +++++++++++++ drivers/net/phy/xpowers/acx00.c | 633 +++++++++++++++++++++ drivers/net/phy/xpowers/acx00.h | 28 + 8 files changed, 1547 insertions(+)
---
base-commit: ce48a0fdc56464b1afb03471dbdf38a5e0d571ad
change-id: 20260802-submit-acx00-of-dynamic-v1-94a0dc15f282
Best regards,
Signature · 1 line
James Hilliard <[email protected]>
PATCH v11 1/2 dt-bindings: net: x-powers: add AC200/AC300 EPHY packages
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. Their package control paths differ: AC200 control registers are accessed through the I2C register interface of the companion IC, while the AC300 control range is at a second Clause 22 address fixed at 16 plus the link address.
Describe both variants as Ethernet PHY packages. The package reg value is the link PHY base address and the child supplies the documented PHY ID, because the identification registers cannot be read until package setup has completed. The AC300 driver reaches its control range with the PHY package offset helpers. The AC200 package instead references the companion IC described by the separately submitted x-powers,ac200 MFD binding. Its I2C interface provides access to the package controls.
Give fixed hardware variant-specific compatibles. Also provide an ACx00 compatible for systems which can contain either package, with one packed NVMEM field containing calibration in bits 3 through 0, the AC300 selector in bit 8 and its low-calibration selector in bit 9. Such a description contains the potential resources for both backends; the driver consumes only those selected by the configuration field.
Document the little-endian encoding and two-byte full configuration, while allowing a one-byte calibration value for fixed AC200 packages.
Describe the package clock, supply and optional xMII receive-clock inversion needed by some integrations. A fixed AC200 package may omit the NVMEM field and use its internal calibration copy. Limit both the package and child link-PHY addresses in AC300-capable descriptions to 0 through 7 so the control address remains in the documented range 16 through 23.
--- .../bindings/net/x-powers,acx00-ephy-package.yaml | 170 +++++++++++++++++++++ 1 file changed, 170 insertions(+)
Documentation/devicetree/bindings/net/x-powers,acx00-ephy-package.yaml new file +170 -0
@@ -0,0 +1,170 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/net/x-powers,acx00-ephy-package.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: X-Powers AC200 and AC300 Ethernet PHY packages + +maintainers: + - James Hilliard <[email protected]> + +description: + The AC200 and AC300 contain compatible Fast Ethernet PHY blocks which report + the same Clause 22 PHY ID and use the same link-side register layout. The + package control paths differ. AC200 package control registers are accessed + through the companion IC's I2C register interface, while AC300 control + registers occupy a second Clause 22 address fixed at 16 plus the link PHY + address. + + Systems with a known package use the corresponding AC200 or AC300 compatible. + Systems which can contain either package use the ACx00 compatible and a + packed NVMEM configuration field to select the backend at runtime. + + The link PHY cannot report its ID until the package control sequence has + completed, so its child node supplies the documented PHY ID. The package and + child use the same base address. The AC200 driver programs that address into + the package, while the AC300 driver derives its control address from it. + +properties: + compatible: + enum: + - x-powers,ac200-ephy-package + - x-powers,ac300-ephy-package + - x-powers,acx00-ephy-package + + reg: + maximum: 31 + + clocks: + maxItems: 1 + description: AC300 input clock, running at 24, 25, or 27 MHz + + vcc-supply: + description: + 3.3 V package supply. This is connected to EPHY_VCC on AC200 and VCC1 + on AC300. + + nvmem-cells: + maxItems: 1 + description: + Packed little-endian EPHY configuration value, with the least-significant + byte first. Bits 3 through 0 contain the analog calibration code, bits 7 + through 4 are reserved, bit 8 selects AC300 when set and AC200 when clear, + and bit 9 requests the AC300 low-calibration tuning sequence. Bits 15 + through 10 are reserved. + + AC300 and selectable ACx00 packages require the full configuration + field, including bits 8 and 9 even when their values are zero, returned + as two bytes. A fixed AC200 package may provide a one-byte calibration + value or a two-byte configuration with bit 8 clear, or omit the cell + and use its internal eFuse calibration copy. + + nvmem-cell-names: + const: configuration + + x-powers,ac200: + $ref: /schemas/types.yaml#/definitions/phandle + description: + Phandle to the AC200 companion IC described by the x-powers,ac200 MFD + binding. Its I2C interface provides access to the package control + registers used to power and configure the Ethernet PHY. + + x-powers,xmii-rx-clock-inverted: + type: boolean + description: + Invert the xMII receive clock inside the PHY. This is required by some + SoC integrations, including the Allwinner H6 AC200 connection. + +patternProperties: + ^ethernet-phy@[a-f0-9]+$: + $ref: ethernet-phy.yaml# + properties: + compatible: + const: ethernet-phy-id0044.1400 + required: + - compatible + unevaluatedProperties: false + +required: + - compatible + - vcc-supply + +dependentRequired: + nvmem-cells: [ nvmem-cell-names ] + +allOf: + - $ref: ethernet-phy-package.yaml# + - if: + properties: + compatible: + const: x-powers,ac200-ephy-package + then: + properties: + clocks: false + required: + - x-powers,ac200 + - if: + properties: + compatible: + const: x-powers,ac300-ephy-package + then: + properties: + x-powers,ac200: false + required: + - clocks + - nvmem-cells + - nvmem-cell-names + - if: + properties: + compatible: + const: x-powers,acx00-ephy-package + then: + required: + - clocks + - nvmem-cells + - nvmem-cell-names + - x-powers,ac200 + - if: + properties: + compatible: + enum: + - x-powers,ac300-ephy-package + - x-powers,acx00-ephy-package + then: + properties: + reg: + maximum: 7 + patternProperties: + ^ethernet-phy@[a-f0-9]+$: + properties: + reg: + maximum: 7 + +unevaluatedProperties: false + +examples: + - | + mdio { + #address-cells = <1>; + #size-cells = <0>; + + ethernet-phy-package@0 { + compatible = "x-powers,acx00-ephy-package"; + reg = <0>; + #address-cells = <1>; + #size-cells = <0>; + clocks = <&pwm 5>; + vcc-supply = <®_3v3>; + nvmem-cells = <&ephy_configuration>; + nvmem-cell-names = "configuration"; + x-powers,ac200 = <&ac200>; + + ethernet-phy@0 { + compatible = "ethernet-phy-id0044.1400"; + reg = <0>; + }; + }; + }; + +...
Signature · 1 line
2.53.0
PATCH v11 2/2 net: phy: add X-Powers AC200/AC300 EPHY driver
In reply to James HilliardThe AC200 and AC300 contain compatible Fast Ethernet link PHYs, but the link endpoint is inaccessible until package-specific control registers have powered and configured it.
Add one PHY driver which binds the link child and joins its parent Ethernet PHY package. Fixed package compatibles select the corresponding backend. The generic ACx00 compatible reads one packed configuration field and selects the backend before touching backend-specific resources. The AC300 path therefore does not resolve or access the candidate AC200 I2C device.
Require two returned NVMEM bytes for AC300 and selectable ACx00 packages before selecting the backend. Keep the existing little-endian decoding and one-byte calibration support for fixed AC200 packages.
AC200 locates the I2C device referenced by the package and establishes a managed device link. It verifies that the provider is fully bound under the supplier device lock before retrieving the regmap attached to the I2C device. The companion MFD provider enables and exclusively pins the input clock rate while it is bound. The link keeps the supplier bound until the PHY consumer has unbound. Firmware must make the selected AC200 provider path available before the PHY probes.
AC300 uses the PHY package helpers to access the control range at base address plus 16. Keeping both backends in the same module lets the common link implementation own the complete PHY without registering artificial control devices.
Obtain and manage the selected package supply and calibration, manage the AC300 input clock, validate or program the link address, and apply the required reset, clock, I/O and shutdown sequences. Start in the hardware-default MII mode so the forced PHY device can probe before a MAC attaches, then apply the MAC-provided MII or RMII mode before the normal PHY soft reset. AC200 specifies no additional delay between its EPHY controls; the provider's input-clock startup delay is already complete before its regmap becomes available.
Apply the common vendor analog initialization, optional AC300 low-calibration tuning and board-selected receive-clock inversion. Keep MDI/MDI-X in automatic mode. Preserve standard MAC-managed EEE support while disabling the vendor PHY-autonomous Intelligent EEE mode. Restart autonegotiation when restoring the standard EEE advertisement changes it.
Serialize package state and the multi-register power sequences across the different phylib callback lock contexts. Power down the package control block and its supply during PHY suspend, then restore them and the vendor configuration during resume. If shutdown fails after resetting the PHY, restore the vendor settings and standard advertisement or forced speed/duplex under the phylib lock before returning the original error. A failed suspend is not followed by a normal resume to restore these settings. Power down again if recovery fails, and unwind package power if reset, resume or configuration fails after power-on.
--- drivers/net/phy/Kconfig | 11 + drivers/net/phy/Makefile | 1 + drivers/net/phy/xpowers/Makefile | 3 + drivers/net/phy/xpowers/ac200.c | 314 +++++++++++++++++++ drivers/net/phy/xpowers/ac300.c | 387 ++++++++++++++++++++++++ drivers/net/phy/xpowers/acx00.c | 633 +++++++++++++++++++++++++++++++++++++++ drivers/net/phy/xpowers/acx00.h | 28 ++ 7 files changed, 1377 insertions(+)
drivers/net/phy/Kconfig +11 -0
@@ -484,6 +484,17 @@ config VITESSE_PHY help Currently supports the vsc8244 +config XPOWERS_ACX00_PHY + tristate "X-Powers AC200/AC300 Ethernet PHY" + depends on COMMON_CLK && NVMEM && OF_MDIO && REGULATOR + depends on I2C || !I2C + select PHY_PACKAGE + help + Enable the Fast Ethernet PHY driver shared by the X-Powers AC200 + and AC300 companion ICs. The driver configures their common MDIO PHY + registers and the package-specific AC200 I2C or AC300 MDIO control + registers. + config XILINX_GMII2RGMII tristate "Xilinx GMII2RGMII converter driver" help
drivers/net/phy/Makefile +1 -0
@@ -101,4 +101,5 @@ obj-$(CONFIG_SMSC_PHY) += smsc.o obj-$(CONFIG_STE10XP) += ste10Xp.o obj-$(CONFIG_TERANETICS_PHY) += teranetics.o obj-$(CONFIG_VITESSE_PHY) += vitesse.o +obj-$(CONFIG_XPOWERS_ACX00_PHY) += xpowers/ obj-$(CONFIG_XILINX_GMII2RGMII) += xilinx_gmii2rgmii.o
drivers/net/phy/xpowers/Makefile new file +3 -0
@@ -0,0 +1,3 @@ +# SPDX-License-Identifier: GPL-2.0 +xpowers-acx00-y := acx00.o ac200.o ac300.o +obj-$(CONFIG_XPOWERS_ACX00_PHY) += xpowers-acx00.o
drivers/net/phy/xpowers/ac200.c new file +314 -0
314 lines not on this page · raw message
drivers/net/phy/xpowers/ac300.c new file +387 -0
387 lines not on this page · raw message
drivers/net/phy/xpowers/acx00.c new file +633 -0
633 lines not on this page · raw message
drivers/net/phy/xpowers/acx00.h new file +28 -0
@@ -0,0 +1,28 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +#ifndef __DRIVERS_NET_PHY_XPOWERS_ACX00_H +#define __DRIVERS_NET_PHY_XPOWERS_ACX00_H + +#include <linux/err.h> +#include <linux/phy.h> + +#define AC300_EPHY_CONTROL_ADDR_OFFSET 16 + +struct device_node ; + +struct acx00_ephy_control { +int (*power_on)(struct acx00_ephy_control *control, +unsigned int phy_addr); +int (*power_off)(struct acx00_ephy_control *control); +int (*set_interface)(struct acx00_ephy_control *control, +phy_interface_t interface); +}; + +struct acx00_ephy_control * +ac200_ephy_ctl_create (struct phy_device *phydev, +struct device_node *package_node, +bool has_calibration,u8 calibration); +struct acx00_ephy_control * +ac300_ephy_ctl_create (struct phy_device *phydev, +struct device_node *package_node,u8 calibration); + +#endif
Signature · 1 line
2.53.0
This series was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This series was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Quoted 6 lines · On Wed, 09 Sep 2026 18:15:36 -0600 you wrote:
This submission contains only the networking binding and PHY driver and is intended for net-next. The AC200 I2C register provider was submitted separately for the MFD tree:
Quoted 7 lines
The two series can build and be merged independently. AC300 needs only the networking series. The AC200 runtime path additionally needs the separately submitted MFD provider and binding. Their shared design point is the DT
representation: the MDIO PHY-package node references the AC200 I2C node for access to package-control registers.[...]
Here is the summary with links:
- [net-next,v11,1/2] dt-bindings: net: x-powers: add AC200/AC300 EPHY packages
https://git.kernel.org/netdev/net-next/c/783f6f1fdcd5 - [net-next,v11,2/2] net: phy: add X-Powers AC200/AC300 EPHY driver https://git.kernel.org/netdev/net-next/c/6cc2fbceb49b
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html