Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D9838C001E0 for ; Sun, 23 Jul 2023 04:43:51 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D54CD86821; Sun, 23 Jul 2023 06:42:14 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=tinylab.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id C0A9A86817; Sun, 23 Jul 2023 06:42:09 +0200 (CEST) Received: from bg4.exmail.qq.com (bg4.exmail.qq.com [43.154.221.58]) (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 6BA2786824 for ; Sun, 23 Jul 2023 06:42:06 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=tinylab.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=bmeng@tinylab.org X-QQ-mid: bizesmtp84t1690087287t40r22bg Received: from ubuntu.. ( [111.196.130.174]) by bizesmtp.qq.com (ESMTP) with id ; Sun, 23 Jul 2023 12:41:26 +0800 (CST) X-QQ-SSF: 01200000000000F0H000000A0000000 X-QQ-FEAT: cbck7jzG4wZK9hIF4ToNV0aQJ5MtIgGrrqWJmNDpc/S3lzPcxjffZWAX0sSF2 4vv/CirKK+u+lv922kE8xMRb/QTolQGFFKuQ3MdBI/d74rG/2sp1PiVgMpjrQ82HWy4r+dV CfnNgebI1WX71thaRSKNcC3cwEAiGuU57mmdNxW+Qrdtpr04PVX2c5V5SKA2OWbt9rJ/81U xgFxEA8gzrFqfwcEkOtaUHIRM/fij+Mq89AO21YPTdAvxk8Z0SqdqyCTYtMq2rGvKThDp// zQNdsLvaR0SEt82I7Fj9L+hkzstbI609wMwtI/dHbItsWu68IFhaES1qV89kHP8dW6gj4zz 8xblZUJU8v/ARpAbyvUMOIge1XNcZ4D0sOHY6YW X-QQ-GoodBg: 0 X-BIZMAIL-ID: 5115817996352147540 From: Bin Meng To: Simon Glass , u-boot@lists.denx.de Cc: Harald Seiler , Heinrich Schuchardt , =?UTF-8?q?Pali=20Roh=C3=A1r?= , Rasmus Villemoes , Stefan Roese Subject: [PATCH 14/18] console: Print out complete stdio device list Date: Sun, 23 Jul 2023 12:40:37 +0800 Message-Id: <20230723044041.1089804-15-bmeng@tinylab.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230723044041.1089804-1-bmeng@tinylab.org> References: <20230723044041.1089804-1-bmeng@tinylab.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:tinylab.org:qybglogicsvrgz:qybglogicsvrgz7a-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.8 at phobos.denx.de X-Virus-Status: Clean At present if both CONSOLE_MUX and SYS_CONSOLE_IS_IN_ENV are on, during boot, the printed out stdio devices are incomplete, e.g.: with "stdout=serial,vidconsole", only "vidconsole" is printed. For such case, we can print out the stdio device name from the environment variables. Signed-off-by: Bin Meng --- common/console.c | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/common/console.c b/common/console.c index af52897ec3..98c3ee6ca6 100644 --- a/common/console.c +++ b/common/console.c @@ -1014,15 +1014,27 @@ static void stdio_print_current_devices(void) { char *stdinname, *stdoutname, *stderrname; - stdinname = stdio_devices[stdin] ? - stdio_devices[stdin]->name : - "No input devices available!"; - stdoutname = stdio_devices[stdout] ? - stdio_devices[stdout]->name : - "No output devices available!"; - stderrname = stdio_devices[stderr] ? - stdio_devices[stderr]->name : - "No error devices available!"; + if (CONFIG_IS_ENABLED(CONSOLE_MUX) && + CONFIG_IS_ENABLED(SYS_CONSOLE_IS_IN_ENV)) { + /* stdin stdout and stderr are in environment */ + stdinname = env_get("stdin"); + stdoutname = env_get("stdout"); + stderrname = env_get("stderr"); + + stdinname = stdinname ? : "No input devices available!"; + stdoutname = stdoutname ? : "No output devices available!"; + stderrname = stderrname ? : "No error devices available!"; + } else { + stdinname = stdio_devices[stdin] ? + stdio_devices[stdin]->name : + "No input devices available!"; + stdoutname = stdio_devices[stdout] ? + stdio_devices[stdout]->name : + "No output devices available!"; + stderrname = stdio_devices[stderr] ? + stdio_devices[stderr]->name : + "No error devices available!"; + } /* Print information */ puts("In: "); -- 2.34.1