Commit 141a8dec authored by Jiawen Wu's avatar Jiawen Wu Committed by Jakub Kicinski
Browse files

net: txgbe: Fix to calculate EEPROM checksum for AML devices



In the new firmware version, the shadow ram reserves some space to store
I2C information, so the checksum calculation needs to skip this section.
Otherwise, the driver will fail to probe because the invalid EEPROM
checksum.

Fixes: 2e5af6b2 ("net: txgbe: Add basic support for new AML devices")
Signed-off-by: default avatarJiawen Wu <jiawenwu@trustnetic.com>
Reviewed-by: default avatarSimon Horman <horms@kernel.org>
Link: https://patch.msgid.link/1C6BF7A937237F5A+20250513021009.145708-2-jiawenwu@trustnetic.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 865ab246
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -99,9 +99,15 @@ static int txgbe_calc_eeprom_checksum(struct wx *wx, u16 *checksum)
	}
	local_buffer = eeprom_ptrs;

	for (i = 0; i < TXGBE_EEPROM_LAST_WORD; i++)
	for (i = 0; i < TXGBE_EEPROM_LAST_WORD; i++) {
		if (wx->mac.type == wx_mac_aml) {
			if (i >= TXGBE_EEPROM_I2C_SRART_PTR &&
			    i < TXGBE_EEPROM_I2C_END_PTR)
				local_buffer[i] = 0xffff;
		}
		if (i != wx->eeprom.sw_region_offset + TXGBE_EEPROM_CHECKSUM)
			*checksum += local_buffer[i];
	}

	kvfree(eeprom_ptrs);

+2 −0
Original line number Diff line number Diff line
@@ -158,6 +158,8 @@
#define TXGBE_EEPROM_VERSION_L                  0x1D
#define TXGBE_EEPROM_VERSION_H                  0x1E
#define TXGBE_ISCSI_BOOT_CONFIG                 0x07
#define TXGBE_EEPROM_I2C_SRART_PTR              0x580
#define TXGBE_EEPROM_I2C_END_PTR                0x800

#define TXGBE_MAX_MSIX_VECTORS          64
#define TXGBE_MAX_FDIR_INDICES          63