]> git.baikalelectronics.ru Git - uboot.git/commit
board: ti: common: board_detect: Fix EEPROM read quirk for 2-byte
authorNeha Malcom Francis <n-francis@ti.com>
Tue, 13 Dec 2022 06:27:34 +0000 (11:57 +0530)
committerTom Rini <trini@konsulko.com>
Mon, 2 Jan 2023 21:06:07 +0000 (16:06 -0500)
commitf2d3f61b5d3cae34a7ee602aff1183261c486bf2
tree17db2acf50c666656606c8e5009ad7241f663ea7
parent3c7477399be64e030ca70321c16ba10980c899bf
board: ti: common: board_detect: Fix EEPROM read quirk for 2-byte

EEPROM detection logic in ti_i2c_eeprom_get() involves figuring out
whether addressing is 1-byte or 2-byte. There are currently different
behaviours seen across boards as documented in commit 90fde2a3094d
("board: ti: common: board_detect: Fix EEPROM read quirk"). Adding to
the list, we see that there are 2-byte EEPROMs that read properly
with 1-byte addressing with no offset.

For ti_i2c_eeprom_am6_get where eeprom parse operation is dynamic, the
earlier commit 1752ddb410c9 ("board: ti: common: board_detect: Fix
EEPROM read quirk for AM6 style data") tried to resolve this by running
ti_i2c_eeprom_get() twice. However this commit along with its former
commit fails on J7 platforms where EEPROM successfully return back the
header on 1-byte addressing and continues to do so until an offset is
introduced. So the second read incorrectly determines the EEPROM as
1-byte addressing.

A more generic solution is introduced here to solve
this issue: 1-byte read without offset and 1-byte read with offset. If
both passes, it follows 1-byte addressing else we proceed with 2-byte
addressing check.

Tested on J721E, J7200, DRA7xx, AM64x

Signed-off-by: Neha Malcom Francis <n-francis@ti.com>
Fixes: 1752ddb410c9 (board: ti: common: board_detect: Fix EEPROM read quirk for AM6 style data)
Fixes: 90fde2a3094d (board: ti: common: board_detect: Fix EEPROM read quirk)
Tested-By: Matwey V. Kornilov <matwey.kornilov@gmail.com>
board/ti/common/board_detect.c