[PATCH net-next 0/5] net: phy: C45-over-C22 access

From: Michael Walle
Date: Fri Jan 20 2023 - 17:40:28 EST


After the c22 and c45 access split is finally merged. This can now be
posted again. The old version can be found here:
https://lore.kernel.org/netdev/20220325213518.2668832-1-michael@xxxxxxxx/
Although all the discussion was here:
https://lore.kernel.org/netdev/20220323183419.2278676-1-michael@xxxxxxxx/

The goal here is to get the GYP215 and LAN8814 running on the Microchip
LAN9668 SoC. The LAN9668 suppports one external bus and unfortunately, the
LAN8814 has a bug which makes it impossible to use C45 on that bus.
Fortunately, it was the intention of the GPY215 driver to be used on a C22
bus. But I think this could have never really worked, because the
phy_get_c45_ids() will always do c45 accesses and thus gpy_probe() will
fail.

Introduce C45-over-C22 support and use it if the MDIO bus doesn't support
C45. Also enable it when a PHY is promoted from C22 to C45.

Changes since RFC v2:
- Reased to latest net-next
- new check_rc argument in mmd_phy_indirect() to retain old behavior
- determine bus capabilities by bus->read and bus->read_c45
- always set phydev->c45_over_c22 if PHY is promoted

Changes since RFC v1:
- use __phy_mmd_indirect() in mdiobus_probe_mmd_read()
- add new properties has_c45 c45_over_c22 (and remove is_c45)
- drop MDIOBUS_NO_CAP handling, Andrew is preparing a series to
add probe_capabilities to mark all C45 capable MDIO bus drivers

Michael Walle (5):
net: phy: add error checks in mmd_phy_indirect() and export it
net: phy: support indirect c45 access in get_phy_c45_ids()
net: phy: add support for C45-over-C22 transfers
phy: net: introduce phy_promote_to_c45()
net: phy: mxl-gpy: remove unneeded ops

.../net/ethernet/hisilicon/hns/hns_ethtool.c | 4 +-
drivers/net/phy/bcm84881.c | 2 +-
drivers/net/phy/marvell10g.c | 2 +-
drivers/net/phy/mxl-gpy.c | 33 +-------
drivers/net/phy/phy-core.c | 48 ++++++++---
drivers/net/phy/phy.c | 6 +-
drivers/net/phy/phy_device.c | 80 ++++++++++++++++---
drivers/net/phy/phylink.c | 8 +-
include/linux/phy.h | 12 ++-
9 files changed, 128 insertions(+), 67 deletions(-)

--
2.30.2