]> git.ipfire.org Git - thirdparty/openwrt.git/commit
realtek: enhance RTL930x SerDes/PLL/CMU interoperability 19220/head
authorMarkus Stockhausen <markus.stockhausen@gmx.de>
Mon, 23 Jun 2025 18:12:05 +0000 (14:12 -0400)
committerRobert Marko <robimarko@gmail.com>
Fri, 11 Jul 2025 08:05:52 +0000 (10:05 +0200)
commitd2108c2c5896dcc878c7d65d8c3cd9c5b616dfae
tree6e868355ff595dc6a369e3c948288ad025aff12b
parenta854d833eabdbc3b42065927c136d75b981a1021
realtek: enhance RTL930x SerDes/PLL/CMU interoperability

The operating mode of a SerDes must be aligned with the attached PHY or
SFP module. That does not only require to change the protocol (e.g. SGMII,
10Gbase-R, ...) but also the speed (e.g. 1.25G). For this the SerDes must
be re-initialized properly.

- It must be taken into power down
- The PLL speed must be set
- Maybe the CMU (clock management unit) must be resetted
- The new mode must be set
- The state machine must be resetted
- The power must be reactivated

Until now this sequence is bugged. First the driver relies on a clean
setup from U-Boot (rtk network on) and second trying to to change mode
and PLL speeds does not work at all. And not to forget: Currently two
adjacent SerDes cannot drive SGMII/HSGMII at the same time. Fix this by
taking care about the right SerDes/PLL/CMU command init order.

P.S. This code is inspired by the work of Jan Hofmann, who tried to
enable parallel SGMII/HSGMII mode. The only missing bit was a proper CMU
reset sequence.

Signed-off-by: Jan Hoffmann <jan@3e8.eu>
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/19220
Signed-off-by: Robert Marko <robimarko@gmail.com>
target/linux/realtek/files-6.12/drivers/net/phy/rtl83xx-phy.c