]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
board: ti: j721e: Enable support for reading EEPROM at next alternate address
authorSinthu Raja <sinthu.raja@ti.com>
Wed, 9 Feb 2022 09:36:49 +0000 (15:06 +0530)
committerTom Rini <trini@konsulko.com>
Wed, 16 Feb 2022 19:19:30 +0000 (14:19 -0500)
J721E EVM has EEPROM populated at 0x50. J721E SK has EEPROM populated
at next address 0x51 in order to be compatible with RPi. 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>
board/ti/j721e/evm.c

index e15ab7614cb42197fe2f7f5a01ce698334ace2fa..301afe1966d94f331f17a4322d2f983b5f4af234 100644 (file)
@@ -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;
 }