boot: Call flush() before booting
authorPali Rohár <pali@kernel.org>
Mon, 5 Sep 2022 09:31:21 +0000 (11:31 +0200)
committerTom Rini <trini@konsulko.com>
Sat, 24 Sep 2022 15:34:38 +0000 (11:34 -0400)
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>
Reviewed-by: Simon Glass <sjg@chromium.org>
boot/bootm_os.c
cmd/boot.c
cmd/elf.c

index f31820c..079224c 100644 (file)
@@ -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);
 
index be67a59..14839c1 100644 (file)
@@ -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),
index ce40d3f..b7b9f50 100644 (file)
--- 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)