MLK-23405 net: stmmac: mdio bus reset is not necessary during resume back
mdio bus reset should not happen during resume back for most of phys, so let mdio bus reset is decided by dts. Reviewed-by: Richard Zhu <hongxing.zhu@nxp.com> Signed-off-by: Fugang Duan <fugang.duan@nxp.com>5.4-rM2-2.2.x-imx-squashed
parent
d364df4b4b
commit
27873b4e39
|
@ -174,6 +174,7 @@ struct stmmac_priv {
|
|||
struct stmmac_channel channel[STMMAC_CH_MAX];
|
||||
|
||||
int speed;
|
||||
bool mdio_rst_after_resume;
|
||||
unsigned int flow_ctrl;
|
||||
unsigned int pause;
|
||||
struct mii_bus *mii;
|
||||
|
|
|
@ -5024,7 +5024,7 @@ int stmmac_resume(struct device *dev)
|
|||
if (priv->plat->clk_ptp_ref)
|
||||
clk_prepare_enable(priv->plat->clk_ptp_ref);
|
||||
/* reset the phy so that it's ready */
|
||||
if (priv->mii)
|
||||
if (priv->mii && priv->mdio_rst_after_resume)
|
||||
stmmac_mdio_reset(priv->mii);
|
||||
}
|
||||
|
||||
|
|
|
@ -313,6 +313,8 @@ int stmmac_mdio_reset(struct mii_bus *bus)
|
|||
device_property_read_u32_array(priv->device,
|
||||
"snps,reset-delays-us",
|
||||
delays, ARRAY_SIZE(delays));
|
||||
priv->mdio_rst_after_resume = of_property_read_bool(priv->device->of_node,
|
||||
"mdio_rst_after_resume");
|
||||
|
||||
if (delays[0])
|
||||
msleep(DIV_ROUND_UP(delays[0], 1000));
|
||||
|
@ -324,6 +326,8 @@ int stmmac_mdio_reset(struct mii_bus *bus)
|
|||
gpiod_set_value_cansleep(reset_gpio, 0);
|
||||
if (delays[2])
|
||||
msleep(DIV_ROUND_UP(delays[2], 1000));
|
||||
|
||||
devm_gpiod_put(priv->device, reset_gpio);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in New Issue