]> git.ipfire.org Git - thirdparty/openwrt.git/commit
realtek: mdio: rtl838x: activate combo PHY media detection 21653/head
authorMarkus Stockhausen <markus.stockhausen@gmx.de>
Fri, 23 Jan 2026 12:36:06 +0000 (13:36 +0100)
committerRobert Marko <robimarko@gmail.com>
Sat, 24 Jan 2026 10:04:55 +0000 (11:04 +0100)
commit17f12695d0838681020e598ce231af87057f955f
tree2230f1cb576987668da0cabc258d57d457eae8b3
parent87b72fefcb373da99463a7b9eaf881b968d1b71f
realtek: mdio: rtl838x: activate combo PHY media detection

There is a misunderstanding about BIT(7) aka EX_PHY_MAN_24_27 in
SMI_GLB_CTRL register. The SDK sets/clears it at different places and
it is not clear what it is for. Observation shows that it is essential
for a working MAC_LINK_MEDIA_STS register.

A RTL838x device has usally two configurations

- port 24/26 are 2 serdes driven fiber ports
- port 24-27 are 4 PHY driven combo ports

In the combo case the above bit must be set so that a switch between
copper and fiber can be detected. Cleanup the MDIO initialization
and remove the unneeded bit handling in the DSA driver.

Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/21653
Signed-off-by: Robert Marko <robimarko@gmail.com>
target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/common.c
target/linux/realtek/files-6.12/drivers/net/mdio/mdio-realtek-otto.c