[v2,4/5] rockchip: tpl: Print TPL banner at end-of board_init_f

Message ID 20200319101251.7354-4-jagan@amarulasolutions.com
State New
Headers show
Series
  • [v2,1/5] rockchip: Separate the reset cause from display cpuinfo
Related show

Commit Message

Jagan Teki March 19, 2020, 10:12 a.m.
Usually printing the TPL banner various between architecture
or board codes.
- Some of them would print at the end of board_init_f for
  making sure all initialization prior to this would happen
  properly. if at all there is a requirement for serial init,
  that happen properly since it prints all after that.
- Some of them would print at the beginning once the debug
  uart done. assuming this particular banner wouldn't require
  any serial setup code.

Rockchip TPL is following later one and printing early in
board_init_f.

But, sometimes there is a use case where we can print the banner
only when the board_init_early_f done.

It is  because board_init_early_f has gpio configuration required
for non-standard board design to glow the specific LEDs upon
user interaction. These board design wouldn't recommend to
print any console logs unless user interact with board via
some kind of power button.

This look specific to board but since all rockchip boards use
common tpl code, this seems to the desired solution. and also
it is following similar initialization as rockchip SPL like
- printing banner at end of board_init_f
- debug print at early board_init_f in debug_uart_init block.

Signed-off-by: Jagan Teki <jagan at amarulasolutions.com>
---
Changes for v2:
- none

 arch/arm/mach-rockchip/tpl.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

Comments

Suniel Mahesh March 26, 2020, 5:03 p.m. | #1
On Thu, Mar 19, 2020 at 3:43 PM Jagan Teki <jagan at amarulasolutions.com> wrote:
>
> Usually printing the TPL banner various between architecture
> or board codes.
> - Some of them would print at the end of board_init_f for
>   making sure all initialization prior to this would happen
>   properly. if at all there is a requirement for serial init,
>   that happen properly since it prints all after that.
> - Some of them would print at the beginning once the debug
>   uart done. assuming this particular banner wouldn't require
>   any serial setup code.
>
> Rockchip TPL is following later one and printing early in
> board_init_f.
>
> But, sometimes there is a use case where we can print the banner
> only when the board_init_early_f done.
>
> It is  because board_init_early_f has gpio configuration required
> for non-standard board design to glow the specific LEDs upon
> user interaction. These board design wouldn't recommend to
> print any console logs unless user interact with board via
> some kind of power button.
>
> This look specific to board but since all rockchip boards use
> common tpl code, this seems to the desired solution. and also
> it is following similar initialization as rockchip SPL like
> - printing banner at end of board_init_f
> - debug print at early board_init_f in debug_uart_init block.
>
> Signed-off-by: Jagan Teki <jagan at amarulasolutions.com>
> ---
> Changes for v2:
> - none
>
>  arch/arm/mach-rockchip/tpl.c | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/arch/arm/mach-rockchip/tpl.c b/arch/arm/mach-rockchip/tpl.c
> index fab85dff7d..a9eb27d788 100644
> --- a/arch/arm/mach-rockchip/tpl.c
> +++ b/arch/arm/mach-rockchip/tpl.c
> @@ -60,10 +60,7 @@ void board_init_f(ulong dummy)
>          * printascii("string");
>          */
>         debug_uart_init();
> -#ifdef CONFIG_TPL_BANNER_PRINT
> -       printascii("\nU-Boot TPL " PLAIN_VERSION " (" U_BOOT_DATE " - " \
> -                               U_BOOT_TIME ")\n");
> -#endif
> +       debug("\ntpl:debug uart enabled in %s\n", __func__);
>  #endif
>         ret = spl_early_init();
>         if (ret) {
> @@ -84,6 +81,11 @@ void board_init_f(ulong dummy)
>                 printf("DRAM init failed: %d\n", ret);
>                 return;
>         }
> +
> +#ifdef CONFIG_TPL_BANNER_PRINT
> +       printascii("\nU-Boot TPL " PLAIN_VERSION " (" U_BOOT_DATE " - " \
> +                               U_BOOT_TIME ")\n");
> +#endif
>  }
>
>  int board_return_to_bootrom(struct spl_image_info *spl_image,
> --
> 2.17.1
>

Tested-by: Suniel Mahesh <sunil at amarulasolutions.com>

Patch

diff --git a/arch/arm/mach-rockchip/tpl.c b/arch/arm/mach-rockchip/tpl.c
index fab85dff7d..a9eb27d788 100644
--- a/arch/arm/mach-rockchip/tpl.c
+++ b/arch/arm/mach-rockchip/tpl.c
@@ -60,10 +60,7 @@  void board_init_f(ulong dummy)
 	 * printascii("string");
 	 */
 	debug_uart_init();
-#ifdef CONFIG_TPL_BANNER_PRINT
-	printascii("\nU-Boot TPL " PLAIN_VERSION " (" U_BOOT_DATE " - " \
-				U_BOOT_TIME ")\n");
-#endif
+	debug("\ntpl:debug uart enabled in %s\n", __func__);
 #endif
 	ret = spl_early_init();
 	if (ret) {
@@ -84,6 +81,11 @@  void board_init_f(ulong dummy)
 		printf("DRAM init failed: %d\n", ret);
 		return;
 	}
+
+#ifdef CONFIG_TPL_BANNER_PRINT
+	printascii("\nU-Boot TPL " PLAIN_VERSION " (" U_BOOT_DATE " - " \
+				U_BOOT_TIME ")\n");
+#endif
 }
 
 int board_return_to_bootrom(struct spl_image_info *spl_image,