net: sfp: add quirk for Potron SFP+ XGSPON ONU Stick
Subsystems (4)
PATCH v3 1/1 net: sfp: add quirk for Potron SFP+ XGSPON ONU Stick
From: Chris Morgan <[email protected]>
Add quirk for Potron SFP+ XGSPON ONU Stick (YV SFP+ONT-XGSPON).
This device uses pins 2 and 7 for UART communication, so disable TX_FAULT and LOS. Additionally as it is an embedded system in an SFP+ form factor provide it enough time to fully boot before we attempt to use it.
https://www.potrontec.com/index/index/list/cat_id/2.html#11-83
https://pon.wiki/xgs-pon/ont/potron-technology/x-onu-sfpp/
---
Changes since v2:
- Waited until merge window closed (sorry).
- Only disable hardware LOS and TX_FAULT, as software appears to work.
- Created sfp_fixup_ignore_hw() helper which is used to disable specific hardware signals and use said helper with both the SFP+ONT-XGSPON stick as well as the existing sfp_fixup_halny_gsfp() which performs similar fixups.
--- drivers/net/phy/sfp.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-)
drivers/net/phy/sfp.c +20 -1
@@ -361,6 +361,11 @@ static void sfp_fixup_ignore_tx_fault(struct sfp *sfp) sfp->state_ignore_mask |=SFP_F_TX_FAULT ; } +static void sfp_fixup_ignore_hw (struct sfp *sfp,unsigned int mask) +{ + sfp->state_hw_mask &= ~mask; +} +static void sfp_fixup_nokia (struct sfp *sfp) {sfp_fixup_long_startup (sfp);
@@ -409,7 +414,19 @@ static void sfp_fixup_halny_gsfp(struct sfp *sfp)* these are possibly used for other purposes on this * module, e.g. a serial port. */ - sfp->state_hw_mask &= ~(SFP_F_TX_FAULT |SFP_F_LOS ); +sfp_fixup_ignore_hw (sfp, (SFP_F_TX_FAULT |SFP_F_LOS )); +} + +static void sfp_fixup_potron (struct sfp *sfp) +{ +/* +* The TX_FAULT and LOS pins on this device are used for serial +* communication, so ignore them. Additionally, provide extra +* time for this device to fully start up. +*/ + +sfp_fixup_long_startup (sfp); +sfp_fixup_ignore_hw (sfp, (SFP_F_TX_FAULT |SFP_F_LOS )); }static void sfp_fixup_rollball_cc (struct sfp *sfp)
@@ -512,6 +529,8 @@ static const struct sfp_quirk sfp_quirks[] = {SFP_QUIRK_F ("Walsun" ,"HXSX-ATRC-1" , sfp_fixup_fs_10gt),SFP_QUIRK_F ("Walsun" ,"HXSX-ATRI-1" , sfp_fixup_fs_10gt), +SFP_QUIRK_F ("YV" ,"SFP+ONU-XGSPON" , sfp_fixup_potron), +// OEM SFP-GE-T is a 1000Base-T module with broken TX_FAULT indicator SFP_QUIRK_F("OEM", "SFP-GE-T", sfp_fixup_ignore_tx_fault),
Signature · 1 line
2.43.0
Russell King (Oracle)
maintainerQuoted 8 lines · Chris Morgan
drivers/net/phy/sfp.c +3
-1@@ -409,7 +414,19 @@ static void sfp_fixup_halny_gsfp(struct sfp *sfp)* these are possibly used for other purposes on this * module, e.g. a serial port. */ - sfp->state_hw_mask &= ~(SFP_F_TX_FAULT |SFP_F_LOS ); +sfp_fixup_ignore_hw (sfp, (SFP_F_TX_FAULT |SFP_F_LOS )); +} +
drivers/net/phy/sfp.c static void sfp_fixup_halny_gsfp(struct sfp *sfp) · line 429
Quoted 10 lines
drivers/net/phy/sfp.c +10
-0+static void sfp_fixup_potron (struct sfp *sfp) +{ +/* +* The TX_FAULT and LOS pins on this device are used for serial +* communication, so ignore them. Additionally, provide extra +* time for this device to fully start up. +*/ + +sfp_fixup_long_startup (sfp); +sfp_fixup_ignore_hw (sfp, (SFP_F_TX_FAULT |SFP_F_LOS ));
There's no need for parens around the second argument to sfp_fixup_ignore_hw() - the bitwise OR is unambiguous.
Apart from that, the patch looks fine, thanks.
Signature · 2 lines
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
Quoted 23 lines · Russell King (Oracle)
Quoted 8 lines · Chris Morgan
drivers/net/phy/sfp.c +3
-1@@ -409,7 +414,19 @@ static void sfp_fixup_halny_gsfp(struct sfp *sfp)* these are possibly used for other purposes on this * module, e.g. a serial port. */ - sfp->state_hw_mask &= ~(SFP_F_TX_FAULT |SFP_F_LOS ); +sfp_fixup_ignore_hw (sfp, (SFP_F_TX_FAULT |SFP_F_LOS )); +} +drivers/net/phy/sfp.c static void sfp_fixup_halny_gsfp(struct sfp *sfp) · line 429
Quoted 10 lines
drivers/net/phy/sfp.c +10
-0+static void sfp_fixup_potron (struct sfp *sfp) +{ +/* +* The TX_FAULT and LOS pins on this device are used for serial +* communication, so ignore them. Additionally, provide extra +* time for this device to fully start up. +*/ + +sfp_fixup_long_startup (sfp); +sfp_fixup_ignore_hw (sfp, (SFP_F_TX_FAULT |SFP_F_LOS ));There's no need for parens around the second argument to
sfp_fixup_ignore_hw()- the bitwise OR is unambiguous.
Quoted 1 line
Apart from that, the patch looks fine, thanks.
Thank you, I'll resubmit tomorrow with the requested changes.
- Chris
Quoted 4 lines
Signature · 3 lines
-- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!