[PATCH 03/10] board: stm32mp1: Implement board_fit_config_name_match() for SPL

Alexandru Gagniuc mr.nuke.me at gmail.com
Thu Aug 26 23:42:02 CEST 2021


This function is needed when loading a FIT image from SPL. It selects
the correct configuration node for the current board. Implement it.

Signed-off-by: Alexandru Gagniuc <mr.nuke.me at gmail.com>
---
 board/st/stm32mp1/spl.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/board/st/stm32mp1/spl.c b/board/st/stm32mp1/spl.c
index bb210d7727..543c037ad8 100644
--- a/board/st/stm32mp1/spl.c
+++ b/board/st/stm32mp1/spl.c
@@ -5,6 +5,7 @@
 
 #include <config.h>
 #include <common.h>
+#include <dm/device.h>
 #include <init.h>
 #include <asm/io.h>
 #include <asm/arch/sys_proto.h>
@@ -92,3 +93,12 @@ void board_debug_uart_init(void)
 #endif
 }
 #endif
+
+int board_fit_config_name_match(const char *name)
+{
+	if (of_machine_is_compatible("st,stm32mp157c-dk2"))
+		return !strstr(name, "stm32mp157c-dk2");
+
+	/* Okay, it's most likely an EV board */
+	return !strstr(name, "stm32mp157") + !strstr(name, "-ev");
+}
-- 
2.31.1



More information about the U-Boot mailing list