From: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
To: davem@davemloft.net
Cc: Bruce Allan <bruce.w.allan@intel.com>,
netdev@vger.kernel.org, gospo@redhat.com, sassmann@redhat.com,
Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Subject: [net-next 03/15] e1000e: Invalid Image CSUM bit changed for I217
Date: Wed, 16 Jan 2013 01:10:15 -0800 [thread overview]
Message-ID: <1358327427-3146-4-git-send-email-jeffrey.t.kirsher@intel.com> (raw)
In-Reply-To: <1358327427-3146-1-git-send-email-jeffrey.t.kirsher@intel.com>
From: Bruce Allan <bruce.w.allan@intel.com>
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>
---
drivers/net/ethernet/intel/e1000e/defines.h | 4 ++++
drivers/net/ethernet/intel/e1000e/ich8lan.c | 29 +++++++++++++++++++++--------
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 2073532..7326ea2 100644
--- a/drivers/net/ethernet/intel/e1000e/defines.h
+++ b/drivers/net/ethernet/intel/e1000e/defines.h
@@ -639,6 +639,10 @@
/* NVM Word Offsets */
#define NVM_COMPAT 0x0003
#define NVM_ID_LED_SETTINGS 0x0004
+#define NVM_FUTURE_INIT_WORD1 0x0019
+#define NVM_COMPAT_VALID_CSUM 0x0001
+#define NVM_FUTURE_INIT_WORD1_VALID_CSUM 0x0040
+
#define NVM_INIT_CONTROL2_REG 0x000F
#define NVM_INIT_CONTROL3_PORT_B 0x0014
#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 9763365..7d5f6b7 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)
{
s32 ret_val;
u16 data;
+ u16 word;
+ u16 valid_csum_mask;
- /* Read 0x19 and check bit 6. If this bit is 0, the checksum
- * needs to be fixed. This bit is an indication that the NVM
- * was prepared by OEM software and did not calculate the
- * checksum...a likely scenario.
+ /* Read NVM and check Invalid Image CSUM bit. If this bit is 0,
+ * the checksum needs to be fixed. This bit is an indication that
+ * the NVM was prepared by OEM software and did not calculate
+ * the checksum...a likely scenario.
*/
- ret_val = e1000_read_nvm(hw, 0x19, 1, &data);
+ switch (hw->mac.type) {
+ case e1000_pch_lpt:
+ word = NVM_COMPAT;
+ valid_csum_mask = NVM_COMPAT_VALID_CSUM;
+ break;
+ default:
+ word = NVM_FUTURE_INIT_WORD1;
+ valid_csum_mask = NVM_FUTURE_INIT_WORD1_VALID_CSUM;
+ break;
+ }
+
+ ret_val = e1000_read_nvm(hw, word, 1, &data);
if (ret_val)
return ret_val;
- if (!(data & 0x40)) {
- data |= 0x40;
- ret_val = e1000_write_nvm(hw, 0x19, 1, &data);
+ if (!(data & valid_csum_mask)) {
+ data |= valid_csum_mask;
+ ret_val = e1000_write_nvm(hw, word, 1, &data);
if (ret_val)
return ret_val;
ret_val = e1000e_update_nvm_checksum(hw);
--
1.7.11.7
next prev parent reply other threads:[~2013-01-16 9:10 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-16 9:10 [net-nexti v2 00/15][pull request] Intel Wired LAN Driver Updates Jeff Kirsher
2013-01-16 9:10 ` [net-next 01/15] e1000e: SerDes autoneg flow control Jeff Kirsher
2013-01-16 9:10 ` [net-next 02/15] e1000e: Acquire/release semaphore when writing each EEPROM page Jeff Kirsher
2013-01-16 9:10 ` Jeff Kirsher [this message]
2013-01-16 9:10 ` [net-next 04/15] e1000e: helper functions for accessing EMI registers Jeff Kirsher
2013-01-16 9:10 ` [net-next 05/15] e1000e: 82577: workaround for link drop issue Jeff Kirsher
2013-01-16 9:10 ` [net-next 06/15] e1000e: fix enabling of EEE on 82579 and I217 Jeff Kirsher
2013-01-16 9:10 ` [net-next 07/15] e1000e: unexpected "Reset adapter" message when cable pulled Jeff Kirsher
2013-01-16 9:10 ` [net-next 08/15] e1000e: add missing bailout on error Jeff Kirsher
2013-01-16 9:10 ` [net-next v2 09/15] e1000e: resolve checkpatch PREFER_PR_LEVEL warning Jeff Kirsher
2013-01-16 9:10 ` [net-next 10/15] e1000e: cleanup redundant statistics counter Jeff Kirsher
2013-01-16 9:10 ` [net-next 11/15] e1000e: cleanup unusual comment placement Jeff Kirsher
2013-01-16 9:10 ` [net-next 12/15] e1000e: cleanup unnecessary line wrap Jeff Kirsher
2013-01-16 9:10 ` [net-next 13/15] e1000e: cleanup magic number Jeff Kirsher
2013-01-16 9:10 ` [net-next 14/15] e1000e: cleanup code duplication Jeff Kirsher
2013-01-16 9:10 ` [net-next 15/15] e1000e: merge multiple conditional statements into one Jeff Kirsher
2013-01-16 19:32 ` [net-nexti v2 00/15][pull request] Intel Wired LAN Driver Updates David Miller
-- strict thread matches above, loose matches on Subject: below --
2013-01-11 10:23 [net-next " Jeff Kirsher
2013-01-11 10:23 ` [net-next 03/15] e1000e: Invalid Image CSUM bit changed for I217 Jeff Kirsher
2013-01-11 10:26 ` David Laight
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1358327427-3146-4-git-send-email-jeffrey.t.kirsher@intel.com \
--to=jeffrey.t.kirsher@intel.com \
--cc=bruce.w.allan@intel.com \
--cc=davem@davemloft.net \
--cc=gospo@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=sassmann@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).