Skip to content

Commit a404a78

Browse files
committed
generic: 6.18: import some SFP quirks
Import upstream and pending patches implementing SFP quirks. Signed-off-by: Daniel Golle <daniel@makrotopia.org>
1 parent 18cbd83 commit a404a78

4 files changed

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

target/linux/generic/pending-6.18/750-net-sfp-add-quirk-for-QINIYEK-BJ-SFP-10G-T-copper-SF.patch

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Signed-off-by: Daniel Golle <daniel@makrotopia.org>
1616

1717
--- a/drivers/net/phy/sfp.c
1818
+++ b/drivers/net/phy/sfp.c
19-
@@ -564,6 +564,7 @@ static const struct sfp_quirk sfp_quirks
19+
@@ -580,6 +580,7 @@ static const struct sfp_quirk sfp_quirks
2020
SFP_QUIRK_S("OEM", "SFP-2.5G-BX10-U", sfp_quirk_2500basex),
2121
SFP_QUIRK_F("OEM", "RTSFP-10", sfp_fixup_rollball_cc),
2222
SFP_QUIRK_F("OEM", "RTSFP-10G", sfp_fixup_rollball_cc),
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
From 163d7cf204f72c056fb7c9e0d79f5dfa8efbb5f0 Mon Sep 17 00:00:00 2001
2+
From: Daniel Golle <daniel@makrotopia.org>
3+
Date: Tue, 21 Apr 2026 01:27:19 +0100
4+
Subject: [PATCH] net: sfp: add quirk for TP-LINK SM410U
5+
6+
The TP-LINK SM410U is a 2.5G copper module which is based on RealTek
7+
RTL8221B, but doesn't seem to offer any way to access the PHY over I2C.
8+
Add a quirk to disable in-band which isn't supported by the PHY.
9+
10+
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
11+
---
12+
drivers/net/phy/sfp.c | 1 +
13+
1 file changed, 1 insertion(+)
14+
15+
--- a/drivers/net/phy/sfp.c
16+
+++ b/drivers/net/phy/sfp.c
17+
@@ -586,6 +586,7 @@ static const struct sfp_quirk sfp_quirks
18+
SFP_QUIRK_F("Turris", "RTSFP-10G", sfp_fixup_rollball),
19+
20+
SFP_QUIRK_S("ZOERAX", "SFP-2.5G-T", sfp_quirk_oem_2_5g),
21+
+ SFP_QUIRK_S("TP-LINK", "TL-SM410U", sfp_quirk_oem_2_5g),
22+
};
23+
24+
static size_t sfp_strlen(const char *str, size_t maxlen)

0 commit comments

Comments
 (0)