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

tg3: Fix AC131 loopback test errors for 5785

The AC131 does not enable the forced transmit clock settings
immediately.  The workaround is to read the register again to get the
setting to take effect.
Signed-off-by: default avatarMatt Carlson <mcarlson@broadcom.com>
Reviewed-by: default avatarMichael Chan <mchan@broadcom.com>
Reviewed-by: default avatarBenjamin Li <benli@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent c8873405
...@@ -10822,8 +10822,12 @@ static int tg3_run_loopback(struct tg3 *tp, int loopback_mode) ...@@ -10822,8 +10822,12 @@ static int tg3_run_loopback(struct tg3 *tp, int loopback_mode)
mac_mode = tp->mac_mode & ~MAC_MODE_PORT_MODE_MASK; mac_mode = tp->mac_mode & ~MAC_MODE_PORT_MODE_MASK;
if (tp->tg3_flags3 & TG3_FLG3_PHY_IS_FET) { if (tp->tg3_flags3 & TG3_FLG3_PHY_IS_FET) {
if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5906) tg3_writephy(tp, MII_TG3_FET_PTEST,
tg3_writephy(tp, MII_TG3_FET_PTEST, 0x1800); MII_TG3_FET_PTEST_FRC_TX_LINK |
MII_TG3_FET_PTEST_FRC_TX_LOCK);
/* The write needs to be flushed for the AC131 */
if (GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5785)
tg3_readphy(tp, MII_TG3_FET_PTEST, &val);
mac_mode |= MAC_MODE_PORT_MODE_MII; mac_mode |= MAC_MODE_PORT_MODE_MII;
} else } else
mac_mode |= MAC_MODE_PORT_MODE_GMII; mac_mode |= MAC_MODE_PORT_MODE_GMII;
......
...@@ -2112,6 +2112,9 @@ ...@@ -2112,6 +2112,9 @@
/* Fast Ethernet Tranceiver definitions */ /* Fast Ethernet Tranceiver definitions */
#define MII_TG3_FET_PTEST 0x17 #define MII_TG3_FET_PTEST 0x17
#define MII_TG3_FET_PTEST_FRC_TX_LINK 0x1000
#define MII_TG3_FET_PTEST_FRC_TX_LOCK 0x0800
#define MII_TG3_FET_TEST 0x1f #define MII_TG3_FET_TEST 0x1f
#define MII_TG3_FET_SHADOW_EN 0x0080 #define MII_TG3_FET_SHADOW_EN 0x0080
......
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