* [PATCH net-next] net: sfp: add support for a couple of copper multi-rate modules
@ 2023-05-20 10:18 Russell King (Oracle)
2023-05-21 15:21 ` Andrew Lunn
2023-05-23 2:20 ` patchwork-bot+netdevbpf
0 siblings, 2 replies; 3+ messages in thread
From: Russell King (Oracle) @ 2023-05-20 10:18 UTC (permalink / raw)
To: Andrew Lunn, Heiner Kallweit
Cc: Josua Mayer, David S. Miller, Eric Dumazet, Jakub Kicinski,
Paolo Abeni, netdev
Add support for the Fiberstore SFP-10G-T and Walsun HXSX-ATRC-1
modules. Internally, the PCB silkscreen has what seems to be a part
number of WT_502. Fiberstore use v2.2 whereas Walsun use v2.6.
These modules contain a Marvell AQrate AQR113C PHY, accessible through
I2C 0x51 using the "rollball" protocol. In both cases, the PHY is
programmed to use 10GBASE-R with pause-mode rate adaption.
Unlike the other rollball modules, these only need a four second delay
before we can talk to the PHY.
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
---
drivers/net/phy/sfp.c | 34 +++++++++++++++++++++++++++++++---
1 file changed, 31 insertions(+), 3 deletions(-)
diff --git a/drivers/net/phy/sfp.c b/drivers/net/phy/sfp.c
index 4799976a1609..7ddebf38ef3d 100644
--- a/drivers/net/phy/sfp.c
+++ b/drivers/net/phy/sfp.c
@@ -170,7 +170,6 @@ static const enum gpiod_flags gpio_flags[] = {
* on board (for a copper SFP) time to initialise.
*/
#define T_WAIT msecs_to_jiffies(50)
-#define T_WAIT_ROLLBALL msecs_to_jiffies(25000)
#define T_START_UP msecs_to_jiffies(300)
#define T_START_UP_BAD_GPON msecs_to_jiffies(60000)
@@ -351,6 +350,27 @@ static void sfp_fixup_ignore_tx_fault(struct sfp *sfp)
sfp->tx_fault_ignore = true;
}
+// For 10GBASE-T short-reach modules
+static void sfp_fixup_10gbaset_30m(struct sfp *sfp)
+{
+ sfp->id.base.connector = SFF8024_CONNECTOR_RJ45;
+ sfp->id.base.extended_cc = SFF8024_ECC_10GBASE_T_SR;
+}
+
+static void sfp_fixup_rollball_proto(struct sfp *sfp, unsigned int secs)
+{
+ sfp->mdio_protocol = MDIO_I2C_ROLLBALL;
+ sfp->module_t_wait = msecs_to_jiffies(secs * 1000);
+}
+
+static void sfp_fixup_fs_10gt(struct sfp *sfp)
+{
+ sfp_fixup_10gbaset_30m(sfp);
+
+ // These SFPs need 4 seconds before the PHY can be accessed
+ sfp_fixup_rollball_proto(sfp, 4);
+}
+
static void sfp_fixup_halny_gsfp(struct sfp *sfp)
{
/* Ignore the TX_FAULT and LOS signals on this module.
@@ -362,8 +382,8 @@ static void sfp_fixup_halny_gsfp(struct sfp *sfp)
static void sfp_fixup_rollball(struct sfp *sfp)
{
- sfp->mdio_protocol = MDIO_I2C_ROLLBALL;
- sfp->module_t_wait = T_WAIT_ROLLBALL;
+ // Rollball SFPs need 25 seconds before the PHY can be accessed
+ sfp_fixup_rollball_proto(sfp, 25);
}
static void sfp_fixup_rollball_cc(struct sfp *sfp)
@@ -428,6 +448,10 @@ static const struct sfp_quirk sfp_quirks[] = {
SFP_QUIRK("ALCATELLUCENT", "3FE46541AA", sfp_quirk_2500basex,
sfp_fixup_long_startup),
+ // Fiberstore SFP-10G-T doesn't identify as copper, and uses the
+ // Rollball protocol to talk to the PHY.
+ SFP_QUIRK_F("FS", "SFP-10G-T", sfp_fixup_fs_10gt),
+
SFP_QUIRK_F("HALNy", "HL-GSFP", sfp_fixup_halny_gsfp),
// HG MXPD-483II-F 2.5G supports 2500Base-X, but incorrectly reports
@@ -445,6 +469,10 @@ static const struct sfp_quirk sfp_quirks[] = {
SFP_QUIRK_M("UBNT", "UF-INSTANT", sfp_quirk_ubnt_uf_instant),
+ // Walsun HXSX-ATRC-1 doesn't identify as copper, and uses the
+ // Rollball protocol to talk to the PHY.
+ SFP_QUIRK_F("Walsun", "HXSX-ATRC-1", sfp_fixup_fs_10gt),
+
SFP_QUIRK_F("OEM", "SFP-10G-T", sfp_fixup_rollball_cc),
SFP_QUIRK_M("OEM", "SFP-2.5G-T", sfp_quirk_oem_2_5g),
SFP_QUIRK_F("OEM", "RTSFP-10", sfp_fixup_rollball_cc),
--
2.30.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] net: sfp: add support for a couple of copper multi-rate modules
2023-05-20 10:18 [PATCH net-next] net: sfp: add support for a couple of copper multi-rate modules Russell King (Oracle)
@ 2023-05-21 15:21 ` Andrew Lunn
2023-05-23 2:20 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: Andrew Lunn @ 2023-05-21 15:21 UTC (permalink / raw)
To: Russell King (Oracle)
Cc: Heiner Kallweit, Josua Mayer, David S. Miller, Eric Dumazet,
Jakub Kicinski, Paolo Abeni, netdev
On Sat, May 20, 2023 at 11:18:30AM +0100, Russell King (Oracle) wrote:
> Add support for the Fiberstore SFP-10G-T and Walsun HXSX-ATRC-1
> modules. Internally, the PCB silkscreen has what seems to be a part
> number of WT_502. Fiberstore use v2.2 whereas Walsun use v2.6.
>
> These modules contain a Marvell AQrate AQR113C PHY, accessible through
> I2C 0x51 using the "rollball" protocol. In both cases, the PHY is
> programmed to use 10GBASE-R with pause-mode rate adaption.
>
> Unlike the other rollball modules, these only need a four second delay
> before we can talk to the PHY.
>
> Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH net-next] net: sfp: add support for a couple of copper multi-rate modules
2023-05-20 10:18 [PATCH net-next] net: sfp: add support for a couple of copper multi-rate modules Russell King (Oracle)
2023-05-21 15:21 ` Andrew Lunn
@ 2023-05-23 2:20 ` patchwork-bot+netdevbpf
1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-05-23 2:20 UTC (permalink / raw)
To: Russell King
Cc: andrew, hkallweit1, josua, davem, edumazet, kuba, pabeni, netdev
Hello:
This patch was applied to netdev/net-next.git (main)
by Jakub Kicinski <kuba@kernel.org>:
On Sat, 20 May 2023 11:18:30 +0100 you wrote:
> Add support for the Fiberstore SFP-10G-T and Walsun HXSX-ATRC-1
> modules. Internally, the PCB silkscreen has what seems to be a part
> number of WT_502. Fiberstore use v2.2 whereas Walsun use v2.6.
>
> These modules contain a Marvell AQrate AQR113C PHY, accessible through
> I2C 0x51 using the "rollball" protocol. In both cases, the PHY is
> programmed to use 10GBASE-R with pause-mode rate adaption.
>
> [...]
Here is the summary with links:
- [net-next] net: sfp: add support for a couple of copper multi-rate modules
https://git.kernel.org/netdev/net-next/c/5859a99b5225
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] 3+ messages in thread
end of thread, other threads:[~2023-05-23 2:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-20 10:18 [PATCH net-next] net: sfp: add support for a couple of copper multi-rate modules Russell King (Oracle)
2023-05-21 15:21 ` Andrew Lunn
2023-05-23 2:20 ` 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).