[PATCH 05/17] board: ti: j721e: Enable support for reading EEPROM at next alternate address

Sinthu Raja sinthu.raja at mistralsolutions.com
Sat Jun 26 16:55:50 CEST 2021


From: Amarnath MB <amarnath.mb at ti.com>

J721E EVM has EEPROM populated at 0x50. J721E EAIK has EEPROM populated
at next address 0x51 in order to be compatible with RBPi. So start
looking for TI specific EEPROM at 0x50, if not found look for EEPROM at
0x51.

Signed-off-by: Amarnath MB <amarnath.mb at ti.com>
Signed-off-by: Sinthu Raja <sinthu.raja at ti.com>
---
 board/ti/j721e/evm.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

diff --git a/board/ti/j721e/evm.c b/board/ti/j721e/evm.c
index 23e739bcd3..b618325627 100644
--- a/board/ti/j721e/evm.c
+++ b/board/ti/j721e/evm.c
@@ -150,9 +150,15 @@ int do_board_detect(void)
 
 	ret = ti_i2c_eeprom_am6_get_base(CONFIG_EEPROM_BUS_ADDRESS,
 					 CONFIG_EEPROM_CHIP_ADDRESS);
-	if (ret)
-		pr_err("Reading on-board EEPROM at 0x%02x failed %d\n",
-		       CONFIG_EEPROM_CHIP_ADDRESS, ret);
+	if (ret) {
+		printf("EEPROM not available at 0x%02x, trying to read at 0x%02x\n",
+		       CONFIG_EEPROM_CHIP_ADDRESS, CONFIG_EEPROM_CHIP_ADDRESS + 1);
+		ret = ti_i2c_eeprom_am6_get_base(CONFIG_EEPROM_BUS_ADDRESS,
+						 CONFIG_EEPROM_CHIP_ADDRESS + 1);
+		if (ret)
+			pr_err("Reading on-board EEPROM at 0x%02x failed %d\n",
+			       CONFIG_EEPROM_CHIP_ADDRESS + 1, ret);
+	}
 
 	return ret;
 }
-- 
2.31.1



More information about the U-Boot mailing list