mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Coia Prant <coiaprant@gmail.com>
To: Andrew Lunn <andrew@lunn.ch>
Cc: Maxime Chevallier <maxime.chevallier@bootlin.com>,
	Jakub Kicinski <kuba@kernel.org>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	Russell King <linux@armlinux.org.uk>,
	"David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Paolo Abeni <pabeni@redhat.com>,
	netdev@vger.kernel.org, linux-rockchip@lists.infradead.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH net] net: pcs: xpcs-rk: limit advertised interfaces
Date: Tue, 03 Nov 2026 14:11:59 +0800	[thread overview]
Message-ID: <27E466B0-72FD-47BA-B952-68BF4A817A04@gmail.com> (raw)
In-Reply-To: <48cb8a9d-622f-497c-a13e-bc679c764ce0@lunn.ch>

On November 3, 2026 10:54:57 AM GMT+08:00, Andrew Lunn <andrew@lunn.ch> wrote:
>> Hi Maxime,
>> 
>> You're right that for modes the PCS does implement, the limit belongs
>> on the MAC side. The complication is that the compat table describes
>> the whole Synopsys IP set, while a given XPCS instance only implements
>> a subset of it. That is a historical design issue in pcs-xpcs: the
>> table mixes C73, C37, 2500BASE-X and 10GBASE-X entries, but different
>> integrations implement different subsets.
>> 
>> On RK3568 the XPCS instance is wired up for the C37 SGMII path only.
>> 1000BASE-X is part of the same C37 core, but I don't have a PHY to test
>> it against. QSGMII is not implemented in this core. 2500BASE-X and
>> 10GBASE-X are separate modes the shared table carries, and neither is
>> implemented on this SoC. C73 is not wired up either.
>> 
>> Trimming the mask is not limiting the PCS, it is cutting the shared
>> table down to what this instance actually implements. A
>> platform-specific glue is the right place to do that.
>
>Are there any registers which describe how the PCS was configured at
>syntheses time?
>
>	Andrew

Hi Andrew,

Yes, looking at the `xpcs_identity` code, the core does probe different
MMDs to get the rough type: PMA/PMD MMD for C73 and VEND2 MMD for C37.

However, even if we determine it's a C37 or C73 block, that only gives
us the rough family, not the exact feature set. For example, a VEND2
(C37) block might not implement 2500BASE-X, and a PMA/PMD (C73) block
might not implement 10GBASE-R. The MMD ID itself doesn't tell us which
of these sub-modes were actually synthesized and wired out.

Since I only have the Rockchip RK3568 PCS documentation, I don't want
to blindly touch the global compat[] table in the core, as it could
easily break other platforms (Intel, NXP, etc.).

That's why intersecting the platform mask with the core mask in the
Rockchip glue is the safest approach for now.

As a bit of context on where this is heading: currently, the PMA layers
for wx, fbnic, and nxp are separate source files but are compiled into
the generic core module, relying on a shared compat table. In a
follow-up net-next series, I plan to split them into actual independent
modules using an abstraction layer and their own xpcs_xxx_create()
functions.

This will allow other platforms (including Rockchip) to do the same
mask intersection and PMA-specific setup without bloating the generic
core with more and more platform quirks. Right now, dwmac-intel seems
to be the only platform that completely relies on the generic core
without a specific PMA module. So keeping the core generic and doing the
narrowing in the glue is a safe, self-contained step that aligns with
that future direction.

Coia

  reply	other threads:[~2026-11-03  6:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-29  9:49 Coia Prant
2026-10-29  9:56 ` netdev-bot+sinfo
2026-10-29 10:23   ` Coia Prant
2026-10-30 20:44 ` Maxime Chevallier
2026-10-30 21:08   ` Coia Prant
2026-11-03  2:54     ` Andrew Lunn
2026-11-03  6:11       ` Coia Prant [this message]
2026-11-03 13:09         ` Andrew Lunn
2026-11-03 14:54           ` Coia Prant

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=27E466B0-72FD-47BA-B952-68BF4A817A04@gmail.com \
    --to=coiaprant@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=hkallweit1@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.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

all inboxes | Powered by JetHome®