Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 149772
b: refs/heads/master
c: 4f1ceb4
h: refs/heads/master
v: v3
  • Loading branch information
Sascha Hauer authored and David S. Miller committed Apr 16, 2009
1 parent 3bf5d42 commit 344a43c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 36 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4e8318368af44488f6438a31537ddb57de0d4e00
refs/heads/master: 4f1ceb4b46d523382f5a46622af9d3315a9b3e7f
39 changes: 4 additions & 35 deletions trunk/drivers/net/fec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1615,10 +1615,6 @@ int __init fec_enet_init(struct net_device *dev, int index)
fep->hwp = (void __iomem *)dev->base_addr;
fep->netdev = dev;

/* Whack a reset. We should wait for this. */
writel(1, fep->hwp + FEC_ECNTRL);
udelay(10);

/* Set the Ethernet address */
#ifdef CONFIG_M5272
fec_get_mac(dev);
Expand All @@ -1640,11 +1636,6 @@ int __init fec_enet_init(struct net_device *dev, int index)
fep->rx_bd_base = cbd_base;
fep->tx_bd_base = cbd_base + RX_RING_SIZE;

fep->dirty_tx = fep->cur_tx = fep->tx_bd_base;
fep->cur_rx = fep->rx_bd_base;

fep->skb_cur = fep->skb_dirty = 0;

/* Initialize the receive buffer descriptors. */
bdp = fep->rx_bd_base;
for (i=0; i<FEC_ENET_RX_PAGES; i++) {
Expand Down Expand Up @@ -1688,25 +1679,9 @@ int __init fec_enet_init(struct net_device *dev, int index)
bdp--;
bdp->cbd_sc |= BD_SC_WRAP;

/* Set receive and transmit descriptor base */
writel(fep->bd_dma, fep->hwp + FEC_R_DES_START);
writel((unsigned long)fep->bd_dma + sizeof(struct bufdesc) * RX_RING_SIZE,
fep->hwp + FEC_X_DES_START);

#ifdef HAVE_mii_link_interrupt
fec_request_mii_intr(dev);
#endif

writel(0, fep->hwp + FEC_GRP_HASH_TABLE_HIGH);
writel(0, fep->hwp + FEC_GRP_HASH_TABLE_LOW);
writel(PKT_MAXBLR_SIZE, fep->hwp + FEC_R_BUFF_SIZE);
writel(2, fep->hwp + FEC_ECNTRL);
writel(0, fep->hwp + FEC_R_DES_ACTIVE);
#ifndef CONFIG_M5272
writel(0, fep->hwp + FEC_HASH_TABLE_HIGH);
writel(0, fep->hwp + FEC_HASH_TABLE_LOW);
#endif

/* The FEC Ethernet specific entries in the device structure */
dev->open = fec_enet_open;
dev->hard_start_xmit = fec_enet_start_xmit;
Expand All @@ -1719,21 +1694,11 @@ int __init fec_enet_init(struct net_device *dev, int index)
mii_cmds[i].mii_next = &mii_cmds[i+1];
mii_free = mii_cmds;

/* setup MII interface */
writel(OPT_FRAME_SIZE | 0x04, fep->hwp + FEC_R_CNTRL);
writel(0, fep->hwp + FEC_X_CNTRL);

/* Set MII speed to 2.5 MHz */
fep->phy_speed = ((((clk_get_rate(fep->clk) / 2 + 4999999)
/ 2500000) / 2) & 0x3F) << 1;
writel(fep->phy_speed, fep->hwp + FEC_MII_SPEED);
fec_restart(dev, 0);

/* Clear and enable interrupts */
writel(0xffc00000, fep->hwp + FEC_IEVENT);
writel(FEC_ENET_TXF | FEC_ENET_RXF | FEC_ENET_MII,
fep->hwp + FEC_IMASK);

/* Queue up command to detect the PHY and initialize the
* remainder of the interface.
*/
Expand Down Expand Up @@ -1768,6 +1733,10 @@ fec_restart(struct net_device *dev, int duplex)
/* Reset all multicast. */
writel(0, fep->hwp + FEC_GRP_HASH_TABLE_HIGH);
writel(0, fep->hwp + FEC_GRP_HASH_TABLE_LOW);
#ifndef CONFIG_M5272
writel(0, fep->hwp + FEC_HASH_TABLE_HIGH);
writel(0, fep->hwp + FEC_HASH_TABLE_LOW);
#endif

/* Set maximum receive buffer size. */
writel(PKT_MAXBLR_SIZE, fep->hwp + FEC_R_BUFF_SIZE);
Expand Down

0 comments on commit 344a43c

Please sign in to comment.