]> git.ipfire.org Git - thirdparty/openwrt.git/commit
realtek: pcs: rtl931x: fix SerDes mode application 20736/head
authorJonas Jelonek <jelonek.jonas@gmail.com>
Sat, 20 Dec 2025 23:53:20 +0000 (23:53 +0000)
committerRobert Marko <robimarko@gmail.com>
Mon, 29 Dec 2025 16:06:19 +0000 (17:06 +0100)
commita0805af66c6aa6106ff04ffdd6b190623fd80a7e
treed292a678d74d1ff6d51f91347914a84e70e4f1ee
parent9efcc52a7bf61a3728ffb87f54c03ca1e8840c66
realtek: pcs: rtl931x: fix SerDes mode application

The SerDes mode setting at the end of rtpcs_931x_setup_serdes is
currently broken although it is mostly similar to what the SDK does [1].
It prevents several modes from being set, especially fiber modes. This
seems to be one (if not the only) issue for currently missing SFP
support.

Add a small helper function which takes cares of setting the mode, to
keep the still valid different procedure when using XSGMII mode. Only
this helper is called in rtpcs_931x_setup_serdes to keep it clean there.

As a functional change, call mode application in every case, not just
for SGMII, QSGMII and USXGMII. We can assume the SDK is misleading in
this case, either accidentially or on purpose. This makes SFP modules
work in theory. In practice, there still seem to be device-specific
issues which need to be fixed later. These issues may include no link
detection or link flapping.

[1] https://github.com/plappermaul/realtek-doc/blob/f7f85ffc14c6e575ad94f2b427106de533b888fe/sources/rtk-dms1250/src/dal/mango/dal_mango_construct.c#L2266

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20736
Signed-off-by: Robert Marko <robimarko@gmail.com>
target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c