On Thu, Jun 01, 2017 at 10:15:28AM -0700, Florian Fainelli wrote:
> On 06/01/2017 03:26 AM, Russell King wrote:
> > Add generic helpers for 802.3 clause 45 PHYs for >= 10Gbps support.
> > 
> > Signed-off-by: Russell King <rmk+ker...@armlinux.org.uk>
> > ---
> 
> > +   ctrl1 &= ~MDIO_CTRL1_SPEEDSEL;
> > +   /* PMA/PMD type selection is 1.7.5:0 not 1.7.3:0.  See 45.2.1.6.1. */
> > +   ctrl2 &= ~(MDIO_PMA_CTRL2_TYPE | 0x30);
> 
> You could add a define for this 0x30 to indicate that you are masking
> off the reserved bits (there are more entries that are reserved
> actually, but that would do for now).

They are not reserved according to 802.3-2015 and 802.3-2012:

802.3-2012: 45.2.1.6.1 PMA/PMD type selection (1.7.5:0)
802.3-2015: 45.2.1.6.3 PMA/PMD type selection (1.7.5:0)

which defines the type selection as occupying six bits, but the definition
in the UAPI mdio.h header file is:

#define MDIO_PMA_CTRL2_TYPE             0x000f  /* PMA/PMD type selection */

I presume that this is according to an earlier version of 802.3.
Changing this definition may cause userspace and/or kernel regressions,
so I propose something like:

#define MDIO_PMA_CTRL2_TYPE_2012        0x003f  /* PMA/PMD type selection */

instead.  The rest of the reserved entries are not specified as being
part of the type selection (yet) so it would be inappropriate to change
their value.

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.

Reply via email to