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 <[email protected]>
---
 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


_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox

Reply via email to