From 1a5e8733a01ac6d79c61463337a2d7e688cb77cf Mon Sep 17 00:00:00 2001 From: Jonas Jelonek Date: Thu, 24 Sep 2026 11:46:09 +0000 Subject: [PATCH] realtek: pcs: rtl931x: prepare 100BASE-X support RTL931x handles 100BASE-X through its 1G fiber digital path, but the FIB1G link detector must remain disabled at 100 Mbps. Add 100BASE-X to the fiber setup and symbol-error handling paths. Share the 1000BASE-X setup while selecting the appropriate FIB1G link-enable value for each mode. Keep the mode unavailable until the shared RTL93xx support is enabled. Link: https://github.com/openwrt/openwrt/pull/25378 Signed-off-by: Jonas Jelonek --- .../realtek/files-6.18/drivers/net/pcs/pcs-rtl-otto.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/target/linux/realtek/files-6.18/drivers/net/pcs/pcs-rtl-otto.c b/target/linux/realtek/files-6.18/drivers/net/pcs/pcs-rtl-otto.c index 7b4a60ac989..82305ea2a22 100644 --- a/target/linux/realtek/files-6.18/drivers/net/pcs/pcs-rtl-otto.c +++ b/target/linux/realtek/files-6.18/drivers/net/pcs/pcs-rtl-otto.c @@ -3298,6 +3298,7 @@ static int rtpcs_931x_sds_fiber_get_symerr(struct rtpcs_serdes *sds, case RTPCS_SDS_MODE_10GBASER: symerr = rtpcs_sds_read_bits(sds, PAGE_TGR_STD_1, 0x1, 7, 0); break; + case RTPCS_SDS_MODE_100BASEX: case RTPCS_SDS_MODE_1000BASEX: rtpcs_sds_write_bits(sds, DIGI_1(PAGE_SDS_EXT), 0x18, 2, 0, 0x0); @@ -3327,6 +3328,7 @@ static void rtpcs_931x_sds_clear_symerr(struct rtpcs_serdes *sds, rtpcs_sds_xsg_write(sds, PAGE_SDS_EXT, 0x0, 0x0); rtpcs_sds_xsg_write_bits(sds, PAGE_SDS_EXT, 0x1, 15, 8, 0x0); break; + case RTPCS_SDS_MODE_100BASEX: case RTPCS_SDS_MODE_1000BASEX: rtpcs_sds_write_bits(sds, DIGI_1(PAGE_SDS_EXT), 0x18, 2, 0, 0x0); rtpcs_sds_write_bits(sds, DIGI_1(PAGE_SDS_EXT), 0x3, 15, 8, 0x0); @@ -4038,11 +4040,14 @@ static int rtpcs_931x_sds_config_hw_mode(struct rtpcs_serdes *sds, case RTPCS_SDS_MODE_OFF: break; + case RTPCS_SDS_MODE_100BASEX: case RTPCS_SDS_MODE_1000BASEX: rtpcs_sds_write_mask(sds, DIGI_1(PAGE_FIB_EXT), FIB_EXT_REG19, RTL931X_CFG_TX_MODE, 0); rtpcs_sds_write_mask(sds, DIGI_1(PAGE_SDS), SDS_REG04, - RTL931X_CFG_EN_LINK_FIB1G, RTL931X_CFG_EN_LINK_FIB1G); + RTL931X_CFG_EN_LINK_FIB1G, + hw_mode == RTPCS_SDS_MODE_1000BASEX ? + RTL931X_CFG_EN_LINK_FIB1G : 0); break; case RTPCS_SDS_MODE_2500BASEX: