u-boot.lists.denx.de archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] cmd: consider multiplexing in coninfo
@ 2023-04-01 10:20 Heinrich Schuchardt
  2023-04-02  2:39 ` Simon Glass
  0 siblings, 1 reply; 2+ messages in thread
From: Heinrich Schuchardt @ 2023-04-01 10:20 UTC (permalink / raw)
  To: Tom Rini; +Cc: Simon Glass, u-boot, Heinrich Schuchardt

If console multiplexing in enabled (CONFIG_CONSOLE_MUX=y), the output of
the coninfo command should show the file association (stdin, stderr,
stdout) for all devices not only the default ones.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
---
 cmd/console.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/cmd/console.c b/cmd/console.c
index 620a961cde..58c2cf1c89 100644
--- a/cmd/console.c
+++ b/cmd/console.c
@@ -9,6 +9,7 @@
  */
 #include <common.h>
 #include <command.h>
+#include <iomux.h>
 #include <stdio_dev.h>
 
 extern void _do_coninfo (void);
@@ -33,9 +34,15 @@ static int do_coninfo(struct cmd_tbl *cmd, int flag, int argc,
 		       (dev->flags & DEV_FLAGS_OUTPUT) ? "O" : "");
 
 		for (l = 0; l < MAX_FILES; l++) {
-			if (stdio_devices[l] == dev) {
-				printf("|   |-- %s\n", stdio_names[l]);
+			if (CONFIG_IS_ENABLED(CONSOLE_MUX)) {
+				if (iomux_match_device(console_devices[l],
+						       cd_count[l], dev) >= 0)
+					printf("|   |-- %s\n", stdio_names[l]);
+			} else {
+				if (stdio_devices[l] == dev)
+					printf("|   |-- %s\n", stdio_names[l]);
 			}
+
 		}
 	}
 	return 0;
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/1] cmd: consider multiplexing in coninfo
  2023-04-01 10:20 [PATCH 1/1] cmd: consider multiplexing in coninfo Heinrich Schuchardt
@ 2023-04-02  2:39 ` Simon Glass
  0 siblings, 0 replies; 2+ messages in thread
From: Simon Glass @ 2023-04-02  2:39 UTC (permalink / raw)
  To: Heinrich Schuchardt; +Cc: Tom Rini, U-Boot Mailing List

On Sat, 1 Apr 2023 at 23:20, Heinrich Schuchardt <
heinrich.schuchardt@canonical.com> wrote:
>
> If console multiplexing in enabled (CONFIG_CONSOLE_MUX=y), the output of
> the coninfo command should show the file association (stdin, stderr,
> stdout) for all devices not only the default ones.
>
> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
> ---
>  cmd/console.c | 11 +++++++++--
>  1 file changed, 9 insertions(+), 2 deletions(-)
>

Reviewed-by: Simon Glass <sjg@chromium.org>

Could add a test for this.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-04-02  2:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-01 10:20 [PATCH 1/1] cmd: consider multiplexing in coninfo Heinrich Schuchardt
2023-04-02  2:39 ` Simon Glass

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).