Banana Pi R3 - Enable SFP to RJ45 Adapters with OpenWRT

Banana Pi R3 - Enable SFP to RJ45 Adapters (10/100/1000M)

  • (A guide for beginners and hobbyists alike)

System Info

  • Banana Pi-R3 (Board v1.1) (BPiR3v1.1)
  • OpenWRT version: 24.10.0-rc2 (Kernel 6.6 - MediaTek)
  • OWRT v23.05.0 & later supports BPiR3 (Sept 2024 & later)
  • Requirements:
    • Compatible USB to UART adapter (CP1202, CH340 or FDTI’s )
    • Working UART (serial) “Connection” to BPi-R3 console via Putty (Windows / Ubuntu)
    • Compatible SFP to RJ45 Adapter (10/100/1000M)

Adapter Types (Tested / Compatible):

  • QSFPTEK - QT-SFP-T (SFP 10/100/1000M RJ45)
    • Finisar FCLF8522P2BTL Compatible 10/100/1000BASE-T SFP SGMII Copper RJ-45 100m Transceiver Module
    • Capacity: 10/100/1000Base-T: 100m
    • 1.25G SFP to Ethernet Compatible for Cisco GLC-T/GLC-TE/GLC-TA, Mikrotik S-RJ01. Widely used in fiber switches, routers, NIC, server or other fiber optic equipments with 1Gb SFP ports.
    • 10/100/1000BASE-T SFP to RJ45 Copper for Category 5e copper wire. Gigabit SFP to RJ45 Copper Module 10/100/1000M Auto-Negotiation. Compliant with MSA standards. RJ45 connector. Reach 100m.

QSFPTEK - QT-SFP-T

  • 10Gtek - ASF-2G-T (2.5G RJ-45 Copper SFP, 100-m)
    • This adapter only works at 2.5G. It connected and was recognized but I do not have a 2.5G network to test it on.

Notes

  • Device References (for this tutorials reference):

    • eth1 → SFP1
    • sfp2 → SFP2
    • WAN → WAN
    • LAN 1 -4 → LAN 1-4

Detailed Instructions - Steps to Get SFP1 & SFP2 Part of LAN

  1. Connect Serial Bpi R3 to the USB Serial Adapter
    • (Connection is a crossover connection: Rx → Tx | Rx → Rx | Gnd → Gnd)

  1. From Putty Serial Console/Terminal, monitor response when inserting the SFP Adapter into the BPI
  • Response - Device is working - Go To STEP 4
=> [ 3200.875232] sfp sfp-2: module QSFPTEK          QT-SFP-T         rev A    sn BQT200408060     dc 200420

> [ 3201.127249] mt7530-mdio mdio-bus:1f sfp2: PHY [i2c:sfp-2:16] driver [Marvell 88E1111] (irq=POLL)
  • Response - Device needs a driver installed - Go To STEP 3
> [18634.901040] mtk_soc_eth 15100000.ethernet eth1: validation with support 00,00000000,00000000,00000000 failed: -EINVAL

> [18634.911731] sfp sfp-1: sfp_add_phy failed: -EINVAL
> sfp sfp-1: sfp_add_phy failed: -EINVAL

  1. Install the marvell driver

    Run the following:

    > opkg update
    
    > opkg install kmod-phy-marvell
    

Note: When testing this adapter, I noticed BPiR3 was able to read the EEPROM of the Adapter which lead me to believe there was a missing driver. I found this marvell driver after many hours of combing through the forums and it worked immediately. From console, inserted SFP adapter:

> [18634.901040] mtk_soc_eth 15100000.ethernet eth1: validation with support 00,00000000,00000000,00000000 failed: -EINVAL

> [18634.911731] sfp sfp-1: sfp_add_phy failed: -EINVAL
> sfp sfp-1: sfp_add_phy failed: -EINVAL

root@OpenWRT:~#  opkg update

root@OpenWRT:~#  opkg install ethtool

root@OpenWRT:~#  ethtool eth1

Settings for eth1:
    Supported ports: [ FIBRE ]
    Supported link modes:   2500baseX/Full
                            2500baseT/Full
    Supported pause frame use: Symmetric Receive-only
    Supports auto-negotiation: No
    Supported FEC modes: Not reported
    Advertised link modes:  2500baseX/Full
                            2500baseT/Full
    Advertised pause frame use: Symmetric Receive-only
    Advertised auto-negotiation: No
    Advertised FEC modes: Not reported
    Speed: 2500Mb/s
    Duplex: Full
    Port: FIBRE
    PHYAD: 0
    Transceiver: internal
    Auto-negotiation: off
    Current message level: 0x000000ff (255)
                           drv probe link timer ifdown ifup rx_err tx_err
    Link detected: no

root@OpenWRT:~#   ethtool -m eth0
Offset          Values
------          ------
0x0000:         03 04 00 00 00 00 08 00 00 00 00 01 0d 00 00 00

0x0010:         20 20 20 20 20

0x0020:         20 20 20 20 01 00 00 00 

0x0030:         20 20 20 20 20 20 20 20 41 20 20 20 00 00 c1 5e

0x0040:         

0x0050:         "Data Removed for this tutorial"

0x0060:         

0x0070:         

0x0080:         

0x0090:         20 00 00 00 00 00 00 00 c3

0x00a0:         00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0x00b0:         00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

0x00c0:         

0x00d0:         20 20 20 20 ff ff ff ff ff ff ff ff ff ff ff ff

0x00e0:         ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff

0x00f0:         ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff


root@OpenWRT:~#   opkg update

root@OpenWRT:~#   opkg install kmod-phy-marvell


> [ 3200.875232] sfp sfp-2: module QSFPTEK          QT-SFP-T         rev A    sn BQT200408060     dc 200420

> [ 3201.127249] mt7530-mdio mdio-bus:1f sfp2: PHY [i2c:sfp-2:16] driver [Marvell 88E1111] (irq=POLL)

> root@OpenWRT:~# ethtool eth1
> Settings for eth1:
    Supported ports: [ TP MII ]
    Supported link modes:   10baseT/Half 10baseT/Full
                            100baseT/Half 100baseT/Full
                            1000baseT/Half 1000baseT/Full
                            1000baseX/Full
    Supported pause frame use: Symmetric Receive-only
    Supports auto-negotiation: Yes
    Supported FEC modes: Not reported
    Advertised link modes:  10baseT/Half 10baseT/Full
                            100baseT/Half 100baseT/Full
                            1000baseT/Half 1000baseT/Full
                            1000baseX/Full
    Advertised pause frame use: Symmetric Receive-only
    Advertised auto-negotiation: Yes
    Advertised FEC modes: Not reported
    Link partner advertised link modes:  10baseT/Half 10baseT/Full
                                         100baseT/Half 100baseT/Full
                                         1000baseT/Full
    Link partner advertised pause frame use: Symmetric Receive-only
    Link partner advertised auto-negotiation: Yes
    Link partner advertised FEC modes: Not reported
    Speed: 1000Mb/s
    Duplex: Full
    Port: Twisted Pair
    PHYAD: 22
    Transceiver: external
    Auto-negotiation: on
    MDI-X: Unknown
    Current message level: 0x000000ff (255)
                           drv probe link timer ifdown ifup rx_err tx_err
    Link detected: yes

  1. Configure SFP 2 to a Bridged LAN Port
    • From Luci (By Default OPWRT has SFP2 configured as bridged LAN Port): (For Reference)
      • Luci - > Network → Interfaces → Devices tab
      • br-lan → Configure → Bridge Ports → Select sfp2 (Save, Save & Apply)

  • From Config File - Future Addition - To Be Added after tested

  1. Configure SFP 1 to a Bridged LAN Port
    • By Default, OPWRT has SFP1 configured as a bridged WAN Port, we need to remove this & then add SFP1 (eth1) to the br-lan device.
    • From Luci
      • Luci - > Network → Interfaces → Devices tab
      • br-wan → Configure → Bridge Ports → Deselect eth1 (Save)
      • Devices Tab → Unconfigure eth1 (Optional)
      • br-lan → Configure → Bridge Ports → Select eth1 (Save, Save & Apply)

  • From Config File - Future Addition - To Be Added after tested

At this point, if you didn’t make any other changes from the default installation, the ports should work as follows:

(Dev name) Port Name → Port Function

(wan) WAN → WAN

(eth1) SFP 1 → LAN 6

(sfp2) SFP 2 → LAN 5

LAN 1 → LAN 1

LAN 3 → LAN 2

LAN 3 → LAN 3

LAN 4 → LAN 4



Resourceful Links (Misc.)

Banana Pi R3

OpenWRT

Mediatek / Arm7986a

Software

Please message with edit recommendations

1 Like

Really? I tested

10Gtek ASF-2G2-T+(OEM-EU)

This one works flawlessly (at least on Debian 12.8) with 1000BASE-T Copper RJ45 or even 100BASE-T (e.g. directly connected to a Raspberry PI).

Please see this posting also

UPDATE:

great thanks for hinting me to include the Marvell driver modules.

Now even my

H!Fiber ASF-GE-T-Cisco-2pcs-HF(EU)

SFPs work as expected