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 59B25C001B0 for ; Sun, 23 Jul 2023 06:38:08 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4876E86625; Sun, 23 Jul 2023 08:38:06 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmx.de 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; secure) header.d=gmx.de header.i=xypron.glpk@gmx.de header.b="jGHGR5vn"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4421686663; Sun, 23 Jul 2023 08:38:05 +0200 (CEST) Received: from mout.gmx.net (mout.gmx.net [212.227.17.22]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 6EA34865B6 for ; Sun, 23 Jul 2023 08:38:02 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=xypron.glpk@gmx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1690094273; x=1690699073; i=xypron.glpk@gmx.de; bh=hHJUl7jE4KzDNPQBt7N2rUBQXyEJqkNDlosj8nSvXyw=; h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:In-Reply-To; b=jGHGR5vn4xec8qL0pQeu7ERnzaNesa+BAeUO69x3/dGTuEiCrDPSECyWtBB+mdH/04yhWPG PBzm5c9A9jydxNtBPx/dxIGBCYqmNJLZ0pQKhCzUr04CpfJobWcuPlgO6jgvj7Bssalf+9Ezi alRUSPM3YMyaWUrlCgpHkq+IapsMF1M6kYDRCuuFa1/1Uz5TSdBpdVrWiScwB3j6KtNzplyds ARfts6hOBa/Wyp7vxuAWmD/wcyuXPpfR418sySl8Is/OzhCItpP6zEqi+OmPDMgXtb8qbSDaq 0zQhiJkZlJP2ZjeykmIF644+tJpBPe1lukYPHIP1eoz/FpgEqv/Q== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from [192.168.123.94] ([62.143.244.162]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MK3Vu-1qcEgx0pxu-00LYOf; Sun, 23 Jul 2023 08:37:53 +0200 Message-ID: <218f14dd-93aa-3dab-58ef-068d7a840022@gmx.de> Date: Sun, 23 Jul 2023 08:38:17 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH 14/18] console: Print out complete stdio device list To: Bin Meng Cc: Harald Seiler , =?UTF-8?Q?Pali_Roh=c3=a1r?= , Rasmus Villemoes , Stefan Roese , u-boot@lists.denx.de, Simon Glass References: <20230723044041.1089804-1-bmeng@tinylab.org> <20230723044041.1089804-15-bmeng@tinylab.org> Content-Language: en-US From: Heinrich Schuchardt In-Reply-To: <20230723044041.1089804-15-bmeng@tinylab.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:Sr9yJgqYyWo4S6U2kIw/PSxfPwb9ToNmw12twtP1kZifizMUpQi fuj8fu+iX58o3rNSq1+v0pAjf3+xMnr4khYvlO3A/6wcMkhLX/IHEOVO0VUbGovE4D/hNBB 2FtEBX2yZjClwOKkuCkm5okzzzAd1u/jKMQx50IDcVUB8ocvYX8Pa5WxdkKotDmaUAneBTO o2K4BxKwBeIRFlt0chFoA== U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man-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 On 7/23/23 06:40, Bin Meng wrote: > 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=3Dserial,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 =3D stdio_devices[stdin] ? > - stdio_devices[stdin]->name : > - "No input devices available!"; > - stdoutname =3D stdio_devices[stdout] ? > - stdio_devices[stdout]->name : > - "No output devices available!"; > - stderrname =3D 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 =3D env_get("stdin"); > + stdoutname =3D env_get("stdout"); > + stderrname =3D env_get("stderr"); > + > + stdinname =3D stdinname ? : "No input devices available!"; > + stdoutname =3D stdoutname ? : "No output devices available!"; This string will never be printed as you have no output device. > + stderrname =3D stderrname ? : "No error devices available!"; > + } else { > + stdinname =3D stdio_devices[stdin] ? > + stdio_devices[stdin]->name : > + "No input devices available!"; > + stdoutname =3D stdio_devices[stdout] ? > + stdio_devices[stdout]->name : > + "No output devices available!"; ditto > + stderrname =3D stdio_devices[stderr] ? > + stdio_devices[stderr]->name : > + "No error devices available!"; > + } do_coninfo() shows how to print all muxed devices irrespective of SYS_CONSOLE_IS_IN_ENV. Best regards Heinrich > > /* Print information */ > puts("In: ");