Commit 3b3c028a authored by Troy Kisky's avatar Troy Kisky Committed by Kevin Hilman

ARM: DaVinci: EMAC: Fix Duplex problem with NFS root

The duplex bit in MACCONTROL wasn't changed.
Signed-off-by: default avatarTroy Kisky <Troy.Kisky@boundarydevices.com>
Signed-off-by: default avatarKevin Hilman <khilman@deeprootsystems.com>
parent e8f1a90f
...@@ -485,7 +485,7 @@ struct emac_priv { ...@@ -485,7 +485,7 @@ struct emac_priv {
struct emac_rxch *rxch[EMAC_DEF_MAX_RX_CH]; struct emac_rxch *rxch[EMAC_DEF_MAX_RX_CH];
u32 link; /* 1=link on, 0=link off */ u32 link; /* 1=link on, 0=link off */
u32 speed; /* 0=Auto Neg, 1=No PHY, 10,100, 1000 - mbps */ u32 speed; /* 0=Auto Neg, 1=No PHY, 10,100, 1000 - mbps */
u32 duplex; /* Link duplex: 1=Unknown, 2=Half, 3=Full */ u32 duplex; /* Link duplex: -1=Unknown, 0=Half, 1=Full */
u32 rx_buf_size; u32 rx_buf_size;
u32 isr_count; u32 isr_count;
u8 rmii_en; u8 rmii_en;
...@@ -746,17 +746,19 @@ static void emac_update_phystatus(struct emac_priv *priv) ...@@ -746,17 +746,19 @@ static void emac_update_phystatus(struct emac_priv *priv)
{ {
u32 mac_control; u32 mac_control;
u32 new_duplex; u32 new_duplex;
u32 cur_duplex;
struct net_device *ndev = priv->ndev; struct net_device *ndev = priv->ndev;
mac_control = emac_read(EMAC_MACCONTROL); mac_control = emac_read(EMAC_MACCONTROL);
cur_duplex = (mac_control & EMAC_MACCONTROL_FULLDUPLEXEN) ?
DUPLEX_FULL : DUPLEX_HALF;
if (priv->phy_mask) if (priv->phy_mask)
new_duplex = priv->phydev->duplex; new_duplex = priv->phydev->duplex;
else else
new_duplex = DUPLEX_FULL; new_duplex = DUPLEX_FULL;
/* We get called only if link has changed (speed/duplex/status) */ /* We get called only if link has changed (speed/duplex/status) */
if ((priv->link) && (new_duplex != priv->duplex)) { if ((priv->link) && (new_duplex != cur_duplex)) {
priv->duplex = new_duplex; priv->duplex = new_duplex;
if (DUPLEX_FULL == priv->duplex) if (DUPLEX_FULL == priv->duplex)
mac_control |= (EMAC_MACCONTROL_FULLDUPLEXEN); mac_control |= (EMAC_MACCONTROL_FULLDUPLEXEN);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment