Bpi-r4 sfp odi dfp-34g-2c2

Hi, I’m trying 6.17-rc with my SFP stick ODI DFP-34G-2C2 and I can not get FIBRE as supported port. I’m building a nixos with frank-w repo here:

I have already edited module’s eeprom to enable 2500basex.

[root@nixos:~]# ethtool end2
Settings for end2:
	Supported ports: [ MII ]
	Supported link modes:   10baseT/Half 10baseT/Full
	                       100baseT/Half 100baseT/Full
	                       1000baseT/Half 1000baseT/Full
	                       10000baseT/Full
	                       2500baseX/Full
	                       1000baseKX/Full
	                       10000baseKX4/Full
	                       10000baseKR/Full
	                       10000baseR_FEC
	                       1000baseX/Full
	                       10000baseCR/Full
	                       10000baseSR/Full
	                       10000baseLR/Full
	                       10000baseLRM/Full
	                       10000baseER/Full
	                       2500baseT/Full
	                       5000baseT/Full
	                       100baseT1/Full
	                       1000baseT1/Full
	                       100baseFX/Half 100baseFX/Full
	                       10baseT1L/Full
	                       10baseT1S/Full
	                       10baseT1S/Half 10baseT1S_P2MP/Half 10baseT1BRR/Full
	Supported pause frame use: Symmetric Receive-only
	Supports auto-negotiation: Yes
	Supported FEC modes: Not reported
	Advertised link modes:  Not reported
	Advertised pause frame use: No
	Advertised auto-negotiation: No
	Advertised FEC modes: Not reported
	Speed: Unknown!
	Duplex: Half
	Auto-negotiation: off
	Port: MII
	PHYAD: 0
	Transceiver: internal
        Current message level: 0x000000ff (255)
                               drv probe link timer ifdown ifup rx_err tx_err
	Link detected: no
[root@nixos:~]# ethtool -m end2
	Identifier                                : 0x03 (SFP)
	Extended identifier                       : 0x04 (GBIC/SFP defined by 2-wire interface ID)
	Connector                                 : 0x01 (SC)
	Transceiver codes                         : 0x00 0x00 0x00 0x00 0x22 0x00 0x01 0x00 0x00
	Transceiver type                          : FC: Single Mode (SM)
	Encoding                                  : 0x01 (8B/10B)
	BR Nominal                                : 3100MBd
	Rate identifier                           : 0x00 (unspecified)
	Length (SMF)                              : 20km
	Length (OM2)                              : 0m
	Length (OM1)                              : 0m
	Length (Copper or Active cable)           : 0m
	Length (OM3)                              : 0m
	Laser wavelength                          : 1310nm
	Vendor name                               : ODI
	Vendor OUI                                : 00:00:00
	Vendor PN                                 : DFP-34G-2C2
	Vendor rev                                : 
	Option values                             : 0x00 0x1a
	Option                                    : TX_DISABLE implemented
	BR margin max                             : 0%
	BR margin min                             : 0%
	Vendor SN                                 : GPON23010092
	Date code                                 : 230105
[root@nixos:~]# dmesg | grep end2
[    2.026864] mtk_soc_eth 15100000.ethernet end2: renamed from eth2
[  136.637462] mtk_soc_eth 15100000.ethernet end2: autoneg setting not compatible with PCS # <-- tried ethtool -s end2 autoneg off

[root@nixos:~]# dmesg | grep sfp
[    0.997763] sfp sfp1: Host maximum power 3.0W
[    0.998442] sfp sfp2: Host maximum power 3.0W
[    1.317757] sfp sfp1: module ODI              DFP-34G-2C2      rev      sn GPON23010092     dc 230105    

[root@nixos:~]# dmesg | grep eth
[    0.000000] psci: probing for conduit method from DT.
[    1.262515] mtk_soc_eth 15100000.ethernet eth0: mediatek frame engine at 0xffffffc083240000, irq 102
[    1.276744] mtk_soc_eth 15100000.ethernet eth1: mediatek frame engine at 0xffffffc083240000, irq 102
[    1.277191] mtk_soc_eth 15100000.ethernet eth2: mediatek frame engine at 0xffffffc083240000, irq 102
[    1.317800] mtk_soc_eth 15100000.ethernet eth2: autoneg setting not compatible with PCS
[    1.456410] mtk_soc_eth 15100000.ethernet eth0: entered promiscuous mode
[    2.019135] mtk_soc_eth 15100000.ethernet end0: renamed from eth0
[    2.026385] mtk_soc_eth 15100000.ethernet end1: renamed from eth1
[    2.026864] mtk_soc_eth 15100000.ethernet end2: renamed from eth2
[  136.637462] mtk_soc_eth 15100000.ethernet end2: autoneg setting not compatible with PCS

I also tried this patch below to force 2500-basex, to no avail:

Date: Sat, 6 Sep 2025 15:51:45 +0200
Subject: [PATCH] sfp: quirks to enable 2500base-x

---
 drivers/net/phy/sfp.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/phy/sfp.c b/drivers/net/phy/sfp.c
index 5347c95d1e77..a4188fd774eb 100644
--- a/drivers/net/phy/sfp.c
+++ b/drivers/net/phy/sfp.c
@@ -543,6 +543,7 @@ static const struct sfp_quirk sfp_quirks[] = {
 	SFP_QUIRK_F("Turris", "RTSFP-2.5G", sfp_fixup_rollball),
 	SFP_QUIRK_F("Turris", "RTSFP-10", sfp_fixup_rollball),
 	SFP_QUIRK_F("Turris", "RTSFP-10G", sfp_fixup_rollball),
+	SFP_QUIRK_M("ODI", "DFP-34G-2C2", sfp_quirk_2500basex),
 };
 
 static size_t sfp_strlen(const char *str, size_t maxlen)
-- 
2.51.0

I also don’t observe this issue with branch 6.12-main, module works fine on that branch. (FIBRE 2500 basex) Maybe 6.17-rc is lacking a couple of patches ? Thanks for kind help :slight_smile:

Is 6.15/6.16-main working?

I switched pcs patches from christians version to daniels because of changes (sram,irq) in eth driver.

FWIW, I have a tree with a somewhat smaller set of patches that I’m specifically running on NixOS (and so are a few other people): GitHub - K900/linux at bpi-r4-test

Also, you probably want to join https://matrix.to/#/#nixos-on-arm:nixos.org as we have some more users there.

Edit: also @frank-w might be interested in some of those as well - we have been having a bit of a community crisis lately so didn’t have time to upstream anything yet.

Hi @frank-w I noticed same behavior on 6.16-main branch, didn’t try 6.15-main.

@K900 Thanks a lot, I was not aware of this community, I’m joining. :slightly_smiling_face: Meanwhile I tried your bpi-r4-test branch but I’m not sure how to tune the configuration. When I use defconfig, I observe no interface except lo. I guess I miss a configuration flag, maybe CONFIG_NET_MEDIATEK_SOC (?) but even built as a module I get no ethernet interface. I cannot build it in the image directly, not sure exactly why, might be something wrong with my flake.

You should be able to use the default NixOS config.

Ok it took me a while to figure, turns out all I needed is this patch:

Still there’s an odd behavior, the link is flapping up/down and it seems to go down when there’s no more traffic on the interface. When it gets up and I ping the stick IP, the link stays up indefinitely. Thanks guys!