Re: [PATCH RFC v4 09/15] phy: freescale: s32g: Add SerDes subsystem PHY
From: Vladimir Oltean
Date: Wed Nov 25 2026 - 09:44:41 EST
Hi Jan,
On Wed, Nov 25, 2026 at 10:33:51AM +0100, Jan Petrous via B4 Relay wrote:
> From: Vincent Guittot <vincent.guittot@xxxxxxxxxx>
>
> Each S32G SerDes subsystem is made of one PCIe controller, two XPCS and
> a shared 2-lane combo PHY. The lanes carry PCIe and/or SGMII.
>
> Add the SerDes subsystem driver: the PCIe PHY, the combo PHY bring-up
> and the setup of the XPCS instances. A MAC gets its phylink PCS through
> s32g_serdes_pcs_create(), which also creates a device link, so that the
> MAC is unbound and suspended before the SerDes.
>
> SS_RW_REG_0[SUBSYS_MODE] is derived at probe from the consumers' phys
> references to the SerDes node, <lane type instance max-speed>: a PCIe
> root port names its lanes, a MAC names its lane, the XPCS instance it
> is wired to and the highest speed the lane is wired for, 1000 in this
> series. The driver walks the tree for them, as the mux is programmed before
> the reset is released, long before the consumers probe. Each supported
> mode has a unique lane mux; a lane nobody references takes the function
> it has in the first matching mode. The reference clock rate is
> validated against the derived mode.
>
> The SerDes provides one PHY for the PCIe link, whatever its width, and
> one PHY per XPCS instance in use. The XPCS lane PHY has no operations:
> the lane is brought up with the SerDes, and the MAC drives it through
> the PCS, which it gets from s32g_serdes_pcs_create() with its own node.
>
> After the subsystem reset is released, the PHY needs up to 5.2 ms to
> become operational (MPLL_STATE). Poll it before any further PHY or XPCS
> PMA access, in every mode.
>
> Signed-off-by: Vincent Guittot <vincent.guittot@xxxxxxxxxx>
> Co-developed-by: Ciprian Marian Costea <ciprianmarian.costea@xxxxxxxxxxx>
> Signed-off-by: Ciprian Marian Costea <ciprianmarian.costea@xxxxxxxxxxx>
> Co-developed-by: Alexandru-Catalin Ionita <alexandru-catalin.ionita@xxxxxxx>
> Signed-off-by: Alexandru-Catalin Ionita <alexandru-catalin.ionita@xxxxxxx>
> Co-developed-by: Ghennadi Procopciuc <ghennadi.procopciuc@xxxxxxx>
> Signed-off-by: Ghennadi Procopciuc <ghennadi.procopciuc@xxxxxxx>
> Co-developed-by: Ionut Vicovan <Ionut.Vicovan@xxxxxxx>
> Signed-off-by: Ionut Vicovan <Ionut.Vicovan@xxxxxxx>
> Co-developed-by: Bogdan Roman <bogdan-gabriel.roman@xxxxxxx>
> Signed-off-by: Bogdan Roman <bogdan-gabriel.roman@xxxxxxx>
> Co-developed-by: Jan Petrous (OSS) <jan.petrous@xxxxxxxxxxx>
> Signed-off-by: Jan Petrous (OSS) <jan.petrous@xxxxxxxxxxx>
> ---
I am trying to spend some time to understand this design. I have a few
basic questions:
- Simply explained, what do you gain by integrating with the Generic PHY framework?
The XPCS has a dummy phy_ops. Clearly this means phy_init(), phy_power_on(),
phy_set_mode_ext() etc will do nothing for it. Who and why is better
off if it exists?
- If you have 2 physical lanes, why do you have 3 Generic PHY objects?
Why not a Generic PHY object per lane?
- Does the lane mux need to be programmed by the kernel driver? Does it
ever need to change at runtime? How do previous boot layers use the
SerDes? If you leave the lane mux set by a previous boot layer, and
make the device tree describe that configuration as read-only, what
doesn't work for your use cases?