]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
board: st: stm32mp2: add checkboard
authorPatrick Delaunay <patrick.delaunay@foss.st.com>
Mon, 15 Jan 2024 14:05:54 +0000 (15:05 +0100)
committerPatrice Chotard <patrice.chotard@foss.st.com>
Fri, 19 Jan 2024 13:38:59 +0000 (14:38 +0100)
Implement the weak function checkboard to identify the used board with
compatible in device tree for the support of stm32mp2 STMicroelectronics
boards.

Reviewed-by: Patrice Chotard <patrice.chotard@foss.st.com>
Signed-off-by: Patrick Delaunay <patrick.delaunay@foss.st.com>
board/st/stm32mp2/stm32mp2.c

index c97a7efff46e9fe9c8d966ab2b5621354a94a893..9a881583d90499b6a3f828d45e7fb11f3d3f6dc5 100644 (file)
@@ -8,14 +8,28 @@
 #include <config.h>
 #include <env.h>
 #include <fdt_support.h>
+#include <log.h>
 #include <asm/global_data.h>
 #include <asm/arch/sys_proto.h>
+#include <dm/ofnode.h>
 
 /*
  * Get a global data pointer
  */
 DECLARE_GLOBAL_DATA_PTR;
 
+int checkboard(void)
+{
+       const char *fdt_compat;
+       int fdt_compat_len;
+
+       fdt_compat = ofnode_get_property(ofnode_root(), "compatible", &fdt_compat_len);
+
+       log_info("Board: stm32mp2 (%s)\n", fdt_compat && fdt_compat_len ? fdt_compat : "");
+
+       return 0;
+}
+
 /* board dependent setup after realloc */
 int board_init(void)
 {