Dlink dgs-1210-10p with glc-t-co SFP

Hello,
I wondered if other people have the cosmetic problem that SFP links on dlink dgs-1210-10p with glc-t-co SFP are always up even with no cable connected?

Example with no cable:

ip link
....
11: lan9@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master switch _state UP_ mode DEFAULT group default qlen 1000
    link/ether 00:00:00:01:00:00 brd ff:ff:ff:ff:ff:ff

Is that normal behavior?

I just saw now that its even up with no SFP inserted.

This is because the DTS file for the D-Link DGS-1210 series with SFP ports are still missing full support for the SFP ports. For full SFP support you need the sfp nodes defined. You can see an example of how this is done by looking at the rtl8380_zyxel_gs1900-10hp as an example. Someone would need to determine the corresponding nodes for the D-Link DGS-1210 devices.

Thanks for your insight. And what would need to be done to determine the corresponding nodes for the D-Link DGS-1210 devices? I am willing to run tests on my device if that would help.

I recall some merge requests posted to the mailing lists in late 2021 by Paul Ferster that had the relevant data. Don't recall why they were not merged. You could search the archives for the merge request and reach out to Paul and see if he is interested in re-submitting.

Seems to be this PR: realtek: DGS-1210-28 gpio lines for SFPs, reset #4654
The reason why it was retracted should not exist for the dgs-1210-10p. But of course the definitions are probably different for that model. I will try to contact lhuedepohl.
Thank you very much for pointing me in the right direction.

You probably ment this:
http://lists.openwrt.org/pipermail/openwrt-devel/2021-October/036623.html

In particular http://lists.openwrt.org/pipermail/openwrt-devel/2021-October/036625.html has the nodes for i2c0, sfp0, i2c1 and sfp1 which along with the switch0 port24 and port26 are what should enable full support for the SFP ports.

I really don't know what i am doing but it seems to work with a combination of the patch from 2021 and the dts from the dgs-1210-10mp. Here's a diff for openwrt/target/linux/realtek/dts-5.15/rtl8382_d-link_dgs-1210-10p.dts:

9a10,45
> 	/* i2c of the left SFP cage: port 9 */
> 	i2c0: i2c-gpio-0 {
> 		compatible = "i2c-gpio";
> 		sda-gpios = <&gpio1 6 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
> 		scl-gpios = <&gpio1 7 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
> 		i2c-gpio,delay-us = <2>;
> 		#address-cells = <1>;
> 		#size-cells = <0>;
> 	};
> 
> 	sfp0: sfp-p9 {
> 		compatible = "sff,sfp";
> 		i2c-bus = <&i2c0>;
> 		los-gpio = <&gpio1 9 GPIO_ACTIVE_HIGH>;
> 		mod-def0-gpio = <&gpio1 8 GPIO_ACTIVE_LOW>;
> 		tx-disable-gpio = <&gpio1 11 GPIO_ACTIVE_HIGH>;
> 	};
> 
> 	/* i2c of the right SFP cage: port 10 */
> 	i2c1: i2c-gpio-1 {
> 		compatible = "i2c-gpio";
> 		sda-gpios = <&gpio1 1 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
> 		scl-gpios = <&gpio1 2 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>;
> 		i2c-gpio,delay-us = <2>;
> 		#address-cells = <1>;
> 		#size-cells = <0>;
> 	};
> 
> 	sfp1: sfp-p10 {
> 		compatible = "sff,sfp";
> 		i2c-bus = <&i2c1>;
> 		los-gpio = <&gpio1 4 GPIO_ACTIVE_HIGH>;
> 		mod-def0-gpio = <&gpio1 3 GPIO_ACTIVE_LOW>;
> 		tx-disable-gpio = <&gpio1 12 GPIO_ACTIVE_HIGH>;
> 	};
> 
89,90d124
< 		SWITCH_SFP_PORT(24, 9, rgmii-id)
< 		SWITCH_SFP_PORT(26, 10, rgmii-id)
91a126,143
>                 port@24 {
>                         reg = <24>;
>                         label = "lan9";
>                         phy-handle = <&phy24>;
>                         phy-mode = "1000base-x";
>                         managed = "in-band-status";
>                         sfp = <&sfp0>;
>                 };
> 
>                 port@26 {
>                         reg = <26>;
>                         label = "lan10";
>                         phy-handle = <&phy26>;
>                         phy-mode = "1000base-x";
>                         managed = "in-band-status";
>                         sfp = <&sfp1>;
>                 };
> 			

But unfortunately i have no idea how to make a PR from this.

Great that it works for you. I am currently on vacation, but after I return near the end of the month I'll try to find time to submit a proper pull request for the DGS-1210-10 devices. When I do, if I post a link to an image for the DGS-1210-10MP are you willing to test and provide a tested by signing? I can test the DGS-1210-10 and DGS-1210-10P, but I don't have the DGS-1210-10MP.

The DGS-1210-10MP has already proper SFP support in the DTS. I just used that DTS also as a second reference.
I personally only own a DGS-1210-10P but I could gladly test that image as a second tester once you have your pull request ready.
Have a nice rest of holidays!