public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [u-boot] [PATCH] [1/2] mxc_fec: fix some erroneous PHY accesses.
@ 2009-10-19 12:16 javier Martin
  2009-10-23 14:02 ` javier Martin
  2009-10-25 19:20 ` Ben Warren
  0 siblings, 2 replies; 5+ messages in thread
From: javier Martin @ 2009-10-19 12:16 UTC (permalink / raw)
  To: u-boot

This patch fixes erroneous access to the ethernet PHY which broke the driver.
1. Selector field in the auto-negotiation register must be 0x00001 for
using 802.3, not 0x00000 which is reseved.
2. Access to the PHY address specified by CONFIG_FEC_MXC_PHYADDR, not
0x0 fixed address.

This has been tested in i.MX27 Litekit board and eldk-2.0 toolchains.

Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>
--

diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c
index bd83a24..18f0bba 100644
--- a/drivers/net/fec_mxc.c
+++ b/drivers/net/fec_mxc.c
@@ -157,7 +157,7 @@ static int miiphy_restart_aneg(struct eth_device *dev)
 	/*
 	 * Set the auto-negotiation advertisement register bits
 	 */
-	miiphy_write(dev->name, CONFIG_FEC_MXC_PHYADDR, PHY_ANAR, 0x1e0);
+	miiphy_write(dev->name, CONFIG_FEC_MXC_PHYADDR, PHY_ANAR, 0x1e1);
 	miiphy_write(dev->name, CONFIG_FEC_MXC_PHYADDR, PHY_BMCR,
 			PHY_BMCR_AUTON | PHY_BMCR_RST_NEG);

@@ -341,8 +341,8 @@ static int fec_open(struct eth_device *edev)
 	writel(FEC_ECNTRL_ETHER_EN, &fec->eth->ecntrl);

 	miiphy_wait_aneg(edev);
-	miiphy_speed(edev->name, 0);
-	miiphy_duplex(edev->name, 0);
+	miiphy_speed(edev->name, CONFIG_FEC_MXC_PHYADDR);
+	miiphy_duplex(edev->name, CONFIG_FEC_MXC_PHYADDR);

 	/*
 	 * Enable SmartDMA receive task

-- 
Javier Martin
Vista Silicon S.L.
CDTUC - FASE C - Oficina S-345
Avda de los Castros s/n
39005- Santander. Cantabria. Spain
+34 942 25 32 60
www.vista-silicon.com

^ permalink raw reply related	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-10-25 19:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-19 12:16 [U-Boot] [u-boot] [PATCH] [1/2] mxc_fec: fix some erroneous PHY accesses javier Martin
2009-10-23 14:02 ` javier Martin
2009-10-24 18:35   ` Tom
2009-10-25  6:27     ` Ben Warren
2009-10-25 19:20 ` Ben Warren

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox