board: am65x: Use generic AM6x board detection function
Replace the board-specific implementation of do_board_detect() with a call to the generic do_board_detect_am6() function to avoid code duplication across AM6x family boards. The generic function provides the same functionality with additional fallback logic to try alternate EEPROM addresses. Reviewed-by: Mattijs Korpershoek <mkorpershoek@kernel.org> Signed-off-by: Guillaume La Roque (TI.com) <glaroque@baylibre.com>
This commit is contained in:
committed by
Tom Rini
parent
ce56e553c3
commit
804b80288a
@@ -72,24 +72,11 @@ int board_fit_config_name_match(const char *name)
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_TI_I2C_BOARD_DETECT
|
||||
int do_board_detect(void)
|
||||
{
|
||||
int ret;
|
||||
|
||||
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);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
int checkboard(void)
|
||||
{
|
||||
struct ti_am6_eeprom *ep = TI_AM6_EEPROM_DATA;
|
||||
|
||||
if (do_board_detect())
|
||||
if (do_board_detect_am6())
|
||||
/* EEPROM not populated */
|
||||
printf("Board: %s rev %s\n", "AM6-COMPROCEVM", "E3");
|
||||
else
|
||||
@@ -102,7 +89,7 @@ static void setup_board_eeprom_env(void)
|
||||
{
|
||||
char *name = "am65x";
|
||||
|
||||
if (do_board_detect())
|
||||
if (do_board_detect_am6())
|
||||
goto invalid_eeprom;
|
||||
|
||||
if (board_is_am65x_base_board())
|
||||
|
||||
Reference in New Issue
Block a user