Import upstream and pending patches implementing SFP quirks.
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
--- /dev/null
+From 911e2c050963ccf239faec6ae9dee0f5e8f1cc5c Mon Sep 17 00:00:00 2001
+From: Jan Hoffmann <jan@3e8.eu>
+Date: Sun, 29 Mar 2026 21:11:11 +0200
+Subject: [PATCH] net: sfp: add quirk for ZOERAX SFP-2.5G-T
+
+This is a 2.5G copper module which appears to be based on a Motorcomm
+YT8821 PHY. There doesn't seem to be a usable way to to access the PHY
+(I2C address 0x56 provides only read-only C22 access, and Rollball is
+also not working).
+
+The module does not report the correct extended compliance code for
+2.5GBase-T, and instead claims to support SONET OC-48 and Fibre Channel:
+
+ Identifier : 0x03 (SFP)
+ Extended identifier : 0x04 (GBIC/SFP defined by 2-wire interface ID)
+ Connector : 0x07 (LC)
+ Transceiver codes : 0x00 0x01 0x00 0x00 0x40 0x40 0x04 0x00 0x00
+ Transceiver type : FC: Multimode, 50um (M5)
+ Encoding : 0x05 (SONET Scrambled)
+ BR Nominal : 2500MBd
+
+Despite this, the kernel still enables the correct 2500Base-X interface
+mode. However, for the module to actually work, it is also necessary to
+disable inband auto-negotiation.
+
+Enable the existing "sfp_quirk_oem_2_5g" for this module, which handles
+that and also sets the bit for 2500Base-T link mode.
+
+Signed-off-by: Jan Hoffmann <jan@3e8.eu>
+Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
+Link: https://patch.msgid.link/20260329191304.720160-1-jan@3e8.eu
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+---
+ drivers/net/phy/sfp.c | 2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/drivers/net/phy/sfp.c
++++ b/drivers/net/phy/sfp.c
+@@ -567,6 +567,8 @@ static const struct sfp_quirk sfp_quirks
+ SFP_QUIRK_F("Turris", "RTSFP-2.5G", sfp_fixup_rollball),
+ SFP_QUIRK_F("Turris", "RTSFP-10", sfp_fixup_rollball),
+ SFP_QUIRK_F("Turris", "RTSFP-10G", sfp_fixup_rollball),
++
++ SFP_QUIRK_S("ZOERAX", "SFP-2.5G-T", sfp_quirk_oem_2_5g),
+ };
+
+ static size_t sfp_strlen(const char *str, size_t maxlen)
--- /dev/null
+From 95aca8602ef70ffd3d971675751c81826e124f90 Mon Sep 17 00:00:00 2001
+From: John Pavlick <jspavlick@posteo.net>
+Date: Mon, 6 Apr 2026 13:23:33 +0000
+Subject: [PATCH] net: sfp: add quirks for Hisense and HSGQ GPON ONT SFP
+ modules
+
+Several GPON ONT SFP sticks based on Realtek RTL960x report
+1000BASE-LX at 1300MBd in their EEPROM but can operate at 2500base-X.
+On hosts capable of 2500base-X (e.g. Banana Pi R3 / MT7986), the
+kernel negotiates only 1G because it trusts the incorrect EEPROM data.
+
+Add quirks for:
+- Hisense-Leox LXT-010S-H
+- Hisense ZNID-GPON-2311NA
+- HSGQ HSGQ-XPON-Stick
+
+Each quirk advertises 2500base-X and ignores TX_FAULT during the
+module's ~40s Linux boot time.
+
+Tested on Banana Pi R3 (MT7986) with OpenWrt 25.12.1, confirmed
+2.5Gbps link and full throughput with flow offloading.
+
+Reviewed-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
+Suggested-by: Marcin Nita <marcin.nita@leolabs.pl>
+Signed-off-by: John Pavlick <jspavlick@posteo.net>
+Link: https://patch.msgid.link/20260406132321.72563-1-jspavlick@posteo.net
+Signed-off-by: Jakub Kicinski <kuba@kernel.org>
+---
+ drivers/net/phy/sfp.c | 16 ++++++++++++++++
+ 1 file changed, 16 insertions(+)
+
+--- a/drivers/net/phy/sfp.c
++++ b/drivers/net/phy/sfp.c
+@@ -538,6 +538,22 @@ static const struct sfp_quirk sfp_quirks
+ SFP_QUIRK("HUAWEI", "MA5671A", sfp_quirk_2500basex,
+ sfp_fixup_ignore_tx_fault_and_los),
+
++ // Hisense LXT-010S-H is a GPON ONT SFP (sold as LEOX LXT-010S-H) that
++ // can operate at 2500base-X, but reports 1000BASE-LX / 1300MBd in its
++ // EEPROM
++ SFP_QUIRK("Hisense-Leox", "LXT-010S-H", sfp_quirk_2500basex,
++ sfp_fixup_ignore_tx_fault),
++
++ // Hisense ZNID-GPON-2311NA can operate at 2500base-X, but reports
++ // 1000BASE-LX / 1300MBd in its EEPROM
++ SFP_QUIRK("Hisense", "ZNID-GPON-2311NA", sfp_quirk_2500basex,
++ sfp_fixup_ignore_tx_fault),
++
++ // HSGQ HSGQ-XPON-Stick can operate at 2500base-X, but reports
++ // 1000BASE-LX / 1300MBd in its EEPROM
++ SFP_QUIRK("HSGQ", "HSGQ-XPON-Stick", sfp_quirk_2500basex,
++ sfp_fixup_ignore_tx_fault),
++
+ // Lantech 8330-262D-E and 8330-265D can operate at 2500base-X, but
+ // incorrectly report 2500MBd NRZ in their EEPROM.
+ // Some 8330-265D modules have inverted LOS, while all of them report
--- a/drivers/net/phy/sfp.c
+++ b/drivers/net/phy/sfp.c
-@@ -564,6 +564,7 @@ static const struct sfp_quirk sfp_quirks
+@@ -580,6 +580,7 @@ static const struct sfp_quirk sfp_quirks
SFP_QUIRK_S("OEM", "SFP-2.5G-BX10-U", sfp_quirk_2500basex),
SFP_QUIRK_F("OEM", "RTSFP-10", sfp_fixup_rollball_cc),
SFP_QUIRK_F("OEM", "RTSFP-10G", sfp_fixup_rollball_cc),
--- /dev/null
+From 163d7cf204f72c056fb7c9e0d79f5dfa8efbb5f0 Mon Sep 17 00:00:00 2001
+From: Daniel Golle <daniel@makrotopia.org>
+Date: Tue, 21 Apr 2026 01:27:19 +0100
+Subject: [PATCH] net: sfp: add quirk for TP-LINK SM410U
+
+The TP-LINK SM410U is a 2.5G copper module which is based on RealTek
+RTL8221B, but doesn't seem to offer any way to access the PHY over I2C.
+Add a quirk to disable in-band which isn't supported by the PHY.
+
+Signed-off-by: Daniel Golle <daniel@makrotopia.org>
+---
+ drivers/net/phy/sfp.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/net/phy/sfp.c
++++ b/drivers/net/phy/sfp.c
+@@ -586,6 +586,7 @@ static const struct sfp_quirk sfp_quirks
+ SFP_QUIRK_F("Turris", "RTSFP-10G", sfp_fixup_rollball),
+
+ SFP_QUIRK_S("ZOERAX", "SFP-2.5G-T", sfp_quirk_oem_2_5g),
++ SFP_QUIRK_S("TP-LINK", "TL-SM410U", sfp_quirk_oem_2_5g),
+ };
+
+ static size_t sfp_strlen(const char *str, size_t maxlen)