[BPI-R4] Zyxel PMG3000-D20B SFP module not detected

The module is not ready on insertion, it runs Linux with OpenWRT, so it needs 20~30 seconds to boot. It only pulls def0 low once it’s done booting. And before it’s booted, all communication with it will fail.

So bridgeing def0 to ground manually will make the board try to talk to the module before it’s booted, which will cause all kinds of bad issues, and will likely end up with the kernel concluding the module is broken before it has a chance to boot and operate.

For that, should use a quirk with sfp_fixup_long_startup

https://elixir.bootlin.com/linux/v6.10.7/source/drivers/net/phy/sfp.c#L343

So shorting the mosfet will trick the system in making it think it is inserted at the moment it is booted. Will work, but hotplugging would be unsafe.

Shouldn’t there be pads somewhere for those missing bridge resistors, R102 and R127?

They are under the mosfet, which indicates to me that briding it was very much intended.

Hi people,

I want to use my BPI R4 with the Telekom (Germany) Branded Zyxel PMG3000-DB20B SFP. I installed the snapshot-openwrt image on the SD-Card and insterted the SFP after it arrived. First nothing appeared in dmesg but the notice when i remove the module.

After bridging the MOSFET it got recognised, but nothing more than that. I dont have any PHY devices and cant bring up the eth2 manually.

So i just wanted to ask: What did you do to get it working?

Thanks in advance.

Nothing really, once the module gets its power, it takes some 20~30 seconds to boot up, and then it just works. Keep in mind that you need special VLAN setups for some providers, like the Telekom. And you also need to tell them the SN of your module, or ssh into the module and change it to the one you already have registered.

Does this help?

If it’s Telekom, there is no DHCP. You need to do PPPoE on VLAN 7 once the GPON link is established. The link of the interface itself should eventually come up on its own, and you can then manually assign a static IP to it and ssh into the OpenWRT on the SFP module to change setting/SN/… To go online, you add a VLAN interface for VLAN 7 on top, and then do PPPoE with your provided credentials. For IPv6, you then do DHCPv6 PD on top of the established PPPoE link.

The Module is actually already configured to the Telekom side. And i configured the network like this:

config interface 'sfp'
	option proto 'static'
	option ipaddr '10.10.1.2'
	option netmask '255.255.255.0'
	option gateway '10.10.1.1'
	option device 'eth2.7'
config vlan
	option device 'eth2'
	option vid '7'

In dmesg i find only these lines regarding sfp and eth2:

[   10.506008] sfp sfp1: Host maximum power 3.0W
[   10.510860] sfp sfp2: Host maximum power 3.0W
[   10.832644] sfp sfp2: module ZYXEL PMG3000-D20B rev V1.0 sn S234107503784 dc 150525
[    4.724506] mtk_soc_eth 15100000.ethernet eth2: mediatek frame engine at 0xffffffc082900000, irq 103
[   13.575165] mtk_soc_eth 15100000.ethernet eth2: configuring for inband/10gbase-r link mode

I’d recommend not configuring the ssh interface unless you really want to connect to it right now. The OpenWRT on there is horrendously insecure and ancient, so better not expose it in any way.

10G is wrong though, the module by default runs in 1G mode, and can be configured to 2.5G mode, but host support for that mode is uncertain, and setting that mode is immediate and irreversible. If you are trying to access it like it’s a 10G SFP module, there’s your issue right there.

Was this from a reboot? It takes longer then that for the sfp to finish boot, so was it booted before, or was this too soon?

Depending on how long BL2 and uboot took to load, and how long of a timeout is set in uboot, this could be right on time actually.

Forgot those seconds :wink:

Now just set it to sgmii/1000base-x

Thanks for the quick answer. The eth2 is configured to MII and eththool says it only supports MII:

Settings for eth2:
	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
	                        1000baseX/Full
	                        10000baseCR/Full
	                        10000baseSR/Full
	                        10000baseLR/Full
	                        10000baseLRM/Full
	                        10000baseER/Full
	                        2500baseT/Full
	                        5000baseT/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: No
	Advertised FEC modes: Not reported
	Speed: 1000Mb/s
	Duplex: Full
	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

ethtool looks like this for me, on 6.10.8-bpi-r4-main, which if Franks 6.10-main tree rebased on top of 6.10.8.

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

Have you already set the correct speed?

Assuming you have done already:

ip link set eth2 up

Sometimes a bug is found after doing:

ip link set eth2 down
ip link set eth2 up

Did you already see sgmii or 1000base-x in the line:

[ 13.575165] mtk_soc_eth 15100000.ethernet eth2: configuring for inband/10gbase-r link mode

Donnow if this is activated in your openwrt, but you may get more useful dmesg output after:

echo "file drivers/net/phy/* +p" > /sys/kernel/debug/dynamic_debug/control

Also strange there is no 1000base-x in:

But not sure if this is a problem when autoneg is off. You could try setting it manually:

ethtool -s eth2 advertise 0x20000000000

I remember reading somewhere that the OpenWRT build only supports 10G sfp module, but I don’t recall the reason or how to remedy it. On normal Linux the module just worked out of the box, with the kernel auto-negotiating the speed and mode with it.

I have a spare SD card so i will try to build the Debian images and have a look if it works there. Do you mind sharing what image you used or the build options?

The speed is read from eeprom, negotiation is turned off.

I also do not use openwrt, and I really don’t know, of all different version out there, which one suipports what. Hopefully eventually all is supported.

I’m running Gentoo on mine, so there is no image or anything I could provide. But anything running Franks latest 6.9/6.10/6.11 kernels should just work.