Commit d2394e6b authored by Matt Carlson's avatar Matt Carlson Committed by David S. Miller

tg3: Always turn on APE features in mac_mode reg

The APE needs certain bits in the mac_mode register to be enabled for
traffic to flow correctly.  This patch changes the code to always enable
these bits in the presence of the APE.
Signed-off-by: default avatarMatt Carlson <mcarlson@broadcom.com>
Reviewed-by: default avatarMichael Chan <mchan@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent b75cc0e4
...@@ -2728,12 +2728,10 @@ static int tg3_set_power_state(struct tg3 *tp, pci_power_t state) ...@@ -2728,12 +2728,10 @@ static int tg3_set_power_state(struct tg3 *tp, pci_power_t state)
(tp->tg3_flags3 & TG3_FLG3_ENABLE_APE))) (tp->tg3_flags3 & TG3_FLG3_ENABLE_APE)))
mac_mode |= MAC_MODE_KEEP_FRAME_IN_WOL; mac_mode |= MAC_MODE_KEEP_FRAME_IN_WOL;
if (tp->tg3_flags3 & TG3_FLG3_ENABLE_APE) { if (tp->tg3_flags3 & TG3_FLG3_ENABLE_APE)
mac_mode |= tp->mac_mode & mac_mode |= MAC_MODE_APE_TX_EN |
(MAC_MODE_APE_TX_EN | MAC_MODE_APE_RX_EN); MAC_MODE_APE_RX_EN |
if (mac_mode & MAC_MODE_APE_TX_EN) MAC_MODE_TDE_ENABLE;
mac_mode |= MAC_MODE_TDE_ENABLE;
}
tw32_f(MAC_MODE, mac_mode); tw32_f(MAC_MODE, mac_mode);
udelay(100); udelay(100);
...@@ -7222,19 +7220,21 @@ static int tg3_chip_reset(struct tg3 *tp) ...@@ -7222,19 +7220,21 @@ static int tg3_chip_reset(struct tg3 *tp)
tw32(TG3PCI_CLOCK_CTRL, tp->pci_clock_ctrl); tw32(TG3PCI_CLOCK_CTRL, tp->pci_clock_ctrl);
} }
if (tp->tg3_flags3 & TG3_FLG3_ENABLE_APE)
tp->mac_mode = MAC_MODE_APE_TX_EN |
MAC_MODE_APE_RX_EN |
MAC_MODE_TDE_ENABLE;
if (tp->phy_flags & TG3_PHYFLG_PHY_SERDES) { if (tp->phy_flags & TG3_PHYFLG_PHY_SERDES) {
tp->mac_mode = MAC_MODE_PORT_MODE_TBI; tp->mac_mode |= MAC_MODE_PORT_MODE_TBI;
tw32_f(MAC_MODE, tp->mac_mode); val = tp->mac_mode;
} else if (tp->phy_flags & TG3_PHYFLG_MII_SERDES) { } else if (tp->phy_flags & TG3_PHYFLG_MII_SERDES) {
tp->mac_mode = MAC_MODE_PORT_MODE_GMII; tp->mac_mode |= MAC_MODE_PORT_MODE_GMII;
tw32_f(MAC_MODE, tp->mac_mode); val = tp->mac_mode;
} else if (tp->tg3_flags3 & TG3_FLG3_ENABLE_APE) {
tp->mac_mode &= (MAC_MODE_APE_TX_EN | MAC_MODE_APE_RX_EN);
if (tp->mac_mode & MAC_MODE_APE_TX_EN)
tp->mac_mode |= MAC_MODE_TDE_ENABLE;
tw32_f(MAC_MODE, tp->mac_mode);
} else } else
tw32_f(MAC_MODE, 0); val = 0;
tw32_f(MAC_MODE, val);
udelay(40); udelay(40);
tg3_ape_unlock(tp, TG3_APE_LOCK_GRC); tg3_ape_unlock(tp, TG3_APE_LOCK_GRC);
...@@ -8287,7 +8287,7 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy) ...@@ -8287,7 +8287,7 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
} }
if (tp->tg3_flags3 & TG3_FLG3_ENABLE_APE) if (tp->tg3_flags3 & TG3_FLG3_ENABLE_APE)
tp->mac_mode &= MAC_MODE_APE_TX_EN | MAC_MODE_APE_RX_EN; tp->mac_mode = MAC_MODE_APE_TX_EN | MAC_MODE_APE_RX_EN;
else else
tp->mac_mode = 0; tp->mac_mode = 0;
tp->mac_mode |= MAC_MODE_TXSTAT_ENABLE | MAC_MODE_RXSTAT_ENABLE | tp->mac_mode |= MAC_MODE_TXSTAT_ENABLE | MAC_MODE_RXSTAT_ENABLE |
...@@ -13729,8 +13729,7 @@ static int __devinit tg3_get_invariants(struct tg3 *tp) ...@@ -13729,8 +13729,7 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
/* Preserve the APE MAC_MODE bits */ /* Preserve the APE MAC_MODE bits */
if (tp->tg3_flags3 & TG3_FLG3_ENABLE_APE) if (tp->tg3_flags3 & TG3_FLG3_ENABLE_APE)
tp->mac_mode = tr32(MAC_MODE) | tp->mac_mode = MAC_MODE_APE_TX_EN | MAC_MODE_APE_RX_EN;
MAC_MODE_APE_TX_EN | MAC_MODE_APE_RX_EN;
else else
tp->mac_mode = TG3_DEF_MAC_MODE; tp->mac_mode = TG3_DEF_MAC_MODE;
......
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