realtek: add SerDes PCS driver
authorMarkus Stockhausen <[email protected]>
Wed, 17 Sep 2025 18:22:25 +0000 (14:22 -0400)
committerRobert Marko <[email protected]>
Sat, 20 Sep 2025 10:51:23 +0000 (12:51 +0200)
commitfe27cce1ecb78d3f26137d44d8a20845a18af3ec
tree7815849b481f3c261118561a3f8db8be268188bd
parent06c895f5d3a98669aa0f6ac3a06815474e57234d
realtek: add SerDes PCS driver

Until now the the SerDes configuration is realized with helper functions
scattered around the DSA and PHY driver. Give them a new home as a PCS
driver.

The target design is as follows:

- dsa driver manages switch
- pcs driver manages SerDes on high level (this commit)
- mdio driver manages SerDes on low level

This driver adds the high level SerDes access via PCS. It makes use of
the low level mdio SerDes driver to access the registers.

Remark: This initial version provides exactly all phylink_pcs_ops that
are currently part of the DSA driver. So this can be swapped in one of
the next commits as a drop in replacement. To make use of it something
like this is needed:

...
ports = of_get_child_by_name(node, "ethernet-ports");
if (!ports)
return -EINVAL;

for_each_available_child_of_node(ports, port) {
pcs_node = of_parse_phandle(port, "pcs-handle", 0);
of_property_read_u32(port, "reg", &port_nr)) {

priv->pcs[port_nr] = rtpcs_create(dev, pcs_node, port_nr);
}
...

Signed-off-by: Markus Stockhausen <[email protected]>
Link: https://github.com/openwrt/openwrt/pull/20075
Signed-off-by: Robert Marko <[email protected]>
12 files changed:
target/linux/realtek/dts/rtl838x.dtsi
target/linux/realtek/dts/rtl839x.dtsi
target/linux/realtek/dts/rtl930x.dtsi
target/linux/realtek/dts/rtl931x.dtsi
target/linux/realtek/files-6.12/drivers/net/pcs/pcs-rtl-otto.c [new file with mode: 0644]
target/linux/realtek/patches-6.12/730-add-pcs-rtl-otto.patch [new file with mode: 0644]
target/linux/realtek/rtl838x/config-6.12
target/linux/realtek/rtl839x/config-6.12
target/linux/realtek/rtl930x/config-6.12
target/linux/realtek/rtl930x_nand/config-6.12
target/linux/realtek/rtl931x/config-6.12
target/linux/realtek/rtl931x_nand/config-6.12