aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/e1000e/ethtool.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/e1000e/ethtool.c')
-rw-r--r--drivers/net/e1000e/ethtool.c39
1 files changed, 28 insertions, 11 deletions
diff --git a/drivers/net/e1000e/ethtool.c b/drivers/net/e1000e/ethtool.c
index ce045acce63e..2bb6da057c40 100644
--- a/drivers/net/e1000e/ethtool.c
+++ b/drivers/net/e1000e/ethtool.c
@@ -803,8 +803,7 @@ static int e1000_reg_test(struct e1000_adapter *adapter, u64 *data)
803 /* restore previous status */ 803 /* restore previous status */
804 ew32(STATUS, before); 804 ew32(STATUS, before);
805 805
806 if ((mac->type != e1000_ich8lan) && 806 if (!(adapter->flags & FLAG_IS_ICH)) {
807 (mac->type != e1000_ich9lan)) {
808 REG_PATTERN_TEST(E1000_FCAL, 0xFFFFFFFF, 0xFFFFFFFF); 807 REG_PATTERN_TEST(E1000_FCAL, 0xFFFFFFFF, 0xFFFFFFFF);
809 REG_PATTERN_TEST(E1000_FCAH, 0x0000FFFF, 0xFFFFFFFF); 808 REG_PATTERN_TEST(E1000_FCAH, 0x0000FFFF, 0xFFFFFFFF);
810 REG_PATTERN_TEST(E1000_FCT, 0x0000FFFF, 0xFFFFFFFF); 809 REG_PATTERN_TEST(E1000_FCT, 0x0000FFFF, 0xFFFFFFFF);
@@ -824,15 +823,13 @@ static int e1000_reg_test(struct e1000_adapter *adapter, u64 *data)
824 823
825 REG_SET_AND_CHECK(E1000_RCTL, 0xFFFFFFFF, 0x00000000); 824 REG_SET_AND_CHECK(E1000_RCTL, 0xFFFFFFFF, 0x00000000);
826 825
827 before = (((mac->type == e1000_ich8lan) || 826 before = ((adapter->flags & FLAG_IS_ICH) ? 0x06C3B33E : 0x06DFB3FE);
828 (mac->type == e1000_ich9lan)) ? 0x06C3B33E : 0x06DFB3FE);
829 REG_SET_AND_CHECK(E1000_RCTL, before, 0x003FFFFB); 827 REG_SET_AND_CHECK(E1000_RCTL, before, 0x003FFFFB);
830 REG_SET_AND_CHECK(E1000_TCTL, 0xFFFFFFFF, 0x00000000); 828 REG_SET_AND_CHECK(E1000_TCTL, 0xFFFFFFFF, 0x00000000);
831 829
832 REG_SET_AND_CHECK(E1000_RCTL, before, 0xFFFFFFFF); 830 REG_SET_AND_CHECK(E1000_RCTL, before, 0xFFFFFFFF);
833 REG_PATTERN_TEST(E1000_RDBAL, 0xFFFFFFF0, 0xFFFFFFFF); 831 REG_PATTERN_TEST(E1000_RDBAL, 0xFFFFFFF0, 0xFFFFFFFF);
834 if ((mac->type != e1000_ich8lan) && 832 if (!(adapter->flags & FLAG_IS_ICH))
835 (mac->type != e1000_ich9lan))
836 REG_PATTERN_TEST(E1000_TXCW, 0xC000FFFF, 0x0000FFFF); 833 REG_PATTERN_TEST(E1000_TXCW, 0xC000FFFF, 0x0000FFFF);
837 REG_PATTERN_TEST(E1000_TDBAL, 0xFFFFFFF0, 0xFFFFFFFF); 834 REG_PATTERN_TEST(E1000_TDBAL, 0xFFFFFFF0, 0xFFFFFFFF);
838 REG_PATTERN_TEST(E1000_TIDV, 0x0000FFFF, 0x0000FFFF); 835 REG_PATTERN_TEST(E1000_TIDV, 0x0000FFFF, 0x0000FFFF);
@@ -911,9 +908,7 @@ static int e1000_intr_test(struct e1000_adapter *adapter, u64 *data)
911 908
912 /* Test each interrupt */ 909 /* Test each interrupt */
913 for (i = 0; i < 10; i++) { 910 for (i = 0; i < 10; i++) {
914 911 if ((adapter->flags & FLAG_IS_ICH) && (i == 8))
915 if (((adapter->hw.mac.type == e1000_ich8lan) ||
916 (adapter->hw.mac.type == e1000_ich9lan)) && i == 8)
917 continue; 912 continue;
918 913
919 /* Interrupt to test */ 914 /* Interrupt to test */
@@ -1184,6 +1179,7 @@ static int e1000_integrated_phy_loopback(struct e1000_adapter *adapter)
1184 struct e1000_hw *hw = &adapter->hw; 1179 struct e1000_hw *hw = &adapter->hw;
1185 u32 ctrl_reg = 0; 1180 u32 ctrl_reg = 0;
1186 u32 stat_reg = 0; 1181 u32 stat_reg = 0;
1182 u16 phy_reg = 0;
1187 1183
1188 hw->mac.autoneg = 0; 1184 hw->mac.autoneg = 0;
1189 1185
@@ -1211,6 +1207,28 @@ static int e1000_integrated_phy_loopback(struct e1000_adapter *adapter)
1211 E1000_CTRL_SPD_100 |/* Force Speed to 100 */ 1207 E1000_CTRL_SPD_100 |/* Force Speed to 100 */
1212 E1000_CTRL_FD); /* Force Duplex to FULL */ 1208 E1000_CTRL_FD); /* Force Duplex to FULL */
1213 break; 1209 break;
1210 case e1000_phy_bm:
1211 /* Set Default MAC Interface speed to 1GB */
1212 e1e_rphy(hw, PHY_REG(2, 21), &phy_reg);
1213 phy_reg &= ~0x0007;
1214 phy_reg |= 0x006;
1215 e1e_wphy(hw, PHY_REG(2, 21), phy_reg);
1216 /* Assert SW reset for above settings to take effect */
1217 e1000e_commit_phy(hw);
1218 mdelay(1);
1219 /* Force Full Duplex */
1220 e1e_rphy(hw, PHY_REG(769, 16), &phy_reg);
1221 e1e_wphy(hw, PHY_REG(769, 16), phy_reg | 0x000C);
1222 /* Set Link Up (in force link) */
1223 e1e_rphy(hw, PHY_REG(776, 16), &phy_reg);
1224 e1e_wphy(hw, PHY_REG(776, 16), phy_reg | 0x0040);
1225 /* Force Link */
1226 e1e_rphy(hw, PHY_REG(769, 16), &phy_reg);
1227 e1e_wphy(hw, PHY_REG(769, 16), phy_reg | 0x0040);
1228 /* Set Early Link Enable */
1229 e1e_rphy(hw, PHY_REG(769, 20), &phy_reg);
1230 e1e_wphy(hw, PHY_REG(769, 20), phy_reg | 0x0400);
1231 /* fall through */
1214 default: 1232 default:
1215 /* force 1000, set loopback */ 1233 /* force 1000, set loopback */
1216 e1e_wphy(hw, PHY_CONTROL, 0x4140); 1234 e1e_wphy(hw, PHY_CONTROL, 0x4140);
@@ -1224,8 +1242,7 @@ static int e1000_integrated_phy_loopback(struct e1000_adapter *adapter)
1224 E1000_CTRL_SPD_1000 |/* Force Speed to 1000 */ 1242 E1000_CTRL_SPD_1000 |/* Force Speed to 1000 */
1225 E1000_CTRL_FD); /* Force Duplex to FULL */ 1243 E1000_CTRL_FD); /* Force Duplex to FULL */
1226 1244
1227 if ((adapter->hw.mac.type == e1000_ich8lan) || 1245 if (adapter->flags & FLAG_IS_ICH)
1228 (adapter->hw.mac.type == e1000_ich9lan))
1229 ctrl_reg |= E1000_CTRL_SLU; /* Set Link Up */ 1246 ctrl_reg |= E1000_CTRL_SLU; /* Set Link Up */
1230 } 1247 }
1231 1248