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