public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/5] net: fec_mxc: Add 1000 Mbps selection
@ 2012-01-13 12:10 Dirk Behme
  2012-01-13 12:10 ` [U-Boot] [PATCH 2/5] net: fec_mxc: Increase autonegotiation timeout Dirk Behme
                   ` (4 more replies)
  0 siblings, 5 replies; 19+ messages in thread
From: Dirk Behme @ 2012-01-13 12:10 UTC (permalink / raw)
  To: u-boot

From: Troy Kisky <troy.kisky@boundarydevices.com>

Add 1000 Mbps selection and print negotiated speed

Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com>
CC: Troy Kisky <troy.kisky@boundarydevices.com>
CC: Stefano Babic <sbabic@denx.de>
CC: Marek Vasut <marek.vasut@gmail.com>
---
 drivers/net/fec_mxc.c |   16 +++++++++++++++-
 1 files changed, 15 insertions(+), 1 deletions(-)

diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c
index ed73353..9e8ef7a 100644
--- a/drivers/net/fec_mxc.c
+++ b/drivers/net/fec_mxc.c
@@ -379,6 +379,7 @@ static int fec_set_hwaddr(struct eth_device *dev)
 static int fec_open(struct eth_device *edev)
 {
 	struct fec_priv *fec = (struct fec_priv *)edev->priv;
+	int speed;
 
 	debug("fec_open: fec_open(dev)\n");
 	/* full-duplex, heartbeat disabled */
@@ -428,8 +429,21 @@ static int fec_open(struct eth_device *edev)
 #endif
 
 	miiphy_wait_aneg(edev);
-	miiphy_speed(edev->name, fec->phy_id);
+	speed = miiphy_speed(edev->name, fec->phy_id);
 	miiphy_duplex(edev->name, fec->phy_id);
+#ifdef CONFIG_MX6Q
+	{
+		u32 ecr = readl(&fec->eth->ecntrl) & ~(0x1 << 5);
+		u32 rcr = (readl(&fec->eth->r_cntrl) & ~0x300) | 0x44;
+		if (speed == _1000BASET)
+			ecr |= (0x1 << 5);
+		else if (speed != _100BASET)
+			rcr |= (0x1 << 9);
+		writel(ecr, &fec->eth->ecntrl);
+		writel(rcr, &fec->eth->r_cntrl);
+	}
+#endif
+	printf("%s:Speed=%i\n", __func__, speed);
 
 	/*
 	 * Enable SmartDMA receive task
-- 
1.7.0.4

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

end of thread, other threads:[~2012-01-19 18:24 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-13 12:10 [U-Boot] [PATCH 1/5] net: fec_mxc: Add 1000 Mbps selection Dirk Behme
2012-01-13 12:10 ` [U-Boot] [PATCH 2/5] net: fec_mxc: Increase autonegotiation timeout Dirk Behme
2012-01-13 12:10 ` [U-Boot] [PATCH 3/5] miiphyutil: Add Micrel KSZ9021 support to miiphy_speed Dirk Behme
2012-01-13 12:44   ` Marek Vasut
2012-01-15  0:56   ` Mike Frysinger
2012-01-19 12:38     ` Dirk Behme
2012-01-19 16:19       ` Dirk Behme
2012-01-19 18:24         ` Mike Frysinger
2012-01-19 18:24       ` Mike Frysinger
2012-01-19 12:27   ` Dirk Behme
2012-01-13 12:10 ` [U-Boot] [PATCH 4/5] net: fec_mxc: Nove autonegoatiate restart after mii_postcall Dirk Behme
2012-01-13 12:44   ` Marek Vasut
2012-01-13 21:42     ` Troy Kisky
2012-01-13 13:54   ` Stefano Babic
2012-01-13 21:22     ` Troy Kisky
2012-01-13 12:10 ` [U-Boot] [PATCH 5/5] i.mx6q: mx6qsabrelite: Update the network configuration Dirk Behme
2012-01-16 13:48   ` Jason Hui
2012-01-16 19:51     ` Troy Kisky
2012-01-13 12:42 ` [U-Boot] [PATCH 1/5] net: fec_mxc: Add 1000 Mbps selection Marek Vasut

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