Commit 61114910 authored by Jacek Kowalski's avatar Jacek Kowalski Committed by Tony Nguyen
Browse files

e1000e: ignore uninitialized checksum word on tgp



As described by Vitaly Lifshits:

> Starting from Tiger Lake, LAN NVM is locked for writes by SW, so the
> driver cannot perform checksum validation and correction. This means
> that all NVM images must leave the factory with correct checksum and
> checksum valid bit set.

Unfortunately some systems have left the factory with an uninitialized
value of 0xFFFF at register address 0x3F (checksum word location).
So on Tiger Lake platform we ignore the computed checksum when such
condition is encountered.

Signed-off-by: default avatarJacek Kowalski <jacek@jacekk.info>
Tested-by: default avatarVlad URSU <vlad@ursu.me>
Fixes: 4051f683 ("e1000e: Do not take care about recovery NVM checksum")
Cc: stable@vger.kernel.org
Reviewed-by: default avatarSimon Horman <horms@kernel.org>
Reviewed-by: default avatarVitaly Lifshits <vitaly.lifshits@intel.com>
Tested-by: default avatarMor Bar-Gabay <morx.bar.gabay@intel.com>
Signed-off-by: default avatarTony Nguyen <anthony.l.nguyen@intel.com>
parent 536fd741
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -638,6 +638,9 @@
/* For checksumming, the sum of all words in the NVM should equal 0xBABA. */
#define NVM_SUM                    0xBABA

/* Uninitialized ("empty") checksum word value */
#define NVM_CHECKSUM_UNINITIALIZED 0xFFFF

/* PBA (printed board assembly) number words */
#define NVM_PBA_OFFSET_0           8
#define NVM_PBA_OFFSET_1           9
+6 −0
Original line number Diff line number Diff line
@@ -558,6 +558,12 @@ s32 e1000e_validate_nvm_checksum_generic(struct e1000_hw *hw)
		checksum += nvm_data;
	}

	if (hw->mac.type == e1000_pch_tgp &&
	    nvm_data == NVM_CHECKSUM_UNINITIALIZED) {
		e_dbg("Uninitialized NVM Checksum on TGP platform - ignoring\n");
		return 0;
	}

	if (checksum != (u16)NVM_SUM) {
		e_dbg("NVM Checksum Invalid\n");
		return -E1000_ERR_NVM;