Clearfog cn9130 pro and sfp ftth

Hy :slight_smile:

I tried to use sfp gpon onu with my clearfog pro.

I have 3 models :
-fs
-sercomm fgs202
-huawei ma 5671a

With th fs,it’s ok.

But i don’t succeed to use the sercomm and the huawei.

I tried to modify the quirks in the sfp.c :

SFP_QUIRK_M(FS, GSFP-ONU-SC, sfp_quirk_2500basex),

SFP_QUIRK_M(SERCOMM, FGS202, sfp_quirk_2500basex),

Here the output with huawei and sercomm sfp :

[    7.812392] sfp sfp-eth@0: please wait, module slow to respond

bash-5.1# ethtool -m eth0
netlink error: No such device or address
bash-5.1# ethtool eth0
Settings for eth0:
        Supported ports: [ MII ]
        Supported link modes:   10000baseT/Full
                                10000baseKX4/Full
                                10000baseKR/Full
                                10000baseCR/Full
                                10000baseSR/Full
                                10000baseLR/Full
                                10000baseLRM/Full
                                10000baseER/Full
        Supported pause frame use: Symmetric Receive-only
        Supports auto-negotiation: Yes
        Supported FEC modes: Not reported
        Advertised link modes:  10000baseT/Full
                                10000baseKX4/Full
                                10000baseKR/Full
                                10000baseCR/Full
                                10000baseSR/Full
                                10000baseLR/Full
                                10000baseLRM/Full
                                10000baseER/Full
        Advertised pause frame use: Symmetric Receive-only
        Advertised auto-negotiation: Yes
        Advertised FEC modes: Not reported
        Speed: Unknown!
        Duplex: Unknown! (255)
        Auto-negotiation: on
        Port: MII
        PHYAD: 0
        Transceiver: internal
        Link detected: no

And here with the fs :

bash-5.1# ethtool -m eth0
Identifier : 0x03 (SFP)
Extended identifier : 0x04 (GBIC/SFP defined by 2-wire interface ID)
Connector : 0x01 (SC)
Transceiver codes : 0x00 0x00 0x00 0x02 0x00 0x00 0x00 0x00 0x00
Transceiver type : Ethernet: 1000BASE-LX
Encoding : 0x03 (NRZ)
BR, Nominal : 1200MBd
Rate identifier : 0x00 (unspecified)
Length (SMF,km) : 20km
Length (SMF) : 20000m
Length (50um) : 0m
Length (62.5um) : 0m
Length (Copper) : 0m
Length (OM3) : 0m
Laser wavelength : 1310nm
Vendor name : FS
Vendor OUI : 00:00:00
Vendor PN : GSFP-ONU-SC
Vendor rev : 01
Option values : 0x00 0x1a
Option : RX_LOS implemented
Option : TX_FAULT implemented
Option : TX_DISABLE implemented
BR margin, max : 0%
BR margin, min : 0%
Vendor SN : SCOM210A1F5A
Date code : 211007
bash-5.1# ethtool eth0
Settings for eth0:
Supported ports: [ FIBRE ]
Supported link modes: 2500baseX/Full
1000baseX/Full
Supported pause frame use: Symmetric Receive-only
Supports auto-negotiation: Yes
Supported FEC modes: Not reported
Advertised link modes: 2500baseX/Full
Advertised pause frame use: Symmetric Receive-only
Advertised auto-negotiation: Yes
Advertised FEC modes: Not reported
Speed: Unknown!
Duplex: Unknown! (255)
Auto-negotiation: on
Port: FIBRE
PHYAD: 0
Transceiver: internal
Link detected: no
bash-5.1#

Thank you by advance :slight_smile:

Make sure you have this patch in your kernel sources. [PATCH v2] net: sfp: Add tx-fault workaround for Huawei MA5671A SFP ONT — Netdev

1 Like

Hy,
I applied this patch and here the part modified of my driver :

	/* Initialise state bits to use from hardware */
	sfp->state_hw_mask = SFP_F_PRESENT;
	if (sfp->gpio[GPIO_TX_DISABLE])
		sfp->state_hw_mask |= SFP_F_TX_DISABLE;
	if (sfp->gpio[GPIO_TX_FAULT])
		sfp->state_hw_mask |= SFP_F_TX_FAULT;
	if (sfp->gpio[GPIO_LOS])
		sfp->state_hw_mask |= SFP_F_LOS;

	sfp->module_t_start_up = T_START_UP;

	if (!memcmp(id.base.vendor_name, "HUAWEI          ", 16) &&
	    !memcmp(id.base.vendor_pn, "MA5671A         ", 16))
		sfp->tx_fault_ignore = true;
	else
		sfp->tx_fault_ignore = false;

	return 0;

	if (!memcmp(id.base.vendor_name, "SERCOMM          ", 16) &&
	    !memcmp(id.base.vendor_pn, "FGS202         ", 16))
		sfp->tx_fault_ignore = true;
	else
		sfp->tx_fault_ignore = false;

	return 0;


	sfp->module_t_wait = T_WAIT;

and

static void sfp_check_state(struct sfp *sfp)
{
	unsigned int state, i, changed;

	mutex_lock(&sfp->st_mutex);
	state = sfp_get_state(sfp);
	changed = state ^ sfp->state;
	if (sfp->tx_fault_ignore)
		changed &= SFP_F_PRESENT | SFP_F_LOS;
	else
		changed &= SFP_F_PRESENT | SFP_F_LOS | SFP_F_TX_FAULT;

	for (i = 0; i < GPIO_MAX; i++)
		if (changed & BIT(i))
			dev_dbg(sfp->dev, "%s %u -> %u\n", gpio_of_names[i],
				!!(sfp->state & BIT(i)), !!(state & BIT(i)));

	state |= sfp->state & (SFP_F_TX_DISABLE | SFP_F_RATE_SELECT);
	sfp->state = state;

	rtnl_lock();
	if (changed & SFP_F_PRESENT)
		sfp_sm_event(sfp, state & SFP_F_PRESENT ?
				SFP_E_INSERT : SFP_E_REMOVE);

	if (changed & SFP_F_TX_FAULT)
		sfp_sm_event(sfp, state & SFP_F_TX_FAULT ?
				SFP_E_TX_FAULT : SFP_E_TX_CLEAR);

	if (changed & SFP_F_LOS)
		sfp_sm_event(sfp, state & SFP_F_LOS ?
				SFP_E_LOS_HIGH : SFP_E_LOS_LOW);
	rtnl_unlock();
	mutex_unlock(&sfp->st_mutex);
}

I use kernel 6.1 and i have applied all patches

I vaguely remember an issue with the SERDEV GPON units. They incorrectly require PIN 7 to be pulled high to not constantly reset. By default PIN 7 is grounded on the ClearFog carriers and requires changing a resistor location to pull it high.

1 Like

I understand.
That why, some people modify the pin 7 of the module sfp.

Thank you