diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2011-04-01 15:13:55 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2011-04-11 12:36:08 +0200 |
commit | 3f1ff6b730ec17ce635fcf38770358d8042e80b4 (patch) | |
tree | 3b93a1f2f90bcfde6bfecd30d74635e54756c584 | |
parent | 09da8d4bab923871891e275e83c90419d9235231 (diff) | |
download | barebox-3f1ff6b730ec17ce635fcf38770358d8042e80b4.tar.gz barebox-3f1ff6b730ec17ce635fcf38770358d8042e80b4.tar.xz |
move version_string to seperate file
In a noninteractive environment barebox will be compiled without
command support. So move version_string to a seperate file which
is compiled unconditionally.
Also, display the banner when the simple console support is used.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | common/Makefile | 1 | ||||
-rw-r--r-- | common/command.c | 4 | ||||
-rw-r--r-- | common/console.c | 10 | ||||
-rw-r--r-- | common/console_simple.c | 2 | ||||
-rw-r--r-- | common/version.c | 13 | ||||
-rw-r--r-- | include/common.h | 1 |
6 files changed, 19 insertions, 12 deletions
diff --git a/common/Makefile b/common/Makefile index 6cc61435d5..d8c302f0a3 100644 --- a/common/Makefile +++ b/common/Makefile @@ -9,6 +9,7 @@ obj-$(CONFIG_POLLER) += poller.o obj-y += dlmalloc.o obj-y += clock.o +obj-y += version.o obj-y += command.o obj-$(CONFIG_CONSOLE_FULL) += console.o obj-$(CONFIG_CONSOLE_SIMPLE) += console_simple.o diff --git a/common/command.c b/common/command.c index f1aeeb9df0..ab02ed5322 100644 --- a/common/command.c +++ b/common/command.c @@ -33,12 +33,8 @@ #include <linux/list.h> #include <init.h> #include <complete.h> -#include <generated/utsrelease.h> #include <getopt.h> -const char version_string[] = - "barebox " UTS_RELEASE " (" __DATE__ " - " __TIME__ ")"; - LIST_HEAD(command_list); EXPORT_SYMBOL(command_list); diff --git a/common/console.c b/common/console.c index 5548a409ac..d33a249c92 100644 --- a/common/console.c +++ b/common/console.c @@ -45,12 +45,6 @@ EXPORT_SYMBOL(console_list); #define CONSOLE_INIT_EARLY 1 #define CONSOLE_INIT_FULL 2 -static void display_banner (void) -{ - printf (RELOC("\n\n%s\n\n"), RELOC_VAR(version_string)); - printf(RELOC("Board: " CONFIG_BOARDINFO "\n")); -} - static int __early_initdata initialized = 0; static int console_std_set(struct device_d *dev, struct param_d *param, @@ -169,7 +163,7 @@ int console_register(struct console_device *newcdev) #ifndef CONFIG_HAS_EARLY_INIT if (first) - display_banner(); + barebox_banner(); #endif return 0; @@ -420,7 +414,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(); + barebox_banner(); } } diff --git a/common/console_simple.c b/common/console_simple.c index 1b58deaff7..7304d8ee05 100644 --- a/common/console_simple.c +++ b/common/console_simple.c @@ -152,6 +152,8 @@ int console_register(struct console_device *newcdev) console = newcdev; console_list.prev = console_list.next = &newcdev->list; newcdev->list.prev = newcdev->list.next = &console_list; + + barebox_banner(); } return 0; } diff --git a/common/version.c b/common/version.c new file mode 100644 index 0000000000..945475fc3d --- /dev/null +++ b/common/version.c @@ -0,0 +1,13 @@ +#include <common.h> +#include <reloc.h> +#include <generated/utsrelease.h> + +const char version_string[] = + "barebox " UTS_RELEASE " (" __DATE__ " - " __TIME__ ")"; + +void barebox_banner (void) +{ + printf (RELOC("\n\n%s\n\n"), RELOC_VAR(version_string)); + printf(RELOC("Board: " CONFIG_BOARDINFO "\n")); +} + diff --git a/include/common.h b/include/common.h index 35ad7b994d..491bc98033 100644 --- a/include/common.h +++ b/include/common.h @@ -219,6 +219,7 @@ int run_shell(void); int memory_display(char *addr, ulong offs, ulong nbytes, int size); extern const char version_string[]; +void barebox_banner(void); #define IOMEM(addr) ((void __force __iomem *)(addr)) |