net: gem: Do not initialize BDs again

BDs can be correctly setup just once and init function
performs only phy autodetection and enabling RX/TX.
RX/TX are disabled in halt function.

This patch solves the problem with repeatable tftp transfers.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Tom Rini <trini@ti.com>
This commit is contained in:
Michal Simek 2013-01-24 13:04:12 +01:00
parent 3b90d0afe5
commit 058687597d

View file

@ -134,6 +134,7 @@ struct zynq_gem_priv {
u32 rxbd_current;
u32 rx_first_buf;
int phyaddr;
int init;
struct phy_device *phydev;
struct mii_dev *bus;
};
@ -239,6 +240,7 @@ static int zynq_gem_init(struct eth_device *dev, bd_t * bis)
SUPPORTED_1000baseT_Half |
SUPPORTED_1000baseT_Full;
if (!priv->init) {
/* Disable all interrupts */
writel(0xFFFFFFFF, &regs->idr);
@ -248,7 +250,9 @@ static int zynq_gem_init(struct eth_device *dev, bd_t * bis)
writel(0, &regs->rxsr);
writel(0, &regs->phymntnc);
/* Clear the Hash registers for the mac address pointed by AddressPtr */
/* Clear the Hash registers for the mac address
* pointed by AddressPtr
*/
writel(0x0, &regs->hashl);
/* Write bits [63:32] in TOP */
writel(0x0, &regs->hashh);
@ -264,7 +268,8 @@ static int zynq_gem_init(struct eth_device *dev, bd_t * bis)
for (i = 0; i < RX_BUF; i++) {
priv->rx_bd[i].status = 0xF0000000;
priv->rx_bd[i].addr = (u32)((char *) &(priv->rxbuffers) +
priv->rx_bd[i].addr =
(u32)((char *)&(priv->rxbuffers) +
(i * PKTSIZE_ALIGN));
}
/* WRAP bit to last BD */
@ -283,6 +288,9 @@ static int zynq_gem_init(struct eth_device *dev, bd_t * bis)
setbits_le32(&regs->nwctrl, ZYNQ_GEM_NWCTRL_MDEN_MASK |
ZYNQ_GEM_NWCTRL_RXEN_MASK | ZYNQ_GEM_NWCTRL_TXEN_MASK);
priv->init++;
}
/* interface - look at tsec */
phydev = phy_connect(priv->bus, priv->phyaddr, dev, 0);