1
0
Fork 0
forked from mirror/openwrt

realtek: dsa: remove sds_num entirely

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>
This commit is contained in:
Jonas Jelonek 2025-10-27 19:30:06 +00:00 committed by Robert Marko
parent 447415b167
commit 3570dee5f0
3 changed files with 0 additions and 41 deletions

View 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)

View 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;
}

View 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;