public inbox for linux-phy@lists.infradead.org
 help / color / mirror / Atom feed
From: Tanjeff Moos <Tanjeff.Moos@westermo.com>
To: Vladimir Oltean <vladimir.oltean@nxp.com>
Cc: Sean Anderson <sean.anderson@seco.com>,
	"linux-phy@lists.infradead.org" <linux-phy@lists.infradead.org>
Subject: Re: Lynx 10G SerDes Driver on my kernel
Date: Wed, 3 Dec 2025 17:25:46 +0100	[thread overview]
Message-ID: <4287097e-a906-438f-b3a1-33e374477367@westermo.com> (raw)
In-Reply-To: <20251203122601.72cwwpsp6loqpkpj@skbuf>

On 12/3/25 13:26, Vladimir Oltean wrote:
> On Wed, Dec 03, 2025 at 12:41:16PM +0100, Tanjeff Moos wrote:
>> I created the patches for kernel 5.15.167, and they do not apply on
>> v6.6.110. Instead of reworking my patch, I'd rather use your work, which
>> is much cleaner. Also I hope that it supports switching between SGMII
>> and XFI, which would allow our "fast" variant to support all speeds from
>> 100M to 10G.
> 
> The intention, based on hardware capabilities, is for the SerDes driver
> to read the PLL clock net frequencies at probe time, and build for each
> of the 2 PLLs a list of supported SerDes protocols.
> 
> The phy_validate() API function is supposed to return which SerDes protocols
> can be used on a particular lane. Phylink in particular uses this
> information to build its phylink_config :: supported_interfaces map.
> 
> In the SerDes, each lane can be reconfigured to use the clock net
> provided by PLLF or PLLS ("F" = first, "S" - second), further divided or
> multiplied by a configurable power of 2 factor.
> 
> Furthermore, each lane may support only a subset of SerDes protocols
> that its PLL selection can support (depending which protocol converters
> are instantiated on it).
> 
> For LS1046A, lanes 2 and 3 have all the required protocol converters to
> support LANE_MODE_1000BASEX_SGMII, LANE_MODE_2500BASEX and LANE_MODE_10GBASER:
> https://github.com/nxp-qoriq/linux/blob/lf-6.12.34-2.1.0/drivers/phy/freescale/phy-fsl-lynx-10g.c#L774-L790
>
> but there is an incompatibility between your use case and the PLL frequencies.
> Each SerDes protocol requires a different clock net frequency:
> - LANE_MODE_1000BASEX_SGMII requires PLLnCR0_FRATE_5G
> - LANE_MODE_2500BASEX requires PLLnCR0_FRATE_3_125G
> - LANE_MODE_10GBASER requires PLLnCR0_FRATE_5_15625G
> https://github.com/nxp-qoriq/linux/blob/lf-6.12.34-2.1.0/drivers/phy/freescale/phy-fsl-lynx-10g.c#L2273-L2298
According to LS1046ARM [1] SGMII requires 1.25 Gbps. I don't understand 
where the 5 GHz comes from. I believe I am missing some knowledge here.

> The problem is that 2 PLLs can't provide 3 distinct clock net frequencies.
> So you can either support 1G and 2.5G, or 1G and 10G, or 2.5G and 10G.
According to table 31-4 "Valid SerDes RCW Encodings and Reference 
Clocks" (page 1919):
- SGMII can be used with PLL=100 MHz or PLL=125 MHZ
- 2.5G SGMII can be used with PLL=125 MHz or PLL=156.25 MHZ
- XFI can be used with PLL=156.25 MHZ
My clocks receive the following frequencies (on all devices, "fast" and 
"slow"):
- PLL 1: 125 MHz
- PLL 2: 156.25 MHz
By choosing the right PLL I can use SGMII, 2.5G SGMII or XFI, which I 
actually do. It is possible to freely assign PLL 1 or PLL 2 to any lane 
using LNxGCR0[RPLL_LES].

> Reading your message carefully, it seems that you aren't requesting the
> "fast" Ethernet device to support the 2.5G media speed via LANE_MODE_2500BASEX,
> because that isn't going to be possible.
Correct.

> You are just requesting to support the 10G, 5G and 2.5G media speeds via
> LANE_MODE_10GBASER (with pause-based rate adaptation in the Ethernet PHY),
> and the 1G and 100M media speeds via LANE_MODE_1000BASEX_SGMII.
Yes, that is my minimum target. I hoped that the "fast" device can 
support all speeds, but it's not mandatory.

> That second case *is* going to be possible, provided that your PLL clock
> net frequencies are properly provisioned.
>
> Look at the output from lynx_10g_pll_dump() to avoid any unpleasant
> surprises. It should tell you that PLLF supports LANE_MODE_1000BASEX_SGMII,
> and PLLS supports LANE_MODE_10GBASER. If it doesn't, you need to make
> changes to your hardware design.
I will, thank you.

Kind regards, Tanjeff

[1] LS1046A Reference Manual, LS1046ARM, Rev. 3, 08/2021

-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

  reply	other threads:[~2025-12-03 16:25 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-02 11:12 Lynx 10G SerDes Driver on my kernel Tanjeff Moos
2025-12-02 16:29 ` Vladimir Oltean
2025-12-03 11:41   ` Tanjeff Moos
2025-12-03 12:26     ` Vladimir Oltean
2025-12-03 16:25       ` Tanjeff Moos [this message]
2025-12-03 18:00         ` Vladimir Oltean
2025-12-04 19:01           ` Tanjeff Moos
2025-12-04 19:34             ` Vladimir Oltean
2025-12-05 11:38               ` Tanjeff Moos
2025-12-05 12:44                 ` Vladimir Oltean
2025-12-08 16:50                   ` Tanjeff Moos
2026-02-05 16:47                   ` Tanjeff Moos
2026-02-08 13:42                     ` Vladimir Oltean
2026-02-12  8:30                       ` Tanjeff Moos

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=4287097e-a906-438f-b3a1-33e374477367@westermo.com \
    --to=tanjeff.moos@westermo.com \
    --cc=linux-phy@lists.infradead.org \
    --cc=sean.anderson@seco.com \
    --cc=vladimir.oltean@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