[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aIt-rT4T7BnUZk90@pidgin.makrotopia.org>
Date: Thu, 31 Jul 2025 15:33:17 +0100
From: Daniel Golle <daniel@...rotopia.org>
To: "Russell King (Oracle)" <linux@...linux.org.uk>
Cc: markus.stockhausen@....de, 'Heiner Kallweit' <hkallweit1@...il.com>,
andrew@...n.ch, davem@...emloft.net, edumazet@...gle.com,
kuba@...nel.org, pabeni@...hat.com, michael@...sekall.de,
netdev@...r.kernel.org, jan@....eu
Subject: Re: AW: [PATCH v2] net: phy: realtek: convert RTL8226-CG to c45 only
On Thu, Jul 31, 2025 at 03:01:21PM +0100, Russell King (Oracle) wrote:
> On Thu, Jul 31, 2025 at 12:55:40PM +0200, markus.stockhausen@....de wrote:
> > As soon as this bit is set to one mode the bus will block most
> > accesses with the other mode. E.g. In c22 mode registers 13/14
> > are a dead end. So the only option for the bus is to limit access
> > like this.
>
> Why would a bus implementation block access to clause 22 registers
> 13/14 when operating in clause 22 mode? Or is the above badly phrased?
No, you understood correctly. Sadly.
RealTek's MDIO controller is a highly abstracted beast, with many
assumptions regarding the meaning of each register. It is NOT a generic
MDIO host controller, but rather quite specific to the way registers are
defined for Ethernet PHYs. As such, it "offloads" things like
MMD-over-C22 as well as C22 register pages (always assuming register 0x1f
is the page selector).
Further down the road it does provide specific calls for MMD-over-C22
which the current driver is not using -- it could, however, be implemented
by intercepting access to registers 13 and 14 in the MDIO controller
driver, storing device and register addresses in the driver's priv struct
and using hardware-assisted MMD-over-C22 API when ever an MMD read or
write operation is requested (ie. the final access to MII_MMD_DATA).
A similar logic is already implemented for page selection and RealTek-specific
PHY package port selection mechanisms, see
https://git.openwrt.org/?p=openwrt/openwrt.git;a=blob;f=target/linux/realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.c;h=5c6d79d19b598bbb2f5b74c3d25f5cf3ee077096;hb=HEAD#l2084
The same could be implemented in mdio-realtek-rtl9300.c, and similarly also
MMD-over-C22 could be implemented.
Powered by blists - more mailing lists