From 6437a0156ad8001fb5f115e4ff5c29865acba6ed Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Thu, 30 Jul 2009 16:09:59 +0200 Subject: fec_imx: Make sure MII speed is correct before reading the phy Signed-off-by: Sascha Hauer --- drivers/net/fec_imx.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'drivers/net') diff --git a/drivers/net/fec_imx.c b/drivers/net/fec_imx.c index 067e1f3e06..35ac670767 100644 --- a/drivers/net/fec_imx.c +++ b/drivers/net/fec_imx.c @@ -54,6 +54,8 @@ static int fec_miiphy_read(struct miiphy_device *mdev, uint8_t phyAddr, uint32_t phy; /* convenient holder for the PHY */ uint64_t start; + writel(((imx_get_fecclk() >> 20) / 5) << 1, + fec->regs + FEC_MII_SPEED); /* * reading from any PHY's register is done by properly * programming the FEC's MII data register. @@ -98,6 +100,9 @@ static int fec_miiphy_write(struct miiphy_device *mdev, uint8_t phyAddr, uint32_t phy; /* convenient holder for the PHY */ uint64_t start; + writel(((imx_get_fecclk() >> 20) / 5) << 1, + fec->regs + FEC_MII_SPEED); + reg = regAddr << FEC_MII_DATA_RA_SHIFT; phy = phyAddr << FEC_MII_DATA_PA_SHIFT; -- cgit v1.2.3