Re: [PATCH 10/21] net: phy: add X-Powers AC200 EPHY control driver
James Hilliard <[email protected]> Tue, 4 Aug 2026 09:26:35 -0600
| Newsgroups | dev.linux.lists.linux-sunxi,dev.linux.lists.mfd,org.infradead.lists.linux-arm-kernel,org.infradead.lists.linux-rockchip,org.kernel.vger.linux-devicetree,org.kernel.vger.linux-kernel,org.kernel.vger.netdev |
|---|---|
| Message-ID | <CADvTj4qmXWbDsc-vigcSrF1N=zpxmZWGp3YaZ9PFcWK551h3mg@mail.gmail.com> |
On Tue, Aug 4, 2026 at 8:54=E2=80=AFAM Andrew Lunn <[email protected]> wrote: > > > I agree that the link PHY cannot be identified by reading its > > registers before the package control sequence has run. I do not agree > > that this means an arbitrary ID should be placed in DT, though. > > The ability to put the ID in DT is there for two reasons: > > 1) You cannot enumerate the PHY because of missing clocks etc. > 2) The vendor messed up, and did not put a valid ID in registers 2 and 3. > > 2 does not happen very often, but this is one example. They are > different PHYs, they need different driver code, when you consider the > PHY as a whole. > > I also wound not put in an arbitrary ID, pick an unused ID in the > vendors range. The value currently used in DT is not arbitrary: 0x00441400 is exactly what both link-side Clause 22 endpoints report from registers 2 and 3 after the corresponding package control sequence has run. This is case (1), rather than case (2): the ID cannot initially be read because the EPHY has not yet been clocked, configured and released from reset. The reported ID does not distinguish the two packages, but replacing it with a synthetic unused ID would make an ethernet-phy-idAAAA.BBBB compatible disagree with the value actually reported by registers 2 and 3. If separate AC200 and AC300 PHY driver entries are needed to identify the complete package variants, they can use package-specific match data while sharing the common link-PHY implementation. > > > Both AC200 and AC300 expose the same link-side PHY ID and register > > layout. > > No they don't. There are extra registers in different address domains. The block diagrams make the distinction clearer. Both diagrams depict an EPHY block with the same internal organization: MII/RMII, auto negotiation, auto-MDIX, 10/100 TX and RX PCS/PMA blocks, LED logic, clock/reset, PLL and EPHY AFE. What differs is the surrounding top-level control path. In AC200, E_MDC/E_MDIO connect directly to the EPHY, while the package control logic and registers are reached separately through RSB/TWI. In AC300, the external MDC/MDIO pins first enter a top-level MDIO slave and register block, which then provides internal MDC/MDIO connections to the EPHY. That top-level block also contains the AC300-specific reset, clock, I/O and eFuse controls. Therefore, I agree that saying the complete register layouts are the same was too broad. The packages have different top-level control registers in different address domains, but the diagrams indicate that they contain the same link-facing EPHY implementation. That maps naturally to shared link-PHY code with separate AC200 and AC300 control backends, rather than two copies of the common EPHY implementation. > > Andrew