From: Maxime Chevallier <maxime.chevallier@bootlin.com>
To: <Tristram.Ha@microchip.com>
Cc: Woojung Huh <woojung.huh@microchip.com>,
Andrew Lunn <andrew@lunn.ch>, Vladimir Oltean <olteanv@gmail.com>,
Rob Herring <robh@kernel.org>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Marek Vasut <marex@denx.de>, <UNGLinuxDriver@microchip.com>,
<devicetree@vger.kernel.org>, <netdev@vger.kernel.org>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH net-next 2/2] net: dsa: microchip: Add SGMII port support to KSZ9477 switch
Date: Fri, 29 Nov 2024 13:59:19 +0100 [thread overview]
Message-ID: <20241129135919.57d59c90@fedora.home> (raw)
In-Reply-To: <20241109015633.82638-3-Tristram.Ha@microchip.com>
Hello Tristram,
On Fri, 8 Nov 2024 17:56:33 -0800
<Tristram.Ha@microchip.com> wrote:
> From: Tristram Ha <tristram.ha@microchip.com>
>
> The SGMII module of KSZ9477 switch can be setup in 3 ways: 0 for direct
> connect, 1 for 1000BaseT/1000BaseX SFP, and 2 for 10/100/1000BaseT SFP.
>
> SFP is typically used so the default is 1. The driver can detect
> 10/100/1000BaseT SFP and change the mode to 2. For direct connect the
> device tree can use fixed-link for the SGMII port as this link will
> never be disconnected.
>
> The SGMII module can only support basic link status of the SFP, so the
> port can be simulated as having a regular internal PHY when SFP cage
> logic is not used.
>
> One issue for the 1000BaseX SFP is there is no link down interrupt, so
> the driver has to use polling to detect link off when the link is up.
>
> Note the SGMII interrupt cannot be masked in hardware. Also the module
> is not reset when the switch is reset. It is important to reset the
> module properly to make sure interrupt is not triggered prematurely.
>
> A PCS driver for the SGMII port is added to accommodate the SFP cage
> logic used in the phylink code. It is used to confirm the link is up
> and process the SGMII interrupt.
I'm currently working on a product on which I need the SGMII/1000BaseX
port to work on KSZ9477, so I gave that series a try.
I seems that this PCS is actually a Designware XPCS, reading the
registers 0x2/3 returns 0x7996ced0, which is the PHY id for the
Designware XPCS. Looking at the register definitions, they are
indeed very very similar. Andrew already pointed out that the SGMII
acccessors in the series (port_sgmii_r/w) look like C45 MDIO accessors.
So, you could move forward by implementing an mdio bus for the PCS with
the C45 accessors mentionned above, and then plumb that to the XPCS
driver with the xpcs_create_mdiodev(). I'm still figuring out if the
KSZ9477 needs some extra bits of configuration to get that port fully
operationnal though.
I'm currently integrating such a solution on a 6.6 kernel, I would be
very happy to test any further version of this patchset.
Thanks,
Maxime
prev parent reply other threads:[~2024-11-29 12:59 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-09 1:56 [PATCH net-next 0/2] net: dsa: microchip: Add SGMII port support to KSZ9477 switch Tristram.Ha
2024-11-09 1:56 ` [PATCH net-next 1/2] dt-bindings: " Tristram.Ha
2024-11-09 10:43 ` Krzysztof Kozlowski
2024-11-12 2:45 ` Tristram.Ha
2024-11-09 1:56 ` [PATCH net-next 2/2] " Tristram.Ha
2024-11-09 15:13 ` Andrew Lunn
2024-11-12 2:55 ` Tristram.Ha
2024-11-12 13:50 ` Andrew Lunn
2024-11-13 2:12 ` Tristram.Ha
2024-11-13 14:42 ` Vladimir Oltean
2024-11-15 1:53 ` Tristram.Ha
2024-11-14 1:43 ` Andrew Lunn
2024-11-15 2:00 ` Tristram.Ha
2024-11-15 18:08 ` Andrew Lunn
2024-11-09 15:43 ` Andrew Lunn
2024-11-12 2:58 ` Tristram.Ha
2024-11-10 15:50 ` Vladimir Oltean
2024-11-12 2:43 ` Tristram.Ha
2024-11-29 12:59 ` Maxime Chevallier [this message]
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=20241129135919.57d59c90@fedora.home \
--to=maxime.chevallier@bootlin.com \
--cc=Tristram.Ha@microchip.com \
--cc=UNGLinuxDriver@microchip.com \
--cc=andrew@lunn.ch \
--cc=conor+dt@kernel.org \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=edumazet@google.com \
--cc=krzk+dt@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marex@denx.de \
--cc=netdev@vger.kernel.org \
--cc=olteanv@gmail.com \
--cc=pabeni@redhat.com \
--cc=robh@kernel.org \
--cc=woojung.huh@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