* [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
* [RFC PATCH net-next 1/2] dt-bindings: net: add Realtek XSGMII interface mode
2026-11-17 8:47 [RFC PATCH net-next 0/2] Add Realtek XSGMII interface mode Jonas Jelonek
@ 2026-11-17 8:47 ` Jonas Jelonek
2026-11-17 8:47 ` [RFC PATCH net-next 2/2] net: phy: " Jonas Jelonek
1 sibling, 0 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
Add xsgmii to the supported MAC-PHY connection types. Realtek's
proprietary XSGMII interface carries eight 10/100/1000 Mbps ports over a
single 10.3125 Gbaud SerDes lane and is distinct from USXGMII and
10G-QXGMII.
Signed-off-by: Jonas Jelonek <jonas@jonasjelonek.de>
---
Documentation/devicetree/bindings/net/ethernet-controller.yaml | 1 +
1 file changed, 1 insertion(+)
diff --git a/Documentation/devicetree/bindings/net/ethernet-controller.yaml b/Documentation/devicetree/bindings/net/ethernet-controller.yaml
index 30b2a335116e..e9406ddd0fc0 100644
--- a/Documentation/devicetree/bindings/net/ethernet-controller.yaml
+++ b/Documentation/devicetree/bindings/net/ethernet-controller.yaml
@@ -45,6 +45,7 @@ properties:
- psgmii
- qsgmii
- qusgmii
+ - xsgmii
- tbi
- rev-mii
- rmii
--
2.53.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* [RFC PATCH net-next 2/2] net: phy: add Realtek XSGMII interface mode
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 ` Jonas Jelonek
1 sibling, 0 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
Introduce PHY_INTERFACE_MODE_XSGMII for Realtek's proprietary eight-port
MAC-PHY interface. Append the enum value before PHY_INTERFACE_MODE_MAX
and provide the xsgmii string mapping.
Report eight carried ports and per-port 10/100/1000 Mbps capabilities.
Handle XSGMII as a PHY-status interface in phylink, accepting in-band
status and limiting the maximum per-port speed to 1 Gbps.
Document that XSGMII's transport capacity is independent of the number
of enabled ports. A dedicated mode distinguishes it from USXGMII and
10G-QXGMII without inferring the wire protocol from the active port count.
Signed-off-by: Jonas Jelonek <jonas@jonasjelonek.de>
---
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 ++++
5 files changed, 17 insertions(+)
diff --git a/Documentation/networking/phy.rst b/Documentation/networking/phy.rst
index d53067ab1a61..675787c4ab52 100644
--- a/Documentation/networking/phy.rst
+++ b/Documentation/networking/phy.rst
@@ -327,6 +327,13 @@ Some of the interface modes are described below:
This is the Penta SGMII mode, it is similar to QSGMII but it combines 5
SGMII lines into a single link compared to 4 on QSGMII.
+``PHY_INTERFACE_MODE_XSGMII``
+ This is Realtek's proprietary eight-port MAC-PHY interface. A single
+ SerDes lane operating at 10.3125 Gbaud carries eight ports, each supporting
+ speeds of 10Mbps, 100Mbps and 1Gbps. The interface describes the transport
+ capacity, independently of how many ports are enabled. It is distinct
+ from USXGMII and 10G-QXGMII.
+
``PHY_INTERFACE_MODE_10G_QXGMII``
Represents the 10G-QXGMII PHY-MAC interface as defined by the Cisco USXGMII
Multiport Copper Interface document. It supports 4 ports over a 10.3125 GHz
diff --git a/drivers/net/phy/phy-core.c b/drivers/net/phy/phy-core.c
index d7a4a977fc8a..2dd36fa18e2c 100644
--- a/drivers/net/phy/phy-core.c
+++ b/drivers/net/phy/phy-core.c
@@ -201,6 +201,8 @@ int phy_interface_num_ports(phy_interface_t interface)
return 4;
case PHY_INTERFACE_MODE_PSGMII:
return 5;
+ case PHY_INTERFACE_MODE_XSGMII:
+ return 8;
case PHY_INTERFACE_MODE_MAX:
WARN_ONCE(1, "PHY_INTERFACE_MODE_MAX isn't a valid interface mode");
return 0;
diff --git a/drivers/net/phy/phy_caps.c b/drivers/net/phy/phy_caps.c
index 558e4df4d63c..0de12c42c47b 100644
--- a/drivers/net/phy/phy_caps.c
+++ b/drivers/net/phy/phy_caps.c
@@ -313,6 +313,7 @@ unsigned long phy_caps_from_interface(phy_interface_t interface)
case PHY_INTERFACE_MODE_QUSGMII:
case PHY_INTERFACE_MODE_SGMII:
case PHY_INTERFACE_MODE_GMII:
+ case PHY_INTERFACE_MODE_XSGMII:
link_caps |= BIT(LINK_CAPA_1000HD) | BIT(LINK_CAPA_1000FD);
fallthrough;
diff --git a/drivers/net/phy/phylink.c b/drivers/net/phy/phylink.c
index e885da1c2831..0028b543c788 100644
--- a/drivers/net/phy/phylink.c
+++ b/drivers/net/phy/phylink.c
@@ -263,6 +263,7 @@ static int phylink_interface_max_speed(phy_interface_t interface)
case PHY_INTERFACE_MODE_PSGMII:
case PHY_INTERFACE_MODE_QSGMII:
case PHY_INTERFACE_MODE_QUSGMII:
+ case PHY_INTERFACE_MODE_XSGMII:
case PHY_INTERFACE_MODE_SGMII:
case PHY_INTERFACE_MODE_GMII:
return SPEED_1000;
@@ -812,6 +813,7 @@ static int phylink_parse_mode(struct phylink *pl,
case PHY_INTERFACE_MODE_PSGMII:
case PHY_INTERFACE_MODE_QSGMII:
case PHY_INTERFACE_MODE_QUSGMII:
+ case PHY_INTERFACE_MODE_XSGMII:
case PHY_INTERFACE_MODE_RGMII:
case PHY_INTERFACE_MODE_RGMII_ID:
case PHY_INTERFACE_MODE_RGMII_RXID:
@@ -1046,6 +1048,7 @@ static enum inband_type phylink_get_inband_type(phy_interface_t interface)
case PHY_INTERFACE_MODE_PSGMII:
case PHY_INTERFACE_MODE_QSGMII:
case PHY_INTERFACE_MODE_QUSGMII:
+ case PHY_INTERFACE_MODE_XSGMII:
case PHY_INTERFACE_MODE_USXGMII:
case PHY_INTERFACE_MODE_10G_QXGMII:
/* These protocols are designed for use with a PHY which
diff --git a/include/linux/phy.h b/include/linux/phy.h
index 21afc2082b17..ffff2a6313d3 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -107,6 +107,7 @@ extern const int phy_basic_ports_array[3];
* @PHY_INTERFACE_MODE_LAUI: 50 Gigabit Attachment Unit Interface
* @PHY_INTERFACE_MODE_100GBASEP: 100GBase-P - with Clause 134 FEC
* @PHY_INTERFACE_MODE_MIILITE: MII-Lite - MII without RXER TXER CRS COL
+ * @PHY_INTERFACE_MODE_XSGMII: Realtek proprietary eight-port SGMII over 10G
* @PHY_INTERFACE_MODE_MAX: Book keeping
*
* Describes the interface between the MAC and PHY.
@@ -152,6 +153,7 @@ typedef enum {
PHY_INTERFACE_MODE_LAUI,
PHY_INTERFACE_MODE_100GBASEP,
PHY_INTERFACE_MODE_MIILITE,
+ PHY_INTERFACE_MODE_XSGMII,
PHY_INTERFACE_MODE_MAX,
} phy_interface_t;
@@ -286,6 +288,8 @@ static inline const char *phy_modes(phy_interface_t interface)
return "100gbase-p";
case PHY_INTERFACE_MODE_MIILITE:
return "mii-lite";
+ case PHY_INTERFACE_MODE_XSGMII:
+ return "xsgmii";
default:
return "unknown";
}
--
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®