netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Enguerrand de Ribaucourt 
	<enguerrand.de-ribaucourt@savoirfairelinux.com>,
	Prasanna Vengateshan <prasanna.vengateshan@microchip.com>
Cc: netdev <netdev@vger.kernel.org>,
	hkallweit1 <hkallweit1@gmail.com>, linux <linux@armlinux.org.uk>
Subject: Re: [PATCH v2 1/2] net: phy: micrel: add Microchip KSZ 9897 Switch PHY support
Date: Tue, 8 Feb 2022 14:13:41 +0100	[thread overview]
Message-ID: <YgJshWvkCQLoGuNX@lunn.ch> (raw)
In-Reply-To: <2044096516.560385.1644309521228.JavaMail.zimbra@savoirfairelinux.com>

On Tue, Feb 08, 2022 at 03:38:41AM -0500, Enguerrand de Ribaucourt wrote:
> ----- Original Message -----
> > From: "Andrew Lunn" <andrew@lunn.ch>
> > To: "Enguerrand de Ribaucourt" <enguerrand.de-ribaucourt@savoirfairelinux.com>
> > Cc: "netdev" <netdev@vger.kernel.org>, "hkallweit1" <hkallweit1@gmail.com>, "linux" <linux@armlinux.org.uk>
> > Sent: Tuesday, February 8, 2022 12:28:53 AM
> > Subject: Re: [PATCH v2 1/2] net: phy: micrel: add Microchip KSZ 9897 Switch PHY support
> 
> > > + /* KSZ8081A3/KSZ8091R1 PHY and KSZ9897 switch share the same
> > > + * exact PHY ID. However, they can be told apart by the default value
> > > + * of the LED mode. It is 0 for the PHY, and 1 for the switch.
> > > + */
> > > + ret &= (MICREL_KSZ8081_CTRL2_LED_MODE0 | MICREL_KSZ8081_CTRL2_LED_MODE1);
> > > + if (!ksz_8081)
> > > + return ret;
> > > + else
> > > + return !ret;
> 
> > What exactly does MICREL_KSZ8081_CTRL2_LED_MODE0 and
> > MICREL_KSZ8081_CTRL2_LED_MODE1 mean? We have to be careful in that
> > there could be use cases which actually wants to configure the
> > LEDs. There have been recent discussions for two other PHYs recently
> > where the bootloader is configuring the LEDs, to something other than
> > their default value.
> 
> Those registers configure the LED Mode according to the KSZ8081 datasheet:
> [00] = LED1: Speed LED0: Link/Activity
> [01] = LED1: Activity LED0: Link
> [10], [11] = Reserved
> default value is [00].
> 
> Indeed, if the bootloader changes them, we would match the wrong
> device. However, I closely examined all the registers, and there is no
> read-only bit that we can use to differentiate both models. The
> LED mode bits are the only ones that have a different default value on the
> KSZ8081: [00] and the KSZ9897: [01]. Also, the RMII registers are not
> documented in the KSZ9897 datasheet so that value is not guaranteed to
> be [01] even though that's what I observed.
> 
> Do you think we should find another way to match KSZ8081 and KSZ9897?
> The good news is that I'm now confident about the phy_id emitted by
> both models.

Lets try asking Prasanna Vengateshan, who is working on other
Microchip switches and PHYs at Microchip.

     Andrew

  reply	other threads:[~2022-02-08 13:16 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-07 17:45 [PATCH v2 0/2] net: phy: micrel: add Microchip KSZ 9897 Switch PHY Enguerrand de Ribaucourt
2022-02-07 17:45 ` [PATCH v2 1/2] net: phy: micrel: add Microchip KSZ 9897 Switch PHY support Enguerrand de Ribaucourt
2022-02-07 23:28   ` Andrew Lunn
2022-02-08  8:38     ` Enguerrand de Ribaucourt
2022-02-08 13:13       ` Andrew Lunn [this message]
2022-02-10 15:30         ` Prasanna.VengateshanVaradharajan
2022-02-10 15:38           ` Prasanna.VengateshanVaradharajan
2022-04-05 14:53             ` Enguerrand de Ribaucourt
2022-04-05 16:47               ` Russell King (Oracle)
2022-02-07 17:45 ` [PATCH v2 2/2] net: phy: micrel: add Microchip KSZ 9477 to the device table Enguerrand de Ribaucourt
2022-02-07 23:29   ` Andrew Lunn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YgJshWvkCQLoGuNX@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=enguerrand.de-ribaucourt@savoirfairelinux.com \
    --cc=hkallweit1@gmail.com \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=prasanna.vengateshan@microchip.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).