aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBruce Allan <bruce.w.allan@intel.com>2012-03-19 23:47:57 -0400
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2012-05-02 04:58:38 -0400
commit62bc813e48aef39c187bb426ddd5441862f1d8d1 (patch)
treeed41c6ede87fa6dcc71dfd7e2c4775fe9c0dd479
parente4ae004b84b315dd4b762e474f97403eac70f76a (diff)
e1000e: workaround EEPROM configuration change on 82579
An update to the EEPROM on 82579 will extend a delay in hardware to fix an issue with WoL not working after a G3->S5 transition which is unrelated to the driver. However, this extended delay conflicts with nominal operation of the device when it is initialized by the driver and after every reset of the hardware (i.e. the driver starts configuring the device before the hardware is done with it's own configuration work). The workaround for when the driver is in control of the device is to tell the hardware after every reset the configuration delay should be the original shorter one. Some pre-existing variables are renamed generically to be re-used with new register accesses. 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>
-rw-r--r--drivers/net/ethernet/intel/e1000e/hw.h1
-rw-r--r--drivers/net/ethernet/intel/e1000e/ich8lan.c48
2 files changed, 34 insertions, 15 deletions
diff --git a/drivers/net/ethernet/intel/e1000e/hw.h b/drivers/net/ethernet/intel/e1000e/hw.h
index 7ca1b68e2e3d..3a5acb54cd4e 100644
--- a/drivers/net/ethernet/intel/e1000e/hw.h
+++ b/drivers/net/ethernet/intel/e1000e/hw.h
@@ -51,6 +51,7 @@ enum e1e_registers {
51 E1000_FEXTNVM = 0x00028, /* Future Extended NVM - RW */ 51 E1000_FEXTNVM = 0x00028, /* Future Extended NVM - RW */
52 E1000_FCT = 0x00030, /* Flow Control Type - RW */ 52 E1000_FCT = 0x00030, /* Flow Control Type - RW */
53 E1000_VET = 0x00038, /* VLAN Ether Type - RW */ 53 E1000_VET = 0x00038, /* VLAN Ether Type - RW */
54 E1000_FEXTNVM3 = 0x0003C, /* Future Extended NVM 3 - RW */
54 E1000_ICR = 0x000C0, /* Interrupt Cause Read - R/clr */ 55 E1000_ICR = 0x000C0, /* Interrupt Cause Read - R/clr */
55 E1000_ITR = 0x000C4, /* Interrupt Throttling Rate - RW */ 56 E1000_ITR = 0x000C4, /* Interrupt Throttling Rate - RW */
56 E1000_ICS = 0x000C8, /* Interrupt Cause Set - WO */ 57 E1000_ICS = 0x000C8, /* Interrupt Cause Set - WO */
diff --git a/drivers/net/ethernet/intel/e1000e/ich8lan.c b/drivers/net/ethernet/intel/e1000e/ich8lan.c
index d7fd1e848ddc..2506ee275312 100644
--- a/drivers/net/ethernet/intel/e1000e/ich8lan.c
+++ b/drivers/net/ethernet/intel/e1000e/ich8lan.c
@@ -105,6 +105,9 @@
105#define E1000_FEXTNVM_SW_CONFIG 1 105#define E1000_FEXTNVM_SW_CONFIG 1
106#define E1000_FEXTNVM_SW_CONFIG_ICH8M (1 << 27) /* Bit redefined for ICH8M :/ */ 106#define E1000_FEXTNVM_SW_CONFIG_ICH8M (1 << 27) /* Bit redefined for ICH8M :/ */
107 107
108#define E1000_FEXTNVM3_PHY_CFG_COUNTER_MASK 0x0C000000
109#define E1000_FEXTNVM3_PHY_CFG_COUNTER_50MSEC 0x08000000
110
108#define E1000_FEXTNVM4_BEACON_DURATION_MASK 0x7 111#define E1000_FEXTNVM4_BEACON_DURATION_MASK 0x7
109#define E1000_FEXTNVM4_BEACON_DURATION_8USEC 0x7 112#define E1000_FEXTNVM4_BEACON_DURATION_8USEC 0x7
110#define E1000_FEXTNVM4_BEACON_DURATION_16USEC 0x3 113#define E1000_FEXTNVM4_BEACON_DURATION_16USEC 0x3
@@ -286,16 +289,23 @@ static inline void __ew32flash(struct e1000_hw *hw, unsigned long reg, u32 val)
286 289
287static void e1000_toggle_lanphypc_value_ich8lan(struct e1000_hw *hw) 290static void e1000_toggle_lanphypc_value_ich8lan(struct e1000_hw *hw)
288{ 291{
289 u32 ctrl; 292 u32 reg;
290 293
291 ctrl = er32(CTRL); 294 /* Set Phy Config Counter to 50msec */
292 ctrl |= E1000_CTRL_LANPHYPC_OVERRIDE; 295 reg = er32(FEXTNVM3);
293 ctrl &= ~E1000_CTRL_LANPHYPC_VALUE; 296 reg &= ~E1000_FEXTNVM3_PHY_CFG_COUNTER_MASK;
294 ew32(CTRL, ctrl); 297 reg |= E1000_FEXTNVM3_PHY_CFG_COUNTER_50MSEC;
298 ew32(FEXTNVM3, reg);
299
300 /* Toggle LANPHYPC Value bit */
301 reg = er32(CTRL);
302 reg |= E1000_CTRL_LANPHYPC_OVERRIDE;
303 reg &= ~E1000_CTRL_LANPHYPC_VALUE;
304 ew32(CTRL, reg);
295 e1e_flush(); 305 e1e_flush();
296 udelay(10); 306 udelay(10);
297 ctrl &= ~E1000_CTRL_LANPHYPC_OVERRIDE; 307 reg &= ~E1000_CTRL_LANPHYPC_OVERRIDE;
298 ew32(CTRL, ctrl); 308 ew32(CTRL, reg);
299} 309}
300 310
301/** 311/**
@@ -3071,8 +3081,8 @@ static s32 e1000_get_bus_info_ich8lan(struct e1000_hw *hw)
3071static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw) 3081static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw)
3072{ 3082{
3073 struct e1000_dev_spec_ich8lan *dev_spec = &hw->dev_spec.ich8lan; 3083 struct e1000_dev_spec_ich8lan *dev_spec = &hw->dev_spec.ich8lan;
3074 u16 reg; 3084 u16 kum_cfg;
3075 u32 ctrl, kab; 3085 u32 ctrl, reg;
3076 s32 ret_val; 3086 s32 ret_val;
3077 3087
3078 /* 3088 /*
@@ -3106,12 +3116,12 @@ static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw)
3106 } 3116 }
3107 3117
3108 if (hw->mac.type == e1000_pchlan) { 3118 if (hw->mac.type == e1000_pchlan) {
3109 /* Save the NVM K1 bit setting*/ 3119 /* Save the NVM K1 bit setting */
3110 ret_val = e1000_read_nvm(hw, E1000_NVM_K1_CONFIG, 1, &reg); 3120 ret_val = e1000_read_nvm(hw, E1000_NVM_K1_CONFIG, 1, &kum_cfg);
3111 if (ret_val) 3121 if (ret_val)
3112 return ret_val; 3122 return ret_val;
3113 3123
3114 if (reg & E1000_NVM_K1_ENABLE) 3124 if (kum_cfg & E1000_NVM_K1_ENABLE)
3115 dev_spec->nvm_k1_enabled = true; 3125 dev_spec->nvm_k1_enabled = true;
3116 else 3126 else
3117 dev_spec->nvm_k1_enabled = false; 3127 dev_spec->nvm_k1_enabled = false;
@@ -3141,6 +3151,14 @@ static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw)
3141 /* cannot issue a flush here because it hangs the hardware */ 3151 /* cannot issue a flush here because it hangs the hardware */
3142 msleep(20); 3152 msleep(20);
3143 3153
3154 /* Set Phy Config Counter to 50msec */
3155 if (hw->mac.type == e1000_pch2lan) {
3156 reg = er32(FEXTNVM3);
3157 reg &= ~E1000_FEXTNVM3_PHY_CFG_COUNTER_MASK;
3158 reg |= E1000_FEXTNVM3_PHY_CFG_COUNTER_50MSEC;
3159 ew32(FEXTNVM3, reg);
3160 }
3161
3144 if (!ret_val) 3162 if (!ret_val)
3145 clear_bit(__E1000_ACCESS_SHARED_RESOURCE, &hw->adapter->state); 3163 clear_bit(__E1000_ACCESS_SHARED_RESOURCE, &hw->adapter->state);
3146 3164
@@ -3165,9 +3183,9 @@ static s32 e1000_reset_hw_ich8lan(struct e1000_hw *hw)
3165 ew32(IMC, 0xffffffff); 3183 ew32(IMC, 0xffffffff);
3166 er32(ICR); 3184 er32(ICR);
3167 3185
3168 kab = er32(KABGTXD); 3186 reg = er32(KABGTXD);
3169 kab |= E1000_KABGTXD_BGSQLBIAS; 3187 reg |= E1000_KABGTXD_BGSQLBIAS;
3170 ew32(KABGTXD, kab); 3188 ew32(KABGTXD, reg);
3171 3189
3172 return 0; 3190 return 0;
3173} 3191}