Skip to content

Commit 141a8de

Browse files
Jiawen Wukuba-moo
authored andcommitted
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: 2e5af6b ("net: txgbe: Add basic support for new AML devices") Signed-off-by: Jiawen Wu <jiawenwu@trustnetic.com> Reviewed-by: Simon Horman <horms@kernel.org> Link: https://patch.msgid.link/1C6BF7A937237F5A+20250513021009.145708-2-jiawenwu@trustnetic.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 865ab24 commit 141a8de

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

drivers/net/ethernet/wangxun/txgbe/txgbe_hw.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,15 @@ static int txgbe_calc_eeprom_checksum(struct wx *wx, u16 *checksum)
9999
}
100100
local_buffer = eeprom_ptrs;
101101

102-
for (i = 0; i < TXGBE_EEPROM_LAST_WORD; i++)
102+
for (i = 0; i < TXGBE_EEPROM_LAST_WORD; i++) {
103+
if (wx->mac.type == wx_mac_aml) {
104+
if (i >= TXGBE_EEPROM_I2C_SRART_PTR &&
105+
i < TXGBE_EEPROM_I2C_END_PTR)
106+
local_buffer[i] = 0xffff;
107+
}
103108
if (i != wx->eeprom.sw_region_offset + TXGBE_EEPROM_CHECKSUM)
104109
*checksum += local_buffer[i];
110+
}
105111

106112
kvfree(eeprom_ptrs);
107113

drivers/net/ethernet/wangxun/txgbe/txgbe_type.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,8 @@
158158
#define TXGBE_EEPROM_VERSION_L 0x1D
159159
#define TXGBE_EEPROM_VERSION_H 0x1E
160160
#define TXGBE_ISCSI_BOOT_CONFIG 0x07
161+
#define TXGBE_EEPROM_I2C_SRART_PTR 0x580
162+
#define TXGBE_EEPROM_I2C_END_PTR 0x800
161163

162164
#define TXGBE_MAX_MSIX_VECTORS 64
163165
#define TXGBE_MAX_FDIR_INDICES 63

0 commit comments

Comments
 (0)