From patchwork Thu Aug 11 12:39:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pali_Roh=C3=A1r?= X-Patchwork-Id: 1665525 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=N9wh/GDd; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4M3RHG4XcFz9s5W for ; Thu, 11 Aug 2022 22:40:42 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 826C384942; Thu, 11 Aug 2022 14:40:13 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.b="N9wh/GDd"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 557E384925; Thu, 11 Aug 2022 14:39:58 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id D09D384927 for ; Thu, 11 Aug 2022 14:39:52 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=pali@kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 832B26145B; Thu, 11 Aug 2022 12:39:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BEA58C4347C; Thu, 11 Aug 2022 12:39:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1660221590; bh=HZlpIrBAAWewAR0F54wNyHj7xHX6x7JhcPibUWMJk58=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=N9wh/GDdGLTLdee64Jq9UF5HYgdTijY8gcRuvD8ghy/qvQyXbNhRl0jLhQWTkqizE IToA4s+HL87iAyac60eJ2RSX3tWe5edKtNOL9QTuXNcSzxrcLOOJWUMJK0qTukZrtb sS9yqsUhkETH67q89Gd02rHti7LY7jRaRfTuYf3d2NNrcHUa5qRWmOw59vPnRRnWnd z9w+C3PUjEvK3gmHvWxf1rGOmhdIj+pfMA/s+sFU+0iX0wl4ZbYApptijVcNIQ84go OnN7vhIlBn8/MD2SCNU1rQKJt4ce6/o2lesLpiNV6owwvNvrhc+fVSmm4JxMaIPr+B eVhCKgDjMseIw== Received: by pali.im (Postfix) id B39422782; Thu, 11 Aug 2022 14:39:49 +0200 (CEST) From: =?utf-8?q?Pali_Roh=C3=A1r?= To: Simon Glass 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 Message-Id: <20220811123925.23981-7-pali@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220811123925.23981-1-pali@kernel.org> References: <20220811123925.23981-1-pali@kernel.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.6 at phobos.denx.de X-Virus-Status: Clean 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 Reviewed-by: Simon Glass --- 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)