Unable to access SFP port on D-LINK DGS-1210-28

Hello all, I have D-link DGS-1210-28 (F1 version) in which I flashed OpenWRT. The switch has 28 ports out of which 24 are normal ports and the last 4 are dual SFP ports. That means if I have an SFP plugged in the ports 24-28 cannot be used as normal ports. If SFP is not plugged then ports 24-28 work as normal ports.

OpenWrt 21.02.0-rc3, r16172-2aba3e9784 is the version I have flashed into my switch

PROBLEM
The problem is no matter, whether I connect SFP or not, my port 24-28 are working as normal ports.

MY OBSERVATIONS

  1. If I don't connect my SFP cables then my port 24-28 are working as expected
  2. The bootlog says
[   14.065639] rtl83xx-switch switch@bb000000 lan1 (uninitialized): PHY [mdio-bus:00] driver [Realtek RTL8218B (external)]
[   14.080641] rtl83xx-switch switch@bb000000 lan2 (uninitialized): PHY [mdio-bus:01] driver [Realtek RTL8218B (external)]
[   14.095442] rtl83xx-switch switch@bb000000 lan3 (uninitialized): PHY [mdio-bus:02] driver [Realtek RTL8218B (external)]
[   14.110542] rtl83xx-switch switch@bb000000 lan4 (uninitialized): PHY [mdio-bus:03] driver [Realtek RTL8218B (external)]
[   14.125941] rtl83xx-switch switch@bb000000 lan5 (uninitialized): PHY [mdio-bus:04] driver [Realtek RTL8218B (external)]
[   14.140946] rtl83xx-switch switch@bb000000 lan6 (uninitialized): PHY [mdio-bus:05] driver [Realtek RTL8218B (external)]
[   14.155846] rtl83xx-switch switch@bb000000 lan7 (uninitialized): PHY [mdio-bus:06] driver [Realtek RTL8218B (external)]
[   14.170744] rtl83xx-switch switch@bb000000 lan8 (uninitialized): PHY [mdio-bus:07] driver [Realtek RTL8218B (external)]
[   14.185642] rtl83xx-switch switch@bb000000 lan9 (uninitialized): PHY [mdio-bus:08] driver [Realtek RTL8218B (internal)]
[   14.210729] rtl83xx-switch switch@bb000000 lan10 (uninitialized): PHY [mdio-bus:09] driver [Realtek RTL8218B (internal)]
[   14.236243] rtl83xx-switch switch@bb000000 lan11 (uninitialized): PHY [mdio-bus:0a] driver [Realtek RTL8218B (internal)]
[   14.261752] rtl83xx-switch switch@bb000000 lan12 (uninitialized): PHY [mdio-bus:0b] driver [Realtek RTL8218B (internal)]
[   14.287258] rtl83xx-switch switch@bb000000 lan13 (uninitialized): PHY [mdio-bus:0c] driver [Realtek RTL8218B (internal)]
[   14.312771] rtl83xx-switch switch@bb000000 lan14 (uninitialized): PHY [mdio-bus:0d] driver [Realtek RTL8218B (internal)]
[   14.338283] rtl83xx-switch switch@bb000000 lan15 (uninitialized): PHY [mdio-bus:0e] driver [Realtek RTL8218B (internal)]
[   14.363790] rtl83xx-switch switch@bb000000 lan16 (uninitialized): PHY [mdio-bus:0f] driver [Realtek RTL8218B (internal)]
[   14.389295] rtl83xx-switch switch@bb000000 lan17 (uninitialized): PHY [mdio-bus:10] driver [REALTEK RTL8218D]
[   14.413953] rtl83xx-switch switch@bb000000 lan18 (uninitialized): PHY [mdio-bus:11] driver [REALTEK RTL8218D]
[   14.438616] rtl83xx-switch switch@bb000000 lan19 (uninitialized): PHY [mdio-bus:12] driver [REALTEK RTL8218D]
[   14.462856] rtl83xx-switch switch@bb000000 lan20 (uninitialized): PHY [mdio-bus:13] driver [REALTEK RTL8218D]
[   14.487086] rtl83xx-switch switch@bb000000 lan21 (uninitialized): PHY [mdio-bus:14] driver [REALTEK RTL8218D]
[   14.511321] rtl83xx-switch switch@bb000000 lan22 (uninitialized): PHY [mdio-bus:15] driver [REALTEK RTL8218D]
[   14.535565] rtl83xx-switch switch@bb000000 lan23 (uninitialized): PHY [mdio-bus:16] driver [REALTEK RTL8218D]
[   14.560226] rtl83xx-switch switch@bb000000 lan24 (uninitialized): PHY [mdio-bus:17] driver [REALTEK RTL8218D]
[   14.574266] rtl83xx-switch switch@bb000000 lan25 (uninitialized): PHY [mdio-bus:18] driver [Realtek RTL8214FC]
[   14.588326] rtl83xx-switch switch@bb000000 lan26 (uninitialized): PHY [mdio-bus:19] driver [Realtek RTL8214FC]
[   14.602381] rtl83xx-switch switch@bb000000 lan27 (uninitialized): PHY [mdio-bus:1a] driver [Realtek RTL8214FC]
[   14.616425] rtl83xx-switch switch@bb000000 lan28 (uninitialized): PHY [mdio-bus:1b] driver [Realtek RTL8214FC]
[   14.629768] rtl83xx-switch switch@bb000000: configuring for fixed/internal link mode

This shows last 4 ports are loaded with different driver supporting SFP.

if you run ethtool on the port, do you see FIBRE listed in "Supported ports:"? Does it work if you try to switch to fibre, using something like

ethtool -s lan28 port fibre

Thank You very much for the solution, ethtool worked !!!. But what seemed to me is that we need to manually change the port to fibre. Can we do something so that it autodetects fibre? The current mode was MII?

Great that the manual workaround helped!

IIUC, this code is supposed to do auto medium selection:
https://git.openwrt.org/?p=openwrt/openwrt.git;a=blob;f=target/linux/realtek/files-5.4/drivers/net/phy/rtl83xx-phy.c;h=3e187228a9a37ae3979bc998234a86403a5bf94c;hb=HEAD#l1436

@kobi will know more, I guess.

There is no auto configuration between fibre and copper in the openwrt code. The original firmware supports this in a limited way. I think Cooper always wins when there is a cable in the ethernet port and both are connected. It should be possible to do some sensing using the sfp subsystem I guess.

@kobi Thanks for the reply? On the OpenWRT side can we have ethtool exposed at luci? What I mean to say is that can we have an option in the web interface that which ports we want to configure as Fiber?

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.