aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/e1000e/ich8lan.c
diff options
context:
space:
mode:
authorBruce Allan <bruce.w.allan@intel.com>2009-10-26 07:23:25 -0400
committerDavid S. Miller <davem@davemloft.net>2009-10-26 19:16:23 -0400
commitfa2ce13ca7a415332181adf2eb06d39e8e5054f7 (patch)
tree8e06729076f32e32eb0ca931b876886bdb1ac25a /drivers/net/e1000e/ich8lan.c
parent53ac5a887519f0c3fc94a6acdfc22aa4e97f64f7 (diff)
e1000e: 82577/82578 requires a different method to configure LPLU
Unlike previous ICHx-based parts, the PCH-based parts (82577/82578) require LPLU (Low Power Link Up, or "reverse auto-negotiation") to be configured in the PHY rather than the MAC. Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/e1000e/ich8lan.c')
-rw-r--r--drivers/net/e1000e/ich8lan.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/drivers/net/e1000e/ich8lan.c b/drivers/net/e1000e/ich8lan.c
index fb2222d60a79..2451dc8aef70 100644
--- a/drivers/net/e1000e/ich8lan.c
+++ b/drivers/net/e1000e/ich8lan.c
@@ -124,6 +124,11 @@
124 124
125#define SW_FLAG_TIMEOUT 1000 /* SW Semaphore flag timeout in milliseconds */ 125#define SW_FLAG_TIMEOUT 1000 /* SW Semaphore flag timeout in milliseconds */
126 126
127/* OEM Bits Phy Register */
128#define HV_OEM_BITS PHY_REG(768, 25)
129#define HV_OEM_BITS_LPLU 0x0004 /* Low Power Link Up */
130#define HV_OEM_BITS_RESTART_AN 0x0400 /* Restart Auto-negotiation */
131
127/* ICH GbE Flash Hardware Sequencing Flash Status Register bit breakdown */ 132/* ICH GbE Flash Hardware Sequencing Flash Status Register bit breakdown */
128/* Offset 04h HSFSTS */ 133/* Offset 04h HSFSTS */
129union ich8_hws_flash_status { 134union ich8_hws_flash_status {
@@ -202,6 +207,7 @@ static s32 e1000_setup_led_pchlan(struct e1000_hw *hw);
202static s32 e1000_cleanup_led_pchlan(struct e1000_hw *hw); 207static s32 e1000_cleanup_led_pchlan(struct e1000_hw *hw);
203static s32 e1000_led_on_pchlan(struct e1000_hw *hw); 208static s32 e1000_led_on_pchlan(struct e1000_hw *hw);
204static s32 e1000_led_off_pchlan(struct e1000_hw *hw); 209static s32 e1000_led_off_pchlan(struct e1000_hw *hw);
210static s32 e1000_set_lplu_state_pchlan(struct e1000_hw *hw, bool active);
205 211
206static inline u16 __er16flash(struct e1000_hw *hw, unsigned long reg) 212static inline u16 __er16flash(struct e1000_hw *hw, unsigned long reg)
207{ 213{
@@ -244,6 +250,8 @@ static s32 e1000_init_phy_params_pchlan(struct e1000_hw *hw)
244 250
245 phy->ops.check_polarity = e1000_check_polarity_ife_ich8lan; 251 phy->ops.check_polarity = e1000_check_polarity_ife_ich8lan;
246 phy->ops.read_phy_reg = e1000_read_phy_reg_hv; 252 phy->ops.read_phy_reg = e1000_read_phy_reg_hv;
253 phy->ops.set_d0_lplu_state = e1000_set_lplu_state_pchlan;
254 phy->ops.set_d3_lplu_state = e1000_set_lplu_state_pchlan;
247 phy->ops.write_phy_reg = e1000_write_phy_reg_hv; 255 phy->ops.write_phy_reg = e1000_write_phy_reg_hv;
248 phy->autoneg_mask = AUTONEG_ADVERTISE_SPEED_DEFAULT; 256 phy->autoneg_mask = AUTONEG_ADVERTISE_SPEED_DEFAULT;
249 257
@@ -1060,6 +1068,38 @@ static s32 e1000_check_polarity_ife_ich8lan(struct e1000_hw *hw)
1060} 1068}
1061 1069
1062/** 1070/**
1071 * e1000_set_lplu_state_pchlan - Set Low Power Link Up state
1072 * @hw: pointer to the HW structure
1073 * @active: true to enable LPLU, false to disable
1074 *
1075 * Sets the LPLU state according to the active flag. For PCH, if OEM write
1076 * bit are disabled in the NVM, writing the LPLU bits in the MAC will not set
1077 * the phy speed. This function will manually set the LPLU bit and restart
1078 * auto-neg as hw would do. D3 and D0 LPLU will call the same function
1079 * since it configures the same bit.
1080 **/
1081static s32 e1000_set_lplu_state_pchlan(struct e1000_hw *hw, bool active)
1082{
1083 s32 ret_val = 0;
1084 u16 oem_reg;
1085
1086 ret_val = e1e_rphy(hw, HV_OEM_BITS, &oem_reg);
1087 if (ret_val)
1088 goto out;
1089
1090 if (active)
1091 oem_reg |= HV_OEM_BITS_LPLU;
1092 else
1093 oem_reg &= ~HV_OEM_BITS_LPLU;
1094
1095 oem_reg |= HV_OEM_BITS_RESTART_AN;
1096 ret_val = e1e_wphy(hw, HV_OEM_BITS, oem_reg);
1097
1098out:
1099 return ret_val;
1100}
1101
1102/**
1063 * e1000_set_d0_lplu_state_ich8lan - Set Low Power Linkup D0 state 1103 * e1000_set_d0_lplu_state_ich8lan - Set Low Power Linkup D0 state
1064 * @hw: pointer to the HW structure 1104 * @hw: pointer to the HW structure
1065 * @active: TRUE to enable LPLU, FALSE to disable 1105 * @active: TRUE to enable LPLU, FALSE to disable