[SOLVED] BPI R3 and 2.5Gbps RJ45 SFP modules

Hi, I bought 2 such SFP modules for my BPI R3: https://www.aliexpress.us/item/1005005201566342.html?spm=a2g0o.order_list.order_list_main.5.251f1c241MvcH2&gatewayAdapt=4itemAdapt

Both of them are recognized by my BPI R3 with 6.14.0-rc1 kernel but I cannot establish any ethernet connection with my 1Gbps card in my PC. Here are outputs from ethtool command:

# ethtool -i end1
driver: mtk_soc_eth
version: 6.14.0-rc1-bpi-r3+
firmware-version:
expansion-rom-version:
bus-info: 15100000.ethernet
supports-statistics: yes
supports-test: no
supports-eeprom-access: no
supports-register-dump: no
supports-priv-flags: no


# ethtool  end1
Settings for end1:
        Supported ports: [ MII ]
        Supported link modes:   2500baseX/Full
                                2500baseT/Full
        Supported pause frame use: Symmetric Receive-only
        Supports auto-negotiation: Yes
        Supported FEC modes: Not reported
        Advertised link modes:  2500baseX/Full
                                2500baseT/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
        Current message level: 0x000000ff (255)
                               drv probe link timer ifdown ifup rx_err tx_err
        Link detected: no

Is there any method to “convince” these SFP’s PHY modules to switch to 1000Mbps mode?

TBH the same question concerns also the WAN port in BPI R3 - it is also working in 2.5Gbps mode.

If your PHY is not recognised, it should stay at 2500base-x. Then the modules does the rate adaptation to 1000Mbps (sgmii)

However, kernel still has trouble with the mtk mac at 2500base-x. Checkout the latest changes of phylink.c in net-next (now in net i think). It can now handle the fact that the mac does not support inband at 2500base-x. This should help the link being detected, so it reports link up.

I built newest kernel with SHA1: 7fe0353606d77a32c4c7f2814833dd1c043ebdd2 from git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net-next.git but still the same - no communication.

And witb this:

ethtool -s end1 autoneg off

And this one will make the PHY get recognized, if the strings match:

Or you could even modify the module to activate the turris fixup, so you wouldn’t need a patch

I2csfp - sfp debugging via i2c

i2csfp sfp-X eepromfix -V Turris -N RTSFP-2.5G -E 0x1e

But you want to be sure you have the rtl8221b rollball module. That was sold by bpi store. Use at own risk.

Hi Eric, I finally got both of the SFP RJ45 modules working at 1000Mbps. I used your first two suggestions: with ethtool and patch for kernel. Thank you for your help!

Great to hear it worked, but the patch should not need ethtool to switch off autoneg, if applied to latest net-next.

I applied it to 6.14.0-rc1 but I don’t know why sometimes it worked sometimes not. After I used ethtool it is working fine. TBH I haven’t investigated it more deeply and I’ve just added some systemd script for running this ethtool for sfp1 after boot.

It has to do with the mtk MAC, it needs special treatment, which has recently been added to netdev.

I have it here:

https://ftp.woudstra.mywire.org/repo/aarch64/linux-bpirnn-git-6.14.0.rc4.bpi.0e920394cb-1-aarch64.pkg.tar.xz

I’m not sure if I understood correctly how SFP is talking with BPI R3 but I’m very curious about that. My understanding is that MAC controller of any kind of physical SFP module is already embedded in the main board as a separate chip or even in MTK CPU. Then there should be some kind of communication protocol which allows to plug in any kind of SFP module - for example with RJ45 connector or fiber. So SFP module provides only so called PHY layer and is just controlled by MAC layer from BPI R3.

Is this true or I misunderstood anything?

This is my first time when I’ve got any contact with SFP modules so I’m trying to understand how does it work.

Roughly this is true.