summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorFugang Duan <b38611@freescale.com>2015-04-20 18:28:48 +0800
committerMax Krummenacher <max.krummenacher@toradex.com>2016-03-09 14:42:27 +0100
commita31736ebd7661f134f003f3ea060e20914fc4c7c (patch)
tree113bde3672d40bc3ed00a3d826ab7d74dca37ddf /drivers
parentd09f56972eb7e960fccbc9f76cda2d19ae13290f (diff)
MLK-10701 net: fec_mxc: setup right value for mdio hold time
The minimal hold time according to IEE802.3 (clause 22) is 10 ns. HOLDTIME + 1 is the number of clk cycles the fec is holding the output. Set the right hold time value when the MDC root clock is greater than 100Mhz. The issue was reported on i.MX28 and is fixed by Uwe Kleine-König in kernel: https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit/ drivers/net/ethernet/freescale/fec_main.c?id=63c607321492c5efc7a31bc4ea734b877f8e7f87 Signed-off-by: Fugang Duan <B38611@freescale.com> (cherry picked from commit 0373a160e7f698064a6625e85f9120b6c81c1b61)
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/fec_mxc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c
index 1c65bd708e..1771fd4e1f 100644
--- a/drivers/net/fec_mxc.c
+++ b/drivers/net/fec_mxc.c
@@ -138,11 +138,13 @@ static void fec_mii_setspeed(struct ethernet_regs *eth)
* and do not drop the Preamble.
*/
register u32 speed = DIV_ROUND_UP(imx_get_fecclk(), 5000000);
+ register u32 holdtime = DIV_ROUND_UP(imx_get_fecclk(), 100000000) - 1;
#ifdef FEC_QUIRK_ENET_MAC
speed--;
#endif
speed <<= 1;
- writel(speed, &eth->mii_speed);
+ holdtime <<= 8;
+ writel(speed | holdtime, &eth->mii_speed);
debug("%s: mii_speed %08x\n", __func__, readl(&eth->mii_speed));
}