cmd: fdt: Use env_set_hex() for "get addr" and "get size"
[platform/kernel/u-boot.git] / cmd / console.c
1 // SPDX-License-Identifier: GPL-2.0+
2 /*
3  * (C) Copyright 2000
4  * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
5  */
6
7 /*
8  * Boot support
9  */
10 #include <common.h>
11 #include <command.h>
12 #include <stdio_dev.h>
13
14 extern void _do_coninfo (void);
15 static int do_coninfo(struct cmd_tbl *cmd, int flag, int argc,
16                       char *const argv[])
17 {
18         int l;
19         struct list_head *list = stdio_get_list();
20         struct list_head *pos;
21         struct stdio_dev *dev;
22
23         /* Scan for valid output and input devices */
24
25         puts("List of available devices\n");
26
27         list_for_each(pos, list) {
28                 dev = list_entry(pos, struct stdio_dev, list);
29
30                 printf("|-- %s (%s%s)\n",
31                        dev->name,
32                        (dev->flags & DEV_FLAGS_INPUT) ? "I" : "",
33                        (dev->flags & DEV_FLAGS_OUTPUT) ? "O" : "");
34
35                 for (l = 0; l < MAX_FILES; l++) {
36                         if (stdio_devices[l] == dev) {
37                                 printf("|   |-- %s\n", stdio_names[l]);
38                         }
39                 }
40         }
41         return 0;
42 }
43
44
45 /***************************************************/
46
47 U_BOOT_CMD(
48         coninfo,        3,      1,      do_coninfo,
49         "print console devices and information",
50         ""
51 );