From: Vladimir Oltean <olteanv@gmail.com>
To: "Russell King (Oracle)" <linux@armlinux.org.uk>
Cc: Tristram.Ha@microchip.com, Woojung.Huh@microchip.com,
andrew@lunn.ch, hkallweit1@gmail.com,
maxime.chevallier@bootlin.com, davem@davemloft.net,
edumazet@google.com, kuba@kernel.org, pabeni@redhat.com,
UNGLinuxDriver@microchip.com, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH RFC net-next 1/2] net: pcs: xpcs: Add special code to operate in Microchip KSZ9477 switch
Date: Thu, 30 Jan 2025 01:05:49 +0200 [thread overview]
Message-ID: <20250129230549.kwkcxdn62mghdlx3@skbuf> (raw)
In-Reply-To: <Z5qmIEc6xEaeY6ys@shell.armlinux.org.uk>
On Wed, Jan 29, 2025 at 10:05:20PM +0000, Russell King (Oracle) wrote:
> > > It does have the intended effect of separating SGMII and 1000BaseX modes
> > > in later versions. And DW_VR_MII_DIG_CTRL1_PHY_MODE_CTRL is used along
> > > with it. They are mutually exclusive. For SGMII SFP
> > > DW_VR_MII_DIG_CTRL1_MAC_AUTO_SW is set; for 1000BaseX SFP
> > > DW_VR_MII_DIG_CTRL1_PHY_MODE_CTRL is set.
> >
> > It's difficult for me to understand what you are trying to communicate here.
>
> I think it makes sense - MAC_AUTO_SW is meaningless in 1000base-X mode
> because the speed is fixed at 1G, whereas in Cisco SGMII MAC mode this
> bit allows the PCS to change its speed setting according to the AN
> result.
The bit which you've just explained is the only portion that made some
sense to me. What did not make sense was:
- What is the subject of the first sentence? "it has the intended effect
of separating SGMII and 1000BaseX modes" <- who?
- "For 1000BaseX SFP, PHY_MODE_CTRL is set"? How come, and according to whom?
PHY_MODE_CTRL, as I've previously pasted from the XPCS data book in a
previous table, is a field which selects, while in SGMII PHY mode,
whether the contents of the auto-negotiation code word comes from
wires (when set to 1) or from registers (when set to 0).
For this second reply, I even went back to triple-check this, and I am
copying this additional sentence about PHY_MODE_CTRL.
| Note: This bit should be set only when XPCS is configured as
| SGMII/QSGMII PHY i.e., TX_CONFIG=1
| In other configurations, this field is reserved and read-only.
So it is very confusing to me that Tristram would be talking about
PHY_MODE_CTRL in the context of 1000Base-X. I don't know what this
denotes, but it just makes me question whether whatever he's been
calling 1000Base-X all along is something else entirely. This
"guessing what Tristram is trying to say" game is hard.
> For Vladimir: I've added four hacky patches that build on top of the
> large RFC series I sent earlier which add probably saner configuration
> for the SGMII code, hopefully making it more understandable in light
> of Wangxun's TXGBE using PHY mode there (they were adamant that their
> hardware requires it.) These do not address Tristram's issue.
Ok, let's sidetrack Tristram's thread, sure.
Patch 2: correct but
+ /* PHY_MODE_CTRL only applies for PHY-side SGMII. When PHY_MODE_CTRL
+ * is set, the SGMII tx_config register bits 15 (link), 12 (duplex)
+ * and 11:10 (speed) sent is derived from hardware inputs to the XPCS.
+ * When clear, bit 15 comes from DW_VR_MII_AN_CTRL bit 4, bit 12 from
+ * MII_ADVERTISE bit 5, and bits 11:10 from MII_BMCR speed bits. In
+ * the latter case, some implementation documentatoin states that
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
integration documentation
+ * MII_ADVERTISE must be written last.
+ */
Patch 3: "DW_XPCS_SGMII_10_100_UNCHANGED" instead of "UNSET", maybe?
Maybe it's just me, but "unset" sounds like "set to 0"/"cleared".
Patch 4: same "documentatoin" typo.
Otherwise I think there is value in these clarification patches.
next prev parent reply other threads:[~2025-01-29 23:05 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-28 3:32 [PATCH RFC net-next 0/2] Add SGMII port support to KSZ9477 switch Tristram.Ha
2025-01-28 3:32 ` [PATCH RFC net-next 1/2] net: pcs: xpcs: Add special code to operate in Microchip " Tristram.Ha
2025-01-28 9:24 ` Russell King (Oracle)
2025-01-28 10:21 ` Vladimir Oltean
2025-01-28 12:33 ` Russell King (Oracle)
2025-01-28 15:23 ` Vladimir Oltean
2025-01-28 16:32 ` Russell King (Oracle)
2025-01-28 18:26 ` Vladimir Oltean
2025-01-29 0:31 ` Tristram.Ha
2025-01-29 21:12 ` Vladimir Oltean
2025-01-29 22:05 ` Russell King (Oracle)
2025-01-29 23:05 ` Vladimir Oltean [this message]
2025-01-30 12:44 ` Russell King (Oracle)
2025-01-30 17:42 ` Russell King (Oracle)
2025-01-30 4:50 ` [WARNING: ATTACHMENT UNSCANNED]Re: " Tristram.Ha
2025-01-30 10:02 ` Vladimir Oltean
2025-01-30 11:02 ` Russell King (Oracle)
2025-01-30 11:20 ` Jose Abreu
2025-01-31 14:36 ` Jose Abreu
2025-01-31 15:49 ` Russell King (Oracle)
2025-02-01 1:12 ` [WARNING: ATTACHMENT UNSCANNED]Re: " Tristram.Ha
2025-02-01 9:20 ` Russell King (Oracle)
2025-01-31 2:35 ` Tristram.Ha
2025-01-30 10:15 ` Russell King (Oracle)
2025-01-31 2:35 ` Tristram.Ha
2025-01-31 13:35 ` Andrew Lunn
2025-02-01 1:11 ` Tristram.Ha
2025-01-30 4:50 ` Tristram.Ha
2025-01-30 9:59 ` Russell King (Oracle)
2025-01-31 2:24 ` Tristram.Ha
2025-01-31 9:43 ` Russell King (Oracle)
2025-01-30 13:24 ` Andrew Lunn
2025-01-31 2:21 ` Tristram.Ha
2025-01-28 12:40 ` Russell King (Oracle)
2025-01-28 13:16 ` Andrew Lunn
2025-01-28 13:39 ` Russell King (Oracle)
2025-01-28 15:43 ` Vladimir Oltean
2025-01-29 0:31 ` Tristram.Ha
2025-01-28 3:32 ` [PATCH RFC net-next 2/2] net: dsa: microchip: Add SGMII port support to " Tristram.Ha
2025-01-28 9:38 ` Russell King (Oracle)
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=20250129230549.kwkcxdn62mghdlx3@skbuf \
--to=olteanv@gmail.com \
--cc=Tristram.Ha@microchip.com \
--cc=UNGLinuxDriver@microchip.com \
--cc=Woojung.Huh@microchip.com \
--cc=andrew@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=hkallweit1@gmail.com \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=maxime.chevallier@bootlin.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.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).