Commit f949bd8d089ec3059c460ac829c0d919e1d7af0e

Authored by Jon Smirl
Committed by John Rigby
1 parent 3c92217732

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>

Showing 1 changed file with 16 additions and 7 deletions Side-by-side Diff

drivers/net/mpc5xxx_fec.c
... ... @@ -281,13 +281,6 @@
281 281 }
282 282  
283 283 fec->eth->x_cntrl = 0x00000000; /* half-duplex, heartbeat disabled */
284   - if (fec->xcv_type != SEVENWIRE) {
285   - /*
286   - * Set MII_SPEED = (1/(mii_speed * 2)) * System Clock
287   - * and do not drop the Preamble.
288   - */
289   - fec->eth->mii_speed = (((gd->ipb_clk >> 20) / 5) << 1); /* No MII for 7-wire mode */
290   - }
291 284  
292 285 /*
293 286 * Set Opcode/Pause Duration Register
... ... @@ -640,6 +633,15 @@
640 633 */
641 634 udelay(10);
642 635  
  636 + /* don't leave the MII speed set to zero */
  637 + if (fec->xcv_type != SEVENWIRE) {
  638 + /*
  639 + * Set MII_SPEED = (1/(mii_speed * 2)) * System Clock
  640 + * and do not drop the Preamble.
  641 + */
  642 + fec->eth->mii_speed = (((gd->ipb_clk >> 20) / 5) << 1); /* No MII for 7-wire mode */
  643 + }
  644 +
643 645 #if (DEBUG & 0x3)
644 646 printf("Ethernet task stopped\n");
645 647 #endif
... ... @@ -897,6 +899,13 @@
897 899 #else
898 900 #error fec->xcv_type not initialized.
899 901 #endif
  902 + if (fec->xcv_type != SEVENWIRE) {
  903 + /*
  904 + * Set MII_SPEED = (1/(mii_speed * 2)) * System Clock
  905 + * and do not drop the Preamble.
  906 + */
  907 + fec->eth->mii_speed = (((gd->ipb_clk >> 20) / 5) << 1); /* No MII for 7-wire mode */
  908 + }
900 909  
901 910 dev->priv = (void *)fec;
902 911 dev->iobase = MPC5XXX_FEC;