spl: Always define preloader_console_init
PATCH 1/1 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.
--- 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(-)
arch/arm/mach-omap2/boot-common.c +1 -2
@@ -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
arch/arm/mach-uniphier/spl_board_init.c +0 -2
@@ -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) {
common/spl/spl.c +3 -4
@@ -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
Signature · 1 line
2.24.1
PATCH 1/1 spl: Always define preloader_console_init
Quoted 9 lines · Samuel Holland
A large number of boards call
preloader_console_initunconditionally. Currently, they fail to build withCONFIG_SPL_SERIAL=n, because the function is undefined in that case. To fix the build, always definepreloader_console_init, but make it no-op whenCONFIG_SPL_SERIAL=n.For the few boards that did check for
CONFIG_SPL_SERIALbefore callingpreloader_console_init, remove the checks, since the function can now be called unconditionally.
Quoted 6 lines
Signed-off-by Samuel Holland <[email protected]>--- 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(-)
Thanks,
Stefan
Quoted 61 lines
arch/arm/mach-omap2/boot-common.c +1
-2@@ -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 arch/arm/mach-uniphier/spl_board_init.c +0
-2@@ -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) {common/spl/spl.c +2
-3@@ -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 */
common/spl/spl.c void preloader_console_init(void) · line 750
Quoted 9 lines
common/spl/spl.c +1
-1@@ -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
Signature · 3 lines
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
PATCH 1/1 spl: Always define preloader_console_init
In reply to Samuel HollandQuoted 10 lines · Samuel Holland
A large number of boards call
preloader_console_initunconditionally. Currently, they fail to build withCONFIG_SPL_SERIAL=n, because the function is undefined in that case. To fix the build, always definepreloader_console_init, but make it no-op whenCONFIG_SPL_SERIAL=n.For the few boards that did check for
CONFIG_SPL_SERIALbefore callingpreloader_console_init, remove the checks, since the function can now be called unconditionally.Signed-off-by Samuel Holland <[email protected]>
Thanks and regards,
Lokesh
PATCH 1/1 spl: Always define preloader_console_init
In reply to Samuel HollandQuoted 5 lines · Samuel Holland
A large number of boards call
preloader_console_initunconditionally. Currently, they fail to build withCONFIG_SPL_SERIAL=n, because the function is undefined in that case. To fix the build, always definepreloader_console_init, but make it no-op whenCONFIG_SPL_SERIAL=n.
Quoted 7 lines
For the few boards that did check for
CONFIG_SPL_SERIALbefore callingpreloader_console_init, remove the checks, since the function can now be called unconditionally.Signed-off-by Samuel Holland <[email protected]>Reviewed-by Stefan Roese <[email protected]>Reviewed-by Lokesh Vutla <[email protected]>
Applied to u-boot/master, thanks!
Signature · 8 lines
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>