1 // SPDX-License-Identifier: GPL-2.0+
4 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
13 #include <stdio_dev.h>
15 extern void _do_coninfo (void);
16 static int do_coninfo(struct cmd_tbl *cmd, int flag, int argc,
20 struct list_head *list = stdio_get_list();
21 struct list_head *pos;
22 struct stdio_dev *dev;
24 /* Scan for valid output and input devices */
26 puts("List of available devices\n");
28 list_for_each(pos, list) {
29 dev = list_entry(pos, struct stdio_dev, list);
31 printf("|-- %s (%s%s)\n",
33 (dev->flags & DEV_FLAGS_INPUT) ? "I" : "",
34 (dev->flags & DEV_FLAGS_OUTPUT) ? "O" : "");
36 for (l = 0; l < MAX_FILES; l++) {
37 if (CONFIG_IS_ENABLED(CONSOLE_MUX)) {
38 if (iomux_match_device(console_devices[l],
39 cd_count[l], dev) >= 0)
40 printf("| |-- %s\n", stdio_names[l]);
42 if (stdio_devices[l] == dev)
43 printf("| |-- %s\n", stdio_names[l]);
52 /***************************************************/
55 coninfo, 3, 1, do_coninfo,
56 "print console devices and information",