public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: "Pali Rohár" <pali@kernel.org>
To: Simon Glass <sjg@chromium.org>
Cc: u-boot@lists.denx.de
Subject: [PATCH v2 6/6] boot: Call flush() before booting
Date: Thu, 11 Aug 2022 14:39:25 +0200	[thread overview]
Message-ID: <20220811123925.23981-7-pali@kernel.org> (raw)
In-Reply-To: <20220811123925.23981-1-pali@kernel.org>

In lot of cases kernel resets UART HW. To ensure that U-Boot messages
printed before booting kernel are not lost, call new U-Boot console flush()
function.

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

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 2b33c50bd026..413d551dc05e 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)
-- 
2.20.1


  parent reply	other threads:[~2022-08-11 12:40 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-11 12:39 [PATCH v2 0/6] console: Implement flush() function Pali Rohár
2022-08-11 12:39 ` [PATCH v2 1/6] sandbox: Add function os_flush() Pali Rohár
2022-08-11 14:47   ` Simon Glass
2022-08-11 12:39 ` [PATCH v2 2/6] console: Implement flush() function Pali Rohár
2022-08-11 14:47   ` Simon Glass
2022-08-11 14:49     ` Pali Rohár
2022-08-12  0:08       ` Simon Glass
2022-08-12  9:01         ` Pali Rohár
2022-08-12 15:11           ` Simon Glass
2022-08-12 15:17             ` Pali Rohár
2022-08-13  2:21               ` Simon Glass
2022-08-25 14:20                 ` Pali Rohár
2022-08-25 15:08                   ` Simon Glass
2022-08-31  9:13                     ` Pali Rohár
2022-08-31 13:46                       ` Simon Glass
2022-08-31 13:55                         ` Tom Rini
2022-08-11 12:39 ` [PATCH v2 3/6] serial: Implement flush callback Pali Rohár
2022-08-11 14:47   ` Simon Glass
2022-08-11 12:39 ` [PATCH v2 4/6] serial: Implement serial_flush() function for console flush() fallback Pali Rohár
2022-08-11 14:47   ` Simon Glass
2022-08-11 12:39 ` [PATCH v2 5/6] serial: Call flush() before changing baudrate Pali Rohár
2022-08-11 14:47   ` Simon Glass
2022-08-11 14:51     ` Pali Rohár
2022-08-12  0:08       ` Simon Glass
2022-08-12  9:00         ` Pali Rohár
2022-08-11 12:39 ` Pali Rohár [this message]
2022-08-11 14:47   ` [PATCH v2 6/6] boot: Call flush() before booting Simon Glass

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220811123925.23981-7-pali@kernel.org \
    --to=pali@kernel.org \
    --cc=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox