1 // SPDX-License-Identifier: GPL-2.0+
12 #include <stdio_dev.h>
14 extern void _do_coninfo (void);
15 static int do_coninfo(struct cmd_tbl *cmd, int flag, int argc,
19 struct list_head *list = stdio_get_list();
20 struct list_head *pos;
21 struct stdio_dev *dev;
23 /* Scan for valid output and input devices */
25 puts("List of available devices\n");
27 list_for_each(pos, list) {
28 dev = list_entry(pos, struct stdio_dev, list);
30 printf("|-- %s (%s%s)\n",
32 (dev->flags & DEV_FLAGS_INPUT) ? "I" : "",
33 (dev->flags & DEV_FLAGS_OUTPUT) ? "O" : "");
35 for (l = 0; l < MAX_FILES; l++) {
36 if (CONFIG_IS_ENABLED(CONSOLE_MUX)) {
37 if (iomux_match_device(console_devices[l],
38 cd_count[l], dev) >= 0)
39 printf("| |-- %s\n", stdio_names[l]);
41 if (stdio_devices[l] == dev)
42 printf("| |-- %s\n", stdio_names[l]);
50 /***************************************************/
53 coninfo, 3, 1, do_coninfo,
54 "print console devices and information",