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