SFP supply is working and GPIOs looks like to be correct (eject works), also SFP module's info is printed to dmesg correctly, but I am getting error -22 while its initialization.
Installing kmod-phy-realtek might resolve this. If so you should also add it to the default package set for this device. If not please install mdio-utils and see if the RealTek PHY is actually present on address 7 on the bus.
Reading EEPROM of sfp module is not working. Manufacture's firmware does not support it too, but kernel driver sfp reads module info. Is is possible to get it working?
root@OpenWrt:~# ethtool -i sfp
driver: mtk_soc_eth
version: 5.15.93
firmware-version:
expansion-rom-version:
bus-info: 1e100000.ethernet
supports-statistics: yes
supports-test: no
supports-eeprom-access: no
supports-register-dump: no
supports-priv-flags: no
root@OpenWrt:~# ethtool sfp
Settings for sfp:
Supported ports: [ TP AUI MII FIBRE BNC Backplane ]
Supported link modes: 10baseT/Half 10baseT/Full
100baseT/Half 100baseT/Full
1000baseT/Half 1000baseT/Full
1000baseX/Full
100baseT1/Full
1000baseT1/Full
100baseFX/Half 100baseFX/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@OpenWrt:~# ethtool -m sfp
netlink error: Not supported
root@OpenWrt:~#
Line from dmesg:
[ 10.057209] sfp sfp1: module FANG HANG FH-SB3512CDS3 rev A0 sn FS12##0908##### dc 1###20
Since the port is reported as MII, it has not been switched to SFP (FIBRE) in the kernel's perception. It looks like the device is trying to read on a MTK NIC that doesn't support eeprom reading.
Note: on the realtek target device, ethtool -i <port> reports supports-eeprom-access: no but eeprom on SFP module can be read via i2c
As I pointed out in the issue, it's simply as SFP support in at803x was not backported to OpenWrt so it's not actually attaching the SFP bus at all, and thus ethtool cannot access it.
It is true, but only for rb760igs with AR8033 PHY. SNR CPE-ME2-SFP uses other PHY - RTL8211FS. It is used by realtek driver. Latest kernel does not seem to support SFP too.
But I asked explicitly what is the PHY that SFP is hooked up to and I got the reply that its AR8033.
If its Realtek, then support needs to be added, its rather simple to add it
It's actually packaged as a kernel module in kmod-phy-realtek and installing this package should be sufficient. There is no need to have this driver built-into the kernel unless this is the only Ethernet port the device offers (in such case we do want it built-in for failsafe mode to work before any modules have been loaded).
I meant, SFP support needs to be added to the Realtek PHY driver, not the driver to OpenWrt.
As it does not register sfp_upstream_ops which would actually attach the SFP bus that is set in the DTS.