netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v4] net: sfp: add quirk for Potron SFP+ XGSPON ONU Stick
@ 2025-06-17 18:03 Chris Morgan
  2025-06-19 22:50 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Chris Morgan @ 2025-06-17 18:03 UTC (permalink / raw)
  To: netdev
  Cc: linux, andrew, hkallweit1, davem, edumazet, kuba, pabeni,
	Chris Morgan

From: Chris Morgan <macromorgan@hotmail.com>

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/

Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
---
Changes since v3:
 - Removed unnecessary parenthesis.
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(-)

diff --git a/drivers/net/phy/sfp.c b/drivers/net/phy/sfp.c
index 347c1e0e94d9..5347c95d1e77 100644
--- a/drivers/net/phy/sfp.c
+++ b/drivers/net/phy/sfp.c
@@ -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),
 
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v4] net: sfp: add quirk for Potron SFP+ XGSPON ONU Stick
  2025-06-17 18:03 [PATCH v4] net: sfp: add quirk for Potron SFP+ XGSPON ONU Stick Chris Morgan
@ 2025-06-19 22:50 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2025-06-19 22:50 UTC (permalink / raw)
  To: Chris Morgan
  Cc: netdev, linux, andrew, hkallweit1, davem, edumazet, kuba, pabeni,
	macromorgan

Hello:

This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:

On Tue, 17 Jun 2025 13:03:24 -0500 you wrote:
> From: Chris Morgan <macromorgan@hotmail.com>
> 
> 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.
> 
> [...]

Here is the summary with links:
  - [v4] net: sfp: add quirk for Potron SFP+ XGSPON ONU Stick
    https://git.kernel.org/netdev/net-next/c/dfec1c14aece

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2025-06-19 22:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-17 18:03 [PATCH v4] net: sfp: add quirk for Potron SFP+ XGSPON ONU Stick Chris Morgan
2025-06-19 22:50 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).