public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Maxime Chevallier <maxime.chevallier@bootlin.com>
To: davem@davemloft.net, Andrew Lunn <andrew@lunn.ch>,
	Jakub Kicinski <kuba@kernel.org>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>,
	Russell King <linux@armlinux.org.uk>,
	Jonas Jelonek <jelonek.jonas@gmail.com>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Heiner Kallweit <hkallweit1@gmail.com>
Cc: "Maxime Chevallier" <maxime.chevallier@bootlin.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	thomas.petazzoni@bootlin.com, "Simon Horman" <horms@kernel.org>,
	"Romain Gantois" <romain.gantois@bootlin.com>,
	"Marek Behún" <kabel@kernel.org>,
	bcm-kernel-feedback-list@broadcom.com
Subject: [PATCH net-next 1/6] net: sfp: Add support for SGMII to 100FX modules
Date: Wed, 14 Jan 2026 23:57:23 +0100	[thread overview]
Message-ID: <20260114225731.811993-2-maxime.chevallier@bootlin.com> (raw)
In-Reply-To: <20260114225731.811993-1-maxime.chevallier@bootlin.com>

There exist some SFP modules that rely on a built-in PHY (usually a
Broadcom BCM5461) to output 100baseFX, using SGMII as the
phy_interface.

This is relevant as there are devices that support SGMII and 1000BaseX,
but not 100FX natively on their SFP cages.

SGMII can be used to convey 100Mbps links with symbol repetition, but the
serdes lane stays clocked at 1.25GHz. We therefore absolutely need a
media-converter to adapt this to 100BaseFX, that runs at 125MHz.

What this means for the sfp-bus infrastructure is that we may have a PHY
to probe when dealing with a 100FX (and possibly a 100LX) module, and if
this PHY exist it will use SGMII.

Signed-off-by: Maxime Chevallier <maxime.chevallier@bootlin.com>
---
 drivers/net/phy/sfp-bus.c | 11 +++++++++++
 drivers/net/phy/sfp.c     |  3 ++-
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/drivers/net/phy/sfp-bus.c b/drivers/net/phy/sfp-bus.c
index b945d75966d5..85c9f21af69b 100644
--- a/drivers/net/phy/sfp-bus.c
+++ b/drivers/net/phy/sfp-bus.c
@@ -105,6 +105,14 @@ static void sfp_module_parse_may_have_phy(struct sfp_bus *bus,
 		return;
 	}
 
+	/* Some 100M fiber modules have a PHY, acting as an SGMII to 100FX
+	 * media converter.
+	 */
+	if (id->base.e100_base_fx || id->base.e100_base_lx) {
+		bus->caps.may_have_phy = true;
+		return;
+	}
+
 	if (id->base.phys_id != SFF8024_ID_DWDM_SFP) {
 		switch (id->base.extended_cc) {
 		case SFF8024_ECC_10GBASE_T_SFI:
@@ -188,6 +196,9 @@ static void sfp_module_parse_support(struct sfp_bus *bus,
 	if (id->base.e100_base_fx || id->base.e100_base_lx) {
 		phylink_set(modes, 100baseFX_Full);
 		__set_bit(PHY_INTERFACE_MODE_100BASEX, interfaces);
+
+		/* SGMII to 100Base-FX modules with internal PHY */
+		__set_bit(PHY_INTERFACE_MODE_SGMII, interfaces);
 	}
 	if ((id->base.e_base_px || id->base.e_base_bx10) && br_nom == 100) {
 		phylink_set(modes, 100baseFX_Full);
diff --git a/drivers/net/phy/sfp.c b/drivers/net/phy/sfp.c
index 84bef5099dda..5b42af1cf6aa 100644
--- a/drivers/net/phy/sfp.c
+++ b/drivers/net/phy/sfp.c
@@ -2446,7 +2446,8 @@ static int sfp_sm_mod_probe(struct sfp *sfp, bool report)
 	    sfp->id.base.extended_cc == SFF8024_ECC_5GBASE_T ||
 	    sfp->id.base.extended_cc == SFF8024_ECC_2_5GBASE_T)
 		sfp->mdio_protocol = MDIO_I2C_C45;
-	else if (sfp->id.base.e1000_base_t)
+	else if (sfp->id.base.e1000_base_t || sfp->id.base.e100_base_fx ||
+		 sfp->id.base.e100_base_lx)
 		sfp->mdio_protocol = MDIO_I2C_MARVELL_C22;
 	else
 		sfp->mdio_protocol = MDIO_I2C_NONE;
-- 
2.49.0


  reply	other threads:[~2026-01-14 22:57 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-14 22:57 [PATCH net-next 0/6] net: sfp: Add support for SGMII to 100FX modules Maxime Chevallier
2026-01-14 22:57 ` Maxime Chevallier [this message]
2026-01-14 22:57 ` [PATCH net-next 2/6] net: phylink: Allow more interfaces in SFP interface selection Maxime Chevallier
2026-01-14 23:30   ` Russell King (Oracle)
2026-01-15  7:49     ` Maxime Chevallier
2026-02-13  8:41     ` Maxime Chevallier
2026-03-05 15:05       ` Russell King (Oracle)
2026-03-05 16:35         ` Maxime Chevallier
2026-03-05 16:44           ` Russell King (Oracle)
2026-03-06  7:18             ` Maxime Chevallier
2026-01-14 22:57 ` [PATCH net-next 3/6] net: phy: Store module caps for PHYs embedded in SFP Maxime Chevallier
2026-01-14 22:57 ` [PATCH net-next 4/6] net: phy: broadcom: Support SGMII to 100FX on BCM5461 Maxime Chevallier
2026-01-14 22:57 ` [PATCH net-next 5/6] net: mdio: mdio-i2c: Add single-byte C22 MDIO protocol Maxime Chevallier
2026-01-14 22:57 ` [PATCH net-next 6/6] net: sfp: Add support for some BCM5461-based SGMII to 100FX modules Maxime Chevallier

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=20260114225731.811993-2-maxime.chevallier@bootlin.com \
    --to=maxime.chevallier@bootlin.com \
    --cc=andrew@lunn.ch \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=f.fainelli@gmail.com \
    --cc=hkallweit1@gmail.com \
    --cc=horms@kernel.org \
    --cc=jelonek.jonas@gmail.com \
    --cc=kabel@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=romain.gantois@bootlin.com \
    --cc=thomas.petazzoni@bootlin.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