Subject: Re: [PATCH RFC 1/7] net: mdiobus: add clause 45 mdiobus accessors

From: Russell King - ARM Linux admin <[email-masked]>
Date: Tue, 26 May 2020 16:21:03 +0100

On Tue, May 26, 2020 at 04:39:06PM +0200, Andrew Lunn wrote:
> On Tue, May 26, 2020 at 03:31:01PM +0100, Russell King wrote:
> > There is a recurring pattern throughout some of the PHY code converting
> > a devad and regnum to our packed clause 45 representation. Rather than
> > having this scattered around the code, let's put a common translation
> > function in mdio.h, and provide some register accessors.
> > 
> > Convert the phylib core, phylink, bcm87xx and cortina to use these.
> 
> Hi Russell
> 
> This is a useful patch whatever we decide about C45 probing. If you
> can do some basic testing of it, i say submit it for this merge
> window.

It's almost fine, except for one << 16 I seem to have left in
phylink.c.

I can also report that the 2nd revision of the 88x3310 PHY does
_not_ have bit 0 set in the devices-in-package (just like the first
revision).  The 2nd revision should respond to clause 22 cycles, but
as it's connected to the XSMI interface on the 8040, clause 22 cycles
can't be generated.

Also, I found this in linux/mdio.h:

#define MDIO_SUPPORTS_C22               1
#define MDIO_SUPPORTS_C45               2
#define MDIO_EMULATE_C22                4

which are for use with struct mdio_if_info which we don't use in
phylib.  That seems relevant to our discussions last night.

-- 
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTC for 0.8m (est. 1762m) line in suburbia: sync at 13.1Mbps down 424kbps up