public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/5] net: phy: realtek: simplify and reunify C22/C45 drivers
@ 2026-01-13  3:43 Daniel Golle
  2026-01-13  3:44 ` [PATCH v2 1/5] net: phy: realtek: support interrupt also for C22 variants Daniel Golle
                   ` (4 more replies)
  0 siblings, 5 replies; 13+ messages in thread
From: Daniel Golle @ 2026-01-13  3:43 UTC (permalink / raw)
  To: Andrew Lunn, Heiner Kallweit, Russell King, David S. Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Daniel Golle,
	Michael Klein, Vladimir Oltean, Aleksander Jan Bajkowski, netdev,
	linux-kernel

The RTL8221B PHY variants (VB-CG and VM-CG) were previously split into
separate C22 and C45 driver instances to support copper SFP modules
using the RollBall MDIO-over-I2C protocol, which only supports Clause-45
access. However, this split created significant code duplication and
complexity.

Commit 8af2136e77989 ("net: phy: realtek: add helper
RTL822X_VND2_C22_REG") exposed that RealTek PHYs map all standard
Clause-22 registers into MDIO_MMD_VEND2 at offset 0xa400.

With commit 1850ec20d6e71 ("net: phy: realtek: use paged access for
MDIO_MMD_VEND2 in C22 mode") it is now possible to access all MMD
registers transparently, regardless of whether the PHY is accessed via
C22 or C45 MDIO.

Further improve the translation logic for this register mapping, so a
single unified driver works efficiently with both access methods,
reducing code duplication.

The series also includes cleanup to remove unnecessary paged operations
on registers that aren't actually affected by page selection.

Testing was done on RTL8211F and RTL8221B-VB-CG (the latter in both
C22 and C45 modes).

Changes since initial submission:
 - rebase on top of
   "net: phy: realtek: add dummy PHY driver for RTL8127ATF"
 - improve commit messages

Daniel Golle (5):
  net: phy: realtek: support interrupt also for C22 variants
  net: phy: realtek: simplify C22 reg access via MDIO_MMD_VEND2
  net: phy: realtek: reunify C22 and C45 drivers
  net: phy: realtek: demystify PHYSR register location
  net: phy: realtek: simplify bogus paged operations

 drivers/net/phy/realtek/realtek_main.c | 124 ++++++++++---------------
 1 file changed, 48 insertions(+), 76 deletions(-)

-- 
2.52.0

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2026-01-18  0:36 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-13  3:43 [PATCH v2 0/5] net: phy: realtek: simplify and reunify C22/C45 drivers Daniel Golle
2026-01-13  3:44 ` [PATCH v2 1/5] net: phy: realtek: support interrupt also for C22 variants Daniel Golle
2026-01-13  3:44 ` [PATCH v2 2/5] net: phy: realtek: simplify C22 reg access via MDIO_MMD_VEND2 Daniel Golle
2026-01-17 23:20   ` [v2,2/5] " Jakub Kicinski
2026-01-17 23:40     ` Daniel Golle
2026-01-17 23:55       ` Jakub Kicinski
2026-01-18  0:05         ` Daniel Golle
2026-01-18  0:10         ` Chris Mason
2026-01-18  0:17           ` Jakub Kicinski
2026-01-18  0:35             ` Chris Mason
2026-01-13  3:44 ` [PATCH v2 3/5] net: phy: realtek: reunify C22 and C45 drivers Daniel Golle
2026-01-13  3:44 ` [PATCH v2 4/5] net: phy: realtek: demystify PHYSR register location Daniel Golle
2026-01-13  3:44 ` [PATCH v2 5/5] net: phy: realtek: simplify bogus paged operations Daniel Golle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox