From: Jon Smirl Date: Thu, 12 Mar 2009 23:26:38 -0400 Subject: [U-Boot] [PATCH] MPC5200 FEC MII speed register In-Reply-To: <20090311190856.24261.51147.stgit@localhost> References: <20090311190856.24261.51147.stgit@localhost> Message-ID: <9e4733910903122026h638e6cbfl89fa30664dcffd2@mail.gmail.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Wed, Mar 11, 2009 at 3:08 PM, Jon wrote: > From: Jon Smirl Who's the maintainer for the mpc5200 core code? It isn't clear from the MAINTAINERS file. > Set a non-zero speed in the MII register so that MII commands will work. > > Signed-off-by: Jon Smirl > --- > ?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; > > -- Jon Smirl jonsmirl at gmail.com