spl: Always define preloader_console_init
authorSamuel Holland <samuel@sholland.org>
Thu, 7 May 2020 23:08:10 +0000 (18:08 -0500)
committerTom Rini <trini@konsulko.com>
Fri, 15 May 2020 18:47:35 +0000 (14:47 -0400)
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>
arch/arm/mach-omap2/boot-common.c
arch/arm/mach-uniphier/spl_board_init.c
common/spl/spl.c

index 7538523724316e85c9018f616a874aae2b953e02..d57382aabec75e53df4752b13457293eb487c5a1 100644 (file)
@@ -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
index c7262d70a5df9c84259243cbaa258850a50c06dd..48764a18702f67f7ed21e6fe36c27db415e2ab4b 100644 (file)
@@ -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) {
index b0f0e1557b923f8be107e8bdee42f376295f3657..fc5cbbbeba3aae9de3c9ac9f49758adc6b5bf2df 100644 (file)
@@ -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