]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
net: phy: realtek: simplify C22 reg access via MDIO_MMD_VEND2
authorDaniel Golle <daniel@makrotopia.org>
Tue, 13 Jan 2026 03:44:17 +0000 (03:44 +0000)
committerJakub Kicinski <kuba@kernel.org>
Sun, 18 Jan 2026 00:12:16 +0000 (16:12 -0800)
commit2809a1c4340437f2ff6b73c0094d7ca51b575e1b
tree4e5e32e169981cd09d4fd9dddc62affa340d2759
parent84fb8b93fae2a4c53323b2bf6d81e7ddcc8e7cf4
net: phy: realtek: simplify C22 reg access via MDIO_MMD_VEND2

RealTek 2.5GE PHYs have all standard Clause-22 registers mapped also
inside MDIO_MMD_VEND2 at offset 0xa400. This is used mainly in case the
PHY is connected to a Clause-45-only bus. The RTL8221B is frequently
used in copper SFP module which uses the RollBall MDIO-over-I2C
method which *only* supports Clause-45, for example.

In order to support using the PHY on Clause-45-only busses, the PHY
driver has previously been split into a C22-only and C45-only instances,
creating quite a bit of redundancy and confusion.

In preparation of reunifying the two driver instances, add support for
translating MDIO_MMD_VEND2 registers 0xa400 to 0xa43c back to Clause-22
registers 0 to 30 in case the PHY is accessed on a Clause-22 bus.

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
Link: https://patch.msgid.link/fd49d86bd0445b76269fd3ea456c709c2066683f.1768275364.git.daniel@makrotopia.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/phy/realtek/realtek_main.c