]> git.ipfire.org Git - thirdparty/openwrt.git/blob
6b83d3db1dded6aaea40a1573513e3a60db52f10
[thirdparty/openwrt.git] /
1 From cd4a32e60061789676f7f018a94fcc9ec56732a0 Mon Sep 17 00:00:00 2001
2 From: Marek BehĂșn <kabel@kernel.org>
3 Date: Tue, 23 Apr 2024 10:50:39 +0200
4 Subject: net: sfp: enhance quirk for Fibrestore 2.5G copper SFP module
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 Enhance the quirk for Fibrestore 2.5G copper SFP module. The original
10 commit e27aca3760c0 ("net: sfp: add quirk for FS's 2.5G copper SFP")
11 introducing the quirk says that the PHY is inaccessible, but that is
12 not true.
13
14 The module uses Rollball protocol to talk to the PHY, and needs a 4
15 second wait before probing it, same as FS 10G module.
16
17 The PHY inside the module is Realtek RTL8221B-VB-CG PHY. The realtek
18 driver recently gained support to set it up via clause 45 accesses.
19
20 Signed-off-by: Marek BehĂșn <kabel@kernel.org>
21 Reviewed-by: Jiri Pirko <jiri@nvidia.com>
22 Link: https://lore.kernel.org/r/20240423085039.26957-2-kabel@kernel.org
23 Signed-off-by: Jakub Kicinski <kuba@kernel.org>
24 ---
25 drivers/net/phy/sfp.c | 18 ++++++++++++------
26 1 file changed, 12 insertions(+), 6 deletions(-)
27
28 --- a/drivers/net/phy/sfp.c
29 +++ b/drivers/net/phy/sfp.c
30 @@ -370,18 +370,23 @@ static void sfp_fixup_rollball(struct sf
31 sfp->phy_t_retry = msecs_to_jiffies(1000);
32 }
33
34 -static void sfp_fixup_fs_10gt(struct sfp *sfp)
35 +static void sfp_fixup_fs_2_5gt(struct sfp *sfp)
36 {
37 - sfp_fixup_10gbaset_30m(sfp);
38 sfp_fixup_rollball(sfp);
39
40 - /* The RollBall fixup is not enough for FS modules, the AQR chip inside
41 + /* The RollBall fixup is not enough for FS modules, the PHY chip inside
42 * them does not return 0xffff for PHY ID registers in all MMDs for the
43 * while initializing. They need a 4 second wait before accessing PHY.
44 */
45 sfp->module_t_wait = msecs_to_jiffies(4000);
46 }
47
48 +static void sfp_fixup_fs_10gt(struct sfp *sfp)
49 +{
50 + sfp_fixup_10gbaset_30m(sfp);
51 + sfp_fixup_fs_2_5gt(sfp);
52 +}
53 +
54 static void sfp_fixup_halny_gsfp(struct sfp *sfp)
55 {
56 /* Ignore the TX_FAULT and LOS signals on this module.
57 @@ -459,6 +464,10 @@ static const struct sfp_quirk sfp_quirks
58 // PHY.
59 SFP_QUIRK_F("FS", "SFP-10G-T", sfp_fixup_fs_10gt),
60
61 + // Fiberstore SFP-2.5G-T uses Rollball protocol to talk to the PHY and
62 + // needs 4 sec wait before probing the PHY.
63 + SFP_QUIRK_F("FS", "SFP-2.5G-T", sfp_fixup_fs_2_5gt),
64 +
65 // Fiberstore GPON-ONU-34-20BI can operate at 2500base-X, but report 1.2GBd
66 // NRZ in their EEPROM
67 SFP_QUIRK("FS", "GPON-ONU-34-20BI", sfp_quirk_2500basex,
68 @@ -475,9 +484,6 @@ static const struct sfp_quirk sfp_quirks
69 SFP_QUIRK("HUAWEI", "MA5671A", sfp_quirk_2500basex,
70 sfp_fixup_ignore_tx_fault),
71
72 - // FS 2.5G Base-T
73 - SFP_QUIRK_M("FS", "SFP-2.5G-T", sfp_quirk_oem_2_5g),
74 -
75 // Lantech 8330-262D-E can operate at 2500base-X, but incorrectly report
76 // 2500MBd NRZ in their EEPROM
77 SFP_QUIRK_M("Lantech", "8330-262D-E", sfp_quirk_2500basex),