ethernet: stmmac: dwmac-rk: Set input/output before disable pclk_gmac

For rk3588, the input/output of the clock direction needs to set
the php_grf register, and the pclk of php_grf is associated with
pclk_gmac, so you need to set the input/output before closing
pclk_gmac.

Signed-off-by: David Wu <david.wu@rock-chips.com>
Change-Id: Idddec040660aaadd80d7dd6d8aba6220b65425fe
This commit is contained in:
David Wu
2022-04-18 15:35:33 +08:00
committed by Tao Huang
parent 2f4b611c2a
commit 0940193c47

View File

@@ -1982,6 +1982,10 @@ static int gmac_clk_enable(struct rk_priv_data *bsp_priv, bool enable)
}
} else {
if (bsp_priv->clk_enabled) {
if (bsp_priv->ops && bsp_priv->ops->set_clock_selection)
bsp_priv->ops->set_clock_selection(bsp_priv,
bsp_priv->clock_input, false);
if (phy_iface == PHY_INTERFACE_MODE_RMII) {
clk_disable_unprepare(bsp_priv->mac_clk_rx);
@@ -2002,9 +2006,6 @@ static int gmac_clk_enable(struct rk_priv_data *bsp_priv, bool enable)
clk_disable_unprepare(bsp_priv->pclk_xpcs);
if (bsp_priv->ops && bsp_priv->ops->set_clock_selection)
bsp_priv->ops->set_clock_selection(bsp_priv,
bsp_priv->clock_input, false);
/**
* if (!IS_ERR(bsp_priv->clk_mac))
* clk_disable_unprepare(bsp_priv->clk_mac);