[U-Boot] [PATCH 18/28] SPEAr : Network driver fixes.
Vipin KUMAR
vipin.kumar at st.com
Wed Jul 14 07:09:54 CEST 2010
From: Vipin KUMAR <vipin.kumar at st.com>
The network controller mac resets hardware address stored in MAC_HI and MAC_LO
registers if mac is resetted. So, hw mac address needs to be restored in case
mac is explicitly resetted from driver.
Also the max frame length for Normal descriptor can be 0x7FF i.e 2047, so
reducing it to 1600
Signed-off-by: Vipin Kumar <vipin.kumar at st.com>
---
drivers/net/designware.c | 8 ++++++--
drivers/net/designware.h | 2 +-
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/net/designware.c b/drivers/net/designware.c
index d0d9827..3e687a5 100644
--- a/drivers/net/designware.c
+++ b/drivers/net/designware.c
@@ -148,6 +148,8 @@ static int dw_eth_init(struct eth_device *dev, bd_t *bis)
if (mac_reset(dev) < 0)
return -1;
+ dw_write_hwaddr(dev);
+
writel(FIXEDBURST | PRIORXTX_41 | BURST_16,
&dma_p->busmode);
@@ -300,8 +302,10 @@ static int eth_mdio_write(struct eth_device *dev, u8 addr, u8 reg, u16 val)
writel(miiaddr | MII_CLKRANGE_150_250M | MII_BUSY, &mac_p->miiaddr);
do {
- if (!(readl(&mac_p->miiaddr) & MII_BUSY))
+ if (!(readl(&mac_p->miiaddr) & MII_BUSY)) {
ret = 0;
+ break;
+ }
udelay(1000);
} while (timeout--);
@@ -377,7 +381,7 @@ static int configure_phy(struct eth_device *dev)
#if defined(CONFIG_DW_SEARCH_PHY)
phy_addr = find_phy(dev);
- if (phy_addr > 0)
+ if (phy_addr >= 0)
priv->address = phy_addr;
else
return -1;
diff --git a/drivers/net/designware.h b/drivers/net/designware.h
index e5828a6..42133b3 100644
--- a/drivers/net/designware.h
+++ b/drivers/net/designware.h
@@ -121,7 +121,7 @@ struct eth_dma_regs {
#define RXSTART (1 << 1)
/* Descriptior related definitions */
-#define MAC_MAX_FRAME_SZ (2048)
+#define MAC_MAX_FRAME_SZ (1600)
struct dmamacdescr {
u32 txrx_status;
--
1.6.0.2
More information about the U-Boot
mailing list