diff options
author | Jon Smirl <jonsmirl@gmail.com> | 2009-03-11 15:08:56 -0400 |
---|---|---|
committer | John Rigby <jrigby@freescale.com> | 2009-03-13 09:58:37 -0600 |
commit | f949bd8d089ec3059c460ac829c0d919e1d7af0e (patch) | |
tree | c17fcbe2c622d590efa55d7b757651ff88a9b76e /drivers/net/mpc5xxx_fec.c | |
parent | 3c92217732edfc0016c3cbdc828471d013d23a36 (diff) | |
download | u-boot-imx-f949bd8d089ec3059c460ac829c0d919e1d7af0e.zip u-boot-imx-f949bd8d089ec3059c460ac829c0d919e1d7af0e.tar.gz u-boot-imx-f949bd8d089ec3059c460ac829c0d919e1d7af0e.tar.bz2 |
MPC5200 FEC MII speed register
Set a non-zero speed in the MII register so that MII commands will work.
Signed-off-by: Jon Smirl <jonsmirl@gmail.com>
Diffstat (limited to 'drivers/net/mpc5xxx_fec.c')
-rw-r--r-- | 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 2bf901e..0f1d1af 100644 --- a/drivers/net/mpc5xxx_fec.c +++ b/drivers/net/mpc5xxx_fec.c @@ -281,13 +281,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 @@ -640,6 +633,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 @@ -897,6 +899,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; |