aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/e1000e/80003es2lan.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/ethernet/intel/e1000e/80003es2lan.c')
-rw-r--r--drivers/net/ethernet/intel/e1000e/80003es2lan.c66
1 files changed, 23 insertions, 43 deletions
diff --git a/drivers/net/ethernet/intel/e1000e/80003es2lan.c b/drivers/net/ethernet/intel/e1000e/80003es2lan.c
index 4dd18a1f45d2..e73c2c355993 100644
--- a/drivers/net/ethernet/intel/e1000e/80003es2lan.c
+++ b/drivers/net/ethernet/intel/e1000e/80003es2lan.c
@@ -26,8 +26,7 @@
26 26
27*******************************************************************************/ 27*******************************************************************************/
28 28
29/* 29/* 80003ES2LAN Gigabit Ethernet Controller (Copper)
30 * 80003ES2LAN Gigabit Ethernet Controller (Copper)
31 * 80003ES2LAN Gigabit Ethernet Controller (Serdes) 30 * 80003ES2LAN Gigabit Ethernet Controller (Serdes)
32 */ 31 */
33 32
@@ -80,7 +79,8 @@
80 1 = 50-80M 79 1 = 50-80M
81 2 = 80-110M 80 2 = 80-110M
82 3 = 110-140M 81 3 = 110-140M
83 4 = >140M */ 82 4 = >140M
83 */
84 84
85/* Kumeran Mode Control Register (Page 193, Register 16) */ 85/* Kumeran Mode Control Register (Page 193, Register 16) */
86#define GG82563_KMCR_PASS_FALSE_CARRIER 0x0800 86#define GG82563_KMCR_PASS_FALSE_CARRIER 0x0800
@@ -95,8 +95,7 @@
95/* In-Band Control Register (Page 194, Register 18) */ 95/* In-Band Control Register (Page 194, Register 18) */
96#define GG82563_ICR_DIS_PADDING 0x0010 /* Disable Padding */ 96#define GG82563_ICR_DIS_PADDING 0x0010 /* Disable Padding */
97 97
98/* 98/* A table for the GG82563 cable length where the range is defined
99 * A table for the GG82563 cable length where the range is defined
100 * with a lower bound at "index" and the upper bound at 99 * with a lower bound at "index" and the upper bound at
101 * "index + 5". 100 * "index + 5".
102 */ 101 */
@@ -183,8 +182,7 @@ static s32 e1000_init_nvm_params_80003es2lan(struct e1000_hw *hw)
183 size = (u16)((eecd & E1000_EECD_SIZE_EX_MASK) >> 182 size = (u16)((eecd & E1000_EECD_SIZE_EX_MASK) >>
184 E1000_EECD_SIZE_EX_SHIFT); 183 E1000_EECD_SIZE_EX_SHIFT);
185 184
186 /* 185 /* Added to a constant, "size" becomes the left-shift value
187 * Added to a constant, "size" becomes the left-shift value
188 * for setting word_size. 186 * for setting word_size.
189 */ 187 */
190 size += NVM_WORD_SIZE_BASE_SHIFT; 188 size += NVM_WORD_SIZE_BASE_SHIFT;
@@ -375,8 +373,7 @@ static s32 e1000_acquire_swfw_sync_80003es2lan(struct e1000_hw *hw, u16 mask)
375 if (!(swfw_sync & (fwmask | swmask))) 373 if (!(swfw_sync & (fwmask | swmask)))
376 break; 374 break;
377 375
378 /* 376 /* Firmware currently using resource (fwmask)
379 * Firmware currently using resource (fwmask)
380 * or other software thread using resource (swmask) 377 * or other software thread using resource (swmask)
381 */ 378 */
382 e1000e_put_hw_semaphore(hw); 379 e1000e_put_hw_semaphore(hw);
@@ -442,8 +439,7 @@ static s32 e1000_read_phy_reg_gg82563_80003es2lan(struct e1000_hw *hw,
442 if ((offset & MAX_PHY_REG_ADDRESS) < GG82563_MIN_ALT_REG) { 439 if ((offset & MAX_PHY_REG_ADDRESS) < GG82563_MIN_ALT_REG) {
443 page_select = GG82563_PHY_PAGE_SELECT; 440 page_select = GG82563_PHY_PAGE_SELECT;
444 } else { 441 } else {
445 /* 442 /* Use Alternative Page Select register to access
446 * Use Alternative Page Select register to access
447 * registers 30 and 31 443 * registers 30 and 31
448 */ 444 */
449 page_select = GG82563_PHY_PAGE_SELECT_ALT; 445 page_select = GG82563_PHY_PAGE_SELECT_ALT;
@@ -457,8 +453,7 @@ static s32 e1000_read_phy_reg_gg82563_80003es2lan(struct e1000_hw *hw,
457 } 453 }
458 454
459 if (hw->dev_spec.e80003es2lan.mdic_wa_enable) { 455 if (hw->dev_spec.e80003es2lan.mdic_wa_enable) {
460 /* 456 /* The "ready" bit in the MDIC register may be incorrectly set
461 * The "ready" bit in the MDIC register may be incorrectly set
462 * before the device has completed the "Page Select" MDI 457 * before the device has completed the "Page Select" MDI
463 * transaction. So we wait 200us after each MDI command... 458 * transaction. So we wait 200us after each MDI command...
464 */ 459 */
@@ -513,8 +508,7 @@ static s32 e1000_write_phy_reg_gg82563_80003es2lan(struct e1000_hw *hw,
513 if ((offset & MAX_PHY_REG_ADDRESS) < GG82563_MIN_ALT_REG) { 508 if ((offset & MAX_PHY_REG_ADDRESS) < GG82563_MIN_ALT_REG) {
514 page_select = GG82563_PHY_PAGE_SELECT; 509 page_select = GG82563_PHY_PAGE_SELECT;
515 } else { 510 } else {
516 /* 511 /* Use Alternative Page Select register to access
517 * Use Alternative Page Select register to access
518 * registers 30 and 31 512 * registers 30 and 31
519 */ 513 */
520 page_select = GG82563_PHY_PAGE_SELECT_ALT; 514 page_select = GG82563_PHY_PAGE_SELECT_ALT;
@@ -528,8 +522,7 @@ static s32 e1000_write_phy_reg_gg82563_80003es2lan(struct e1000_hw *hw,
528 } 522 }
529 523
530 if (hw->dev_spec.e80003es2lan.mdic_wa_enable) { 524 if (hw->dev_spec.e80003es2lan.mdic_wa_enable) {
531 /* 525 /* The "ready" bit in the MDIC register may be incorrectly set
532 * The "ready" bit in the MDIC register may be incorrectly set
533 * before the device has completed the "Page Select" MDI 526 * before the device has completed the "Page Select" MDI
534 * transaction. So we wait 200us after each MDI command... 527 * transaction. So we wait 200us after each MDI command...
535 */ 528 */
@@ -618,8 +611,7 @@ static s32 e1000_phy_force_speed_duplex_80003es2lan(struct e1000_hw *hw)
618 u16 phy_data; 611 u16 phy_data;
619 bool link; 612 bool link;
620 613
621 /* 614 /* Clear Auto-Crossover to force MDI manually. M88E1000 requires MDI
622 * Clear Auto-Crossover to force MDI manually. M88E1000 requires MDI
623 * forced whenever speed and duplex are forced. 615 * forced whenever speed and duplex are forced.
624 */ 616 */
625 ret_val = e1e_rphy(hw, M88E1000_PHY_SPEC_CTRL, &phy_data); 617 ret_val = e1e_rphy(hw, M88E1000_PHY_SPEC_CTRL, &phy_data);
@@ -657,8 +649,7 @@ static s32 e1000_phy_force_speed_duplex_80003es2lan(struct e1000_hw *hw)
657 return ret_val; 649 return ret_val;
658 650
659 if (!link) { 651 if (!link) {
660 /* 652 /* We didn't get link.
661 * We didn't get link.
662 * Reset the DSP and cross our fingers. 653 * Reset the DSP and cross our fingers.
663 */ 654 */
664 ret_val = e1000e_phy_reset_dsp(hw); 655 ret_val = e1000e_phy_reset_dsp(hw);
@@ -677,8 +668,7 @@ static s32 e1000_phy_force_speed_duplex_80003es2lan(struct e1000_hw *hw)
677 if (ret_val) 668 if (ret_val)
678 return ret_val; 669 return ret_val;
679 670
680 /* 671 /* Resetting the phy means we need to verify the TX_CLK corresponds
681 * Resetting the phy means we need to verify the TX_CLK corresponds
682 * to the link speed. 10Mbps -> 2.5MHz, else 25MHz. 672 * to the link speed. 10Mbps -> 2.5MHz, else 25MHz.
683 */ 673 */
684 phy_data &= ~GG82563_MSCR_TX_CLK_MASK; 674 phy_data &= ~GG82563_MSCR_TX_CLK_MASK;
@@ -687,8 +677,7 @@ static s32 e1000_phy_force_speed_duplex_80003es2lan(struct e1000_hw *hw)
687 else 677 else
688 phy_data |= GG82563_MSCR_TX_CLK_100MBPS_25; 678 phy_data |= GG82563_MSCR_TX_CLK_100MBPS_25;
689 679
690 /* 680 /* In addition, we must re-enable CRS on Tx for both half and full
691 * In addition, we must re-enable CRS on Tx for both half and full
692 * duplex. 681 * duplex.
693 */ 682 */
694 phy_data |= GG82563_MSCR_ASSERT_CRS_ON_TX; 683 phy_data |= GG82563_MSCR_ASSERT_CRS_ON_TX;
@@ -766,8 +755,7 @@ static s32 e1000_reset_hw_80003es2lan(struct e1000_hw *hw)
766 s32 ret_val; 755 s32 ret_val;
767 u16 kum_reg_data; 756 u16 kum_reg_data;
768 757
769 /* 758 /* Prevent the PCI-E bus from sticking if there is no TLP connection
770 * Prevent the PCI-E bus from sticking if there is no TLP connection
771 * on the last TLP read/write transaction when MAC is reset. 759 * on the last TLP read/write transaction when MAC is reset.
772 */ 760 */
773 ret_val = e1000e_disable_pcie_master(hw); 761 ret_val = e1000e_disable_pcie_master(hw);
@@ -899,8 +887,7 @@ static s32 e1000_init_hw_80003es2lan(struct e1000_hw *hw)
899 hw->dev_spec.e80003es2lan.mdic_wa_enable = false; 887 hw->dev_spec.e80003es2lan.mdic_wa_enable = false;
900 } 888 }
901 889
902 /* 890 /* Clear all of the statistics registers (clear on read). It is
903 * Clear all of the statistics registers (clear on read). It is
904 * important that we do this after we have tried to establish link 891 * important that we do this after we have tried to establish link
905 * because the symbol error count will increment wildly if there 892 * because the symbol error count will increment wildly if there
906 * is no link. 893 * is no link.
@@ -945,8 +932,7 @@ static void e1000_initialize_hw_bits_80003es2lan(struct e1000_hw *hw)
945 reg |= (1 << 28); 932 reg |= (1 << 28);
946 ew32(TARC(1), reg); 933 ew32(TARC(1), reg);
947 934
948 /* 935 /* Disable IPv6 extension header parsing because some malformed
949 * Disable IPv6 extension header parsing because some malformed
950 * IPv6 headers can hang the Rx. 936 * IPv6 headers can hang the Rx.
951 */ 937 */
952 reg = er32(RFCTL); 938 reg = er32(RFCTL);
@@ -979,8 +965,7 @@ static s32 e1000_copper_link_setup_gg82563_80003es2lan(struct e1000_hw *hw)
979 if (ret_val) 965 if (ret_val)
980 return ret_val; 966 return ret_val;
981 967
982 /* 968 /* Options:
983 * Options:
984 * MDI/MDI-X = 0 (default) 969 * MDI/MDI-X = 0 (default)
985 * 0 - Auto for all speeds 970 * 0 - Auto for all speeds
986 * 1 - MDI mode 971 * 1 - MDI mode
@@ -1006,8 +991,7 @@ static s32 e1000_copper_link_setup_gg82563_80003es2lan(struct e1000_hw *hw)
1006 break; 991 break;
1007 } 992 }
1008 993
1009 /* 994 /* Options:
1010 * Options:
1011 * disable_polarity_correction = 0 (default) 995 * disable_polarity_correction = 0 (default)
1012 * Automatic Correction for Reversed Cable Polarity 996 * Automatic Correction for Reversed Cable Polarity
1013 * 0 - Disabled 997 * 0 - Disabled
@@ -1065,8 +1049,7 @@ static s32 e1000_copper_link_setup_gg82563_80003es2lan(struct e1000_hw *hw)
1065 if (ret_val) 1049 if (ret_val)
1066 return ret_val; 1050 return ret_val;
1067 1051
1068 /* 1052 /* Do not init these registers when the HW is in IAMT mode, since the
1069 * Do not init these registers when the HW is in IAMT mode, since the
1070 * firmware will have already initialized them. We only initialize 1053 * firmware will have already initialized them. We only initialize
1071 * them if the HW is not in IAMT mode. 1054 * them if the HW is not in IAMT mode.
1072 */ 1055 */
@@ -1087,8 +1070,7 @@ static s32 e1000_copper_link_setup_gg82563_80003es2lan(struct e1000_hw *hw)
1087 return ret_val; 1070 return ret_val;
1088 } 1071 }
1089 1072
1090 /* 1073 /* Workaround: Disable padding in Kumeran interface in the MAC
1091 * Workaround: Disable padding in Kumeran interface in the MAC
1092 * and in the PHY to avoid CRC errors. 1074 * and in the PHY to avoid CRC errors.
1093 */ 1075 */
1094 ret_val = e1e_rphy(hw, GG82563_PHY_INBAND_CTRL, &data); 1076 ret_val = e1e_rphy(hw, GG82563_PHY_INBAND_CTRL, &data);
@@ -1121,8 +1103,7 @@ static s32 e1000_setup_copper_link_80003es2lan(struct e1000_hw *hw)
1121 ctrl &= ~(E1000_CTRL_FRCSPD | E1000_CTRL_FRCDPX); 1103 ctrl &= ~(E1000_CTRL_FRCSPD | E1000_CTRL_FRCDPX);
1122 ew32(CTRL, ctrl); 1104 ew32(CTRL, ctrl);
1123 1105
1124 /* 1106 /* Set the mac to wait the maximum time between each
1125 * Set the mac to wait the maximum time between each
1126 * iteration and increase the max iterations when 1107 * iteration and increase the max iterations when
1127 * polling the phy; this fixes erroneous timeouts at 10Mbps. 1108 * polling the phy; this fixes erroneous timeouts at 10Mbps.
1128 */ 1109 */
@@ -1352,8 +1333,7 @@ static s32 e1000_read_mac_addr_80003es2lan(struct e1000_hw *hw)
1352{ 1333{
1353 s32 ret_val = 0; 1334 s32 ret_val = 0;
1354 1335
1355 /* 1336 /* If there's an alternate MAC address place it in RAR0
1356 * If there's an alternate MAC address place it in RAR0
1357 * so that it will override the Si installed default perm 1337 * so that it will override the Si installed default perm
1358 * address. 1338 * address.
1359 */ 1339 */