summaryrefslogtreecommitdiff
path: root/common/spl/spl.c
diff options
context:
space:
mode:
authorMax Krummenacher <max.krummenacher@toradex.com>2017-04-04 22:11:46 +0200
committerMarcel Ziswiler <marcel.ziswiler@toradex.com>2017-04-05 10:29:22 +0200
commit60021a4daa9720ae89e31def9483a09a78ead049 (patch)
tree19a1553e126faee87441a740bbede2ac77b30253 /common/spl/spl.c
parent3e67ed8179b411249625baf7aa88fc0295fb0190 (diff)
With CONFIG_SPL_SILENT_CONSOLE the 'U-Boot SPL...' version string is no longer linked into the SPL binary. Factor out the version string and make sure that it is not optimize away by lto. Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
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
}