mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-05 10:31:46 +09:00
ethernet: stmmac: dwmac-rk: Add macphy clock input method for rv1126b
Change-Id: I37b33aec1fd5f7d09abfd7b3b4644e6eb5fbc78d Signed-off-by: David Wu <david.wu@rock-chips.com>
This commit is contained in:
@@ -2557,6 +2557,9 @@ static const struct rk_gmac_ops rv1126_ops = {
|
||||
#define RV1126B_RK_MACPHY_DISABLE 0
|
||||
#define RV1126B_RK_MACPHY_ENABLE BIT(31)
|
||||
|
||||
#define RV1126B_RK_MACPHY_EXTCLK_SEL_OUTPUT 0
|
||||
#define RV1126B_RK_MACPHY_EXTCLK_SEL_INPUT BIT(8)
|
||||
|
||||
#define RV1126B_RK_MACPHY_CLK_24M 0
|
||||
#define RV1126B_RK_MACPHY_CLK_50M BIT(11)
|
||||
|
||||
@@ -2680,11 +2683,14 @@ static void rv1126b_integrated_phy_power(struct rk_priv_data *priv, bool up)
|
||||
usleep_range(20, 40);
|
||||
|
||||
if (priv->clk_phy_rate == 50000000)
|
||||
regmap_write(priv->grf, RV1126B_VI_GRF_RK_MACPHY_CON2,
|
||||
RV1126B_RK_MACPHY_CLK_50M);
|
||||
value = RV1126B_RK_MACPHY_CLK_50M;
|
||||
else
|
||||
regmap_write(priv->grf, RV1126B_VI_GRF_RK_MACPHY_CON2,
|
||||
RV1126B_RK_MACPHY_CLK_24M);
|
||||
value = RV1126B_RK_MACPHY_CLK_24M;
|
||||
|
||||
value |= priv->clock_input ? RV1126B_RK_MACPHY_EXTCLK_SEL_INPUT :
|
||||
RV1126B_RK_MACPHY_EXTCLK_SEL_OUTPUT;
|
||||
|
||||
regmap_write(priv->grf, RV1126B_VI_GRF_RK_MACPHY_CON2, value);
|
||||
|
||||
regmap_write(priv->grf, RV1126B_VI_GRF_RK_MACPHY_CON0,
|
||||
RV1126B_RK_MACPHY_PHY_ID | RV1126B_RK_MACPHY_PHY_ADDR);
|
||||
|
||||
Reference in New Issue
Block a user