[Armadeus-commitlog] SF.net SVN: armadeus:[1174] trunk/buildroot/target/u-boot/u-boot-1.3. 4-300-im
Brought to you by:
sszy
|
From: <th...@us...> - 2009-03-19 13:03:57
|
Revision: 1174
http://armadeus.svn.sourceforge.net/armadeus/?rev=1174&view=rev
Author: thom25
Date: 2009-03-19 13:03:48 +0000 (Thu, 19 Mar 2009)
Log Message:
-----------
[U-BOOT] fix reinitialization of network before each ping (ticket 40)
Modified Paths:
--------------
trunk/buildroot/target/u-boot/u-boot-1.3.4-300-imx27.patch
Modified: trunk/buildroot/target/u-boot/u-boot-1.3.4-300-imx27.patch
===================================================================
--- trunk/buildroot/target/u-boot/u-boot-1.3.4-300-imx27.patch 2009-03-19 12:10:26 UTC (rev 1173)
+++ trunk/buildroot/target/u-boot/u-boot-1.3.4-300-imx27.patch 2009-03-19 13:03:48 UTC (rev 1174)
@@ -2441,7 +2441,7 @@
+#########################################################################
--- ref/u-boot-1.3.4/cpu/arm926ejs/imx27/miiphy.c 1970-01-01 01:00:00.000000000 +0100
+++ u-boot-1.3.4/cpu/arm926ejs/imx27/miiphy.c 2008-12-29 16:27:49.000000000 +0100
-@@ -0,0 +1,124 @@
+@@ -0,0 +1,126 @@
+/*
+ * miiphy.c - generic phy abstraction
+ *
@@ -2466,46 +2466,48 @@
+ */
+
+#include <common.h>
-+#include "miiphy.h"
++#include "miiphy.h"
+
+int miiphy_restart_aneg(struct miiphy_device *mdev)
+{
+ uint16_t status;
+ int timeout;
+
-+ /*
-+ * Wake up from sleep if necessary
-+ * Reset PHY, then delay 300ns
-+ */
-+ mdev->write(mdev, mdev->address, MII_SPECIAL, 0x00FF);
-+ mdev->write(mdev, mdev->address, MII_BMCR, BMCR_RESET);
-+ udelay(1000);
++ mdev->read(mdev, mdev->address, MII_SPECIAL, &status);
++ if( status != 0xff){
++ /*
++ * Wake up from sleep if necessary
++ * Reset PHY, then delay 300ns
++ */
++ mdev->write(mdev, mdev->address, MII_SPECIAL, 0x00FF);
++ mdev->write(mdev, mdev->address, MII_BMCR, BMCR_RESET);
++ udelay(1000);
+
-+ if (mdev->flags & MIIPHY_FORCE_10) {
-+ printf("Forcing 10 Mbps ethernet link... ");
-+ mdev->read(mdev, mdev->address, MII_BMSR, &status);
-+ mdev->write(mdev, mdev->address, MII_BMCR, BMCR_FULLDPLX | BMCR_CTST);
-+
-+ timeout = 20;
-+ do { /* wait for link status to go down */
-+ udelay(10000);
-+ if ((timeout--) == 0) {
-+#if (DEBUG & 0x2)
-+ printf("hmmm, should not have waited...");
-+#endif
-+ break;
-+ }
++ if (mdev->flags & MIIPHY_FORCE_10) {
++ printf("Forcing 10 Mbps ethernet link... ");
+ mdev->read(mdev, mdev->address, MII_BMSR, &status);
-+ } while (status & BMSR_LSTATUS);
++ mdev->write(mdev, mdev->address, MII_BMCR, BMCR_FULLDPLX | BMCR_CTST);
+
-+ } else { /* MII100 */
-+ /*
-+ * Set the auto-negotiation advertisement register bits
-+ */
-+ mdev->write(mdev, mdev->address, MII_ADVERTISE, ADVERTISE_ALL);
-+ mdev->write(mdev, mdev->address, MII_BMCR, BMCR_ANENABLE | BMCR_ANRESTART);
++ timeout = 20;
++ do { /* wait for link status to go down */
++ udelay(10000);
++ if ((timeout--) == 0) {
++ #if (DEBUG & 0x2)
++ printf("hmmm, should not have waited...");
++ #endif
++ break;
++ }
++ mdev->read(mdev, mdev->address, MII_BMSR, &status);
++ } while (status & BMSR_LSTATUS);
++
++ } else { /* MII100 */
++ /*
++ * Set the auto-negotiation advertisement register bits
++ */
++ mdev->write(mdev, mdev->address, MII_ADVERTISE, ADVERTISE_ALL);
++ mdev->write(mdev, mdev->address, MII_BMCR, BMCR_ANENABLE | BMCR_ANRESTART);
++ }
+ }
-+
+ return 0;
+}
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|