summaryrefslogtreecommitdiff
path: root/common/spl/spl.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/spl/spl.c')
-rw-r--r--common/spl/spl.c16
1 files changed, 14 insertions, 2 deletions
diff --git a/common/spl/spl.c b/common/spl/spl.c
index 0e50137cdf7..8aee799faaa 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -462,12 +462,22 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
jump_to_image_no_args(&spl_image);
}
+/* factor out puts, otherwise lto removes the version string when
+ * CONFIG_SPL_SILENT_CONSOLE is set */
+static void putsver(char *ver)
+{
+ if(ver[0] != 0)
+ puts(ver);
+}
+
/*
* This requires UART clocks to be enabled. In order for this to work the
* caller must ensure that the gd pointer is valid.
*/
void preloader_console_init(void)
{
+ char *ver = "\nU-Boot SPL " \
+ PLAIN_VERSION " (" U_BOOT_DATE " - " U_BOOT_TIME ")\n";
gd->bd = &bdata;
gd->baudrate = CONFIG_BAUDRATE;
@@ -476,11 +486,13 @@ void preloader_console_init(void)
gd->have_console = 1;
#ifndef CONFIG_SPL_SILENT_CONSOLE
- puts("\nU-Boot SPL " PLAIN_VERSION " (" U_BOOT_DATE " - " \
- U_BOOT_TIME ")\n");
+ putsver(ver);
#ifdef CONFIG_SPL_DISPLAY_PRINT
spl_display_print();
#endif
+#else
+ ver[0] = 0;
+ putsver(ver);
#endif
}