diff options
author | Bruce Allan <bruce.w.allan@intel.com> | 2012-04-18 23:21:47 -0400 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2012-05-04 06:15:06 -0400 |
commit | 2fbe4526e5aafc9ffa5d85fa4749a7c5b22af6b2 (patch) | |
tree | d49b59c7ab233d3280f3054b19fbd3832a8898ca /drivers/net/ethernet/intel | |
parent | d02c70a8ee1738fc2cf6db18df065977bb44fd50 (diff) |
e1000e: initial support for i217
i217 is the next-generation LOM that will be available on systems with the
Lynx Point Platform Controller Hub (PCH) chipset from Intel. This patch
provides the initial support for the device.
Signed-off-by: Bruce Allan <bruce.w.allan@intel.com>
Tested-by: Jeff Pieper <jeffrey.e.pieper@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel')
-rw-r--r-- | drivers/net/ethernet/intel/e1000e/defines.h | 8 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/e1000e/e1000.h | 2 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/e1000e/ethtool.c | 17 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/e1000e/hw.h | 9 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/e1000e/ich8lan.c | 370 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/e1000e/netdev.c | 17 | ||||
-rw-r--r-- | drivers/net/ethernet/intel/e1000e/phy.c | 3 |
7 files changed, 398 insertions, 28 deletions
diff --git a/drivers/net/ethernet/intel/e1000e/defines.h b/drivers/net/ethernet/intel/e1000e/defines.h index 3a5025917163..11c46661af09 100644 --- a/drivers/net/ethernet/intel/e1000e/defines.h +++ b/drivers/net/ethernet/intel/e1000e/defines.h | |||
@@ -74,7 +74,9 @@ | |||
74 | #define E1000_WUS_BC E1000_WUFC_BC | 74 | #define E1000_WUS_BC E1000_WUFC_BC |
75 | 75 | ||
76 | /* Extended Device Control */ | 76 | /* Extended Device Control */ |
77 | #define E1000_CTRL_EXT_LPCD 0x00000004 /* LCD Power Cycle Done */ | ||
77 | #define E1000_CTRL_EXT_SDP3_DATA 0x00000080 /* Value of SW Definable Pin 3 */ | 78 | #define E1000_CTRL_EXT_SDP3_DATA 0x00000080 /* Value of SW Definable Pin 3 */ |
79 | #define E1000_CTRL_EXT_FORCE_SMBUS 0x00000004 /* Force SMBus mode*/ | ||
78 | #define E1000_CTRL_EXT_EE_RST 0x00002000 /* Reinitialize from EEPROM */ | 80 | #define E1000_CTRL_EXT_EE_RST 0x00002000 /* Reinitialize from EEPROM */ |
79 | #define E1000_CTRL_EXT_SPD_BYPS 0x00008000 /* Speed Select Bypass */ | 81 | #define E1000_CTRL_EXT_SPD_BYPS 0x00008000 /* Speed Select Bypass */ |
80 | #define E1000_CTRL_EXT_RO_DIS 0x00020000 /* Relaxed Ordering disable */ | 82 | #define E1000_CTRL_EXT_RO_DIS 0x00020000 /* Relaxed Ordering disable */ |
@@ -573,6 +575,7 @@ | |||
573 | #define NWAY_AR_ASM_DIR 0x0800 /* Asymmetric Pause Direction bit */ | 575 | #define NWAY_AR_ASM_DIR 0x0800 /* Asymmetric Pause Direction bit */ |
574 | 576 | ||
575 | /* Link Partner Ability Register (Base Page) */ | 577 | /* Link Partner Ability Register (Base Page) */ |
578 | #define NWAY_LPAR_100TX_FD_CAPS 0x0100 /* LP 100TX Full Dplx Capable */ | ||
576 | #define NWAY_LPAR_PAUSE 0x0400 /* LP Pause operation desired */ | 579 | #define NWAY_LPAR_PAUSE 0x0400 /* LP Pause operation desired */ |
577 | #define NWAY_LPAR_ASM_DIR 0x0800 /* LP Asymmetric Pause Direction bit */ | 580 | #define NWAY_LPAR_ASM_DIR 0x0800 /* LP Asymmetric Pause Direction bit */ |
578 | 581 | ||
@@ -739,6 +742,7 @@ | |||
739 | #define I82577_E_PHY_ID 0x01540050 | 742 | #define I82577_E_PHY_ID 0x01540050 |
740 | #define I82578_E_PHY_ID 0x004DD040 | 743 | #define I82578_E_PHY_ID 0x004DD040 |
741 | #define I82579_E_PHY_ID 0x01540090 | 744 | #define I82579_E_PHY_ID 0x01540090 |
745 | #define I217_E_PHY_ID 0x015400A0 | ||
742 | 746 | ||
743 | /* M88E1000 Specific Registers */ | 747 | /* M88E1000 Specific Registers */ |
744 | #define M88E1000_PHY_SPEC_CTRL 0x10 /* PHY Specific Control Register */ | 748 | #define M88E1000_PHY_SPEC_CTRL 0x10 /* PHY Specific Control Register */ |
@@ -850,4 +854,8 @@ | |||
850 | /* SerDes Control */ | 854 | /* SerDes Control */ |
851 | #define E1000_GEN_POLL_TIMEOUT 640 | 855 | #define E1000_GEN_POLL_TIMEOUT 640 |
852 | 856 | ||
857 | /* FW Semaphore */ | ||
858 | #define E1000_FWSM_WLOCK_MAC_MASK 0x0380 | ||
859 | #define E1000_FWSM_WLOCK_MAC_SHIFT 7 | ||
860 | |||
853 | #endif /* _E1000_DEFINES_H_ */ | 861 | #endif /* _E1000_DEFINES_H_ */ |
diff --git a/drivers/net/ethernet/intel/e1000e/e1000.h b/drivers/net/ethernet/intel/e1000e/e1000.h index c960cf88cb0f..6e6fffb34581 100644 --- a/drivers/net/ethernet/intel/e1000e/e1000.h +++ b/drivers/net/ethernet/intel/e1000e/e1000.h | |||
@@ -206,6 +206,7 @@ enum e1000_boards { | |||
206 | board_ich10lan, | 206 | board_ich10lan, |
207 | board_pchlan, | 207 | board_pchlan, |
208 | board_pch2lan, | 208 | board_pch2lan, |
209 | board_pch_lpt, | ||
209 | }; | 210 | }; |
210 | 211 | ||
211 | struct e1000_ps_page { | 212 | struct e1000_ps_page { |
@@ -528,6 +529,7 @@ extern const struct e1000_info e1000_ich9_info; | |||
528 | extern const struct e1000_info e1000_ich10_info; | 529 | extern const struct e1000_info e1000_ich10_info; |
529 | extern const struct e1000_info e1000_pch_info; | 530 | extern const struct e1000_info e1000_pch_info; |
530 | extern const struct e1000_info e1000_pch2_info; | 531 | extern const struct e1000_info e1000_pch2_info; |
532 | extern const struct e1000_info e1000_pch_lpt_info; | ||
531 | extern const struct e1000_info e1000_es2_info; | 533 | extern const struct e1000_info e1000_es2_info; |
532 | 534 | ||
533 | extern s32 e1000_read_pba_string_generic(struct e1000_hw *hw, u8 *pba_num, | 535 | extern s32 e1000_read_pba_string_generic(struct e1000_hw *hw, u8 *pba_num, |
diff --git a/drivers/net/ethernet/intel/e1000e/ethtool.c b/drivers/net/ethernet/intel/e1000e/ethtool.c index 4f1edd9c22f1..d863075df7a4 100644 --- a/drivers/net/ethernet/intel/e1000e/ethtool.c +++ b/drivers/net/ethernet/intel/e1000e/ethtool.c | |||
@@ -773,6 +773,7 @@ static int e1000_reg_test(struct e1000_adapter *adapter, u64 *data) | |||
773 | u32 i; | 773 | u32 i; |
774 | u32 toggle; | 774 | u32 toggle; |
775 | u32 mask; | 775 | u32 mask; |
776 | u32 wlock_mac = 0; | ||
776 | 777 | ||
777 | /* | 778 | /* |
778 | * The status register is Read Only, so a write should fail. | 779 | * The status register is Read Only, so a write should fail. |
@@ -838,19 +839,31 @@ static int e1000_reg_test(struct e1000_adapter *adapter, u64 *data) | |||
838 | case e1000_ich10lan: | 839 | case e1000_ich10lan: |
839 | case e1000_pchlan: | 840 | case e1000_pchlan: |
840 | case e1000_pch2lan: | 841 | case e1000_pch2lan: |
842 | case e1000_pch_lpt: | ||
841 | mask |= (1 << 18); | 843 | mask |= (1 << 18); |
842 | break; | 844 | break; |
843 | default: | 845 | default: |
844 | break; | 846 | break; |
845 | } | 847 | } |
846 | for (i = 0; i < mac->rar_entry_count; i++) | 848 | |
849 | if (mac->type == e1000_pch_lpt) | ||
850 | wlock_mac = (er32(FWSM) & E1000_FWSM_WLOCK_MAC_MASK) >> | ||
851 | E1000_FWSM_WLOCK_MAC_SHIFT; | ||
852 | |||
853 | for (i = 0; i < mac->rar_entry_count; i++) { | ||
854 | /* Cannot test write-protected SHRAL[n] registers */ | ||
855 | if ((wlock_mac == 1) || (wlock_mac && (i > wlock_mac))) | ||
856 | continue; | ||
857 | |||
847 | REG_PATTERN_TEST_ARRAY(E1000_RA, ((i << 1) + 1), | 858 | REG_PATTERN_TEST_ARRAY(E1000_RA, ((i << 1) + 1), |
848 | mask, 0xFFFFFFFF); | 859 | mask, 0xFFFFFFFF); |
860 | } | ||
849 | 861 | ||
850 | for (i = 0; i < mac->mta_reg_count; i++) | 862 | for (i = 0; i < mac->mta_reg_count; i++) |
851 | REG_PATTERN_TEST_ARRAY(E1000_MTA, i, 0xFFFFFFFF, 0xFFFFFFFF); | 863 | REG_PATTERN_TEST_ARRAY(E1000_MTA, i, 0xFFFFFFFF, 0xFFFFFFFF); |
852 | 864 | ||
853 | *data = 0; | 865 | *data = 0; |
866 | |||
854 | return 0; | 867 | return 0; |
855 | } | 868 | } |
856 | 869 | ||
diff --git a/drivers/net/ethernet/intel/e1000e/hw.h b/drivers/net/ethernet/intel/e1000e/hw.h index 00a0ebb41b8d..ed5b40985edb 100644 --- a/drivers/net/ethernet/intel/e1000e/hw.h +++ b/drivers/net/ethernet/intel/e1000e/hw.h | |||
@@ -200,6 +200,10 @@ enum e1e_registers { | |||
200 | #define E1000_RA (E1000_RAL(0)) | 200 | #define E1000_RA (E1000_RAL(0)) |
201 | E1000_RAH_BASE = 0x05404, /* Receive Address High - RW */ | 201 | E1000_RAH_BASE = 0x05404, /* Receive Address High - RW */ |
202 | #define E1000_RAH(_n) (E1000_RAH_BASE + ((_n) * 8)) | 202 | #define E1000_RAH(_n) (E1000_RAH_BASE + ((_n) * 8)) |
203 | E1000_SHRAL_PCH_LPT_BASE = 0x05408, | ||
204 | #define E1000_SHRAL_PCH_LPT(_n) (E1000_SHRAL_PCH_LPT_BASE + ((_n) * 8)) | ||
205 | E1000_SHRAH_PCH_LTP_BASE = 0x0540C, | ||
206 | #define E1000_SHRAH_PCH_LPT(_n) (E1000_SHRAH_PCH_LTP_BASE + ((_n) * 8)) | ||
203 | E1000_SHRAL_BASE = 0x05438, /* Shared Receive Address Low - RW */ | 207 | E1000_SHRAL_BASE = 0x05438, /* Shared Receive Address Low - RW */ |
204 | #define E1000_SHRAL(_n) (E1000_SHRAL_BASE + ((_n) * 8)) | 208 | #define E1000_SHRAL(_n) (E1000_SHRAL_BASE + ((_n) * 8)) |
205 | E1000_SHRAH_BASE = 0x0543C, /* Shared Receive Address High - RW */ | 209 | E1000_SHRAH_BASE = 0x0543C, /* Shared Receive Address High - RW */ |
@@ -406,6 +410,8 @@ enum e1e_registers { | |||
406 | #define E1000_DEV_ID_PCH_D_HV_DC 0x10F0 | 410 | #define E1000_DEV_ID_PCH_D_HV_DC 0x10F0 |
407 | #define E1000_DEV_ID_PCH2_LV_LM 0x1502 | 411 | #define E1000_DEV_ID_PCH2_LV_LM 0x1502 |
408 | #define E1000_DEV_ID_PCH2_LV_V 0x1503 | 412 | #define E1000_DEV_ID_PCH2_LV_V 0x1503 |
413 | #define E1000_DEV_ID_PCH_LPT_I217_LM 0x153A | ||
414 | #define E1000_DEV_ID_PCH_LPT_I217_V 0x153B | ||
409 | 415 | ||
410 | #define E1000_REVISION_4 4 | 416 | #define E1000_REVISION_4 4 |
411 | 417 | ||
@@ -426,6 +432,7 @@ enum e1000_mac_type { | |||
426 | e1000_ich10lan, | 432 | e1000_ich10lan, |
427 | e1000_pchlan, | 433 | e1000_pchlan, |
428 | e1000_pch2lan, | 434 | e1000_pch2lan, |
435 | e1000_pch_lpt, | ||
429 | }; | 436 | }; |
430 | 437 | ||
431 | enum e1000_media_type { | 438 | enum e1000_media_type { |
@@ -463,6 +470,7 @@ enum e1000_phy_type { | |||
463 | e1000_phy_82578, | 470 | e1000_phy_82578, |
464 | e1000_phy_82577, | 471 | e1000_phy_82577, |
465 | e1000_phy_82579, | 472 | e1000_phy_82579, |
473 | e1000_phy_i217, | ||
466 | }; | 474 | }; |
467 | 475 | ||
468 | enum e1000_bus_width { | 476 | enum e1000_bus_width { |
@@ -971,6 +979,7 @@ struct e1000_dev_spec_ich8lan { | |||
971 | struct e1000_shadow_ram shadow_ram[E1000_ICH8_SHADOW_RAM_WORDS]; | 979 | struct e1000_shadow_ram shadow_ram[E1000_ICH8_SHADOW_RAM_WORDS]; |
972 | bool nvm_k1_enabled; | 980 | bool nvm_k1_enabled; |
973 | bool eee_disable; | 981 | bool eee_disable; |
982 | u16 eee_lp_ability; | ||
974 | }; | 983 | }; |
975 | 984 | ||
976 | struct e1000_hw { | 985 | struct e1000_hw { |
diff --git a/drivers/net/ethernet/intel/e1000e/ich8lan.c b/drivers/net/ethernet/intel/e1000e/ich8lan.c index dfff4416cf4b..bbf70ba367da 100644 --- a/drivers/net/ethernet/intel/e1000e/ich8lan.c +++ b/drivers/net/ethernet/intel/e1000e/ich8lan.c | |||
@@ -116,6 +116,7 @@ | |||
116 | 116 | ||
117 | #define E1000_ICH_RAR_ENTRIES 7 | 117 | #define E1000_ICH_RAR_ENTRIES 7 |
118 | #define E1000_PCH2_RAR_ENTRIES 5 /* RAR[0], SHRA[0-3] */ | 118 | #define E1000_PCH2_RAR_ENTRIES 5 /* RAR[0], SHRA[0-3] */ |
119 | #define E1000_PCH_LPT_RAR_ENTRIES 12 /* RAR[0], SHRA[0-10] */ | ||
119 | 120 | ||
120 | #define PHY_PAGE_SHIFT 5 | 121 | #define PHY_PAGE_SHIFT 5 |
121 | #define PHY_REG(page, reg) (((page) << PHY_PAGE_SHIFT) | \ | 122 | #define PHY_REG(page, reg) (((page) << PHY_PAGE_SHIFT) | \ |
@@ -131,11 +132,18 @@ | |||
131 | 132 | ||
132 | #define SW_FLAG_TIMEOUT 1000 /* SW Semaphore flag timeout in milliseconds */ | 133 | #define SW_FLAG_TIMEOUT 1000 /* SW Semaphore flag timeout in milliseconds */ |
133 | 134 | ||
135 | /* SMBus Control Phy Register */ | ||
136 | #define CV_SMB_CTRL PHY_REG(769, 23) | ||
137 | #define CV_SMB_CTRL_FORCE_SMBUS 0x0001 | ||
138 | |||
134 | /* SMBus Address Phy Register */ | 139 | /* SMBus Address Phy Register */ |
135 | #define HV_SMB_ADDR PHY_REG(768, 26) | 140 | #define HV_SMB_ADDR PHY_REG(768, 26) |
136 | #define HV_SMB_ADDR_MASK 0x007F | 141 | #define HV_SMB_ADDR_MASK 0x007F |
137 | #define HV_SMB_ADDR_PEC_EN 0x0200 | 142 | #define HV_SMB_ADDR_PEC_EN 0x0200 |
138 | #define HV_SMB_ADDR_VALID 0x0080 | 143 | #define HV_SMB_ADDR_VALID 0x0080 |
144 | #define HV_SMB_ADDR_FREQ_MASK 0x1100 | ||
145 | #define HV_SMB_ADDR_FREQ_LOW_SHIFT 8 | ||
146 | #define HV_SMB_ADDR_FREQ_HIGH_SHIFT 12 | ||
139 | 147 | ||
140 | /* PHY Power Management Control */ | 148 | /* PHY Power Management Control */ |
141 | #define HV_PM_CTRL PHY_REG(770, 17) | 149 | #define HV_PM_CTRL PHY_REG(770, 17) |
@@ -152,11 +160,26 @@ | |||
152 | #define I82579_LPI_UPDATE_TIMER 0x4805 /* in 40ns units + 40 ns base value */ | 160 | #define I82579_LPI_UPDATE_TIMER 0x4805 /* in 40ns units + 40 ns base value */ |
153 | #define I82579_MSE_THRESHOLD 0x084F /* Mean Square Error Threshold */ | 161 | #define I82579_MSE_THRESHOLD 0x084F /* Mean Square Error Threshold */ |
154 | #define I82579_MSE_LINK_DOWN 0x2411 /* MSE count before dropping link */ | 162 | #define I82579_MSE_LINK_DOWN 0x2411 /* MSE count before dropping link */ |
163 | #define I217_EEE_ADVERTISEMENT 0x8001 /* IEEE MMD Register 7.60 */ | ||
164 | #define I217_EEE_LP_ABILITY 0x8002 /* IEEE MMD Register 7.61 */ | ||
165 | #define I217_EEE_100_SUPPORTED (1 << 1) /* 100BaseTx EEE supported */ | ||
166 | |||
167 | /* Intel Rapid Start Technology Support */ | ||
168 | #define I217_PROXY_CTRL PHY_REG(BM_WUC_PAGE, 70) | ||
169 | #define I217_PROXY_CTRL_AUTO_DISABLE 0x0080 | ||
170 | #define I217_SxCTRL PHY_REG(BM_PORT_CTRL_PAGE, 28) | ||
171 | #define I217_SxCTRL_MASK 0x1000 | ||
172 | #define I217_CGFREG PHY_REG(772, 29) | ||
173 | #define I217_CGFREG_MASK 0x0002 | ||
174 | #define I217_MEMPWR PHY_REG(772, 26) | ||
175 | #define I217_MEMPWR_MASK 0x0010 | ||
155 | 176 | ||
156 | /* Strapping Option Register - RO */ | 177 | /* Strapping Option Register - RO */ |
157 | #define E1000_STRAP 0x0000C | 178 | #define E1000_STRAP 0x0000C |
158 | #define E1000_STRAP_SMBUS_ADDRESS_MASK 0x00FE0000 | 179 | #define E1000_STRAP_SMBUS_ADDRESS_MASK 0x00FE0000 |
159 | #define E1000_STRAP_SMBUS_ADDRESS_SHIFT 17 | 180 | #define E1000_STRAP_SMBUS_ADDRESS_SHIFT 17 |
181 | #define E1000_STRAP_SMT_FREQ_MASK 0x00003000 | ||
182 | #define E1000_STRAP_SMT_FREQ_SHIFT 12 | ||
160 | 183 | ||
161 | /* OEM Bits Phy Register */ | 184 | /* OEM Bits Phy Register */ |
162 | #define HV_OEM_BITS PHY_REG(768, 25) | 185 | #define HV_OEM_BITS PHY_REG(768, 25) |
@@ -261,6 +284,7 @@ static s32 e1000_set_mdio_slow_mode_hv(struct e1000_hw *hw); | |||
261 | static bool e1000_check_mng_mode_ich8lan(struct e1000_hw *hw); | 284 | static bool e1000_check_mng_mode_ich8lan(struct e1000_hw *hw); |
262 | static bool e1000_check_mng_mode_pchlan(struct e1000_hw *hw); | 285 | static bool e1000_check_mng_mode_pchlan(struct e1000_hw *hw); |
263 | static void e1000_rar_set_pch2lan(struct e1000_hw *hw, u8 *addr, u32 index); | 286 | static void e1000_rar_set_pch2lan(struct e1000_hw *hw, u8 *addr, u32 index); |
287 | static void e1000_rar_set_pch_lpt(struct e1000_hw *hw, u8 *addr, u32 index); | ||
264 | static s32 e1000_k1_workaround_lv(struct e1000_hw *hw); | 288 | static s32 e1000_k1_workaround_lv(struct e1000_hw *hw); |
265 | static void e1000_gate_hw_phy_config_ich8lan(struct e1000_hw *hw, bool gate); | 289 | static void e1000_gate_hw_phy_config_ich8lan(struct e1000_hw *hw, bool gate); |
266 | 290 | ||
@@ -332,6 +356,7 @@ static s32 e1000_init_phy_workarounds_pchlan(struct e1000_hw *hw) | |||
332 | { | 356 | { |
333 | u32 mac_reg, fwsm = er32(FWSM); | 357 | u32 mac_reg, fwsm = er32(FWSM); |
334 | s32 ret_val; | 358 | s32 ret_val; |
359 | u16 phy_reg; | ||
335 | 360 | ||
336 | ret_val = hw->phy.ops.acquire(hw); | 361 | ret_val = hw->phy.ops.acquire(hw); |
337 | if (ret_val) { | 362 | if (ret_val) { |
@@ -345,16 +370,42 @@ static s32 e1000_init_phy_workarounds_pchlan(struct e1000_hw *hw) | |||
345 | * LANPHYPC Value bit to force the interconnect to PCIe mode. | 370 | * LANPHYPC Value bit to force the interconnect to PCIe mode. |
346 | */ | 371 | */ |
347 | switch (hw->mac.type) { | 372 | switch (hw->mac.type) { |
373 | case e1000_pch_lpt: | ||
374 | if (e1000_phy_is_accessible_pchlan(hw)) | ||
375 | break; | ||
376 | |||
377 | /* | ||
378 | * Before toggling LANPHYPC, see if PHY is accessible by | ||
379 | * forcing MAC to SMBus mode first. | ||
380 | */ | ||
381 | mac_reg = er32(CTRL_EXT); | ||
382 | mac_reg |= E1000_CTRL_EXT_FORCE_SMBUS; | ||
383 | ew32(CTRL_EXT, mac_reg); | ||
384 | |||
385 | /* fall-through */ | ||
348 | case e1000_pch2lan: | 386 | case e1000_pch2lan: |
349 | /* | 387 | /* |
350 | * Gate automatic PHY configuration by hardware on | 388 | * Gate automatic PHY configuration by hardware on |
351 | * non-managed 82579 | 389 | * non-managed 82579 |
352 | */ | 390 | */ |
353 | if (!(fwsm & E1000_ICH_FWSM_FW_VALID)) | 391 | if ((hw->mac.type == e1000_pch2lan) && |
392 | !(fwsm & E1000_ICH_FWSM_FW_VALID)) | ||
354 | e1000_gate_hw_phy_config_ich8lan(hw, true); | 393 | e1000_gate_hw_phy_config_ich8lan(hw, true); |
355 | 394 | ||
356 | if (e1000_phy_is_accessible_pchlan(hw)) | 395 | if (e1000_phy_is_accessible_pchlan(hw)) { |
396 | if (hw->mac.type == e1000_pch_lpt) { | ||
397 | /* Unforce SMBus mode in PHY */ | ||
398 | e1e_rphy_locked(hw, CV_SMB_CTRL, &phy_reg); | ||
399 | phy_reg &= ~CV_SMB_CTRL_FORCE_SMBUS; | ||
400 | e1e_wphy_locked(hw, CV_SMB_CTRL, phy_reg); | ||
401 | |||
402 | /* Unforce SMBus mode in MAC */ | ||
403 | mac_reg = er32(CTRL_EXT); | ||
404 | mac_reg &= ~E1000_CTRL_EXT_FORCE_SMBUS; | ||
405 | ew32(CTRL_EXT, mac_reg); | ||
406 | } | ||
357 | break; | 407 | break; |
408 | } | ||
358 | 409 | ||
359 | /* fall-through */ | 410 | /* fall-through */ |
360 | case e1000_pchlan: | 411 | case e1000_pchlan: |
@@ -385,7 +436,15 @@ static s32 e1000_init_phy_workarounds_pchlan(struct e1000_hw *hw) | |||
385 | mac_reg &= ~E1000_CTRL_LANPHYPC_OVERRIDE; | 436 | mac_reg &= ~E1000_CTRL_LANPHYPC_OVERRIDE; |
386 | ew32(CTRL, mac_reg); | 437 | ew32(CTRL, mac_reg); |
387 | e1e_flush(); | 438 | e1e_flush(); |
388 | msleep(50); | 439 | if (hw->mac.type < e1000_pch_lpt) { |
440 | msleep(50); | ||
441 | } else { | ||
442 | u16 count = 20; | ||
443 | do { | ||
444 | usleep_range(5000, 10000); | ||
445 | } while (!(er32(CTRL_EXT) & | ||
446 | E1000_CTRL_EXT_LPCD) && count--); | ||
447 | } | ||
389 | break; | 448 | break; |
390 | default: | 449 | default: |
391 | break; | 450 | break; |
@@ -454,6 +513,7 @@ static s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw) | |||
454 | break; | 513 | break; |
455 | /* fall-through */ | 514 | /* fall-through */ |
456 | case e1000_pch2lan: | 515 | case e1000_pch2lan: |
516 | case e1000_pch_lpt: | ||
457 | /* | 517 | /* |
458 | * In case the PHY needs to be in mdio slow mode, | 518 | * In case the PHY needs to be in mdio slow mode, |
459 | * set slow mode and try to get the PHY id again. | 519 | * set slow mode and try to get the PHY id again. |
@@ -471,6 +531,7 @@ static s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw) | |||
471 | switch (phy->type) { | 531 | switch (phy->type) { |
472 | case e1000_phy_82577: | 532 | case e1000_phy_82577: |
473 | case e1000_phy_82579: | 533 | case e1000_phy_82579: |
534 | case e1000_phy_i217: | ||
474 | phy->ops.check_polarity = e1000_check_polarity_82577; | 535 | phy->ops.check_polarity = e1000_check_polarity_82577; |
475 | phy->ops.force_speed_duplex = | 536 | phy->ops.force_speed_duplex = |
476 | e1000_phy_force_speed_duplex_82577; | 537 | e1000_phy_force_speed_duplex_82577; |
@@ -655,7 +716,7 @@ static s32 e1000_init_mac_params_ich8lan(struct e1000_hw *hw) | |||
655 | /* Adaptive IFS supported */ | 716 | /* Adaptive IFS supported */ |
656 | mac->adaptive_ifs = true; | 717 | mac->adaptive_ifs = true; |
657 | 718 | ||
658 | /* LED operations */ | 719 | /* LED and other operations */ |
659 | switch (mac->type) { | 720 | switch (mac->type) { |
660 | case e1000_ich8lan: | 721 | case e1000_ich8lan: |
661 | case e1000_ich9lan: | 722 | case e1000_ich9lan: |
@@ -678,6 +739,7 @@ static s32 e1000_init_mac_params_ich8lan(struct e1000_hw *hw) | |||
678 | mac->rar_entry_count = E1000_PCH2_RAR_ENTRIES; | 739 | mac->rar_entry_count = E1000_PCH2_RAR_ENTRIES; |
679 | mac->ops.rar_set = e1000_rar_set_pch2lan; | 740 | mac->ops.rar_set = e1000_rar_set_pch2lan; |
680 | /* fall-through */ | 741 | /* fall-through */ |
742 | case e1000_pch_lpt: | ||
681 | case e1000_pchlan: | 743 | case e1000_pchlan: |
682 | /* check management mode */ | 744 | /* check management mode */ |
683 | mac->ops.check_mng_mode = e1000_check_mng_mode_pchlan; | 745 | mac->ops.check_mng_mode = e1000_check_mng_mode_pchlan; |
@@ -695,12 +757,20 @@ static s32 e1000_init_mac_params_ich8lan(struct e1000_hw *hw) | |||
695 | break; | 757 | break; |
696 | } | 758 | } |
697 | 759 | ||
760 | if (mac->type == e1000_pch_lpt) { | ||
761 | mac->rar_entry_count = E1000_PCH_LPT_RAR_ENTRIES; | ||
762 | mac->ops.rar_set = e1000_rar_set_pch_lpt; | ||
763 | } | ||
764 | |||
698 | /* Enable PCS Lock-loss workaround for ICH8 */ | 765 | /* Enable PCS Lock-loss workaround for ICH8 */ |
699 | if (mac->type == e1000_ich8lan) | 766 | if (mac->type == e1000_ich8lan) |
700 | e1000e_set_kmrn_lock_loss_workaround_ich8lan(hw, true); | 767 | e1000e_set_kmrn_lock_loss_workaround_ich8lan(hw, true); |
701 | 768 | ||
702 | /* Gate automatic PHY configuration by hardware on managed 82579 */ | 769 | /* |
703 | if ((mac->type == e1000_pch2lan) && | 770 | * Gate automatic PHY configuration by hardware on managed |
771 | * 82579 and i217 | ||
772 | */ | ||
773 | if ((mac->type == e1000_pch2lan || mac->type == e1000_pch_lpt) && | ||
704 | (er32(FWSM) & E1000_ICH_FWSM_FW_VALID)) | 774 | (er32(FWSM) & E1000_ICH_FWSM_FW_VALID)) |
705 | e1000_gate_hw_phy_config_ich8lan(hw, true); | 775 | e1000_gate_hw_phy_config_ich8lan(hw, true); |
706 | 776 | ||
@@ -716,22 +786,50 @@ static s32 e1000_init_mac_params_ich8lan(struct e1000_hw *hw) | |||
716 | **/ | 786 | **/ |
717 | static s32 e1000_set_eee_pchlan(struct e1000_hw *hw) | 787 | static s32 e1000_set_eee_pchlan(struct e1000_hw *hw) |
718 | { | 788 | { |
789 | struct e1000_dev_spec_ich8lan *dev_spec = &hw->dev_spec.ich8lan; | ||
719 | s32 ret_val = 0; | 790 | s32 ret_val = 0; |
720 | u16 phy_reg; | 791 | u16 phy_reg; |
721 | 792 | ||
722 | if (hw->phy.type != e1000_phy_82579) | 793 | if ((hw->phy.type != e1000_phy_82579) && |
794 | (hw->phy.type != e1000_phy_i217)) | ||
723 | return 0; | 795 | return 0; |
724 | 796 | ||
725 | ret_val = e1e_rphy(hw, I82579_LPI_CTRL, &phy_reg); | 797 | ret_val = e1e_rphy(hw, I82579_LPI_CTRL, &phy_reg); |
726 | if (ret_val) | 798 | if (ret_val) |
727 | return ret_val; | 799 | return ret_val; |
728 | 800 | ||
729 | if (hw->dev_spec.ich8lan.eee_disable) | 801 | if (dev_spec->eee_disable) |
730 | phy_reg &= ~I82579_LPI_CTRL_ENABLE_MASK; | 802 | phy_reg &= ~I82579_LPI_CTRL_ENABLE_MASK; |
731 | else | 803 | else |
732 | phy_reg |= I82579_LPI_CTRL_ENABLE_MASK; | 804 | phy_reg |= I82579_LPI_CTRL_ENABLE_MASK; |
733 | 805 | ||
734 | return e1e_wphy(hw, I82579_LPI_CTRL, phy_reg); | 806 | ret_val = e1e_wphy(hw, I82579_LPI_CTRL, phy_reg); |
807 | if (ret_val) | ||
808 | return ret_val; | ||
809 | |||
810 | if ((hw->phy.type == e1000_phy_i217) && !dev_spec->eee_disable) { | ||
811 | /* Save off link partner's EEE ability */ | ||
812 | ret_val = hw->phy.ops.acquire(hw); | ||
813 | if (ret_val) | ||
814 | return ret_val; | ||
815 | ret_val = e1e_wphy_locked(hw, I82579_EMI_ADDR, | ||
816 | I217_EEE_LP_ABILITY); | ||
817 | if (ret_val) | ||
818 | goto release; | ||
819 | e1e_rphy_locked(hw, I82579_EMI_DATA, &dev_spec->eee_lp_ability); | ||
820 | |||
821 | /* | ||
822 | * EEE is not supported in 100Half, so ignore partner's EEE | ||
823 | * in 100 ability if full-duplex is not advertised. | ||
824 | */ | ||
825 | e1e_rphy_locked(hw, PHY_LP_ABILITY, &phy_reg); | ||
826 | if (!(phy_reg & NWAY_LPAR_100TX_FD_CAPS)) | ||
827 | dev_spec->eee_lp_ability &= ~I217_EEE_100_SUPPORTED; | ||
828 | release: | ||
829 | hw->phy.ops.release(hw); | ||
830 | } | ||
831 | |||
832 | return 0; | ||
735 | } | 833 | } |
736 | 834 | ||
737 | /** | 835 | /** |
@@ -773,6 +871,9 @@ static s32 e1000_check_for_copper_link_ich8lan(struct e1000_hw *hw) | |||
773 | return ret_val; | 871 | return ret_val; |
774 | } | 872 | } |
775 | 873 | ||
874 | /* Clear link partner's EEE ability */ | ||
875 | hw->dev_spec.ich8lan.eee_lp_ability = 0; | ||
876 | |||
776 | if (!link) | 877 | if (!link) |
777 | return 0; /* No link detected */ | 878 | return 0; /* No link detected */ |
778 | 879 | ||
@@ -868,6 +969,7 @@ static s32 e1000_get_variants_ich8lan(struct e1000_adapter *adapter) | |||
868 | break; | 969 | break; |
869 | case e1000_pchlan: | 970 | case e1000_pchlan: |
870 | case e1000_pch2lan: | 971 | case e1000_pch2lan: |
972 | case e1000_pch_lpt: | ||
871 | rc = e1000_init_phy_params_pchlan(hw); | 973 | rc = e1000_init_phy_params_pchlan(hw); |
872 | break; | 974 | break; |
873 | default: | 975 | default: |
@@ -1117,6 +1219,81 @@ out: | |||
1117 | } | 1219 | } |
1118 | 1220 | ||
1119 | /** | 1221 | /** |
1222 | * e1000_rar_set_pch_lpt - Set receive address registers | ||
1223 | * @hw: pointer to the HW structure | ||
1224 | * @addr: pointer to the receive address | ||
1225 | * @index: receive address array register | ||
1226 | * | ||
1227 | * Sets the receive address register array at index to the address passed | ||
1228 | * in by addr. For LPT, RAR[0] is the base address register that is to | ||
1229 | * contain the MAC address. SHRA[0-10] are the shared receive address | ||
1230 | * registers that are shared between the Host and manageability engine (ME). | ||
1231 | **/ | ||
1232 | static void e1000_rar_set_pch_lpt(struct e1000_hw *hw, u8 *addr, u32 index) | ||
1233 | { | ||
1234 | u32 rar_low, rar_high; | ||
1235 | u32 wlock_mac; | ||
1236 | |||
1237 | /* | ||
1238 | * HW expects these in little endian so we reverse the byte order | ||
1239 | * from network order (big endian) to little endian | ||
1240 | */ | ||
1241 | rar_low = ((u32)addr[0] | ((u32)addr[1] << 8) | | ||
1242 | ((u32)addr[2] << 16) | ((u32)addr[3] << 24)); | ||
1243 | |||
1244 | rar_high = ((u32)addr[4] | ((u32)addr[5] << 8)); | ||
1245 | |||
1246 | /* If MAC address zero, no need to set the AV bit */ | ||
1247 | if (rar_low || rar_high) | ||
1248 | rar_high |= E1000_RAH_AV; | ||
1249 | |||
1250 | if (index == 0) { | ||
1251 | ew32(RAL(index), rar_low); | ||
1252 | e1e_flush(); | ||
1253 | ew32(RAH(index), rar_high); | ||
1254 | e1e_flush(); | ||
1255 | return; | ||
1256 | } | ||
1257 | |||
1258 | /* | ||
1259 | * The manageability engine (ME) can lock certain SHRAR registers that | ||
1260 | * it is using - those registers are unavailable for use. | ||
1261 | */ | ||
1262 | if (index < hw->mac.rar_entry_count) { | ||
1263 | wlock_mac = er32(FWSM) & E1000_FWSM_WLOCK_MAC_MASK; | ||
1264 | wlock_mac >>= E1000_FWSM_WLOCK_MAC_SHIFT; | ||
1265 | |||
1266 | /* Check if all SHRAR registers are locked */ | ||
1267 | if (wlock_mac == 1) | ||
1268 | goto out; | ||
1269 | |||
1270 | if ((wlock_mac == 0) || (index <= wlock_mac)) { | ||
1271 | s32 ret_val; | ||
1272 | |||
1273 | ret_val = e1000_acquire_swflag_ich8lan(hw); | ||
1274 | |||
1275 | if (ret_val) | ||
1276 | goto out; | ||
1277 | |||
1278 | ew32(SHRAL_PCH_LPT(index - 1), rar_low); | ||
1279 | e1e_flush(); | ||
1280 | ew32(SHRAH_PCH_LPT(index - 1), rar_high); | ||
1281 | e1e_flush(); | ||
1282 | |||
1283 | e1000_release_swflag_ich8lan(hw); | ||
1284 | |||
1285 | /* verify the register updates */ | ||
1286 | if ((er32(SHRAL_PCH_LPT(index - 1)) == rar_low) && | ||
1287 | (er32(SHRAH_PCH_LPT(index - 1)) == rar_high)) | ||
1288 | return; | ||
1289 | } | ||
1290 | } | ||
1291 | |||
1292 | out: | ||
1293 | e_dbg("Failed to write receive address at index %d\n", index); | ||
1294 | } | ||
1295 | |||
1296 | /** | ||
1120 | * e1000_check_reset_block_ich8lan - Check if PHY reset is blocked | 1297 | * e1000_check_reset_block_ich8lan - Check if PHY reset is blocked |
1121 | * @hw: pointer to the HW structure | 1298 | * @hw: pointer to the HW structure |
1122 | * | 1299 | * |
@@ -1144,6 +1321,8 @@ static s32 e1000_write_smbus_addr(struct e1000_hw *hw) | |||
1144 | { | 1321 | { |
1145 | u16 phy_data; | 1322 | u16 phy_data; |
1146 | u32 strap = er32(STRAP); | 1323 | u32 strap = er32(STRAP); |
1324 | u32 freq = (strap & E1000_STRAP_SMT_FREQ_MASK) >> | ||
1325 | E1000_STRAP_SMT_FREQ_SHIFT; | ||
1147 | s32 ret_val = 0; | 1326 | s32 ret_val = 0; |
1148 | 1327 | ||
1149 | strap &= E1000_STRAP_SMBUS_ADDRESS_MASK; | 1328 | strap &= E1000_STRAP_SMBUS_ADDRESS_MASK; |
@@ -1156,6 +1335,19 @@ static s32 e1000_write_smbus_addr(struct e1000_hw *hw) | |||
1156 | phy_data |= (strap >> E1000_STRAP_SMBUS_ADDRESS_SHIFT); | 1335 | phy_data |= (strap >> E1000_STRAP_SMBUS_ADDRESS_SHIFT); |
1157 | phy_data |= HV_SMB_ADDR_PEC_EN | HV_SMB_ADDR_VALID; | 1336 | phy_data |= HV_SMB_ADDR_PEC_EN | HV_SMB_ADDR_VALID; |
1158 | 1337 | ||
1338 | if (hw->phy.type == e1000_phy_i217) { | ||
1339 | /* Restore SMBus frequency */ | ||
1340 | if (freq--) { | ||
1341 | phy_data &= ~HV_SMB_ADDR_FREQ_MASK; | ||
1342 | phy_data |= (freq & (1 << 0)) << | ||
1343 | HV_SMB_ADDR_FREQ_LOW_SHIFT; | ||
1344 | phy_data |= (freq & (1 << 1)) << | ||
1345 | (HV_SMB_ADDR_FREQ_HIGH_SHIFT - 1); | ||
1346 | } else { | ||
1347 | e_dbg("Unsupported SMB frequency in PHY\n"); | ||
1348 | } | ||
1349 | } | ||
1350 | |||
1159 | return e1000_write_phy_reg_hv_locked(hw, HV_SMB_ADDR, phy_data); | 1351 | return e1000_write_phy_reg_hv_locked(hw, HV_SMB_ADDR, phy_data); |
1160 | } | 1352 | } |
1161 | 1353 | ||
@@ -1193,6 +1385,7 @@ static s32 e1000_sw_lcd_config_ich8lan(struct e1000_hw *hw) | |||
1193 | /* Fall-thru */ | 1385 | /* Fall-thru */ |
1194 | case e1000_pchlan: | 1386 | case e1000_pchlan: |
1195 | case e1000_pch2lan: | 1387 | case e1000_pch2lan: |
1388 | case e1000_pch_lpt: | ||
1196 | sw_cfg_mask = E1000_FEXTNVM_SW_CONFIG_ICH8M; | 1389 | sw_cfg_mask = E1000_FEXTNVM_SW_CONFIG_ICH8M; |
1197 | break; | 1390 | break; |
1198 | default: | 1391 | default: |
@@ -1212,10 +1405,9 @@ static s32 e1000_sw_lcd_config_ich8lan(struct e1000_hw *hw) | |||
1212 | * extended configuration before SW configuration | 1405 | * extended configuration before SW configuration |
1213 | */ | 1406 | */ |
1214 | data = er32(EXTCNF_CTRL); | 1407 | data = er32(EXTCNF_CTRL); |
1215 | if (!(hw->mac.type == e1000_pch2lan)) { | 1408 | if ((hw->mac.type < e1000_pch2lan) && |
1216 | if (data & E1000_EXTCNF_CTRL_LCD_WRITE_ENABLE) | 1409 | (data & E1000_EXTCNF_CTRL_LCD_WRITE_ENABLE)) |
1217 | goto release; | 1410 | goto release; |
1218 | } | ||
1219 | 1411 | ||
1220 | cnf_size = er32(EXTCNF_SIZE); | 1412 | cnf_size = er32(EXTCNF_SIZE); |
1221 | cnf_size &= E1000_EXTCNF_SIZE_EXT_PCIE_LENGTH_MASK; | 1413 | cnf_size &= E1000_EXTCNF_SIZE_EXT_PCIE_LENGTH_MASK; |
@@ -1226,9 +1418,9 @@ static s32 e1000_sw_lcd_config_ich8lan(struct e1000_hw *hw) | |||
1226 | cnf_base_addr = data & E1000_EXTCNF_CTRL_EXT_CNF_POINTER_MASK; | 1418 | cnf_base_addr = data & E1000_EXTCNF_CTRL_EXT_CNF_POINTER_MASK; |
1227 | cnf_base_addr >>= E1000_EXTCNF_CTRL_EXT_CNF_POINTER_SHIFT; | 1419 | cnf_base_addr >>= E1000_EXTCNF_CTRL_EXT_CNF_POINTER_SHIFT; |
1228 | 1420 | ||
1229 | if ((!(data & E1000_EXTCNF_CTRL_OEM_WRITE_ENABLE) && | 1421 | if (((hw->mac.type == e1000_pchlan) && |
1230 | (hw->mac.type == e1000_pchlan)) || | 1422 | !(data & E1000_EXTCNF_CTRL_OEM_WRITE_ENABLE)) || |
1231 | (hw->mac.type == e1000_pch2lan)) { | 1423 | (hw->mac.type > e1000_pchlan)) { |
1232 | /* | 1424 | /* |
1233 | * HW configures the SMBus address and LEDs when the | 1425 | * HW configures the SMBus address and LEDs when the |
1234 | * OEM and LCD Write Enable bits are set in the NVM. | 1426 | * OEM and LCD Write Enable bits are set in the NVM. |
@@ -1425,14 +1617,14 @@ static s32 e1000_oem_bits_config_ich8lan(struct e1000_hw *hw, bool d0_state) | |||
1425 | u32 mac_reg; | 1617 | u32 mac_reg; |
1426 | u16 oem_reg; | 1618 | u16 oem_reg; |
1427 | 1619 | ||
1428 | if ((hw->mac.type != e1000_pch2lan) && (hw->mac.type != e1000_pchlan)) | 1620 | if (hw->mac.type < e1000_pchlan) |
1429 | return ret_val; | 1621 | return ret_val; |
1430 | 1622 | ||
1431 | ret_val = hw->phy.ops.acquire(hw); | 1623 | ret_val = hw->phy.ops.acquire(hw); |
1432 | if (ret_val) | 1624 | if (ret_val) |
1433 | return ret_val; | 1625 | return ret_val; |
1434 | 1626 | ||
1435 | if (!(hw->mac.type == e1000_pch2lan)) { | 1627 | if (hw->mac.type == e1000_pchlan) { |
1436 | mac_reg = er32(EXTCNF_CTRL); | 1628 | mac_reg = er32(EXTCNF_CTRL); |
1437 | if (mac_reg & E1000_EXTCNF_CTRL_OEM_WRITE_ENABLE) | 1629 | if (mac_reg & E1000_EXTCNF_CTRL_OEM_WRITE_ENABLE) |
1438 | goto release; | 1630 | goto release; |
@@ -1629,7 +1821,7 @@ s32 e1000_lv_jumbo_workaround_ich8lan(struct e1000_hw *hw, bool enable) | |||
1629 | u32 mac_reg; | 1821 | u32 mac_reg; |
1630 | u16 i; | 1822 | u16 i; |
1631 | 1823 | ||
1632 | if (hw->mac.type != e1000_pch2lan) | 1824 | if (hw->mac.type < e1000_pch2lan) |
1633 | return 0; | 1825 | return 0; |
1634 | 1826 | ||
1635 | /* disable Rx path while enabling/disabling workaround */ | 1827 | /* disable Rx path while enabling/disabling workaround */ |
@@ -1886,7 +2078,7 @@ static void e1000_gate_hw_phy_config_ich8lan(struct e1000_hw *hw, bool gate) | |||
1886 | { | 2078 | { |
1887 | u32 extcnf_ctrl; | 2079 | u32 extcnf_ctrl; |
1888 | 2080 | ||
1889 | if (hw->mac.type != e1000_pch2lan) | 2081 | if (hw->mac.type < e1000_pch2lan) |
1890 | return; | 2082 | return; |
1891 | 2083 | ||
1892 | extcnf_ctrl = er32(EXTCNF_CTRL); | 2084 | extcnf_ctrl = er32(EXTCNF_CTRL); |
@@ -3525,6 +3717,7 @@ static s32 e1000_setup_link_ich8lan(struct e1000_hw *hw) | |||
3525 | ew32(FCTTV, hw->fc.pause_time); | 3717 | ew32(FCTTV, hw->fc.pause_time); |
3526 | if ((hw->phy.type == e1000_phy_82578) || | 3718 | if ((hw->phy.type == e1000_phy_82578) || |
3527 | (hw->phy.type == e1000_phy_82579) || | 3719 | (hw->phy.type == e1000_phy_82579) || |
3720 | (hw->phy.type == e1000_phy_i217) || | ||
3528 | (hw->phy.type == e1000_phy_82577)) { | 3721 | (hw->phy.type == e1000_phy_82577)) { |
3529 | ew32(FCRTV_PCH, hw->fc.refresh_time); | 3722 | ew32(FCRTV_PCH, hw->fc.refresh_time); |
3530 | 3723 | ||
@@ -3588,6 +3781,7 @@ static s32 e1000_setup_copper_link_ich8lan(struct e1000_hw *hw) | |||
3588 | break; | 3781 | break; |
3589 | case e1000_phy_82577: | 3782 | case e1000_phy_82577: |
3590 | case e1000_phy_82579: | 3783 | case e1000_phy_82579: |
3784 | case e1000_phy_i217: | ||
3591 | ret_val = e1000_copper_link_setup_82577(hw); | 3785 | ret_val = e1000_copper_link_setup_82577(hw); |
3592 | if (ret_val) | 3786 | if (ret_val) |
3593 | return ret_val; | 3787 | return ret_val; |
@@ -3834,14 +4028,88 @@ void e1000e_gig_downshift_workaround_ich8lan(struct e1000_hw *hw) | |||
3834 | * the LPLU setting in the NVM or custom setting. For PCH and newer parts, | 4028 | * the LPLU setting in the NVM or custom setting. For PCH and newer parts, |
3835 | * the OEM bits PHY register (LED, GbE disable and LPLU configurations) also | 4029 | * the OEM bits PHY register (LED, GbE disable and LPLU configurations) also |
3836 | * needs to be written. | 4030 | * needs to be written. |
4031 | * Parts that support (and are linked to a partner which support) EEE in | ||
4032 | * 100Mbps should disable LPLU since 100Mbps w/ EEE requires less power | ||
4033 | * than 10Mbps w/o EEE. | ||
3837 | **/ | 4034 | **/ |
3838 | void e1000_suspend_workarounds_ich8lan(struct e1000_hw *hw) | 4035 | void e1000_suspend_workarounds_ich8lan(struct e1000_hw *hw) |
3839 | { | 4036 | { |
4037 | struct e1000_dev_spec_ich8lan *dev_spec = &hw->dev_spec.ich8lan; | ||
3840 | u32 phy_ctrl; | 4038 | u32 phy_ctrl; |
3841 | s32 ret_val; | 4039 | s32 ret_val; |
3842 | 4040 | ||
3843 | phy_ctrl = er32(PHY_CTRL); | 4041 | phy_ctrl = er32(PHY_CTRL); |
3844 | phy_ctrl |= E1000_PHY_CTRL_GBE_DISABLE; | 4042 | phy_ctrl |= E1000_PHY_CTRL_GBE_DISABLE; |
4043 | if (hw->phy.type == e1000_phy_i217) { | ||
4044 | u16 phy_reg; | ||
4045 | |||
4046 | ret_val = hw->phy.ops.acquire(hw); | ||
4047 | if (ret_val) | ||
4048 | goto out; | ||
4049 | |||
4050 | if (!dev_spec->eee_disable) { | ||
4051 | u16 eee_advert; | ||
4052 | |||
4053 | ret_val = e1e_wphy_locked(hw, I82579_EMI_ADDR, | ||
4054 | I217_EEE_ADVERTISEMENT); | ||
4055 | if (ret_val) | ||
4056 | goto release; | ||
4057 | e1e_rphy_locked(hw, I82579_EMI_DATA, &eee_advert); | ||
4058 | |||
4059 | /* | ||
4060 | * Disable LPLU if both link partners support 100BaseT | ||
4061 | * EEE and 100Full is advertised on both ends of the | ||
4062 | * link. | ||
4063 | */ | ||
4064 | if ((eee_advert & I217_EEE_100_SUPPORTED) && | ||
4065 | (dev_spec->eee_lp_ability & | ||
4066 | I217_EEE_100_SUPPORTED) && | ||
4067 | (hw->phy.autoneg_advertised & ADVERTISE_100_FULL)) | ||
4068 | phy_ctrl &= ~(E1000_PHY_CTRL_D0A_LPLU | | ||
4069 | E1000_PHY_CTRL_NOND0A_LPLU); | ||
4070 | } | ||
4071 | |||
4072 | /* | ||
4073 | * For i217 Intel Rapid Start Technology support, | ||
4074 | * when the system is going into Sx and no manageability engine | ||
4075 | * is present, the driver must configure proxy to reset only on | ||
4076 | * power good. LPI (Low Power Idle) state must also reset only | ||
4077 | * on power good, as well as the MTA (Multicast table array). | ||
4078 | * The SMBus release must also be disabled on LCD reset. | ||
4079 | */ | ||
4080 | if (!(er32(FWSM) & E1000_ICH_FWSM_FW_VALID)) { | ||
4081 | |||
4082 | /* Enable proxy to reset only on power good. */ | ||
4083 | e1e_rphy_locked(hw, I217_PROXY_CTRL, &phy_reg); | ||
4084 | phy_reg |= I217_PROXY_CTRL_AUTO_DISABLE; | ||
4085 | e1e_wphy_locked(hw, I217_PROXY_CTRL, phy_reg); | ||
4086 | |||
4087 | /* | ||
4088 | * Set bit enable LPI (EEE) to reset only on | ||
4089 | * power good. | ||
4090 | */ | ||
4091 | e1e_rphy_locked(hw, I217_SxCTRL, &phy_reg); | ||
4092 | phy_reg |= I217_SxCTRL_MASK; | ||
4093 | e1e_wphy_locked(hw, I217_SxCTRL, phy_reg); | ||
4094 | |||
4095 | /* Disable the SMB release on LCD reset. */ | ||
4096 | e1e_rphy_locked(hw, I217_MEMPWR, &phy_reg); | ||
4097 | phy_reg &= ~I217_MEMPWR; | ||
4098 | e1e_wphy_locked(hw, I217_MEMPWR, phy_reg); | ||
4099 | } | ||
4100 | |||
4101 | /* | ||
4102 | * Enable MTA to reset for Intel Rapid Start Technology | ||
4103 | * Support | ||
4104 | */ | ||
4105 | e1e_rphy_locked(hw, I217_CGFREG, &phy_reg); | ||
4106 | phy_reg |= I217_CGFREG_MASK; | ||
4107 | e1e_wphy_locked(hw, I217_CGFREG, phy_reg); | ||
4108 | |||
4109 | release: | ||
4110 | hw->phy.ops.release(hw); | ||
4111 | } | ||
4112 | out: | ||
3845 | ew32(PHY_CTRL, phy_ctrl); | 4113 | ew32(PHY_CTRL, phy_ctrl); |
3846 | 4114 | ||
3847 | if (hw->mac.type == e1000_ich8lan) | 4115 | if (hw->mac.type == e1000_ich8lan) |
@@ -3870,6 +4138,7 @@ void e1000_suspend_workarounds_ich8lan(struct e1000_hw *hw) | |||
3870 | * on which PHY resets are not blocked, if the PHY registers cannot be | 4138 | * on which PHY resets are not blocked, if the PHY registers cannot be |
3871 | * accessed properly by the s/w toggle the LANPHYPC value to power cycle | 4139 | * accessed properly by the s/w toggle the LANPHYPC value to power cycle |
3872 | * the PHY. | 4140 | * the PHY. |
4141 | * On i217, setup Intel Rapid Start Technology. | ||
3873 | **/ | 4142 | **/ |
3874 | void e1000_resume_workarounds_pchlan(struct e1000_hw *hw) | 4143 | void e1000_resume_workarounds_pchlan(struct e1000_hw *hw) |
3875 | { | 4144 | { |
@@ -3883,6 +4152,47 @@ void e1000_resume_workarounds_pchlan(struct e1000_hw *hw) | |||
3883 | e_dbg("Failed to init PHY flow ret_val=%d\n", ret_val); | 4152 | e_dbg("Failed to init PHY flow ret_val=%d\n", ret_val); |
3884 | return; | 4153 | return; |
3885 | } | 4154 | } |
4155 | |||
4156 | /* | ||
4157 | * For i217 Intel Rapid Start Technology support when the system | ||
4158 | * is transitioning from Sx and no manageability engine is present | ||
4159 | * configure SMBus to restore on reset, disable proxy, and enable | ||
4160 | * the reset on MTA (Multicast table array). | ||
4161 | */ | ||
4162 | if (hw->phy.type == e1000_phy_i217) { | ||
4163 | u16 phy_reg; | ||
4164 | |||
4165 | ret_val = hw->phy.ops.acquire(hw); | ||
4166 | if (ret_val) { | ||
4167 | e_dbg("Failed to setup iRST\n"); | ||
4168 | return; | ||
4169 | } | ||
4170 | |||
4171 | if (!(er32(FWSM) & E1000_ICH_FWSM_FW_VALID)) { | ||
4172 | /* | ||
4173 | * Restore clear on SMB if no manageability engine | ||
4174 | * is present | ||
4175 | */ | ||
4176 | ret_val = e1e_rphy_locked(hw, I217_MEMPWR, &phy_reg); | ||
4177 | if (ret_val) | ||
4178 | goto release; | ||
4179 | phy_reg |= I217_MEMPWR_MASK; | ||
4180 | e1e_wphy_locked(hw, I217_MEMPWR, phy_reg); | ||
4181 | |||
4182 | /* Disable Proxy */ | ||
4183 | e1e_wphy_locked(hw, I217_PROXY_CTRL, 0); | ||
4184 | } | ||
4185 | /* Enable reset on MTA */ | ||
4186 | ret_val = e1e_rphy_locked(hw, I217_CGFREG, &phy_reg); | ||
4187 | if (ret_val) | ||
4188 | goto release; | ||
4189 | phy_reg &= ~I217_CGFREG_MASK; | ||
4190 | e1e_wphy_locked(hw, I217_CGFREG, phy_reg); | ||
4191 | release: | ||
4192 | if (ret_val) | ||
4193 | e_dbg("Error %d in resume workarounds\n", ret_val); | ||
4194 | hw->phy.ops.release(hw); | ||
4195 | } | ||
3886 | } | 4196 | } |
3887 | 4197 | ||
3888 | /** | 4198 | /** |
@@ -4123,6 +4433,7 @@ static void e1000_clear_hw_cntrs_ich8lan(struct e1000_hw *hw) | |||
4123 | /* Clear PHY statistics registers */ | 4433 | /* Clear PHY statistics registers */ |
4124 | if ((hw->phy.type == e1000_phy_82578) || | 4434 | if ((hw->phy.type == e1000_phy_82578) || |
4125 | (hw->phy.type == e1000_phy_82579) || | 4435 | (hw->phy.type == e1000_phy_82579) || |
4436 | (hw->phy.type == e1000_phy_i217) || | ||
4126 | (hw->phy.type == e1000_phy_82577)) { | 4437 | (hw->phy.type == e1000_phy_82577)) { |
4127 | ret_val = hw->phy.ops.acquire(hw); | 4438 | ret_val = hw->phy.ops.acquire(hw); |
4128 | if (ret_val) | 4439 | if (ret_val) |
@@ -4282,3 +4593,22 @@ const struct e1000_info e1000_pch2_info = { | |||
4282 | .phy_ops = &ich8_phy_ops, | 4593 | .phy_ops = &ich8_phy_ops, |
4283 | .nvm_ops = &ich8_nvm_ops, | 4594 | .nvm_ops = &ich8_nvm_ops, |
4284 | }; | 4595 | }; |
4596 | |||
4597 | const struct e1000_info e1000_pch_lpt_info = { | ||
4598 | .mac = e1000_pch_lpt, | ||
4599 | .flags = FLAG_IS_ICH | ||
4600 | | FLAG_HAS_WOL | ||
4601 | | FLAG_HAS_CTRLEXT_ON_LOAD | ||
4602 | | FLAG_HAS_AMT | ||
4603 | | FLAG_HAS_FLASH | ||
4604 | | FLAG_HAS_JUMBO_FRAMES | ||
4605 | | FLAG_APME_IN_WUC, | ||
4606 | .flags2 = FLAG2_HAS_PHY_STATS | ||
4607 | | FLAG2_HAS_EEE, | ||
4608 | .pba = 26, | ||
4609 | .max_hw_frame_size = DEFAULT_JUMBO, | ||
4610 | .get_variants = e1000_get_variants_ich8lan, | ||
4611 | .mac_ops = &ich8_mac_ops, | ||
4612 | .phy_ops = &ich8_phy_ops, | ||
4613 | .nvm_ops = &ich8_nvm_ops, | ||
4614 | }; | ||
diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c index c19784c31819..b53ea83fda29 100644 --- a/drivers/net/ethernet/intel/e1000e/netdev.c +++ b/drivers/net/ethernet/intel/e1000e/netdev.c | |||
@@ -79,6 +79,7 @@ static const struct e1000_info *e1000_info_tbl[] = { | |||
79 | [board_ich10lan] = &e1000_ich10_info, | 79 | [board_ich10lan] = &e1000_ich10_info, |
80 | [board_pchlan] = &e1000_pch_info, | 80 | [board_pchlan] = &e1000_pch_info, |
81 | [board_pch2lan] = &e1000_pch2_info, | 81 | [board_pch2lan] = &e1000_pch2_info, |
82 | [board_pch_lpt] = &e1000_pch_lpt_info, | ||
82 | }; | 83 | }; |
83 | 84 | ||
84 | struct e1000_reg_info { | 85 | struct e1000_reg_info { |
@@ -2863,8 +2864,8 @@ static void e1000_setup_rctl(struct e1000_adapter *adapter) | |||
2863 | u32 rctl, rfctl; | 2864 | u32 rctl, rfctl; |
2864 | u32 pages = 0; | 2865 | u32 pages = 0; |
2865 | 2866 | ||
2866 | /* Workaround Si errata on 82579 - configure jumbo frame flow */ | 2867 | /* Workaround Si errata on PCHx - configure jumbo frame flow */ |
2867 | if (hw->mac.type == e1000_pch2lan) { | 2868 | if (hw->mac.type >= e1000_pch2lan) { |
2868 | s32 ret_val; | 2869 | s32 ret_val; |
2869 | 2870 | ||
2870 | if (adapter->netdev->mtu > ETH_DATA_LEN) | 2871 | if (adapter->netdev->mtu > ETH_DATA_LEN) |
@@ -3487,6 +3488,7 @@ void e1000e_reset(struct e1000_adapter *adapter) | |||
3487 | fc->refresh_time = 0x1000; | 3488 | fc->refresh_time = 0x1000; |
3488 | break; | 3489 | break; |
3489 | case e1000_pch2lan: | 3490 | case e1000_pch2lan: |
3491 | case e1000_pch_lpt: | ||
3490 | fc->high_water = 0x05C20; | 3492 | fc->high_water = 0x05C20; |
3491 | fc->low_water = 0x05048; | 3493 | fc->low_water = 0x05048; |
3492 | fc->pause_time = 0x0650; | 3494 | fc->pause_time = 0x0650; |
@@ -5264,11 +5266,11 @@ static int e1000_change_mtu(struct net_device *netdev, int new_mtu) | |||
5264 | return -EINVAL; | 5266 | return -EINVAL; |
5265 | } | 5267 | } |
5266 | 5268 | ||
5267 | /* Jumbo frame workaround on 82579 requires CRC be stripped */ | 5269 | /* Jumbo frame workaround on 82579 and newer requires CRC be stripped */ |
5268 | if ((adapter->hw.mac.type == e1000_pch2lan) && | 5270 | if ((adapter->hw.mac.type >= e1000_pch2lan) && |
5269 | !(adapter->flags2 & FLAG2_CRC_STRIPPING) && | 5271 | !(adapter->flags2 & FLAG2_CRC_STRIPPING) && |
5270 | (new_mtu > ETH_DATA_LEN)) { | 5272 | (new_mtu > ETH_DATA_LEN)) { |
5271 | e_err("Jumbo Frames not supported on 82579 when CRC stripping is disabled.\n"); | 5273 | e_err("Jumbo Frames not supported on this device when CRC stripping is disabled.\n"); |
5272 | return -EINVAL; | 5274 | return -EINVAL; |
5273 | } | 5275 | } |
5274 | 5276 | ||
@@ -5665,7 +5667,7 @@ static int __e1000_resume(struct pci_dev *pdev) | |||
5665 | return err; | 5667 | return err; |
5666 | } | 5668 | } |
5667 | 5669 | ||
5668 | if (hw->mac.type == e1000_pch2lan) | 5670 | if (hw->mac.type >= e1000_pch2lan) |
5669 | e1000_resume_workarounds_pchlan(&adapter->hw); | 5671 | e1000_resume_workarounds_pchlan(&adapter->hw); |
5670 | 5672 | ||
5671 | e1000e_power_up_phy(adapter); | 5673 | e1000e_power_up_phy(adapter); |
@@ -6564,6 +6566,9 @@ static DEFINE_PCI_DEVICE_TABLE(e1000_pci_tbl) = { | |||
6564 | { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH2_LV_LM), board_pch2lan }, | 6566 | { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH2_LV_LM), board_pch2lan }, |
6565 | { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH2_LV_V), board_pch2lan }, | 6567 | { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH2_LV_V), board_pch2lan }, |
6566 | 6568 | ||
6569 | { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_LPT_I217_LM), board_pch_lpt }, | ||
6570 | { PCI_VDEVICE(INTEL, E1000_DEV_ID_PCH_LPT_I217_V), board_pch_lpt }, | ||
6571 | |||
6567 | { 0, 0, 0, 0, 0, 0, 0 } /* terminate list */ | 6572 | { 0, 0, 0, 0, 0, 0, 0 } /* terminate list */ |
6568 | }; | 6573 | }; |
6569 | MODULE_DEVICE_TABLE(pci, e1000_pci_tbl); | 6574 | MODULE_DEVICE_TABLE(pci, e1000_pci_tbl); |
diff --git a/drivers/net/ethernet/intel/e1000e/phy.c b/drivers/net/ethernet/intel/e1000e/phy.c index ad22b8c8abd2..ada7133078e5 100644 --- a/drivers/net/ethernet/intel/e1000e/phy.c +++ b/drivers/net/ethernet/intel/e1000e/phy.c | |||
@@ -2335,6 +2335,9 @@ enum e1000_phy_type e1000e_get_phy_type_from_id(u32 phy_id) | |||
2335 | case I82579_E_PHY_ID: | 2335 | case I82579_E_PHY_ID: |
2336 | phy_type = e1000_phy_82579; | 2336 | phy_type = e1000_phy_82579; |
2337 | break; | 2337 | break; |
2338 | case I217_E_PHY_ID: | ||
2339 | phy_type = e1000_phy_i217; | ||
2340 | break; | ||
2338 | default: | 2341 | default: |
2339 | phy_type = e1000_phy_unknown; | 2342 | phy_type = e1000_phy_unknown; |
2340 | break; | 2343 | break; |