diff options
author | Albert ARIBAUD <albert.u.boot@aribaud.net> | 2014-02-19 12:04:45 +0100 |
---|---|---|
committer | Albert ARIBAUD <albert.u.boot@aribaud.net> | 2014-02-19 12:04:45 +0100 |
commit | e7538fee991308c16f76f7eca2517089f2a30ff4 (patch) | |
tree | 13530e6f549f997d680eaaba087bdb32f68989b6 /drivers/net | |
parent | 1feb6e3c9216a34885f24f0df4a02a30dfb35f19 (diff) | |
parent | da781c60e5d55904d77931fcb63f25e65e2228be (diff) | |
download | u-boot-imx-e7538fee991308c16f76f7eca2517089f2a30ff4.zip u-boot-imx-e7538fee991308c16f76f7eca2517089f2a30ff4.tar.gz u-boot-imx-e7538fee991308c16f76f7eca2517089f2a30ff4.tar.bz2 |
Merge branch 'u-boot-imx/master' into 'u-boot-arm/master'
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/fec_mxc.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c index 3b2b995..4cefda4 100644 --- a/drivers/net/fec_mxc.c +++ b/drivers/net/fec_mxc.c @@ -128,8 +128,12 @@ static void fec_mii_setspeed(struct ethernet_regs *eth) * Set MII_SPEED = (1/(mii_speed * 2)) * System Clock * and do not drop the Preamble. */ - writel((((imx_get_fecclk() / 1000000) + 2) / 5) << 1, - ð->mii_speed); + register u32 speed = DIV_ROUND_UP(imx_get_fecclk(), 5000000); +#ifdef FEC_QUIRK_ENET_MAC + speed--; +#endif + speed <<= 1; + writel(speed, ð->mii_speed); debug("%s: mii_speed %08x\n", __func__, readl(ð->mii_speed)); } |