mirror of
https://git.openwrt.org/openwrt/openwrt.git
synced 2025-09-20 20:59:22 +00:00
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 <markus.stockhausen@gmx.de> Link: https://github.com/openwrt/openwrt/pull/20075 Signed-off-by: Robert Marko <robimarko@gmail.com>