]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
board: ti: am64x: Add support for detecting multiple device trees
authorLokesh Vutla <lokeshvutla@ti.com>
Thu, 6 May 2021 11:14:51 +0000 (16:44 +0530)
committerLokesh Vutla <lokeshvutla@ti.com>
Wed, 12 May 2021 11:02:44 +0000 (16:32 +0530)
Update the board_fit_config_name_match() to choose the right dtb.

Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
board/ti/am64x/evm.c

index 18e49112ac3c9450cab8abba2c2dbc57a4aa72be..a1ffcb929ceb1e3a0e3b30447b377afb8deaefcc 100644 (file)
@@ -46,10 +46,15 @@ int dram_init_banksize(void)
 #if defined(CONFIG_SPL_LOAD_FIT)
 int board_fit_config_name_match(const char *name)
 {
-#if defined(CONFIG_TARGET_AM642_A53_EVM)
-       if (!strcmp(name, "k3-am642-evm"))
-               return 0;
-#endif
+       bool eeprom_read = board_ti_was_eeprom_read();
+
+       if (!eeprom_read || board_is_am64x_gpevm()) {
+               if (!strcmp(name, "k3-am642-r5-evm") || !strcmp(name, "k3-am642-evm"))
+                       return 0;
+       } else if (board_is_am64x_skevm()) {
+               if (!strcmp(name, "k3-am642-r5-sk") || !strcmp(name, "k3-am642-sk"))
+                       return 0;
+       }
 
        return -1;
 }