]> git.ipfire.org Git - thirdparty/openwrt.git/commitdiff
realtek: dsa: remove sds_num entirely 20577/head
authorJonas Jelonek <jelonek.jonas@gmail.com>
Mon, 27 Oct 2025 19:30:06 +0000 (19:30 +0000)
committerRobert Marko <robimarko@gmail.com>
Sun, 2 Nov 2025 15:32:10 +0000 (16:32 +0100)
After having moved RTL93XX SerDes configuration from PHY to PCS driver,
the DSA driver doesn't need to know about SerDes explicitly anymore.

Although RTL83XX SerDes is still partly managed within the DSA driver,
it doesn't make use of the sds_num property/field. RTL93XX was the only
user of this right now.

Thus, we can just remove the remaining 'sds_num' code which doesn't
serve any purpose anymore.

Signed-off-by: Jonas Jelonek <jelonek.jonas@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/20577
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/dsa/rtl83xx/dsa.c
target/linux/realtek/files-6.12/drivers/net/dsa/rtl83xx/rtl838x.h

index 3dceb93e35bc64d22354826849ff95a96c154961..502c130d6febc8c206833f490cb64af91d9d56fb 100644 (file)
@@ -349,19 +349,6 @@ static int __init rtl83xx_mdio_probe(struct rtl838x_switch_priv *priv)
                        continue;
                }
 
-               /*
-                * TODO: phylink_pcs was completely converted to the standalone PCS driver - see
-                * rtpcs_create(). Nevertheless the DSA driver still relies on the info about the
-                * attached SerDes. As soon as the PCS driver can completely configure the SerDes
-                * this is no longer needed.
-                */
-
-               priv->ports[pn].sds_num = -1;
-               if (pcs_node)
-                       of_property_read_u32(pcs_node, "reg", &priv->ports[pn].sds_num);
-               if (priv->ports[pn].sds_num >= 0)
-                       dev_dbg(priv->dev, "port %d has SDS %d\n", pn, priv->ports[pn].sds_num);
-
                if (of_get_phy_mode(dn, &interface))
                        interface = PHY_INTERFACE_MODE_NA;
                if (interface == PHY_INTERFACE_MODE_10G_QXGMII)
index 06909d205f7342f0bfe2be9a7cf5ea180e8110cf..0e341163760f4602fc94bce1512907af02829959 100644 (file)
@@ -548,26 +548,6 @@ static int rtl93xx_setup(struct dsa_switch *ds)
        return 0;
 }
 
-static int rtl93xx_get_sds(struct phy_device *phydev)
-{
-       struct device *dev = &phydev->mdio.dev;
-       struct device_node *dn;
-       u32 sds_num;
-
-       if (!dev)
-               return -1;
-       if (dev->of_node) {
-               dn = dev->of_node;
-               if (of_property_read_u32(dn, "sds", &sds_num))
-                       sds_num = -1;
-       } else {
-               dev_err(dev, "No DT node.\n");
-               return -1;
-       }
-
-       return sds_num;
-}
-
 static struct phylink_pcs *rtldsa_phylink_mac_select_pcs(struct dsa_switch *ds,
                                                         int port,
                                                         phy_interface_t interface)
@@ -692,12 +672,8 @@ static void rtl931x_phylink_mac_config(struct dsa_switch *ds, int port,
                                        const struct phylink_link_state *state)
 {
        struct rtl838x_switch_priv *priv = ds->priv;
-       int sds_num;
        u32 reg;
 
-       sds_num = priv->ports[port].sds_num;
-       pr_info("%s: speed %d sds_num %d\n", __func__, state->speed, sds_num);
-
        reg = sw_r32(priv->r->mac_force_mode_ctrl(port));
        pr_info("%s reading FORCE_MODE_CTRL: %08x\n", __func__, reg);
 
@@ -1416,9 +1392,6 @@ static int rtldsa_port_enable(struct dsa_switch *ds, int port, struct phy_device
                sw_w32_mask(0, BIT(port), RTL930X_L2_PORT_DABLK_CTRL);
        }
 
-       if (priv->ports[port].sds_num < 0)
-               priv->ports[port].sds_num = rtl93xx_get_sds(phydev);
-
        return 0;
 }
 
index a361b8e9483410073b90f7dd8e1d20efb79726e5..5dba9d5fef0346dd76b599770914832e3bd8d05a 100644 (file)
@@ -688,7 +688,6 @@ struct rtl838x_port {
        u16 pvid;
        bool eee_enabled;
        enum phy_type phy;
-       int sds_num;
        int led_set;
        int leds_on_this_port;
        struct rtldsa_counter_state counters;