u-boot/board/ti/common
Matwey V. Kornilov bf6376642f board: ti: common: board_detect: Fix EEPROM read quirk
There are three different kinds of EEPROM possibly present on boards.
  1. 1byte address. For those we should avoid 2byte address in order
     not to rewrite the data. Second byte of the address can potentially
     be interpreted as the data to write.
  2. 2byte address with defined behaviour. When we try to use 1byte
     address they just return "FF FF FF FF ... FF"
  3. 2byte address with undefined behaviour (for instance, 24LC32AI).
     When we try to use 1byte address, then their internal read
     pointer is changed to some value. Subsequential reads may be
     broken.

To gracefully handle both case #1 and case #3 we read all required
data from EEPROM at once (about 80 bytes). So either all the data is
valid or we fallback to 2byte address.

Cc: Nishanth Menon <nm@ti.com>
Fixes: a58147c2db ("board: ti: common: board_detect: Do 1byte address checks first.")
Reference: https://lore.kernel.org/all/CAJs94Ebdd4foOjhGFu9Bop0v=B1US9neDLxfhgcY23ukgLzFOQ@mail.gmail.com/
Signed-off-by: Matwey V. Kornilov <matwey.kornilov@gmail.com>
Acked-by: Nishanth Menon <nm@ti.com>
2022-08-31 12:16:01 -04:00
..
board_detect.c board: ti: common: board_detect: Fix EEPROM read quirk 2022-08-31 12:16:01 -04:00
board_detect.h board: ti: board_detect: Add stub functions for EEPROM detection apis 2020-08-11 20:34:46 +05:30
cape_detect.c ti/common: add support for extension_scan_board function 2021-05-13 13:09:09 -04:00
cape_detect.h ti/common: add support for extension_scan_board function 2021-05-13 13:09:09 -04:00
Kconfig ti/common: add support for extension_scan_board function 2021-05-13 13:09:09 -04:00
Makefile ti/common: add support for extension_scan_board function 2021-05-13 13:09:09 -04:00