[PATCH 5/5] of: Print model name in banner

Sascha Hauer s.hauer at pengutronix.de
Mon Oct 8 15:46:24 EDT 2012


If we know the model name from the devicetree print this
in the banner instead of the hardcoded board name.

Signed-off-by: Sascha Hauer <s.hauer at pengutronix.de>
---
 common/version.c |   11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/common/version.c b/common/version.c
index a557904..22e111a 100644
--- a/common/version.c
+++ b/common/version.c
@@ -1,6 +1,7 @@
 #include <common.h>
 #include <generated/compile.h>
 #include <generated/utsrelease.h>
+#include <of.h>
 
 const char version_string[] =
 	"barebox " UTS_RELEASE " " UTS_VERSION "\n";
@@ -8,7 +9,13 @@ EXPORT_SYMBOL(version_string);
 
 void barebox_banner (void)
 {
+	const char *board;
+
+	board = of_get_model();
+
+	if (!board)
+		board = CONFIG_BOARDINFO;
+
 	printf("\n\n%s\n\n", version_string);
-	printf("Board: " CONFIG_BOARDINFO "\n");
+	printf("Board: %s\n", board);
 }
-
-- 
1.7.10.4




More information about the barebox mailing list