aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorSamuel Holland <samuel@sholland.org>2020-05-07 18:08:10 -0500
committerTom Rini <trini@konsulko.com>2020-05-15 14:47:35 -0400
commit3988be5fd4369402c410336553bc0ca1920dbe6f (patch)
tree65e74e9f00c3258c8a716c616370e9a5d1c0a660 /common
parent48069ff84fe5e5e0ad733bef4718e02600b518c4 (diff)
downloadu-boot-3988be5fd4369402c410336553bc0ca1920dbe6f.zip
u-boot-3988be5fd4369402c410336553bc0ca1920dbe6f.tar.gz
u-boot-3988be5fd4369402c410336553bc0ca1920dbe6f.tar.bz2
spl: Always define preloader_console_init
A large number of boards call preloader_console_init unconditionally. Currently, they fail to build with CONFIG_SPL_SERIAL=n, because the function is undefined in that case. To fix the build, always define preloader_console_init, but make it no-op when CONFIG_SPL_SERIAL=n. For the few boards that did check for CONFIG_SPL_SERIAL before calling preloader_console_init, remove the checks, since the function can now be called unconditionally. Signed-off-by: Samuel Holland <samuel@sholland.org> Reviewed-by: Stefan Roese <sr@denx.de> Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
Diffstat (limited to 'common')
-rw-r--r--common/spl/spl.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/common/spl/spl.c b/common/spl/spl.c
index b0f0e15..fc5cbbb 100644
--- a/common/spl/spl.c
+++ b/common/spl/spl.c
@@ -574,8 +574,7 @@ void board_init_f(ulong dummy)
}
}
- if (CONFIG_IS_ENABLED(SERIAL_SUPPORT))
- preloader_console_init();
+ preloader_console_init();
}
#endif
@@ -724,13 +723,13 @@ void board_init_r(gd_t *dummy1, ulong dummy2)
jump_to_image_no_args(&spl_image);
}
-#ifdef CONFIG_SPL_SERIAL_SUPPORT
/*
* 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)
{
+#ifdef CONFIG_SPL_SERIAL_SUPPORT
gd->baudrate = CONFIG_BAUDRATE;
serial_init(); /* serial communications setup */
@@ -744,8 +743,8 @@ void preloader_console_init(void)
#ifdef CONFIG_SPL_DISPLAY_PRINT
spl_display_print();
#endif
-}
#endif
+}
/**
* This function is called before the stack is changed from initial stack to