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

Jit Loon Lim jit.loon.lim at intel.com
Sun Dec 11 15:13:10 CET 2022


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

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
 
-- 
2.26.2



More information about the U-Boot mailing list