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