mirror of
https://github.com/AsahiLinux/u-boot
synced 2025-02-17 22:49:02 +00:00
board: ti: common: board_detect: Fix EEPROM offset read for 1-byte
EEPROM detection logic in ti_i2c_eeprom_get() involves reading the total size and the 1-byte size with an offset 1. The commit9f393a2d7a
("board: ti: common: board_detect: Fix EEPROM read quirk for 2-byte") that attempts to fix this uses a wrong pointer to compare. The value with one offset is read into offset_test, but the pointer used to match was still ep, resulting in an invalid comparison of the values. The intent is to identify bad 2-byte addressing eeproms that get stuck on the successive reads. Fixes:9f393a2d7a
(board: ti: common: board_detect: Fix EEPROM read quirk for 2-byte) Signed-off-by: Prasanth Babu Mantena <p-mantena@ti.com> Tested-by: Matwey V. Kornilov <matwey.kornilov@gmail.com> Reviewed-by: Neha Malcom Francis <n-francis@ti.com>
This commit is contained in:
parent
15e7927b5a
commit
dd83c1c865
1 changed files with 2 additions and 2 deletions
|
@ -129,7 +129,7 @@ static int __maybe_unused ti_i2c_eeprom_get(int bus_addr, int dev_addr,
|
|||
|
||||
rc = dm_i2c_read(dev, 0x1, &offset_test, sizeof(offset_test));
|
||||
|
||||
if (*((u32 *)ep) != (header & 0xFF))
|
||||
if (offset_test != ((header >> 8) & 0xFF))
|
||||
one_byte_addressing = false;
|
||||
|
||||
/* Corrupted data??? */
|
||||
|
@ -181,7 +181,7 @@ static int __maybe_unused ti_i2c_eeprom_get(int bus_addr, int dev_addr,
|
|||
|
||||
rc = i2c_read(dev_addr, 0x1, byte, &offset_test, sizeof(offset_test));
|
||||
|
||||
if (*((u32 *)ep) != (header & 0xFF))
|
||||
if (offset_test != ((header >> 8) & 0xFF))
|
||||
one_byte_addressing = false;
|
||||
|
||||
/* Corrupted data??? */
|
||||
|
|
Loading…
Add table
Reference in a new issue