]> git.ipfire.org Git - thirdparty/openwrt.git/commit
realtek: rtl930x: move serdes functions over to mdio bus 19662/head
authorMarkus Stockhausen <markus.stockhausen@gmx.de>
Mon, 4 Aug 2025 13:52:54 +0000 (09:52 -0400)
committerRobert Marko <robimarko@gmail.com>
Wed, 6 Aug 2025 08:10:58 +0000 (10:10 +0200)
commite0ba4cf0867f616c0c6a35d990763069bac7e868
treef51bf28d233f809685c966c8e3779e36972c6fb0
parent6719bf56727f873dbd62d63fe023b4cca64fb786
realtek: rtl930x: move serdes functions over to mdio bus

The migration of the RTL930x mdio/serdes access functions over to the
mdio bus is a little more complicated than for RTL83xx. There are several
places where the serdes is accessed directly. So do it in two steps. With
this first step:

- use the rtmdio prefix for the serdes reader/writer functions
- move the functions over to the bus (inside the ethernet driver)
- Adapt all callers.

This is not only a copy/paste but the serdes access will be hardened too.
For this:

- put a mutex around the read/write functions because we have only
  indirect register access through a mdio style bus.
- Verify input values to avoid data mess.

Tested-by: Bjørn Mork <bjorn@mork.no>
Tested-by: Jan Hoffmann <jan@3e8.eu>
Tested-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Signed-off-by: Markus Stockhausen <markus.stockhausen@gmx.de>
Link: https://github.com/openwrt/openwrt/pull/19662
Signed-off-by: Robert Marko <robimarko@gmail.com>
target/linux/realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.c
target/linux/realtek/files-6.12/drivers/net/ethernet/rtl838x_eth.h
target/linux/realtek/files-6.12/drivers/net/phy/rtl83xx-phy.c
target/linux/realtek/files-6.12/drivers/net/phy/rtl83xx-phy.h