net: gem: ignore tx_clk if MII is used
If the MII interface is used, the PHY is the clock master, thus don't set the clock rate. On Zynq-7000, this will prevent the following error: zynq_gem ethernet@e000b000: failed to set tx clock rate 25000000 Signed-off-by: Martin Kaistra <martin.kaistra@linutronix.de> Link: https://lore.kernel.org/r/20250415150400.136723-1-martin.kaistra@linutronix.de Signed-off-by: Michal Simek <michal.simek@amd.com>
This commit is contained in:

committed by
Michal Simek

parent
90df44fb4f
commit
6759bd73e9
@@ -567,12 +567,14 @@ static int zynq_gem_init(struct udevice *dev)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ret = clk_get_rate(&priv->tx_clk);
|
if (priv->interface != PHY_INTERFACE_MODE_MII) {
|
||||||
if (ret != clk_rate) {
|
ret = clk_get_rate(&priv->tx_clk);
|
||||||
ret = clk_set_rate(&priv->tx_clk, clk_rate);
|
if (ret != clk_rate) {
|
||||||
if (IS_ERR_VALUE(ret)) {
|
ret = clk_set_rate(&priv->tx_clk, clk_rate);
|
||||||
dev_err(dev, "failed to set tx clock rate %ld\n", clk_rate);
|
if (IS_ERR_VALUE(ret)) {
|
||||||
return ret;
|
dev_err(dev, "failed to set tx clock rate %ld\n", clk_rate);
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user