diff options
author | Dasnavis Sabiya <sabiya.d@ti.com> | 2023-01-24 20:22:16 +0530 |
---|---|---|
committer | Udit Kumar <u-kumar1@ti.com> | 2023-02-14 10:49:46 +0530 |
commit | b22aeb83d01b10ec4de6b97a874357638243e668 (patch) | |
tree | bcf352dd162f10c8fe5790d04c4f9c2ba0291c0b | |
parent | 724d9b119793b2f72e91159e6fc4f45e8379aa16 (diff) |
board: ti: j784s4: Add support for detecting multiple device trees
Update the board_fit_config_name_match() to choose the dtb based on
the board name read from EEPROM. Restrict multpile EEPROM reads by
verifying if EEPROM is already read.
Signed-off-by: Dasnavis Sabiya <sabiya.d@ti.com>
Reviewed-by: Neha Malcom Francis <n-francis@ti.com>
-rw-r--r-- | board/ti/j784s4/evm.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/board/ti/j784s4/evm.c b/board/ti/j784s4/evm.c index 68bdade7ff..07e7d9cc8b 100644 --- a/board/ti/j784s4/evm.c +++ b/board/ti/j784s4/evm.c @@ -79,8 +79,15 @@ int dram_init_banksize(void) #ifdef CONFIG_SPL_LOAD_FIT int board_fit_config_name_match(const char *name) { - if (!strcmp(name, "J784S4X-EVM")) - return 0; + bool eeprom_read = board_ti_was_eeprom_read(); + + if (!eeprom_read || board_is_j784s4_evm()) { + if ((!strcmp(name, "k3-j784s4-evm")) || (!strcmp(name, "k3-j784s4-r5-evm"))) + return 0; + } else if (!eeprom_read || board_is_am69_sk()) { + if ((!strcmp(name, "k3-am69-sk")) || (!strcmp(name, "k3-am69-r5-sk"))) + return 0; + } return -1; } @@ -107,6 +114,9 @@ int do_board_detect(void) { int ret; + if (board_ti_was_eeprom_read()) + return 0; + ret = ti_i2c_eeprom_am6_get_base(CONFIG_EEPROM_BUS_ADDRESS, CONFIG_EEPROM_CHIP_ADDRESS); if (ret) { |