summaryrefslogtreecommitdiffstats
path: root/common/console.c
diff options
context:
space:
mode:
authorsascha <sascha@nomad.localdomain>2007-10-19 11:04:33 +0200
committersascha <sascha@nomad.localdomain>2007-10-19 11:04:33 +0200
commitceac76ffceca6e5648c6870dd51103169a476e00 (patch)
treeb1b834a34874ecc48fb23843ed47846cc458b717 /common/console.c
parent2acbe717c13c6cafb6f6c2c23f3a7758e2e4ea66 (diff)
downloadbarebox-ceac76ffceca6e5648c6870dd51103169a476e00.tar.gz
barebox-ceac76ffceca6e5648c6870dd51103169a476e00.tar.xz
Move display_banner() to console.c. This helps us to show
the banner as first message.
Diffstat (limited to 'common/console.c')
-rw-r--r--common/console.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/common/console.c b/common/console.c
index 3868bfab1b..80f8cdb890 100644
--- a/common/console.c
+++ b/common/console.c
@@ -35,6 +35,7 @@
#include <kfifo.h>
#include <module.h>
#include <list.h>
+#include <linux/utsrelease.h>
LIST_HEAD(console_list);
EXPORT_SYMBOL(console_list);
@@ -43,6 +44,15 @@ EXPORT_SYMBOL(console_list);
#define CONSOLE_INIT_EARLY 1
#define CONSOLE_INIT_FULL 2
+const char version_string[] =
+ "U-Boot " UTS_RELEASE " (" __DATE__ " - " __TIME__ ")";
+
+static void display_banner (void)
+{
+ printf (RELOC("\n\n%s\n\n"), RELOC_VAR(version_string));
+ printf(RELOC("Board: " CONFIG_BOARDINFO "\n"));
+}
+
static int __initdata initialized = 0;
static int console_std_set(struct device_d *dev, struct param_d *param,
@@ -98,6 +108,7 @@ static int console_baudrate_set(struct device_d *dev, struct param_d *param,
int console_register(struct console_device *newcdev)
{
struct device_d *dev = newcdev->dev;
+ int first = 0;
if (newcdev->setbrg) {
newcdev->baudrate_param.set = console_baudrate_set;
@@ -120,12 +131,19 @@ int console_register(struct console_device *newcdev)
console_std_set(dev, &newcdev->active_param, "ioe");
#endif
#ifdef CONFIG_CONSOLE_ACTIVATE_FIRST
- if (list_empty(&console_list))
+ if (list_empty(&console_list)) {
+ first = 1;
console_std_set(dev, &newcdev->active_param, "ioe");
+ }
#endif
list_add_tail(&newcdev->list, &console_list);
+#ifndef CONFIG_HAS_EARLY_INIT
+ if (first)
+ display_banner();
+#endif
+
return 0;
}
EXPORT_SYMBOL(console_register);
@@ -358,6 +376,7 @@ void early_console_start(const char *name, int baudrate)
early_console_init(base, baudrate);
INITDATA(initialized) = CONSOLE_INIT_EARLY;
INITDATA(early_console_base) = base;
+ display_banner();
}
}