Re: [net-next PATCH v2] net: phylink: Add helpers for c22 registers without MDIO

From: Russell King (Oracle)
Date: Fri Oct 22 2021 - 12:19:20 EST


On Fri, Oct 22, 2021 at 12:09:59PM -0400, Sean Anderson wrote:
> Some devices expose memory-mapped c22-compliant PHYs. Because these
> devices do not have an MDIO bus, we cannot use the existing helpers.
> Refactor the existing helpers to allow supplying the values for c22
> registers directly, instead of using MDIO to access them. Only get_state
> and set_advertisement are converted, since they contain the most complex
> logic. Because set_advertisement is never actually used outside
> phylink_mii_c22_pcs_config, move the MDIO-writing part into that
> function. Because some modes do not need the advertisement register set
> at all, we use -EINVAL for this purpose.
>
> Additionally, a new function phylink_pcs_enable_an is provided to
> determine whether to enable autonegotiation.
>
> Signed-off-by: Sean Anderson <sean.anderson@xxxxxxxx>

Thanks!

Reviewed-by: Russell King (Oracle) <rmk+kernel@xxxxxxxxxxxxxxx>

> ---
> This series was originally submitted as [1]. Although does not include
> its intended user (macb), I have submitted it separately at the behest
> of Russel. This series depends on [2].

It has uses for the Marvell DSA code, specifically 88E6352 where the
"serdes" PCS needs to be accessed using the PHY's fiber page, and
thus needs to use unlocked accesses to the BMCR/BMSR/LPA registers.

--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!