diff mbox series

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

Message ID 20221211141310.18059-1-jit.loon.lim@intel.com
State Needs Review / ACK, archived
Delegated to: Marek Vasut
Headers show
Series arm: socfpga: Enable U-boot FIT Config Name Match with Board ID | expand

Commit Message

Jit Loon Lim Dec. 11, 2022, 2:13 p.m. UTC
From: Yau Wai Gan <yau.wai.gan@intel.com>

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

Signed-off-by: Yau Wai Gan <yau.wai.gan@intel.com>
Signed-off-by: Jit Loon Lim <jit.loon.lim@intel.com>
---
 arch/arm/mach-socfpga/board.c | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/arch/arm/mach-socfpga/board.c b/arch/arm/mach-socfpga/board.c
index 11abf864f5..a9086d9fbe 100644
--- a/arch/arm/mach-socfpga/board.c
+++ b/arch/arm/mach-socfpga/board.c
@@ -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