mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jonas Jelonek <jonas@jonasjelonek.de>
To: Andrew Lunn <andrew+netdev@lunn.ch>,
	Heiner Kallweit <hkallweit1@gmail.com>,
	Russell King <linux@armlinux.org.uk>,
	"David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Simon Horman <horms@kernel.org>,
	netdev@vger.kernel.org, Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>
Cc: Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Randy Dunlap <rdunlap@infradead.org>,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
	devicetree@vger.kernel.org, Jonas Jelonek <jonas@jonasjelonek.de>
Subject: [RFC PATCH net-next 2/2] net: phy: add Realtek XSGMII interface mode
Date: Tue, 17 Nov 2026 08:47:48 +0000	[thread overview]
Message-ID: <20261117084748.2387647-3-jonas@jonasjelonek.de> (raw)
In-Reply-To: <20261117084748.2387647-1-jonas@jonasjelonek.de>

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


      parent reply	other threads:[~2026-11-17  8:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-17  8:47 [RFC PATCH net-next 0/2] Add " 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 [this message]

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=20261117084748.2387647-3-jonas@jonasjelonek.de \
    --to=jonas@jonasjelonek.de \
    --cc=andrew+netdev@lunn.ch \
    --cc=conor+dt@kernel.org \
    --cc=corbet@lwn.net \
    --cc=davem@davemloft.net \
    --cc=devicetree@vger.kernel.org \
    --cc=edumazet@kernel.org \
    --cc=hkallweit1@gmail.com \
    --cc=horms@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=rdunlap@infradead.org \
    --cc=robh@kernel.org \
    --cc=skhan@linuxfoundation.org \
    /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®