summaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
authorJason <r64343@freescale.com>2010-01-29 14:33:53 +0800
committerAlejandro Gonzalez <alex.gonzalez@digi.com>2010-05-25 11:13:35 +0200
commitec0a30a98001bb6f8df4cd40132244046f21c883 (patch)
tree258ae804fdf37b8f4cd8ece64dd097aaa1de76c8 /drivers/net
parent658906ced07a611495d1e3e3244ea7535c667f05 (diff)
ENGR00120558 FEC Fix broken and warnings on MXC
FEC Fix broken and warnings on MXC. -use the fec_platform_data structure of kernel fec.h, remove the redefinion from mach/mxc.h -use dsv_phy_done completion to make sure fec clk not disabled during phy discovery operation. Signed-off-by:Jason Liu <r64343@freescale.com> Signed-off-by: Alejandro Gonzalez <alex.gonzalez@digi.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/fec.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/drivers/net/fec.c b/drivers/net/fec.c
index 76a3f005fe29..701aed902071 100644
--- a/drivers/net/fec.c
+++ b/drivers/net/fec.c
@@ -58,9 +58,8 @@
#include <mach/hardware.h>
#define FEC_ALIGNMENT 0xf
#ifdef CONFIG_ARCH_MXS
-#include <mach/device.h>
-#endif
static unsigned char fec_mac_default[6];
+#endif
#else
#define FEC_ALIGNMENT 0x3
#endif
@@ -233,6 +232,7 @@ struct fec_enet_private {
int old_link;
int full_duplex;
struct completion anc_done;
+ struct completion dsv_phy_done;
};
static void fec_enet_mii(struct net_device *dev);
@@ -1510,7 +1510,7 @@ mii_discover_phy3(uint mii_reg, struct net_device *dev)
fep->phy = phy_info[i];
fep->phy_id_done = 1;
- clk_disable(fep->clk);
+ complete(&fep->dsv_phy_done);
}
/* Scan all of the MII PHY addresses looking for someone to respond
@@ -1642,7 +1642,6 @@ fec_enet_open(struct net_device *dev)
/* I should reset the ring buffers here, but I don't yet know
* a simple way to do that.
*/
-
clk_enable(fep->clk);
ret = fec_enet_alloc_buffers(dev);
if (ret)
@@ -1670,8 +1669,7 @@ fec_enet_open(struct net_device *dev)
schedule();
mii_do_cmd(dev, fep->phy->startup);
- wait_for_completion_timeout(&fep->anc_done,
- msecs_to_jiffies(10000));
+ wait_for_completion_timeout(&fep->anc_done, 10 * HZ);
}
fec_restart(dev, fep->full_duplex);
@@ -1964,7 +1962,10 @@ int __init fec_enet_init(struct net_device *dev, int index)
*/
fep->phy_id_done = 0;
fep->phy_addr = 0;
+
+ init_completion(&fep->dsv_phy_done);
mii_queue(dev, mk_mii_read(MII_REG_PHYIR1), mii_discover_phy);
+ wait_for_completion_timeout(&fep->dsv_phy_done, 10 * HZ);
return 0;
}
@@ -2181,6 +2182,7 @@ fec_probe(struct platform_device *pdev)
if (ret)
goto failed_register;
+ clk_disable(fep->clk);
return 0;
failed_register:
@@ -2250,7 +2252,7 @@ fec_resume(struct platform_device *dev)
fep = netdev_priv(ndev);
if (netif_running(ndev)) {
clk_enable(fep->clk);
- fec_restart(ndev, 1);
+ fec_restart(ndev, fep->full_duplex);
netif_device_attach(ndev);
}
}