]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: phy: realtek: enable serdes option mode for RTL8226-CG
authorMarkus Stockhausen <markus.stockhausen@gmx.de>
Fri, 15 Aug 2025 08:20:09 +0000 (04:20 -0400)
committerJakub Kicinski <kuba@kernel.org>
Wed, 20 Aug 2025 01:09:52 +0000 (18:09 -0700)
commit3a752e67800106a5c42d802d67e06c60aa71d07b
tree3bb765fdd27e1d0fe9d3d4f62e0e84ff69f393b3
parent09bde6fdcd752b4512e7b554a3259e4f6b77c6d1
net: phy: realtek: enable serdes option mode for RTL8226-CG

The RTL8226-CG can make use of the serdes option mode feature to
dynamically switch between SGMII and 2500base-X. From what is
known the setup sequence is much simpler with no magic values.

Convert the exiting config_init() into a helper that configures
the PHY depending on generation 1 or 2. Call the helper from two
separated new config_init() functions.

Finally convert the phy_driver specs of the RTL8226-CG to make
use of the new configuration and switch over to the extended
read_status() function to dynamically change the interface
according to the serdes mode.

Remark! The logic could be simpler if the serdes mode could be
set before all other generation 2 magic values. Due to missing
RTL8221B test hardware the mmd command order was kept.

Tested on Zyxel XGS1210-12.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://patch.msgid.link/20250815082009.3678865-1-markus.stockhausen@gmx.de
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/phy/realtek/realtek_main.c