diff mbox series

[v3,6/6] boot: Call flush() before booting

Message ID 20220905093121.11630-7-pali@kernel.org
State Accepted
Commit efc3f9526f9cfcd8614668c03b9c66b209782c41
Delegated to: Tom Rini
Headers show
Series console: Implement flush() function | expand

Commit Message

Pali Rohár Sept. 5, 2022, 9:31 a.m. UTC
In a lot of cases kernel resets UART HW. To ensure that U-Boot messages
printed before booting the kernel are not lost, call new U-Boot console
flush() function.

Signed-off-by: Pali Rohár <pali@kernel.org>
---
Changes in v3:
* Fix commit message
---
 boot/bootm_os.c | 1 +
 cmd/boot.c      | 1 +
 cmd/elf.c       | 2 ++
 3 files changed, 4 insertions(+)

Comments

Simon Glass Sept. 7, 2022, 9:10 p.m. UTC | #1
On Mon, 5 Sept 2022 at 03:31, Pali Rohár <pali@kernel.org> wrote:
>
> In a lot of cases kernel resets UART HW. To ensure that U-Boot messages
> printed before booting the kernel are not lost, call new U-Boot console
> flush() function.
>
> Signed-off-by: Pali Rohár <pali@kernel.org>
> ---
> Changes in v3:
> * Fix commit message
> ---
>  boot/bootm_os.c | 1 +
>  cmd/boot.c      | 1 +
>  cmd/elf.c       | 2 ++
>  3 files changed, 4 insertions(+)
>

Reviewed-by: Simon Glass <sjg@chromium.org>

although I'm not sure why the load.c change is not in this patch too?
Pali Rohár Sept. 7, 2022, 9:14 p.m. UTC | #2
On Wednesday 07 September 2022 15:10:54 Simon Glass wrote:
> although I'm not sure why the load.c change is not in this patch too?

Because I split boot and serial/load changes into separate patches as
they are different logical things.
diff mbox series

Patch

diff --git a/boot/bootm_os.c b/boot/bootm_os.c
index f31820cd07ef..079224ce585b 100644
--- a/boot/bootm_os.c
+++ b/boot/bootm_os.c
@@ -303,6 +303,7 @@  static void do_bootvx_fdt(bootm_headers_t *images)
 #else
 	printf("## Starting vxWorks at 0x%08lx\n", (ulong)images->ep);
 #endif
+	flush();
 
 	boot_jump_vxworks(images);
 
diff --git a/cmd/boot.c b/cmd/boot.c
index be67a5980de3..14839c1cedcc 100644
--- a/cmd/boot.c
+++ b/cmd/boot.c
@@ -32,6 +32,7 @@  static int do_go(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
 	addr = hextoul(argv[1], NULL);
 
 	printf ("## Starting application at 0x%08lX ...\n", addr);
+	flush();
 
 	/*
 	 * pass address parameter as argv[0] (aka command name),
diff --git a/cmd/elf.c b/cmd/elf.c
index ce40d3f72a7c..b7b9f506a526 100644
--- a/cmd/elf.c
+++ b/cmd/elf.c
@@ -72,6 +72,7 @@  int do_bootelf(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
 		return rcode;
 
 	printf("## Starting application at 0x%08lx ...\n", addr);
+	flush();
 
 	/*
 	 * pass address parameter as argv[0] (aka command name),
@@ -274,6 +275,7 @@  int do_bootvx(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
 		puts("## Not an ELF image, assuming binary\n");
 
 	printf("## Starting vxWorks at 0x%08lx ...\n", addr);
+	flush();
 
 	dcache_disable();
 #if defined(CONFIG_ARM64) && defined(CONFIG_ARMV8_PSCI)