diff options
author | Prasanth Babu Mantena <p-mantena@ti.com> | 2023-10-18 20:06:57 +0530 |
---|---|---|
committer | Praneeth Bajjuri <praneeth@ti.com> | 2023-10-18 12:49:46 -0500 |
commit | d74d0993e2456e7a1d7c7d2af816f3dc5e54bf17 (patch) | |
tree | 40fa808798b2de5bfc1c9a7ca9d779c61c2fbde3 /board/ti/common | |
parent | dd0c500c95b1cfc36d163f38025f6bb85d54b877 (diff) |
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 followed by reading 1-byte size with an offset 1. This commit fixes
the header matching issue in commit 9f393a2d7af8 ("board: ti: common:
board_detect: Fix EEPROM read quirk for 2-byte").
In the previous commit, the value with one offset is being read into
offset_test, but the pointer used to match was still ep. After reading
with an offset 1, the second byte of the header is compared with the 1-byte
data read from EEPROM. This is taken care by comparing proper first byte
value from the header.
Signed-off-by: Prasanth Babu Mantena <p-mantena@ti.com>
Fixes: 9f393a2d7af8 (board: ti: common: board_detect: Fix EEPROM read quirk for 2-byte)
Diffstat (limited to 'board/ti/common')
-rw-r--r-- | board/ti/common/board_detect.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/board/ti/common/board_detect.c b/board/ti/common/board_detect.c index 9a53884c98..17fe8f8069 100644 --- a/board/ti/common/board_detect.c +++ b/board/ti/common/board_detect.c @@ -128,7 +128,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??? */ |