From: Jan Petrous <jan.petrous@oss.nxp.com>
To: Frank Li <Frank.li@oss.nxp.com>
Cc: "Ciprian Marian Costea" <ciprianmarian.costea@oss.nxp.com>,
"NXP S32 Linux Team" <s32@nxp.com>,
"Vinod Koul" <vkoul@kernel.org>,
"Neil Armstrong" <neil.armstrong@linaro.org>,
"Manivannan Sadhasivam" <mani@kernel.org>,
"Rob Herring" <robh@kernel.org>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
"Conor Dooley" <conor+dt@kernel.org>,
"Ghennadi Procopciuc" <ghennadi.procopciuc@nxp.com>,
"Andrew Lunn" <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
"Eric Dumazet" <edumazet@google.com>,
"Jakub Kicinski" <kuba@kernel.org>,
"Paolo Abeni" <pabeni@redhat.com>,
"Geert Uytterhoeven" <geert+renesas@glider.be>,
"Magnus Damm" <magnus.damm@gmail.com>,
"Lorenzo Pieralisi" <lpieralisi@kernel.org>,
"Krzysztof Wilczyński" <kwilczynski@kernel.org>,
"Bjorn Helgaas" <bhelgaas@google.com>,
"Bogdan Hamciuc" <bogdan.hamciuc@nxp.com>,
"Ionut Vicovan" <ionut.vicovan@nxp.com>,
"Andrew Lunn" <andrew@lunn.ch>,
"Heiner Kallweit" <hkallweit1@gmail.com>,
"Russell King" <linux@armlinux.org.uk>,
"Clark Wang" <xiaoning.wang@nxp.com>,
"Philipp Zabel" <p.zabel@pengutronix.de>,
"Maxime Chevallier" <maxime.chevallier@bootlin.com>,
"Maxime Coquelin" <mcoquelin.stm32@gmail.com>,
"Alexandre Torgue" <alexandre.torgue@foss.st.com>,
"Chester Lin" <chester62515@gmail.com>,
"Matthias Brugger" <mbrugger@suse.com>,
"Ghennadi Procopciuc" <ghennadi.procopciuc@oss.nxp.com>,
"Frank Li" <Frank.Li@nxp.com>,
"Sascha Hauer" <s.hauer@pengutronix.de>,
"Pengutronix Kernel Team" <kernel@pengutronix.de>,
"Fabio Estevam" <festevam@gmail.com>,
"Richard Cochran" <richardcochran@gmail.com>,
linux-arm-kernel@lists.infradead.org,
linux-phy@lists.infradead.org, netdev@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-renesas-soc@vger.kernel.org, imx@lists.linux.dev,
linux-pci@vger.kernel.org,
linux-stm32@st-md-mailman.stormreply.com,
"Vincent Guittot" <vincent.guittot@linaro.org>
Subject: Re: [PATCH RFC v3 01/12] dt-bindings: phy: Add NXP S32G SerDes subsystem
Date: Mon, 19 Oct 2026 14:25:18 +0200 [thread overview]
Message-ID: <atYMLsu64znUJkpl@lsv051416.swis.nl-cdc01.nxp.com> (raw)
In-Reply-To: <as-ON6s8sNjQC9NP@SMW015318>
On Wed, Oct 14, 2026 at 09:14:15AM -0500, Frank Li wrote:
> On Tue, Oct 13, 2026 at 04:40:46PM +0200, Jan Petrous wrote:
> > On Mon, Oct 12, 2026 at 01:57:13PM -0500, Frank Li wrote:
> > > On Sat, Sep 19, 2026 at 08:54:29AM +0200, Jan Petrous via B4 Relay wrote:
> > > > [You don't often get email from devnull+jan.petrous.oss.nxp.com@kernel.org. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ]
> > > >
> > > > From: "Jan Petrous (OSS)" <jan.petrous@oss.nxp.com>
> > > >
> > > > The S32G SerDes subsystem multiplexes two lanes between a PCIe PHY and
> > > > two DesignWare XPCS instances. Describe it with one node per SerDes and
> > > > one child node per lane.
> > > >
> > > > Compared to the previous revision, the vendor nxp,sys-mode property is
> > > > removed: the SS_RW_REG_0[SUBSYS_MODE] value is fully derivable from the
> > > > child-node lane mux and the XPCS instance routing (nxp,xpcs-instance).
> > > > Each working mode described here has a unique lane mux, so the mode is
> > > > a pure function of the child nodes. The reference-clock rate is
> > > > validated against the derived mode; it is not used to select it.
> > > >
> > > > The 3.125 Gbit/s working modes are deliberately not described yet.
> > > > Distinguishing them from the 1.25 Gbit/s dual-XPCS mode requires a
> > > > per-lane 2500BASE-X capability that this binding does not express, and
> > > > the reference clock does not distinguish them either - both accept 100
> > > > or 125 MHz. They are added by the 2500BASE-X follow-up.
> > > >
> > > > Only the PCIe lane child gets '#phy-cells'. An XPCS lane is not a
> > > > generic PHY provider; the Ethernet controller references it through the
> > > > standard pcs-handle property instead.
> > >
> > > Is it possible Ether controller use standard phy interface? of use standard
> > > pcs-handle to phy convertion
> > >
> > > pcs-handle = <&pcs>
> > >
> > > pcs: pcs = {
> > > compatible = "pcs-to-phy";
> > > phys = <&phy ...>;
> > > }
> > >
> >
> > The MAC needs a phylink_pcs, not a PHY: the XPCS does the C37 autoneg
> > and link state. pcs-handle is the standard property for that, and in
> > v4 the XPCS is driven by pcs-xpcs. The lane mux is fixed before the
> > SerDes reset is released, so the MAC has nothing to set on a generic
> > PHY, and a "pcs-to-phy" node would describe a block the SoC does not
> > have.
> >
> > > >
> > > > S32G2 and S32G3 use distinct compatibles without fallback because the
> > > > full reference-manual mode tables differ per SoC and per SerDes
> > > > instance.
> > > >
> > > > Co-developed-by: Vincent Guittot <vincent.guittot@linaro.org>
> > > > Signed-off-by: Vincent Guittot <vincent.guittot@linaro.org>
> > > > Signed-off-by: Jan Petrous (OSS) <jan.petrous@oss.nxp.com>
> > > > ---
> > > > .../devicetree/bindings/phy/nxp,s32g-serdes.yaml | 258 +++++++++++++++++++++
> > > > 1 file changed, 258 insertions(+)
> > > >
> > > > diff --git a/Documentation/devicetree/bindings/phy/nxp,s32g-serdes.yaml b/Documentation/devicetree/bindings/phy/nxp,s32g-serdes.yaml
> > > > new file mode 100644
> > > > index 000000000000..6343d01bfde4
> > > > --- /dev/null
> > > > +++ b/Documentation/devicetree/bindings/phy/nxp,s32g-serdes.yaml
> > > > @@ -0,0 +1,258 @@
> > > > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> > > > +%YAML 1.2
> > > > +---
> > > > +$id: http://devicetree.org/schemas/phy/nxp,s32g-serdes.yaml#
> > > > +$schema: http://devicetree.org/meta-schemas/core.yaml#
> > > > +
> > > > +title: NXP S32G2xxx/S32G3xxx SerDes PHY subsystem
> > > > +
> > > > +maintainers:
> > > > + - Ghennadi Procopciuc <ghennadi.procopciuc@nxp.com>
> > > > + - Jan Petrous <jan.petrous@oss.nxp.com>
> > > > +
> > > > +description: |
> > > > + The SerDes subsystem multiplexes two SerDes lanes between one PCIe
> > > > + controller PHY and two Synopsys DesignWare XPCS (Ethernet PCS) instances,
> > > > + behind a shared 2-lane combo PHY. The active routing is selected by the
> > > > + SS_RW_REG_0[SUBSYS_MODE] field.
> > > > +
> > > > + Reference-manual working modes described by this binding:
> > > > +
> > > > + Mode Lane0 Lane1 PHY refclk (MHz) Description
> > > > + ------------------------------------------------------------
> > > > + 0 PCIe PCIe 100 PCIe x2
> > > > + 1 PCIe XPCS0 100 PCIe x1 + SGMII
> > > > + 2 PCIe XPCS1 100 PCIe x1 + SGMII
> > > > + 3 XPCS0 XPCS1 100 or 125 dual SGMII, 1.25 Gbit/s
> > > > +
> > > > + Which Ethernet MAC an XPCS instance feeds is fixed by the SoC integration
> > > > + and differs per SoC and per SerDes instance - on S32G3 SerDes_0, XPCS0
> > > > + feeds GMAC0 and XPCS1 feeds PFE_MAC2, while on SerDes_1 the same two
> > > > + instances feed PFE_MAC0 and PFE_MAC1. That mapping is a property of the
> > > > + SoC, not of this binding, and is resolved by the driver.
> > >
> > > Roughly look like use argument is little bit better
> > >
> > > <&phys PHY_MODE instance(0/1)>;
> > >
> >
> > Rob suggested that in v2 [1]. Child nodes stayed because:
> >
> > - SUBSYS_MODE is written before the reset is released, so the SerDes
> > driver needs the whole lane mux at its own probe. With cells it would
> > have to walk the tree for its consumers, including disabled ones, and
> > an unconnected lane has no consumer to carry a cell.
> >
> > - The MAC uses pcs-handle, which has no argument cells, so the XPCS
> > instance has nowhere else to go.
> >
> > - A type cell duplicates phy_set_mode_ext(PHY_MODE_PCIE) from the PCIe
> > driver.
> >
> > - In mode 0 there is one x2 PHY, not two lane PHYs.
Hi Frank, Rob,
> >
> > I will put this in the v4 commit message. If you or Rob still prefer
> > cells, let me know.
>
> I think Rob suggestion is better. ethernet controller should support
> standard phy interface, more devices will share phy between PCI and
> ethernet.
>
> Frank
>
> >
> > [1] https://lore.kernel.org/all/CAL_Jsq+SswpTjQShfkdhVwL_k8gJ_5+NrecPCUiFR52UB5zNMA@mail.gmail.com/
> >
OK. I went back to Rob's v2 sketch [1] and to the RK3568 XPCS binding
that got his Reviewed-by last week [2], and the child nodes can go.
Walking the tree for the consumers of the SerDes at probe is what Rob
proposed in v2, and the SUBSYS_MODE write before reset release does not
care how the lane map was obtained. The x2 PCIe case is two phys entries
on the root port, one per lane.
The one thing the SoC does not let me derive is the XPCS instance. The
RK3568 binding derives the MII port from the GMAC when the PCS is
created, but the S32G mux is programmed at SerDes probe, before any MAC
exists, and "XPCS0 alone on lane 1" (mode 1 with the PCIe lane idle)
and "XPCS1 alone on lane 1" (mode 2) are different routings of the same
pins. So the instance has to be in the reference.
The same goes for the line rate. The 3.125 Gbit/s configurations of the
reference manual select a different SUBSYS_MODE value on SerDes_1, cap
PCIe at Gen2 on SerDes_0, need the 125 MHz reference when both lanes
run 3.125, and on S32G2 switch the second XPCS off. All of that is
decided at SerDes probe, and the MAC's phy-mode does not tell: an
in-band SGMII link to a 2.5G PHY is "sgmii" and moves to 2500BASE-X at
runtime. The next version therefore makes the SerDes a four-cell
provider, <lane type instance max-speed>, with the last two cells used
by PHY_TYPE_SGMII only and the speed being the highest the lane is
wired for, 1000 or 2500 Mbit/s. This series accepts 1000 only; 2500
will comes with the 3.125 Gbit/s modes follow-up. Putting the cell
in now avoids a #phy-cells change later.
// mode 0: PCIe x2
pcie0 { phys = <&serdes0 0 PHY_TYPE_PCIE 0 0>, <&serdes0 1 PHY_TYPE_PCIE 0 0>; };
// mode 1: PCIe x1 on lane 0, GMAC0 via XPCS0 on lane 1
pcie0 { phys = <&serdes0 0 PHY_TYPE_PCIE 0 0>; };
gmac0 { phys = <&serdes0 1 PHY_TYPE_SGMII 0 1000>; pcs-handle = <&serdes0>; };
// mode 3: GMAC0 via XPCS0 on lane 0, PFE_MAC2 via XPCS1 on lane 1
gmac0 { phys = <&serdes0 0 PHY_TYPE_SGMII 0 1000>; pcs-handle = <&serdes0>; };
pfe_mac2 { phys = <&serdes0 1 PHY_TYPE_SGMII 1 1000>; pcs-handle = <&serdes0>; };
The driver derives SUBSYS_MODE from the enabled consumers' references
to it; a lane nobody references takes the function it has in the first
matching mode. The reference clock is validated against the result as
today. No lane child nodes, no nxp,xpcs-instance.
This is implemented and runs on the RDB3, in both configurations the
board offers, with the numbers of the child-node form:
- SerDes_1 mode 2 (PCIe_1 x1 on lane 0, PFE_MAC1 via XPCS1 on lane 1)
plus SerDes_0 mode 3 (GMAC0 via XPCS0): the 82574L in the PCIe slot at
880/928 Mbit/s, the shared-lane XPCS1 at 935/941, GMAC0 at 935/941,
NIC and XPCS1 together 878 + 935, 10/10 XPCS1 link down/up under
PCIe traffic, no AER events.
- Both SerDes in mode 3: 941/941 and 935/941 Mbit/s on the two
SerDes_1 lanes, 10/10 down/up on each, 0 failures in 36 partner
speed changes on the in-band lane (100M/1G, then 100M/1G/2.5G with
the 2.5G follow-up on top), GMAC0 up on SerDes_0.
The mode is derived from the references alone; the probe log says
"mode 2" and "mode 3" with no lane node in the tree.
Two questions before I post it:
1. The Ethernet side carries two references to the same node:
* phys for the lane
* pcs-handle for the PCS
and I would rather have one. The one I want is pcs-handle
with argument cells, <&serdes0 lane instance max-speed>, with the
SerDes as a PCS provider for the MACs and a PHY provider for PCIe
only. That needs dt-schema PR 198 [3], which is still open, so
a binding written that way cannot be validated by anyone until
the schema is released. phys only is the other way out, but a generic
PHY reference meaning "PCS provider" is not something any binding does
today.
Rob, do you want the pair as above for now, with the phys
reference going away once the cells exist, or should I post with
pcs-handle cells and have the series wait for PR 198?
2. Rob, any objection to PHY_TYPE_SGMII covering both the 1.25 Gbit/s
and, later, the 3.125 Gbit/s XPCS modes? The lane rate follows the
MAC's phy-mode, so I do not plan a separate type for 2500BASE-X.
The DTS, the dwmac-s32 and the PCIe binding patches change accordingly.
On the pcs-xpcs side one value changes: the SGMII link timer written by
the S32G PMA hook becomes 0x2faf, the value the vendor driver programs
for 1G; the 0x7a1 of v3 is its 2500BASE-X value, copied by mistake. The
speed-change figures above are with the new value.
BR.
/Jan
[1] https://lore.kernel.org/all/CAL_Jsq+SswpTjQShfkdhVwL_k8gJ_5+NrecPCUiFR52UB5zNMA@mail.gmail.com/
[2] https://lore.kernel.org/all/20261008175225.3375274-3-coiaprant@gmail.com/
[3] https://github.com/devicetree-org/dt-schema/pull/198
next prev parent reply other threads:[~2026-10-19 12:25 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-19 6:54 [PATCH RFC v3 00/12] Add support for the " Jan Petrous via B4 Relay
2026-09-19 6:54 ` [PATCH RFC v3 01/12] dt-bindings: phy: Add " Jan Petrous via B4 Relay
2026-10-12 18:57 ` Frank Li
2026-10-13 14:40 ` Jan Petrous
2026-10-14 14:14 ` Frank Li
2026-10-19 12:25 ` Jan Petrous [this message]
2026-09-19 6:54 ` [PATCH RFC v3 02/12] dt-bindings: net: nxp,s32-dwmac: Document pcs-handle Jan Petrous via B4 Relay
2026-09-19 6:54 ` [PATCH RFC v3 03/12] dt-bindings: PCI: nxp,s32g-pcie: Fix SerDes PHY phandle in example Jan Petrous via B4 Relay
2026-10-12 18:43 ` Frank Li
2026-10-13 14:37 ` Jan Petrous
2026-10-14 14:06 ` Frank Li
2026-10-19 12:01 ` Jan Petrous
2026-09-19 6:54 ` [PATCH RFC v3 04/12] net: pcs: add NXP SerDes XPCS shared core Jan Petrous via B4 Relay
2026-09-19 15:31 ` Maxime Chevallier
2026-09-19 16:31 ` Coia Prant
2026-10-11 6:01 ` Jan Petrous
2026-10-12 19:47 ` Coia Prant
2026-10-13 14:47 ` Jan Petrous
2026-10-14 12:44 ` Jan Petrous
2026-09-20 18:39 ` Andrew Lunn
2026-10-11 6:03 ` Jan Petrous
2026-09-19 6:54 ` [PATCH RFC v3 05/12] net: pcs: Add NXP S32G XPCS driver Jan Petrous via B4 Relay
2026-09-20 17:07 ` Andrew Lunn
2026-10-11 5:56 ` Jan Petrous
2026-09-19 6:54 ` [PATCH RFC v3 06/12] phy: freescale: s32g: Add SerDes subsystem PHY Jan Petrous via B4 Relay
2026-09-19 6:54 ` [PATCH RFC v3 07/12] net: stmmac: dwmac-s32: Add SGMII support Jan Petrous via B4 Relay
2026-09-19 12:04 ` Maxime Chevallier
2026-10-11 5:53 ` Jan Petrous
2026-09-19 6:54 ` [PATCH RFC v3 08/12] MAINTAINERS: Add NXP S32G SerDes and SerDes xPCS core entries Jan Petrous via B4 Relay
2026-09-19 6:54 ` [PATCH RFC v3 09/12] arm64: dts: s32g: Add SCMI reset controller Jan Petrous via B4 Relay
2026-09-19 6:54 ` [PATCH RFC v3 10/12] arm64: dts: s32g: Add SerDes controller nodes Jan Petrous via B4 Relay
2026-09-19 6:54 ` [PATCH RFC v3 11/12] arm64: dts: s32g: Add PCIe " Jan Petrous via B4 Relay
2026-09-19 6:54 ` [PATCH RFC v3 12/12] arm64: dts: s32g: Add S32G3-RDB3 SerDes routing variants Jan Petrous via B4 Relay
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=atYMLsu64znUJkpl@lsv051416.swis.nl-cdc01.nxp.com \
--to=jan.petrous@oss.nxp.com \
--cc=Frank.Li@nxp.com \
--cc=Frank.li@oss.nxp.com \
--cc=alexandre.torgue@foss.st.com \
--cc=andrew+netdev@lunn.ch \
--cc=andrew@lunn.ch \
--cc=bhelgaas@google.com \
--cc=bogdan.hamciuc@nxp.com \
--cc=chester62515@gmail.com \
--cc=ciprianmarian.costea@oss.nxp.com \
--cc=conor+dt@kernel.org \
--cc=davem@davemloft.net \
--cc=devicetree@vger.kernel.org \
--cc=edumazet@google.com \
--cc=festevam@gmail.com \
--cc=geert+renesas@glider.be \
--cc=ghennadi.procopciuc@nxp.com \
--cc=ghennadi.procopciuc@oss.nxp.com \
--cc=hkallweit1@gmail.com \
--cc=imx@lists.linux.dev \
--cc=ionut.vicovan@nxp.com \
--cc=kernel@pengutronix.de \
--cc=krzk+dt@kernel.org \
--cc=kuba@kernel.org \
--cc=kwilczynski@kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=linux-phy@lists.infradead.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=linux@armlinux.org.uk \
--cc=lpieralisi@kernel.org \
--cc=magnus.damm@gmail.com \
--cc=mani@kernel.org \
--cc=maxime.chevallier@bootlin.com \
--cc=mbrugger@suse.com \
--cc=mcoquelin.stm32@gmail.com \
--cc=neil.armstrong@linaro.org \
--cc=netdev@vger.kernel.org \
--cc=p.zabel@pengutronix.de \
--cc=pabeni@redhat.com \
--cc=richardcochran@gmail.com \
--cc=robh@kernel.org \
--cc=s.hauer@pengutronix.de \
--cc=s32@nxp.com \
--cc=vincent.guittot@linaro.org \
--cc=vkoul@kernel.org \
--cc=xiaoning.wang@nxp.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®