Re: [PATCH net-next 1/2] net: dsa: mv88e6xxx: Workaround missing PHY ID on mv88e6390

2017-01-26 Thread Gregory CLEMENT
Hi Andrew, > - return mv88e6xxx_g2_read(chip, GLOBAL2_SMI_PHY_DATA, val); > + err = mv88e6xxx_g2_read(chip, GLOBAL2_SMI_PHY_DATA, val); > + if (err) > + return err; > + > + if (reg == MII_PHYSID2) { > + /* The mv88e6390 internal PHYS don't have a model

Re: [PATCH net-next 1/2] net: dsa: mv88e6xxx: Workaround missing PHY ID on mv88e6390

2017-01-25 Thread Vivien Didelot
Hi Andrew, Andrew Lunn writes: >> if (reg == MII_PHYSID2 && (*val & 0xfff0) == 0) > > This should be 0x3f0. There are 10 bits for the device model, of which > Marvell uses the lowest 4 for version. > >> *val |= chip->info->prod_num << 4; > > #define

Re: [PATCH net-next 1/2] net: dsa: mv88e6xxx: Workaround missing PHY ID on mv88e6390

2017-01-25 Thread Andrew Lunn
On Wed, Jan 25, 2017 at 01:03:43PM -0500, Vivien Didelot wrote: > Andrew, > > Vivien Didelot writes: > > > Since several chips have this issue, we can introduce a u16 physid2_mask > > member in the mv88e6xxx_info structure and move the check in > >

Re: [PATCH net-next 1/2] net: dsa: mv88e6xxx: Workaround missing PHY ID on mv88e6390

2017-01-25 Thread Vivien Didelot
Andrew, Vivien Didelot writes: > Since several chips have this issue, we can introduce a u16 physid2_mask > member in the mv88e6xxx_info structure and move the check in > mv88e6xxx_phy_read() so that the logic of device (as in Global2) helpers > are not

Re: [PATCH net-next 1/2] net: dsa: mv88e6xxx: Workaround missing PHY ID on mv88e6390

2017-01-25 Thread Andrew Lunn
> Since several chips have this issue, we can introduce a u16 physid2_mask > member in the mv88e6xxx_info structure and move the check in > mv88e6xxx_phy_read() so that the logic of device (as in Global2) helpers > are not affected by such (necessary) hack. Something like: > > static int

Re: [PATCH net-next 1/2] net: dsa: mv88e6xxx: Workaround missing PHY ID on mv88e6390

2017-01-25 Thread Andrew Lunn
> I tested this series on the Topaz switch but it failed because while I > said we read 0x1410C00 actually we read 0x01410C01. With the > MARVELL_PHY_ID_MASK we mask the 4 lower bits so that's why in my patch > "phy: marvell: Add support for the PHY embedded in the topaz switch" I > used the

Re: [PATCH net-next 1/2] net: dsa: mv88e6xxx: Workaround missing PHY ID on mv88e6390

2017-01-25 Thread Florian Fainelli
On 01/25/2017 09:27 AM, Gregory CLEMENT wrote: > Hi Andrew, > > On mer., janv. 25 2017, Andrew Lunn wrote: > >> The internal PHYs of the mv88e6390 do not have a model ID. Trap any >> calls to the ID register, and if it is zero, return the ID for the >> mv88e6390. The Marvell

Re: [PATCH net-next 1/2] net: dsa: mv88e6xxx: Workaround missing PHY ID on mv88e6390

2017-01-25 Thread Vivien Didelot
Hi Gregory, Andrew, Gregory CLEMENT writes: >> +if (reg == MII_PHYSID2) { >> +/* The mv88e6390 internal PHYS don't have a model number. >> + * Use the switch family model number instead. >> + */ >> +if

Re: [PATCH net-next 1/2] net: dsa: mv88e6xxx: Workaround missing PHY ID on mv88e6390

2017-01-25 Thread Gregory CLEMENT
Hi Andrew, On mer., janv. 25 2017, Andrew Lunn wrote: > The internal PHYs of the mv88e6390 do not have a model ID. Trap any > calls to the ID register, and if it is zero, return the ID for the > mv88e6390. The Marvell PHY driver can then bind to this ID. > > Signed-off-by:

[PATCH net-next 1/2] net: dsa: mv88e6xxx: Workaround missing PHY ID on mv88e6390

2017-01-24 Thread Andrew Lunn
The internal PHYs of the mv88e6390 do not have a model ID. Trap any calls to the ID register, and if it is zero, return the ID for the mv88e6390. The Marvell PHY driver can then bind to this ID. Signed-off-by: Andrew Lunn Reviewed-by: Florian Fainelli ---