Skip to contentSkip to conversation

arm: socfpga: Enable U-boot FIT Config Name Match with Board ID

PATCH New Jit Loon Lim 1 participant 1 message Dec 11, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm: socfpga: Enable U-boot FIT Config Name Match with Board ID

From: Yau Wai Gan <[email protected]>

U-boot FIT configuration shall be selected based on the Board ID that is set.

---
 arch/arm/mach-socfpga/board.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
arch/arm/mach-socfpga/board.c +8 -5
index 11abf864f5..a9086d9fbe 100644
@@ -131,13 +131,16 @@ u8 socfpga_get_board_id(void)
 }
 
 
-#ifdef CONFIG_SPL_BUILD
-__weak int board_fit_config_name_match(const char *name)
+#if IS_ENABLED(CONFIG_SPL_BUILD) && IS_ENABLED(CONFIG_TARGET_SOCFPGA_SOC64)
+int board_fit_config_name_match(const char *name)
 {
-	/* Just empty function now - can't decide what to choose */
-	debug("%s: %s\n", __func__, name);
+	char board_name[10];
 
-	return 0;
+	sprintf(board_name, "board_%u", socfpga_get_board_id());
+
+	debug("Board name: %s\n", board_name);
+
+	return strcmp(name, board_name);
 }
 #endif
 
Signature · 1 line
2.26.2