* [PATCH] spl: Always define preloader_console_init
@ 2020-05-07 23:08 Samuel Holland
2020-05-08 8:44 ` Stefan Roese
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: Samuel Holland @ 2020-05-07 23:08 UTC (permalink / raw)
To: u-boot
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>
---
arch/arm/mach-omap2/boot-common.c | 3 +--
arch/arm/mach-uniphier/spl_board_init.c | 2 --
common/spl/spl.c | 7 +++----
3 files changed, 4 insertions(+), 8 deletions(-)
diff --git a/arch/arm/mach-omap2/boot-common.c b/arch/arm/mach-omap2/boot-common.c
index 7538523724..d57382aabe 100644
--- a/arch/arm/mach-omap2/boot-common.c
+++ b/arch/arm/mach-omap2/boot-common.c
@@ -194,10 +194,9 @@ u32 spl_mmc_boot_mode(const u32 boot_device)
void spl_board_init(void)
{
-#ifdef CONFIG_SPL_SERIAL_SUPPORT
/* Prepare console output */
preloader_console_init();
-#endif
+
#if defined(CONFIG_SPL_NAND_SUPPORT) || defined(CONFIG_SPL_ONENAND_SUPPORT)
gpmc_init();
#endif
diff --git a/arch/arm/mach-uniphier/spl_board_init.c b/arch/arm/mach-uniphier/spl_board_init.c
index c7262d70a5..48764a1870 100644
--- a/arch/arm/mach-uniphier/spl_board_init.c
+++ b/arch/arm/mach-uniphier/spl_board_init.c
@@ -112,9 +112,7 @@ void spl_board_init(void)
initdata->early_clk_init();
-#ifdef CONFIG_SPL_SERIAL_SUPPORT
preloader_console_init();
-#endif
ret = initdata->dpll_init(bd);
if (ret) {
diff --git a/common/spl/spl.c b/common/spl/spl.c
index b0f0e1557b..fc5cbbbeba 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
--
2.24.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH] spl: Always define preloader_console_init
2020-05-07 23:08 [PATCH] spl: Always define preloader_console_init Samuel Holland
@ 2020-05-08 8:44 ` Stefan Roese
2020-05-08 14:50 ` Lokesh Vutla
2020-05-15 20:53 ` Tom Rini
2 siblings, 0 replies; 4+ messages in thread
From: Stefan Roese @ 2020-05-08 8:44 UTC (permalink / raw)
To: u-boot
On 08.05.20 01:08, Samuel Holland wrote:
> 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>
> ---
> arch/arm/mach-omap2/boot-common.c | 3 +--
> arch/arm/mach-uniphier/spl_board_init.c | 2 --
> common/spl/spl.c | 7 +++----
> 3 files changed, 4 insertions(+), 8 deletions(-)
Reviewed-by: Stefan Roese <sr@denx.de>
Thanks,
Stefan
> diff --git a/arch/arm/mach-omap2/boot-common.c b/arch/arm/mach-omap2/boot-common.c
> index 7538523724..d57382aabe 100644
> --- a/arch/arm/mach-omap2/boot-common.c
> +++ b/arch/arm/mach-omap2/boot-common.c
> @@ -194,10 +194,9 @@ u32 spl_mmc_boot_mode(const u32 boot_device)
>
> void spl_board_init(void)
> {
> -#ifdef CONFIG_SPL_SERIAL_SUPPORT
> /* Prepare console output */
> preloader_console_init();
> -#endif
> +
> #if defined(CONFIG_SPL_NAND_SUPPORT) || defined(CONFIG_SPL_ONENAND_SUPPORT)
> gpmc_init();
> #endif
> diff --git a/arch/arm/mach-uniphier/spl_board_init.c b/arch/arm/mach-uniphier/spl_board_init.c
> index c7262d70a5..48764a1870 100644
> --- a/arch/arm/mach-uniphier/spl_board_init.c
> +++ b/arch/arm/mach-uniphier/spl_board_init.c
> @@ -112,9 +112,7 @@ void spl_board_init(void)
>
> initdata->early_clk_init();
>
> -#ifdef CONFIG_SPL_SERIAL_SUPPORT
> preloader_console_init();
> -#endif
>
> ret = initdata->dpll_init(bd);
> if (ret) {
> diff --git a/common/spl/spl.c b/common/spl/spl.c
> index b0f0e1557b..fc5cbbbeba 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
>
Viele Gr??e,
Stefan
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-51 Fax: (+49)-8142-66989-80 Email: sr at denx.de
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] spl: Always define preloader_console_init
2020-05-07 23:08 [PATCH] spl: Always define preloader_console_init Samuel Holland
2020-05-08 8:44 ` Stefan Roese
@ 2020-05-08 14:50 ` Lokesh Vutla
2020-05-15 20:53 ` Tom Rini
2 siblings, 0 replies; 4+ messages in thread
From: Lokesh Vutla @ 2020-05-08 14:50 UTC (permalink / raw)
To: u-boot
On 08/05/20 4:38 AM, Samuel Holland wrote:
> 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: Lokesh Vutla <lokeshvutla@ti.com>
Thanks and regards,
Lokesh
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] spl: Always define preloader_console_init
2020-05-07 23:08 [PATCH] spl: Always define preloader_console_init Samuel Holland
2020-05-08 8:44 ` Stefan Roese
2020-05-08 14:50 ` Lokesh Vutla
@ 2020-05-15 20:53 ` Tom Rini
2 siblings, 0 replies; 4+ messages in thread
From: Tom Rini @ 2020-05-15 20:53 UTC (permalink / raw)
To: u-boot
On Thu, May 07, 2020 at 06:08:10PM -0500, Samuel Holland wrote:
> 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>
Applied to u-boot/master, thanks!
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200515/9accc21e/attachment.sig>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-05-15 20:53 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-07 23:08 [PATCH] spl: Always define preloader_console_init Samuel Holland
2020-05-08 8:44 ` Stefan Roese
2020-05-08 14:50 ` Lokesh Vutla
2020-05-15 20:53 ` Tom Rini
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.