summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorVipin Kumar <vipin.kumar@st.com>2012-05-07 13:06:44 +0530
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>2012-07-07 14:07:40 +0200
commit9afc1af01f2d4b033e0da5df105b399949976a12 (patch)
treef0df7ec6f543b2c6f2d0baad645cec5f96c2c289 /drivers
parent8eb0ee6a649d09a41155bf6c9dbd4d531ed41f9e (diff)
downloadu-boot-imx-9afc1af01f2d4b033e0da5df105b399949976a12.zip
u-boot-imx-9afc1af01f2d4b033e0da5df105b399949976a12.tar.gz
u-boot-imx-9afc1af01f2d4b033e0da5df105b399949976a12.tar.bz2
SPEAr: Add interface information in initialization
Few Designware peripheral registers need to be modified based on the ethernet interface selected by the board. This patch supports interface information in ethernet driver Signed-off-by: Vipin Kumar <vipin.kumar@st.com> Signed-off-by: Amit Virdi <amit.virdi@st.com> Signed-off-by: Stefan Roese <sr@denx.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/net/designware.c10
-rw-r--r--drivers/net/designware.h1
2 files changed, 10 insertions, 1 deletions
diff --git a/drivers/net/designware.c b/drivers/net/designware.c
index 9b17db4..8f22e00 100644
--- a/drivers/net/designware.c
+++ b/drivers/net/designware.c
@@ -171,6 +171,13 @@ static int dw_eth_init(struct eth_device *dev, bd_t *bis)
if (priv->speed != SPEED_1000M)
conf |= MII_PORTSELECT;
+ if ((priv->interface != PHY_INTERFACE_MODE_MII) &&
+ (priv->interface != PHY_INTERFACE_MODE_GMII)) {
+
+ if (priv->speed == SPEED_100M)
+ conf |= FES_100;
+ }
+
if (priv->duplex == FULL_DUPLEX)
conf |= FULLDPLXMODE;
@@ -531,7 +538,7 @@ static int dw_mii_write(const char *devname, u8 addr, u8 reg, u16 val)
}
#endif
-int designware_initialize(u32 id, ulong base_addr, u32 phy_addr)
+int designware_initialize(u32 id, ulong base_addr, u32 phy_addr, u32 interface)
{
struct eth_device *dev;
struct dw_eth_dev *priv;
@@ -565,6 +572,7 @@ int designware_initialize(u32 id, ulong base_addr, u32 phy_addr)
DW_DMA_BASE_OFFSET);
priv->address = phy_addr;
priv->phy_configured = 0;
+ priv->interface = interface;
if (mac_reset(dev) < 0)
return -1;
diff --git a/drivers/net/designware.h b/drivers/net/designware.h
index abf729d..40020bf 100644
--- a/drivers/net/designware.h
+++ b/drivers/net/designware.h
@@ -234,6 +234,7 @@ struct dmamacdescr {
struct dw_eth_dev {
u32 address;
+ u32 interface;
u32 speed;
u32 duplex;
u32 tx_currdescnum;