forked from Poco-Ye/rk-ethernet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fix_mdc_clock_2.5M.txt
38 lines (31 loc) · 1.56 KB
/
fix_mdc_clock_2.5M.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
MDC时钟要求最大不超过2.5M
############### for kernel 3.10:
--- a/kernel/drivers/net/ethernet/rockchip/gmac/stmmac_main.c
+++ b/kernel/drivers/net/ethernet/rockchip/gmac/stmmac_main.c
@@ -2836,7 +2857,7 @@ struct stmmac_priv *stmmac_dvr_probe(struct device *device,
priv->mdio_registered = false;
- priv->stmmac_clk = ((struct bsp_priv *)(priv->plat->bsp_priv))->clk_mac;
+ priv->stmmac_clk = ((struct bsp_priv *)(priv->plat->bsp_priv))->pclk_mac;
if (IS_ERR(priv->stmmac_clk)) {
pr_warn("%s: warning: cannot get CSR clock\n", __func__);
goto error_clk_get;
############### for kernel 4.4:
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index e230519..7b7f696 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -165,7 +165,7 @@
{
u32 clk_rate;
- clk_rate = clk_get_rate(priv->stmmac_clk);
+ clk_rate = clk_get_rate(priv->pclk);
/* Platform provided default clk_csr would be assumed valid
* for all other cases except for the below mentioned ones.
@@ -2886,7 +2886,7 @@ int stmmac_dvr_probe(struct device *device,
}
clk_prepare_enable(priv->stmmac_clk);
- priv->pclk = devm_clk_get(priv->device, "pclk");
+ priv->pclk = devm_clk_get(priv->device, "pclk_mac");
if (IS_ERR(priv->pclk)) {
if (PTR_ERR(priv->pclk) == -EPROBE_DEFER) {
ret = -EPROBE_DEFER;