aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBruce Allan <bruce.w.allan@intel.com>2013-01-09 03:15:42 -0500
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2013-01-16 00:38:39 -0500
commit1cc7a3a14fa60f31ca4ff69f0dd31f369e0a51c2 (patch)
treea11380c8a3cd884aa02bf4bc2b868c800f863ea3
parent635ab56439e21cbea6be346ac71222f9c4ac6463 (diff)
e1000e: Invalid Image CSUM bit changed for I217
On I217, the bit that indicates an invalid EEPROM (NVM) image checksum has changed from previous ICH/PCH LOMs. When validating the EEPROM checksum, check the appropriate bit on different devices. Signed-off-by: Bruce Allan <bruce.w.allan@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
-rw-r--r--drivers/net/ethernet/intel/e1000e/defines.h4
-rw-r--r--drivers/net/ethernet/intel/e1000e/ich8lan.c29
2 files changed, 25 insertions, 8 deletions
diff --git a/drivers/net/ethernet/intel/e1000e/defines.h b/drivers/net/ethernet/intel/e1000e/defines.h
index 20735327a7a0..7326ea2fef8f 100644
--- a/drivers/net/ethernet/intel/e1000e/defines.h
+++ b/drivers/net/ethernet/intel/e1000e/defines.h
@@ -639,6 +639,10 @@
639/* NVM Word Offsets */ 639/* NVM Word Offsets */
640#define NVM_COMPAT 0x0003 640#define NVM_COMPAT 0x0003
641#define NVM_ID_LED_SETTINGS 0x0004 641#define NVM_ID_LED_SETTINGS 0x0004
642#define NVM_FUTURE_INIT_WORD1 0x0019
643#define NVM_COMPAT_VALID_CSUM 0x0001
644#define NVM_FUTURE_INIT_WORD1_VALID_CSUM 0x0040
645
642#define NVM_INIT_CONTROL2_REG 0x000F 646#define NVM_INIT_CONTROL2_REG 0x000F
643#define NVM_INIT_CONTROL3_PORT_B 0x0014 647#define NVM_INIT_CONTROL3_PORT_B 0x0014
644#define NVM_INIT_3GIO_3 0x001A 648#define NVM_INIT_3GIO_3 0x001A
diff --git a/drivers/net/ethernet/intel/e1000e/ich8lan.c b/drivers/net/ethernet/intel/e1000e/ich8lan.c
index 976336547607..7d5f6b7856e6 100644
--- a/drivers/net/ethernet/intel/e1000e/ich8lan.c
+++ b/drivers/net/ethernet/intel/e1000e/ich8lan.c
@@ -2949,19 +2949,32 @@ static s32 e1000_validate_nvm_checksum_ich8lan(struct e1000_hw *hw)
2949{ 2949{
2950 s32 ret_val; 2950 s32 ret_val;
2951 u16 data; 2951 u16 data;
2952 u16 word;
2953 u16 valid_csum_mask;
2952 2954
2953 /* Read 0x19 and check bit 6. If this bit is 0, the checksum 2955 /* Read NVM and check Invalid Image CSUM bit. If this bit is 0,
2954 * needs to be fixed. This bit is an indication that the NVM 2956 * the checksum needs to be fixed. This bit is an indication that
2955 * was prepared by OEM software and did not calculate the 2957 * the NVM was prepared by OEM software and did not calculate
2956 * checksum...a likely scenario. 2958 * the checksum...a likely scenario.
2957 */ 2959 */
2958 ret_val = e1000_read_nvm(hw, 0x19, 1, &data); 2960 switch (hw->mac.type) {
2961 case e1000_pch_lpt:
2962 word = NVM_COMPAT;
2963 valid_csum_mask = NVM_COMPAT_VALID_CSUM;
2964 break;
2965 default:
2966 word = NVM_FUTURE_INIT_WORD1;
2967 valid_csum_mask = NVM_FUTURE_INIT_WORD1_VALID_CSUM;
2968 break;
2969 }
2970
2971 ret_val = e1000_read_nvm(hw, word, 1, &data);
2959 if (ret_val) 2972 if (ret_val)
2960 return ret_val; 2973 return ret_val;
2961 2974
2962 if (!(data & 0x40)) { 2975 if (!(data & valid_csum_mask)) {
2963 data |= 0x40; 2976 data |= valid_csum_mask;
2964 ret_val = e1000_write_nvm(hw, 0x19, 1, &data); 2977 ret_val = e1000_write_nvm(hw, word, 1, &data);
2965 if (ret_val) 2978 if (ret_val)
2966 return ret_val; 2979 return ret_val;
2967 ret_val = e1000e_update_nvm_checksum(hw); 2980 ret_val = e1000e_update_nvm_checksum(hw);