mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [RFC PATCH net-next 0/2] Add Realtek XSGMII interface mode
@ 2026-11-17  8:47 Jonas Jelonek
  2026-11-17  8:47 ` [RFC PATCH net-next 1/2] dt-bindings: net: add " Jonas Jelonek
  2026-11-17  8:47 ` [RFC PATCH net-next 2/2] net: phy: " Jonas Jelonek
  0 siblings, 2 replies; 3+ messages in thread
From: Jonas Jelonek @ 2026-11-17  8:47 UTC (permalink / raw)
  To: Andrew Lunn, Heiner Kallweit, Russell King, David S . Miller,
	Eric Dumazet, Jakub Kicinski, Paolo Abeni, Simon Horman, netdev,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley
  Cc: Jonathan Corbet, Shuah Khan, Randy Dunlap, linux-doc,
	linux-kernel, devicetree, Jonas Jelonek

Hi,

This RFC adds an explicit PHY interface mode for Realtek's proprietary
XSGMII transport. It carries eight 10/100/1000 Mbps ports over one
10.3125 Gbaud SerDes lane. Each logical port remains limited to 1 Gbps;
the aggregate serial rate is not a per-port Ethernet speed.

Motivation
----------

The motivating users are downstream Realtek PCS/PHY drivers for OpenWrt,
including RTL930x/RTL931x switches connected to RTL8218D/E octal PHYs.
Their XSGMII connections currently use phy-mode = "usxgmii", with the PCS
driver inferring the actual transport from the number of described ports.

Not only is this a misuse of USXGMII mode, covering two very different
modes with a single name. It also starts to fall apart in several cases.
A specific switch being currently worked on uses an RTL8218E PHY but
only with 4 of the 8 ports actually wired and used. The device tree also
only has those 4 ports but the PHY still talks in XSGMII mode to the
switch SoC. This causes a mismatch, the switch SoC using USXGMII
(because of the assumption that 4 ports -> USXGMII, not XSGMII) but the
PHY using XSGMII.

Protocol identity and naming
----------------------------

XSGMII is the name Realtek uses for this interface. Calling it simply
"octal SGMII" would describe its capacity without identifying its
protocol. Existing modes such as QSGMII and PSGMII already distinguish
multiplexed MAC-PHY transports; the PSGMII introduction is an example of
adding the generic mode definitions separately from a driver user [1].

Cisco USGMII is a relevant comparison, but equivalent port capacity does
not establish interoperability. Cisco defines Q-USGMII for four ports
over 5.0 Gb/s and O-USGMII for eight ports over 10.0 Gb/s, using 8b/10b
coding and a packet-control header [2]. Linux already represents the
quad variant as "qusgmii", with its own control-word decoding [3].

Realtek documents XSGMII and O-USGMII as separate RTL8218E interfaces:
XSGMII runs at 10.3125 Gb/s and O-USGMII at 10.0 Gb/s, with different
hardware strap selections [4]. The SDK also distinguishes them in
phy_8218e_macIntfSerdesMode_get() and applies separate initialization
tables. Realtek's O-USGMII is therefore the candidate for comparison
with Cisco's octal USGMII; it is not evidence that XSGMII can be renamed
to USGMII. Compatibility of those O-USGMII implementations would need
separate confirmation.

This proposal retains the vendor's XSGMII name rather than assigning an
existing protocol name to a distinct hardware configuration. It does
not assume a particular XSGMII line encoding merely from the line rate.

Scope and compatibility
-----------------------

Patch 1 adds "xsgmii" to the Ethernet controller binding. Patch 2 adds
PHY_INTERFACE_MODE_XSGMII, its string mapping, the eight-port capacity,
per-port speed capabilities, phylink handling and a short interface
description. The enum value is appended before PHY_INTERFACE_MODE_MAX,
preserving existing enum values.

The phylink change classifies XSGMII with the SGMII-like PHY-status
interfaces and uses 1 Gbps as the maximum per-port speed. This generic
classification does not prescribe a Clause 22 register layout or a
control-word decoder for a particular PCS implementation.

There is no in-tree driver conversion in this RFC. The intent is to
establish the interface representation before converting the downstream
Realtek PCS/DSA drivers and the affected DT descriptions. Existing
"usxgmii" and "10g-qxgmii" meanings are unchanged. Real users of this
mode will land once PCS and PHY drivers are submitted

Feedback
-----------------------

I would appreciate feedback on:

  - Whether a distinct "xsgmii" mode is the appropriate representation,
    given the differences from USXGMII and O-USGMII.
  - Whether the proposed per-port capabilities and phylink PHY-status
    classification accurately capture the intended generic semantics.
  - Whether introduction of a user of this mode is needed alongside
    adding this new mode, or whether those can be considered separately.

References
----------

[1] 83b5f0253b1e ("net: phy: Introduce PSGMII PHY interface mode")
    https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=83b5f0253b1ef352f4333c4fb2d24eff23045f6b
[2] Cisco USGMII specification, Table 1 and section 2.2.3; downloads:
    https://developer.cisco.com/site/usgmii-usxgmii/
[3] 923454c0368b ("net: phylink: use a dedicated helper to parse usgmii
    control word")
    https://git.kernel.org/linus/923454c0368b8092e9d05c020f50abca577e7290
[4] RTL8218E-CG datasheet, rev. 0.1, sections 6.2, 6.3, 6.6, 7.12 and 7.14.
    https://github.com/jameywine/realtek-doc/blob/main/datasheets/RTL8218E-CG_Datasheet.pdf

Thanks,
Jonas
---
Jonas Jelonek (2):
  dt-bindings: net: add Realtek XSGMII interface mode
  net: phy: add Realtek XSGMII interface mode

 .../devicetree/bindings/net/ethernet-controller.yaml       | 1 +
 Documentation/networking/phy.rst                           | 7 +++++++
 drivers/net/phy/phy-core.c                                 | 2 ++
 drivers/net/phy/phy_caps.c                                 | 1 +
 drivers/net/phy/phylink.c                                  | 3 +++
 include/linux/phy.h                                        | 4 ++++
 6 files changed, 18 insertions(+)


base-commit: 7ccc5e05043b1bb84326b19a2b05938d8f7a2ae6
-- 
2.53.0

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-11-17  8:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-17  8:47 [RFC PATCH net-next 0/2] Add Realtek XSGMII interface mode Jonas Jelonek
2026-11-17  8:47 ` [RFC PATCH net-next 1/2] dt-bindings: net: add " Jonas Jelonek
2026-11-17  8:47 ` [RFC PATCH net-next 2/2] net: phy: " Jonas Jelonek

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®