public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Jon <jonsmirl@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] MPC5200 FEC MII speed register
Date: Wed, 11 Mar 2009 15:08:56 -0400	[thread overview]
Message-ID: <20090311190856.24261.51147.stgit@localhost> (raw)

From: Jon Smirl <jonsmirl@gmail.com>

Set a non-zero speed in the MII register so that MII commands will work.

Signed-off-by: Jon Smirl <jonsmirl@gmail.com>
---
 drivers/net/mpc5xxx_fec.c |   23 ++++++++++++++++-------
 1 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/drivers/net/mpc5xxx_fec.c b/drivers/net/mpc5xxx_fec.c
index 89e91c3..1876b76 100644
--- a/drivers/net/mpc5xxx_fec.c
+++ b/drivers/net/mpc5xxx_fec.c
@@ -285,13 +285,6 @@ static int mpc5xxx_fec_init(struct eth_device *dev, bd_t * bis)
 	}
 
 	fec->eth->x_cntrl = 0x00000000;	/* half-duplex, heartbeat disabled */
-	if (fec->xcv_type != SEVENWIRE) {
-		/*
-		 * Set MII_SPEED = (1/(mii_speed * 2)) * System Clock
-		 * and do not drop the Preamble.
-		 */
-		fec->eth->mii_speed = (((gd->ipb_clk >> 20) / 5) << 1); /* No MII for 7-wire mode */
-	}
 
 	/*
 	 * Set Opcode/Pause Duration Register
@@ -649,6 +642,15 @@ static void mpc5xxx_fec_halt(struct eth_device *dev)
 	 */
 	udelay(10);
 
+	/* don't leave the MII speed set to zero */
+	if (fec->xcv_type != SEVENWIRE) {
+		/*
+		 * Set MII_SPEED = (1/(mii_speed * 2)) * System Clock
+		 * and do not drop the Preamble.
+		 */
+		fec->eth->mii_speed = (((gd->ipb_clk >> 20) / 5) << 1); /* No MII for 7-wire mode */
+	}
+
 #if (DEBUG & 0x3)
 	printf("Ethernet task stopped\n");
 #endif
@@ -906,6 +908,13 @@ int mpc5xxx_fec_initialize(bd_t * bis)
 #else
 #error fec->xcv_type not initialized.
 #endif
+	if (fec->xcv_type != SEVENWIRE) {
+		/*
+		 * Set MII_SPEED = (1/(mii_speed * 2)) * System Clock
+		 * and do not drop the Preamble.
+		 */
+		fec->eth->mii_speed = (((gd->ipb_clk >> 20) / 5) << 1); /* No MII for 7-wire mode */
+	}
 
 	dev->priv = (void *)fec;
 	dev->iobase = MPC5XXX_FEC;

             reply	other threads:[~2009-03-11 19:08 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-11 19:08 Jon [this message]
2009-03-13  3:26 ` [U-Boot] [PATCH] MPC5200 FEC MII speed register Jon Smirl
2009-03-13  7:26   ` Wolfgang Denk
2009-03-13 13:23 ` [U-Boot] Fwd: " Jon Smirl
2009-03-13 16:28   ` John Rigby

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090311190856.24261.51147.stgit@localhost \
    --to=jonsmirl@gmail.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox