[openwrt/openwrt] realtek: rtl930x: Fix bringup of SFP modules
LEDE Commits
lede-commits at lists.infradead.org
Thu Jul 31 12:57:31 PDT 2025
robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/656312f9b7ced02af374236decd050708d2b3cac
commit 656312f9b7ced02af374236decd050708d2b3cac
Author: Harshal Gohel <hg at simonwunderlich.de>
AuthorDate: Fri Jul 25 13:50:36 2025 +0200
realtek: rtl930x: Fix bringup of SFP modules
The commit d2108c2c5896 ("realtek: enhance RTL930x SerDes/PLL/CMU
interoperability") removed a couple of commands for the bringup code.
One of these commands was necessary to bring up SFP modules correctly. This
one can also be found in the RTLSDK [1].
It is currently not 100% clear what this command does. But if it works
similar to the RTL8295 [2,3] (RTL8295_SDS0_ANA_MISC_REG00_REG), we could
assume that it could be the RX_ON and RX_EN bits.
[1] https://gitlab.com/olliver/openwrt/realtek_sdk/-/blob/0e2e45341a268147e3e935a8d0276b60787c1f57/loader/u-boot-2011.12/board/Realtek/switch/sdk/src/dal/longan/dal_longan_sds.c#L1104
[2] https://svanheule.net/realtek/mango/register/serdes_indrt_access_ctrl
[3] https://github.com/plappermaul/realtek-doc/blob/54589ff0afa70045abfdc71a3133aa55c76257bc/sources/rtk-dms1250/include/hal/phy/rtl8295_reg_def.h#L7726
Reported-by: Jan Fuchs <jf at simonwunderlich.de>
Fixes: d2108c2c5896 ("realtek: enhance RTL930x SerDes/PLL/CMU interoperability")
Signed-off-by: Harshal Gohel <hg at simonwunderlich.de>
Co-developed-by: Markus Stockhausen <markus.stockhausen at gmx.de>
Signed-off-by: Sharadanand Karanjkar <sk at simonwunderlich.de>
Link: https://github.com/openwrt/openwrt/pull/19582
Signed-off-by: Robert Marko <robimarko at gmail.com>
---
target/linux/realtek/files-6.12/drivers/net/phy/rtl83xx-phy.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/target/linux/realtek/files-6.12/drivers/net/phy/rtl83xx-phy.c b/target/linux/realtek/files-6.12/drivers/net/phy/rtl83xx-phy.c
index 85399151db..68680b211b 100644
--- a/target/linux/realtek/files-6.12/drivers/net/phy/rtl83xx-phy.c
+++ b/target/linux/realtek/files-6.12/drivers/net/phy/rtl83xx-phy.c
@@ -1711,9 +1711,11 @@ static int rtsds_930x_get_internal_mode(int sds)
static void rtsds_930x_set_power(int sds, bool on)
{
- int power = on ? 0 : 3;
+ int power_down = on ? 0x0 : 0x3;
+ int rx_enable = on ? 0x3 : 0x1;
- rtl9300_sds_field_w(sds, 0x20, 0x00, 7, 6, power);
+ rtl9300_sds_field_w(sds, 0x20, 0x00, 7, 6, power_down);
+ rtl9300_sds_field_w(sds, 0x20, 0x00, 5, 4, rx_enable);
}
static int rtsds_930x_config_pll(int sds, phy_interface_t interface)
More information about the lede-commits
mailing list