if (ret)
dev_err(lane->priv->dev, "comphy%u: timed out waiting for status\n", lane->n);
return ret;
}
/* * We only support changing the speed for comphys configured for GBE. * Since that is all we do, we only poll for PLL ready status.
*/ staticint a38x_comphy_set_mode(struct phy *phy, enum phy_mode mode, int sub)
{ struct a38x_comphy_lane *lane = phy_get_drvdata(phy); unsignedint gen; int ret;
if (mode != PHY_MODE_ETHERNET) return -EINVAL;
switch (sub) { case PHY_INTERFACE_MODE_SGMII: case PHY_INTERFACE_MODE_1000BASEX:
gen = GEN_SGMII_1_25GBPS; break;
case PHY_INTERFACE_MODE_2500BASEX:
gen = GEN_SGMII_3_125GBPS; break;
default: return -EINVAL;
}
a38x_set_conf(lane, false);
a38x_comphy_set_speed(lane, gen, gen);
ret = a38x_comphy_poll(lane, COMPHY_STAT1,
COMPHY_STAT1_PLL_RDY_TX |
COMPHY_STAT1_PLL_RDY_RX,
COMPHY_STAT1_PLL_RDY_TX |
COMPHY_STAT1_PLL_RDY_RX);
if (WARN_ON(args->args[0] >= MAX_A38X_PORTS)) return ERR_PTR(-EINVAL);
phy = of_phy_simple_xlate(dev, args); if (IS_ERR(phy)) return phy;
lane = phy_get_drvdata(phy); if (lane->port >= 0) return ERR_PTR(-EBUSY);
lane->port = args->args[0];
val = readl_relaxed(lane->priv->base + COMPHY_SELECTOR);
val = (val >> (4 * lane->n)) & 0xf;
if (!gbe_mux[lane->n][lane->port] ||
val != gbe_mux[lane->n][lane->port]) {
dev_warn(lane->priv->dev, "comphy%u: not configured for GBE\n", lane->n);
phy = ERR_PTR(-EINVAL);
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.