diff mbox series

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

Message ID 20211102140558.32460-6-sinthu.raja@ti.com
State Changes Requested
Delegated to: Tom Rini
Headers show
Series Add support for J721E SK | expand

Commit Message

Sinthu Raja Nov. 2, 2021, 2:05 p.m. UTC
From: Sinthu Raja <sinthu.raja@ti.com>

J721E EVM has EEPROM populated at 0x50. J721E SK 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: Sinthu Raja <sinthu.raja@ti.com>
---

No changes in V2.

 board/ti/j721e/evm.c | 12 +++++++++---
 1 file changed, 9 insertions(+), 3 deletions(-)

Comments

Tom Rini Nov. 8, 2021, 3:51 p.m. UTC | #1
On Tue, Nov 02, 2021 at 07:35:46PM +0530, Sinthu Raja wrote:

> From: Sinthu Raja <sinthu.raja@ti.com>
> 
> J721E EVM has EEPROM populated at 0x50. J721E SK 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.

Minor, since I'm asking for other changes, please say "RPi" or
"Raspberry Pi" not "RBPi".
diff mbox series

Patch

diff --git a/board/ti/j721e/evm.c b/board/ti/j721e/evm.c
index 9cdb963221..989e15e666 100644
--- a/board/ti/j721e/evm.c
+++ b/board/ti/j721e/evm.c
@@ -152,9 +152,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;
 }