netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* net: micrel: confusion about phyids used in driver
@ 2019-05-09 20:29 Uwe Kleine-König
  2019-05-09 20:55 ` Heiner Kallweit
  0 siblings, 1 reply; 15+ messages in thread
From: Uwe Kleine-König @ 2019-05-09 20:29 UTC (permalink / raw)
  To: Andrew Lunn, Florian Fainelli, Heiner Kallweit, Yuiko Oshino
  Cc: netdev, kernel

Hello,

I have a board here that has a KSZ8051MLL (datasheet:
http://ww1.microchip.com/downloads/en/DeviceDoc/ksz8051mll.pdf, phyid:
0x0022155x) assembled. The actual phyid is 0x00221556.

When enabling the micrel driver it successfully binds and claims to have
detected a "Micrel KSZ8031" because phyid & 0x00ffffff ==
PHY_ID_KSZ8031 (with PHY_ID_KSZ8031 = 0x00221556). I found a datasheet
for KSZ8021RNL and KSZ8031RNL in our collection, there the phyid is
documented as 0x0022155x, too. (So there is a deviation between driver
and data sheet.)

A difference between these two parts are register bits 0x16.9 and
0x1f.7. (I didn't check systematically and there are definitely more
differences, for example 0x16.7 which isn't handled at all in the
driver.)

The driver does the right thing with KSZ8051MLL for bit 0x16.9 (which is
setting a reserved bit on KSZ8021RNL/KSZ8031RNL) and for 0x1f.7 it's the
other way round.

To make the situation still more interesting there is another phy entry
"Micrel KSZ8051" that has .phy_id = 0x00221550 and .phy_id_mask =
0x00fffff0, which just judging from the name would be the better match.
(This isn't used however because even though it matches "Micrel KSZ8031"
is listed before and so is preferred.) With this the handling of the
register bit 0x16.9 isn't right for the KSZ8051MLL. (I think it would if
ksz8051_type had .has_broadcast_disable = true.)

I'm unclear what the right approach is to fix this muddle, maybe someone
with more insight in the driver and maybe also in possession of more
data sheets and hardware can tell?

My impression is that it is not possible to determine all features by
just using the phyid. Would it be sensible to not difference between
KSZ8031 and KSZ8051 and assume that writing to a reserved register bit
does nothing?

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

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

* Re: net: micrel: confusion about phyids used in driver
  2019-05-09 20:29 net: micrel: confusion about phyids used in driver Uwe Kleine-König
@ 2019-05-09 20:55 ` Heiner Kallweit
  2019-05-09 21:07   ` Andrew Lunn
  0 siblings, 1 reply; 15+ messages in thread
From: Heiner Kallweit @ 2019-05-09 20:55 UTC (permalink / raw)
  To: Uwe Kleine-König, Andrew Lunn, Florian Fainelli, Yuiko Oshino
  Cc: netdev, kernel

On 09.05.2019 22:29, Uwe Kleine-König wrote:
> Hello,
> 
> I have a board here that has a KSZ8051MLL (datasheet:
> http://ww1.microchip.com/downloads/en/DeviceDoc/ksz8051mll.pdf, phyid:
> 0x0022155x) assembled. The actual phyid is 0x00221556.
> 
I think the datasheets are the source of the confusion. If the
datasheets for different chips list 0x0022155x as PHYID each, and
authors of support for additional chips don't check the existing code,
then happens what happened.
However it's not a rare exception and not Microchip-specific that
sometimes vendors use the same PHYID for different chips.

And it seems you even missed one: KSZ8795
It's a switch and the internal PHY's have id 0x00221550.

If the drivers for the respective chips are actually different then we
may change the driver to match the exact model number only.
However, if there should be a PHY with e.g. id 0x00221554 out there,
it wouldn't be supported any longer and the generic PHY driver would
be used (what may work or not).

Obviously best would be get some input from Microchip.

> When enabling the micrel driver it successfully binds and claims to have
> detected a "Micrel KSZ8031" because phyid & 0x00ffffff ==
> PHY_ID_KSZ8031 (with PHY_ID_KSZ8031 = 0x00221556). I found a datasheet
> for KSZ8021RNL and KSZ8031RNL in our collection, there the phyid is
> documented as 0x0022155x, too. (So there is a deviation between driver
> and data sheet.)
> 
> A difference between these two parts are register bits 0x16.9 and
> 0x1f.7. (I didn't check systematically and there are definitely more
> differences, for example 0x16.7 which isn't handled at all in the
> driver.)
> 
> The driver does the right thing with KSZ8051MLL for bit 0x16.9 (which is
> setting a reserved bit on KSZ8021RNL/KSZ8031RNL) and for 0x1f.7 it's the
> other way round.
> 
> To make the situation still more interesting there is another phy entry
> "Micrel KSZ8051" that has .phy_id = 0x00221550 and .phy_id_mask =
> 0x00fffff0, which just judging from the name would be the better match.
> (This isn't used however because even though it matches "Micrel KSZ8031"
> is listed before and so is preferred.) With this the handling of the
> register bit 0x16.9 isn't right for the KSZ8051MLL. (I think it would if
> ksz8051_type had .has_broadcast_disable = true.)
> 
> I'm unclear what the right approach is to fix this muddle, maybe someone
> with more insight in the driver and maybe also in possession of more
> data sheets and hardware can tell?
> 
> My impression is that it is not possible to determine all features by
> just using the phyid. Would it be sensible to not difference between
> KSZ8031 and KSZ8051 and assume that writing to a reserved register bit
> does nothing?
> 
> Best regards
> Uwe
> 
Heiner


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

* Re: net: micrel: confusion about phyids used in driver
  2019-05-09 20:55 ` Heiner Kallweit
@ 2019-05-09 21:07   ` Andrew Lunn
  2019-05-10  7:22     ` Uwe Kleine-König
  2019-05-11 14:00     ` Heiner Kallweit
  0 siblings, 2 replies; 15+ messages in thread
From: Andrew Lunn @ 2019-05-09 21:07 UTC (permalink / raw)
  To: Heiner Kallweit
  Cc: Uwe Kleine-König, Florian Fainelli, Yuiko Oshino, netdev, kernel

On Thu, May 09, 2019 at 10:55:29PM +0200, Heiner Kallweit wrote:
> On 09.05.2019 22:29, Uwe Kleine-König wrote:
> > Hello,
> > 
> > I have a board here that has a KSZ8051MLL (datasheet:
> > http://ww1.microchip.com/downloads/en/DeviceDoc/ksz8051mll.pdf, phyid:
> > 0x0022155x) assembled. The actual phyid is 0x00221556.
> > 
> I think the datasheets are the source of the confusion. If the
> datasheets for different chips list 0x0022155x as PHYID each, and
> authors of support for additional chips don't check the existing code,
> then happens what happened.
> However it's not a rare exception and not Microchip-specific that
> sometimes vendors use the same PHYID for different chips.
> 
> And it seems you even missed one: KSZ8795
> It's a switch and the internal PHY's have id 0x00221550.
> 
> If the drivers for the respective chips are actually different then we
> may change the driver to match the exact model number only.
> However, if there should be a PHY with e.g. id 0x00221554 out there,
> it wouldn't be supported any longer and the generic PHY driver would
> be used (what may work or not).

Hi Heiner

We might also want to take a look at the code which matches a driver
to a PHY ID. Ideally we want the most specific match when looking at
the mask. We can then have device specific matches, and then a more
general fallback match using a wider mask.

No idea how to actually implement that :-(

   Andrew

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

* Re: net: micrel: confusion about phyids used in driver
  2019-05-09 21:07   ` Andrew Lunn
@ 2019-05-10  7:22     ` Uwe Kleine-König
  2019-07-02 20:31       ` Uwe Kleine-König
  2019-05-11 14:00     ` Heiner Kallweit
  1 sibling, 1 reply; 15+ messages in thread
From: Uwe Kleine-König @ 2019-05-10  7:22 UTC (permalink / raw)
  To: Andrew Lunn
  Cc: Heiner Kallweit, Florian Fainelli, Yuiko Oshino, netdev, kernel

On Thu, May 09, 2019 at 11:07:45PM +0200, Andrew Lunn wrote:
> On Thu, May 09, 2019 at 10:55:29PM +0200, Heiner Kallweit wrote:
> > On 09.05.2019 22:29, Uwe Kleine-König wrote:
> > > I have a board here that has a KSZ8051MLL (datasheet:
> > > http://ww1.microchip.com/downloads/en/DeviceDoc/ksz8051mll.pdf, phyid:
> > > 0x0022155x) assembled. The actual phyid is 0x00221556.
> >
> > I think the datasheets are the source of the confusion. If the
> > datasheets for different chips list 0x0022155x as PHYID each, and
> > authors of support for additional chips don't check the existing code,
> > then happens what happened.
> > 
> > However it's not a rare exception and not Microchip-specific that
> > sometimes vendors use the same PHYID for different chips.

From the vendor's POV it is even sensible to reuse the phy IDs iff the
chips are "compatible".

Assuming that the last nibble of the phy ID actually helps to
distinguish the different (not completely) compatible chips, we need
some more detailed information than available in the data sheets I have.
There is one person in the recipents of this mail with an @microchip.com
address (hint, hint!).

> > And it seems you even missed one: KSZ8795
> > It's a switch and the internal PHY's have id 0x00221550.
> > 
> > If the drivers for the respective chips are actually different then we
> > may change the driver to match the exact model number only.
> > However, if there should be a PHY with e.g. id 0x00221554 out there,
> > it wouldn't be supported any longer and the generic PHY driver would
> > be used (what may work or not).
> 
> We might also want to take a look at the code which matches a driver
> to a PHY ID. Ideally we want the most specific match when looking at
> the mask. We can then have device specific matches, and then a more
> general fallback match using a wider mask.
> 
> No idea how to actually implement that :-(

As this is not a detailed enough description to get a total order[1] we
either must tune the requirement or just rely on the order of
the drivers (as is). Then the more specific entries should be listed
first.

Alternatively if there is no way to distinguish different chips (where
the difference is important) the only possibility is to rely on
additional information that must be provided in a board-specific way.
(i2c is similar here. In the beginning they relied on the slave address,
but this wasn't good enough either.)

Best regards
Uwe

[1] Consider phyid = 0x12345678 and available mask/id pairs:
	0xffffff0f/0x12345608
	0xfffffff0/0x12345670

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

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

* Re: net: micrel: confusion about phyids used in driver
  2019-05-09 21:07   ` Andrew Lunn
  2019-05-10  7:22     ` Uwe Kleine-König
@ 2019-05-11 14:00     ` Heiner Kallweit
  1 sibling, 0 replies; 15+ messages in thread
From: Heiner Kallweit @ 2019-05-11 14:00 UTC (permalink / raw)
  To: Andrew Lunn
  Cc: Uwe Kleine-König, Florian Fainelli, Yuiko Oshino, netdev, kernel

On 09.05.2019 23:07, Andrew Lunn wrote:
> On Thu, May 09, 2019 at 10:55:29PM +0200, Heiner Kallweit wrote:
>> On 09.05.2019 22:29, Uwe Kleine-König wrote:
>>> Hello,
>>>
>>> I have a board here that has a KSZ8051MLL (datasheet:
>>> http://ww1.microchip.com/downloads/en/DeviceDoc/ksz8051mll.pdf, phyid:
>>> 0x0022155x) assembled. The actual phyid is 0x00221556.
>>>
>> I think the datasheets are the source of the confusion. If the
>> datasheets for different chips list 0x0022155x as PHYID each, and
>> authors of support for additional chips don't check the existing code,
>> then happens what happened.
>> However it's not a rare exception and not Microchip-specific that
>> sometimes vendors use the same PHYID for different chips.
>>
>> And it seems you even missed one: KSZ8795
>> It's a switch and the internal PHY's have id 0x00221550.
>>
>> If the drivers for the respective chips are actually different then we
>> may change the driver to match the exact model number only.
>> However, if there should be a PHY with e.g. id 0x00221554 out there,
>> it wouldn't be supported any longer and the generic PHY driver would
>> be used (what may work or not).
> 
> Hi Heiner
> 
> We might also want to take a look at the code which matches a driver
> to a PHY ID. Ideally we want the most specific match when looking at
> the mask. We can then have device specific matches, and then a more
> general fallback match using a wider mask.
> 
The matching code is the generic driver/device matching code.
As Uwe pointed out before, we can influence the probe order only
by ordering the drivers accordingly and hoping that the core
keeps to the order of registration when probing.

But this still wouldn't solve the issue as there are PHY's with the
same PHYID having registers that need to be treated differently.
When searching the internet a little bit one easily finds old questions
regarding how to tell between KSZ8031 and KSZ8051.

I'm not a fan of workarounds like having one driver and hoping that
writing to a reserved bit on one chip doesn't hurt. You never know
whether this register/bit has an undocumented function.

If these PHY's are primarily used on DT-configured boards, then we
may consider to add DT properties for the features that differ.

> No idea how to actually implement that :-(
> 
>    Andrew
> 
Heiner

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

* Re: net: micrel: confusion about phyids used in driver
  2019-05-10  7:22     ` Uwe Kleine-König
@ 2019-07-02 20:31       ` Uwe Kleine-König
  2019-07-02 20:55         ` Yuiko.Oshino
  0 siblings, 1 reply; 15+ messages in thread
From: Uwe Kleine-König @ 2019-07-02 20:31 UTC (permalink / raw)
  To: Yuiko Oshino
  Cc: netdev, Andrew Lunn, Florian Fainelli, kernel, Heiner Kallweit

Hello Yuiko Oshino,

On Fri, May 10, 2019 at 09:22:43AM +0200, Uwe Kleine-König wrote:
> On Thu, May 09, 2019 at 11:07:45PM +0200, Andrew Lunn wrote:
> > On Thu, May 09, 2019 at 10:55:29PM +0200, Heiner Kallweit wrote:
> > > On 09.05.2019 22:29, Uwe Kleine-König wrote:
> > > > I have a board here that has a KSZ8051MLL (datasheet:
> > > > http://ww1.microchip.com/downloads/en/DeviceDoc/ksz8051mll.pdf, phyid:
> > > > 0x0022155x) assembled. The actual phyid is 0x00221556.
> > >
> > > I think the datasheets are the source of the confusion. If the
> > > datasheets for different chips list 0x0022155x as PHYID each, and
> > > authors of support for additional chips don't check the existing code,
> > > then happens what happened.
> > > 
> > > However it's not a rare exception and not Microchip-specific that
> > > sometimes vendors use the same PHYID for different chips.
> 
> From the vendor's POV it is even sensible to reuse the phy IDs iff the
> chips are "compatible".
> 
> Assuming that the last nibble of the phy ID actually helps to
> distinguish the different (not completely) compatible chips, we need
> some more detailed information than available in the data sheets I have.
> There is one person in the recipents of this mail with an @microchip.com
> address (hint, hint!).

can you give some input here or forward to a person who can?

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

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

* RE: net: micrel: confusion about phyids used in driver
  2019-07-02 20:31       ` Uwe Kleine-König
@ 2019-07-02 20:55         ` Yuiko.Oshino
  2019-08-08  8:36           ` Uwe Kleine-König
  0 siblings, 1 reply; 15+ messages in thread
From: Yuiko.Oshino @ 2019-07-02 20:55 UTC (permalink / raw)
  To: u.kleine-koenig
  Cc: netdev, andrew, f.fainelli, kernel, hkallweit1, Ravi.Hegde, Tristram.Ha



>-----Original Message-----
>From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
>Sent: Tuesday, July 2, 2019 4:32 PM
>To: Yuiko Oshino - C18177 <Yuiko.Oshino@microchip.com>
>Cc: netdev@vger.kernel.org; Andrew Lunn <andrew@lunn.ch>; Florian Fainelli
><f.fainelli@gmail.com>; kernel@pengutronix.de; Heiner Kallweit
><hkallweit1@gmail.com>
>Subject: Re: net: micrel: confusion about phyids used in driver
>
>External E-Mail
>
>
>Hello Yuiko Oshino,
>
>On Fri, May 10, 2019 at 09:22:43AM +0200, Uwe Kleine-König wrote:
>> On Thu, May 09, 2019 at 11:07:45PM +0200, Andrew Lunn wrote:
>> > On Thu, May 09, 2019 at 10:55:29PM +0200, Heiner Kallweit wrote:
>> > > On 09.05.2019 22:29, Uwe Kleine-König wrote:
>> > > > I have a board here that has a KSZ8051MLL (datasheet:
>> > > > http://ww1.microchip.com/downloads/en/DeviceDoc/ksz8051mll.pdf,
>phyid:
>> > > > 0x0022155x) assembled. The actual phyid is 0x00221556.
>> > >
>> > > I think the datasheets are the source of the confusion. If the
>> > > datasheets for different chips list 0x0022155x as PHYID each, and
>> > > authors of support for additional chips don't check the existing
>> > > code, then happens what happened.
>> > >
>> > > However it's not a rare exception and not Microchip-specific that
>> > > sometimes vendors use the same PHYID for different chips.
>>
>> From the vendor's POV it is even sensible to reuse the phy IDs iff the
>> chips are "compatible".
>>
>> Assuming that the last nibble of the phy ID actually helps to
>> distinguish the different (not completely) compatible chips, we need
>> some more detailed information than available in the data sheets I have.
>> There is one person in the recipents of this mail with an
>> @microchip.com address (hint, hint!).
>
>can you give some input here or forward to a person who can?
>
>Best regards
>Uwe
>
>--
>Pengutronix e.K.                           | Uwe Kleine-König            |
>Industrial Linux Solutions                 | http://www.pengutronix.de/  |


Hello Uwe,

I forward this to the team.

Best regards,
Yuiko

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

* Re: net: micrel: confusion about phyids used in driver
  2019-07-02 20:55         ` Yuiko.Oshino
@ 2019-08-08  8:36           ` Uwe Kleine-König
  2019-08-20 20:25             ` Uwe Kleine-König
  0 siblings, 1 reply; 15+ messages in thread
From: Uwe Kleine-König @ 2019-08-08  8:36 UTC (permalink / raw)
  To: Yuiko.Oshino
  Cc: netdev, andrew, f.fainelli, kernel, hkallweit1, Ravi.Hegde, Tristram.Ha

Hello,

On Tue, Jul 02, 2019 at 08:55:07PM +0000, Yuiko.Oshino@microchip.com wrote:
> >On Fri, May 10, 2019 at 09:22:43AM +0200, Uwe Kleine-König wrote:
> >> On Thu, May 09, 2019 at 11:07:45PM +0200, Andrew Lunn wrote:
> >> > On Thu, May 09, 2019 at 10:55:29PM +0200, Heiner Kallweit wrote:
> >> > > On 09.05.2019 22:29, Uwe Kleine-König wrote:
> >> > > > I have a board here that has a KSZ8051MLL (datasheet:
> >> > > > http://ww1.microchip.com/downloads/en/DeviceDoc/ksz8051mll.pdf, phyid:
> >> > > > 0x0022155x) assembled. The actual phyid is 0x00221556.
> >> > >
> >> > > I think the datasheets are the source of the confusion. If the
> >> > > datasheets for different chips list 0x0022155x as PHYID each, and
> >> > > authors of support for additional chips don't check the existing
> >> > > code, then happens what happened.
> >> > >
> >> > > However it's not a rare exception and not Microchip-specific that
> >> > > sometimes vendors use the same PHYID for different chips.
> >>
> >> From the vendor's POV it is even sensible to reuse the phy IDs iff the
> >> chips are "compatible".
> >>
> >> Assuming that the last nibble of the phy ID actually helps to
> >> distinguish the different (not completely) compatible chips, we need
> >> some more detailed information than available in the data sheets I have.
> >> There is one person in the recipents of this mail with an
> >> @microchip.com address (hint, hint!).
> >
> >can you give some input here or forward to a person who can?
>
> I forward this to the team.

This thread still sits in my inbox waiting for some feedback. Did
something happen on your side?

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

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

* Re: net: micrel: confusion about phyids used in driver
  2019-08-08  8:36           ` Uwe Kleine-König
@ 2019-08-20 20:25             ` Uwe Kleine-König
  2019-08-20 20:30               ` Heiner Kallweit
  2019-08-21 17:24               ` Florian Fainelli
  0 siblings, 2 replies; 15+ messages in thread
From: Uwe Kleine-König @ 2019-08-20 20:25 UTC (permalink / raw)
  To: Nicolas Ferre
  Cc: netdev, andrew, f.fainelli, kernel, hkallweit1, Ravi.Hegde,
	Tristram.Ha, Yuiko.Oshino

Hello Nicolas,

there are some open questions regarding details about some PHYs
supported in the drivers/net/phy/micrel.c driver.

On Thu, Aug 08, 2019 at 10:36:37AM +0200, Uwe Kleine-König wrote:
> On Tue, Jul 02, 2019 at 08:55:07PM +0000, Yuiko.Oshino@microchip.com wrote:
> > >On Fri, May 10, 2019 at 09:22:43AM +0200, Uwe Kleine-König wrote:
> > >> On Thu, May 09, 2019 at 11:07:45PM +0200, Andrew Lunn wrote:
> > >> > On Thu, May 09, 2019 at 10:55:29PM +0200, Heiner Kallweit wrote:
> > >> > > On 09.05.2019 22:29, Uwe Kleine-König wrote:
> > >> > > > I have a board here that has a KSZ8051MLL (datasheet:
> > >> > > > http://ww1.microchip.com/downloads/en/DeviceDoc/ksz8051mll.pdf, phyid:
> > >> > > > 0x0022155x) assembled. The actual phyid is 0x00221556.

The short version is that a phy with ID 0x00221556 matches two
phy_driver entries in the driver:

	{ .phy_id = PHY_ID_KSZ8031, .phy_id_mask = 0x00ffffff, ... },
	{ .phy_id = PHY_ID_KSZ8051, .phy_id_mask = MICREL_PHY_ID_MASK, ... }

The driver doesn't behave optimal for "my" KSZ8051MLL with both entries
... It seems to work, but not all features of the phy are used and the
bootlog claims this was a KSZ8031 because that's the first match in the
list.

So we're in need of someone who can get their hands on some more
detailed documentation than publicly available to allow to make the
driver handle the KSZ8051MLL correctly without breaking other stuff.

I assume you are in a different department of Microchip than the people
caring for PHYs, but maybe you can still help finding someone who cares?

> > >> > > I think the datasheets are the source of the confusion. If the
> > >> > > datasheets for different chips list 0x0022155x as PHYID each, and
> > >> > > authors of support for additional chips don't check the existing
> > >> > > code, then happens what happened.
> > >> > >
> > >> > > However it's not a rare exception and not Microchip-specific that
> > >> > > sometimes vendors use the same PHYID for different chips.
> > >>
> > >> From the vendor's POV it is even sensible to reuse the phy IDs iff the
> > >> chips are "compatible".
> > >>
> > >> Assuming that the last nibble of the phy ID actually helps to
> > >> distinguish the different (not completely) compatible chips, we need
> > >> some more detailed information than available in the data sheets I have.
> > >> There is one person in the recipents of this mail with an
> > >> @microchip.com address (hint, hint!).
> > >
> > >can you give some input here or forward to a person who can?
> >
> > I forward this to the team.
> 
> This thread still sits in my inbox waiting for some feedback. Did
> something happen on your side?

This is still true, didn't hear back from Yuiko Oshino for some time
now.

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

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

* Re: net: micrel: confusion about phyids used in driver
  2019-08-20 20:25             ` Uwe Kleine-König
@ 2019-08-20 20:30               ` Heiner Kallweit
  2019-08-21 17:24               ` Florian Fainelli
  1 sibling, 0 replies; 15+ messages in thread
From: Heiner Kallweit @ 2019-08-20 20:30 UTC (permalink / raw)
  To: Uwe Kleine-König, Nicolas Ferre
  Cc: netdev, andrew, f.fainelli, kernel, Ravi.Hegde, Tristram.Ha,
	Yuiko.Oshino

On 20.08.2019 22:25, Uwe Kleine-König wrote:
> Hello Nicolas,
> 
> there are some open questions regarding details about some PHYs
> supported in the drivers/net/phy/micrel.c driver.
> 
> On Thu, Aug 08, 2019 at 10:36:37AM +0200, Uwe Kleine-König wrote:
>> On Tue, Jul 02, 2019 at 08:55:07PM +0000, Yuiko.Oshino@microchip.com wrote:
>>>> On Fri, May 10, 2019 at 09:22:43AM +0200, Uwe Kleine-König wrote:
>>>>> On Thu, May 09, 2019 at 11:07:45PM +0200, Andrew Lunn wrote:
>>>>>> On Thu, May 09, 2019 at 10:55:29PM +0200, Heiner Kallweit wrote:
>>>>>>> On 09.05.2019 22:29, Uwe Kleine-König wrote:
>>>>>>>> I have a board here that has a KSZ8051MLL (datasheet:
>>>>>>>> http://ww1.microchip.com/downloads/en/DeviceDoc/ksz8051mll.pdf, phyid:
>>>>>>>> 0x0022155x) assembled. The actual phyid is 0x00221556.
> 
> The short version is that a phy with ID 0x00221556 matches two
> phy_driver entries in the driver:
> 
> 	{ .phy_id = PHY_ID_KSZ8031, .phy_id_mask = 0x00ffffff, ... },
> 	{ .phy_id = PHY_ID_KSZ8051, .phy_id_mask = MICREL_PHY_ID_MASK, ... }
> 

If two PHYs have same ID but need different drivers, then callback
match_phy_device may have to be implemented, provided that the PHYs
can be differentiated by some other register content.
See Realtek PHY driver for an example.

> The driver doesn't behave optimal for "my" KSZ8051MLL with both entries
> ... It seems to work, but not all features of the phy are used and the
> bootlog claims this was a KSZ8031 because that's the first match in the
> list.
> 
> So we're in need of someone who can get their hands on some more
> detailed documentation than publicly available to allow to make the
> driver handle the KSZ8051MLL correctly without breaking other stuff.
> 
> I assume you are in a different department of Microchip than the people
> caring for PHYs, but maybe you can still help finding someone who cares?
> 
>>>>>>> I think the datasheets are the source of the confusion. If the
>>>>>>> datasheets for different chips list 0x0022155x as PHYID each, and
>>>>>>> authors of support for additional chips don't check the existing
>>>>>>> code, then happens what happened.
>>>>>>>
>>>>>>> However it's not a rare exception and not Microchip-specific that
>>>>>>> sometimes vendors use the same PHYID for different chips.
>>>>>
>>>>> From the vendor's POV it is even sensible to reuse the phy IDs iff the
>>>>> chips are "compatible".
>>>>>
>>>>> Assuming that the last nibble of the phy ID actually helps to
>>>>> distinguish the different (not completely) compatible chips, we need
>>>>> some more detailed information than available in the data sheets I have.
>>>>> There is one person in the recipents of this mail with an
>>>>> @microchip.com address (hint, hint!).
>>>>
>>>> can you give some input here or forward to a person who can?
>>>
>>> I forward this to the team.
>>
>> This thread still sits in my inbox waiting for some feedback. Did
>> something happen on your side?
> 
> This is still true, didn't hear back from Yuiko Oshino for some time
> now.
> 
> Best regards
> Uwe
> 


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

* Re: net: micrel: confusion about phyids used in driver
  2019-08-20 20:25             ` Uwe Kleine-König
  2019-08-20 20:30               ` Heiner Kallweit
@ 2019-08-21 17:24               ` Florian Fainelli
  2019-08-21 18:49                 ` allan.nielsen
  1 sibling, 1 reply; 15+ messages in thread
From: Florian Fainelli @ 2019-08-21 17:24 UTC (permalink / raw)
  To: Uwe Kleine-König, Nicolas Ferre
  Cc: netdev, andrew, kernel, hkallweit1, Ravi.Hegde, Tristram.Ha,
	Yuiko.Oshino, allan.nielsen

+Allan,

On 8/20/19 1:25 PM, Uwe Kleine-König wrote:
> Hello Nicolas,
> 
> there are some open questions regarding details about some PHYs
> supported in the drivers/net/phy/micrel.c driver.
> 
> On Thu, Aug 08, 2019 at 10:36:37AM +0200, Uwe Kleine-König wrote:
>> On Tue, Jul 02, 2019 at 08:55:07PM +0000, Yuiko.Oshino@microchip.com wrote:
>>>> On Fri, May 10, 2019 at 09:22:43AM +0200, Uwe Kleine-König wrote:
>>>>> On Thu, May 09, 2019 at 11:07:45PM +0200, Andrew Lunn wrote:
>>>>>> On Thu, May 09, 2019 at 10:55:29PM +0200, Heiner Kallweit wrote:
>>>>>>> On 09.05.2019 22:29, Uwe Kleine-König wrote:
>>>>>>>> I have a board here that has a KSZ8051MLL (datasheet:
>>>>>>>> http://ww1.microchip.com/downloads/en/DeviceDoc/ksz8051mll.pdf, phyid:
>>>>>>>> 0x0022155x) assembled. The actual phyid is 0x00221556.
> 
> The short version is that a phy with ID 0x00221556 matches two
> phy_driver entries in the driver:
> 
> 	{ .phy_id = PHY_ID_KSZ8031, .phy_id_mask = 0x00ffffff, ... },
> 	{ .phy_id = PHY_ID_KSZ8051, .phy_id_mask = MICREL_PHY_ID_MASK, ... }
> 
> The driver doesn't behave optimal for "my" KSZ8051MLL with both entries
> ... It seems to work, but not all features of the phy are used and the
> bootlog claims this was a KSZ8031 because that's the first match in the
> list.
> 
> So we're in need of someone who can get their hands on some more
> detailed documentation than publicly available to allow to make the
> driver handle the KSZ8051MLL correctly without breaking other stuff.
> 
> I assume you are in a different department of Microchip than the people
> caring for PHYs, but maybe you can still help finding someone who cares?

Allan, is this something you could help with? Thanks!

> 
>>>>>>> I think the datasheets are the source of the confusion. If the
>>>>>>> datasheets for different chips list 0x0022155x as PHYID each, and
>>>>>>> authors of support for additional chips don't check the existing
>>>>>>> code, then happens what happened.
>>>>>>>
>>>>>>> However it's not a rare exception and not Microchip-specific that
>>>>>>> sometimes vendors use the same PHYID for different chips.
>>>>>
>>>>> From the vendor's POV it is even sensible to reuse the phy IDs iff the
>>>>> chips are "compatible".
>>>>>
>>>>> Assuming that the last nibble of the phy ID actually helps to
>>>>> distinguish the different (not completely) compatible chips, we need
>>>>> some more detailed information than available in the data sheets I have.
>>>>> There is one person in the recipents of this mail with an
>>>>> @microchip.com address (hint, hint!).
>>>>
>>>> can you give some input here or forward to a person who can?
>>>
>>> I forward this to the team.
>>
>> This thread still sits in my inbox waiting for some feedback. Did
>> something happen on your side?
> 
> This is still true, didn't hear back from Yuiko Oshino for some time
> now.
> 
> Best regards
> Uwe
> 


-- 
Florian

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

* Re: net: micrel: confusion about phyids used in driver
  2019-08-21 17:24               ` Florian Fainelli
@ 2019-08-21 18:49                 ` allan.nielsen
  2019-08-21 19:53                   ` Woojung.Huh
  0 siblings, 1 reply; 15+ messages in thread
From: allan.nielsen @ 2019-08-21 18:49 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: Uwe Kleine-König, Nicolas Ferre, netdev, andrew, kernel,
	hkallweit1, Ravi.Hegde, Tristram.Ha, Yuiko.Oshino, Woojung.Huh

The 08/21/2019 10:24, Florian Fainelli wrote:
> +Allan,
> 
> On 8/20/19 1:25 PM, Uwe Kleine-König wrote:
> > Hello Nicolas,
> > 
> > there are some open questions regarding details about some PHYs
> > supported in the drivers/net/phy/micrel.c driver.
> > 
> > On Thu, Aug 08, 2019 at 10:36:37AM +0200, Uwe Kleine-König wrote:
> >> On Tue, Jul 02, 2019 at 08:55:07PM +0000, Yuiko.Oshino@microchip.com wrote:
> >>>> On Fri, May 10, 2019 at 09:22:43AM +0200, Uwe Kleine-König wrote:
> >>>>> On Thu, May 09, 2019 at 11:07:45PM +0200, Andrew Lunn wrote:
> >>>>>> On Thu, May 09, 2019 at 10:55:29PM +0200, Heiner Kallweit wrote:
> >>>>>>> On 09.05.2019 22:29, Uwe Kleine-König wrote:
> >>>>>>>> I have a board here that has a KSZ8051MLL (datasheet:
> >>>>>>>> http://ww1.microchip.com/downloads/en/DeviceDoc/ksz8051mll.pdf, phyid:
> >>>>>>>> 0x0022155x) assembled. The actual phyid is 0x00221556.
> > 
> > The short version is that a phy with ID 0x00221556 matches two
> > phy_driver entries in the driver:
> > 
> > 	{ .phy_id = PHY_ID_KSZ8031, .phy_id_mask = 0x00ffffff, ... },
> > 	{ .phy_id = PHY_ID_KSZ8051, .phy_id_mask = MICREL_PHY_ID_MASK, ... }
> > 
> > The driver doesn't behave optimal for "my" KSZ8051MLL with both entries
> > ... It seems to work, but not all features of the phy are used and the
> > bootlog claims this was a KSZ8031 because that's the first match in the
> > list.
> > 
> > So we're in need of someone who can get their hands on some more
> > detailed documentation than publicly available to allow to make the
> > driver handle the KSZ8051MLL correctly without breaking other stuff.
> > 
> > I assume you are in a different department of Microchip than the people
> > caring for PHYs, but maybe you can still help finding someone who cares?
> 
> Allan, is this something you could help with? Thanks!
Sorry, I'm new in Microchip (was aquired through Microsemi), and I know next to
nothing about the Micrel stuff.

Woojung: Can you comment on this, or try to direct this to someone who knows
something...

> >>>>>>> I think the datasheets are the source of the confusion. If the
> >>>>>>> datasheets for different chips list 0x0022155x as PHYID each, and
> >>>>>>> authors of support for additional chips don't check the existing
> >>>>>>> code, then happens what happened.
> >>>>>>>
> >>>>>>> However it's not a rare exception and not Microchip-specific that
> >>>>>>> sometimes vendors use the same PHYID for different chips.
> >>>>>
> >>>>> From the vendor's POV it is even sensible to reuse the phy IDs iff the
> >>>>> chips are "compatible".
> >>>>>
> >>>>> Assuming that the last nibble of the phy ID actually helps to
> >>>>> distinguish the different (not completely) compatible chips, we need
> >>>>> some more detailed information than available in the data sheets I have.
> >>>>> There is one person in the recipents of this mail with an
> >>>>> @microchip.com address (hint, hint!).
> >>>>
> >>>> can you give some input here or forward to a person who can?
> >>>
> >>> I forward this to the team.
> >>
> >> This thread still sits in my inbox waiting for some feedback. Did
> >> something happen on your side?
> > 
> > This is still true, didn't hear back from Yuiko Oshino for some time
> > now.
> > 
> > Best regards
> > Uwe
> > 
> 
> 
> -- 
> Florian

-- 
/Allan

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

* RE: net: micrel: confusion about phyids used in driver
  2019-08-21 18:49                 ` allan.nielsen
@ 2019-08-21 19:53                   ` Woojung.Huh
  2019-10-16  9:09                     ` Uwe Kleine-König
  0 siblings, 1 reply; 15+ messages in thread
From: Woojung.Huh @ 2019-08-21 19:53 UTC (permalink / raw)
  To: Allan.Nielsen, f.fainelli
  Cc: u.kleine-koenig, Nicolas.Ferre, netdev, andrew, kernel,
	hkallweit1, Ravi.Hegde, Tristram.Ha, Yuiko.Oshino

Hi Allan & Florian,

> > > So we're in need of someone who can get their hands on some more
> > > detailed documentation than publicly available to allow to make the
> > > driver handle the KSZ8051MLL correctly without breaking other stuff.
> > >
> > > I assume you are in a different department of Microchip than the people
> > > caring for PHYs, but maybe you can still help finding someone who cares?
> >
> > Allan, is this something you could help with? Thanks!
> Sorry, I'm new in Microchip (was aquired through Microsemi), and I know next to
> nothing about the Micrel stuff.
> 
> Woojung: Can you comment on this, or try to direct this to someone who knows
> something...

Forwarded to Yuiko. Will do follow-up.

Thanks.
Woojung

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

* Re: net: micrel: confusion about phyids used in driver
  2019-08-21 19:53                   ` Woojung.Huh
@ 2019-10-16  9:09                     ` Uwe Kleine-König
  2019-10-16 11:45                       ` Yuiko.Oshino
  0 siblings, 1 reply; 15+ messages in thread
From: Uwe Kleine-König @ 2019-10-16  9:09 UTC (permalink / raw)
  To: Woojung.Huh, Yuiko.Oshino
  Cc: Allan.Nielsen, f.fainelli, Nicolas.Ferre, netdev, andrew, kernel,
	hkallweit1, Ravi.Hegde, Tristram.Ha

On Wed, Aug 21, 2019 at 07:53:29PM +0000, Woojung.Huh@microchip.com wrote:
> Hi Allan & Florian,
> 
> > > > So we're in need of someone who can get their hands on some more
> > > > detailed documentation than publicly available to allow to make the
> > > > driver handle the KSZ8051MLL correctly without breaking other stuff.
> > > >
> > > > I assume you are in a different department of Microchip than the people
> > > > caring for PHYs, but maybe you can still help finding someone who cares?
> > >
> > > Allan, is this something you could help with? Thanks!
> > Sorry, I'm new in Microchip (was aquired through Microsemi), and I know next to
> > nothing about the Micrel stuff.
> > 
> > Woojung: Can you comment on this, or try to direct this to someone who knows
> > something...
> 
> Forwarded to Yuiko. Will do follow-up.

Nothing happend here, right? Would it be possible to get more detailed
documentation about the affected chips than available on the website
such that someone outside of microchip can address the problems?

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

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

* RE: net: micrel: confusion about phyids used in driver
  2019-10-16  9:09                     ` Uwe Kleine-König
@ 2019-10-16 11:45                       ` Yuiko.Oshino
  0 siblings, 0 replies; 15+ messages in thread
From: Yuiko.Oshino @ 2019-10-16 11:45 UTC (permalink / raw)
  To: u.kleine-koenig, Woojung.Huh
  Cc: Allan.Nielsen, f.fainelli, Nicolas.Ferre, netdev, andrew, kernel,
	hkallweit1, Ravi.Hegde, Tristram.Ha

Hi Uwe,

We are still working on this case.
I will feed your input.
Thank you for your patience...

Best regards,
Yuiko

>-----Original Message-----
>From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
>Sent: Wednesday, October 16, 2019 5:10 AM
>To: Woojung Huh - C21699 <Woojung.Huh@microchip.com>; Yuiko Oshino -
>C18177 <Yuiko.Oshino@microchip.com>
>Cc: Allan Nielsen - M31684 <Allan.Nielsen@microchip.com>;
>f.fainelli@gmail.com; Nicolas Ferre - M43238 <Nicolas.Ferre@microchip.com>;
>netdev@vger.kernel.org; andrew@lunn.ch; kernel@pengutronix.de;
>hkallweit1@gmail.com; Ravi Hegde - C21689 <Ravi.Hegde@microchip.com>;
>Tristram Ha - C24268 <Tristram.Ha@microchip.com>
>Subject: Re: net: micrel: confusion about phyids used in driver
>
>External E-Mail
>
>
>On Wed, Aug 21, 2019 at 07:53:29PM +0000, Woojung.Huh@microchip.com
>wrote:
>> Hi Allan & Florian,
>>
>> > > > So we're in need of someone who can get their hands on some more
>> > > > detailed documentation than publicly available to allow to make
>> > > > the driver handle the KSZ8051MLL correctly without breaking other stuff.
>> > > >
>> > > > I assume you are in a different department of Microchip than the
>> > > > people caring for PHYs, but maybe you can still help finding someone who
>cares?
>> > >
>> > > Allan, is this something you could help with? Thanks!
>> > Sorry, I'm new in Microchip (was aquired through Microsemi), and I
>> > know next to nothing about the Micrel stuff.
>> >
>> > Woojung: Can you comment on this, or try to direct this to someone
>> > who knows something...
>>
>> Forwarded to Yuiko. Will do follow-up.
>
>Nothing happend here, right? Would it be possible to get more detailed
>documentation about the affected chips than available on the website such that
>someone outside of microchip can address the problems?
>
>Best regards
>Uwe
>
>--
>Pengutronix e.K.                           | Uwe Kleine-König            |
>Industrial Linux Solutions                 | http://www.pengutronix.de/  |


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

end of thread, other threads:[~2019-10-16 11:45 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-09 20:29 net: micrel: confusion about phyids used in driver Uwe Kleine-König
2019-05-09 20:55 ` Heiner Kallweit
2019-05-09 21:07   ` Andrew Lunn
2019-05-10  7:22     ` Uwe Kleine-König
2019-07-02 20:31       ` Uwe Kleine-König
2019-07-02 20:55         ` Yuiko.Oshino
2019-08-08  8:36           ` Uwe Kleine-König
2019-08-20 20:25             ` Uwe Kleine-König
2019-08-20 20:30               ` Heiner Kallweit
2019-08-21 17:24               ` Florian Fainelli
2019-08-21 18:49                 ` allan.nielsen
2019-08-21 19:53                   ` Woojung.Huh
2019-10-16  9:09                     ` Uwe Kleine-König
2019-10-16 11:45                       ` Yuiko.Oshino
2019-05-11 14:00     ` Heiner Kallweit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).