]>
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 | */ | |
3863585b | 10 | #include <command.h> |
d9d07d75 | 11 | #include <iomux.h> |
52cb4d4f | 12 | #include <stdio_dev.h> |
3863585b | 13 | |
3863585b | 14 | extern void _do_coninfo (void); |
09140113 SG |
15 | static int do_coninfo(struct cmd_tbl *cmd, int flag, int argc, |
16 | 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 | ||
fe34e163 | 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 | 29 | |
fe34e163 HS |
30 | printf("|-- %s (%s%s)\n", |
31 | dev->name, | |
32 | (dev->flags & DEV_FLAGS_INPUT) ? "I" : "", | |
33 | (dev->flags & DEV_FLAGS_OUTPUT) ? "O" : ""); | |
3863585b WD |
34 | |
35 | for (l = 0; l < MAX_FILES; l++) { | |
d9d07d75 HS |
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]); | |
40 | } else { | |
41 | if (stdio_devices[l] == dev) | |
42 | printf("| |-- %s\n", stdio_names[l]); | |
3863585b | 43 | } |
d9d07d75 | 44 | |
3863585b | 45 | } |
3863585b WD |
46 | } |
47 | return 0; | |
48 | } | |
8bde7f77 | 49 | |
8bde7f77 WD |
50 | /***************************************************/ |
51 | ||
0d498393 WD |
52 | U_BOOT_CMD( |
53 | coninfo, 3, 1, do_coninfo, | |
2fb2604d | 54 | "print console devices and information", |
8bde7f77 WD |
55 | "" |
56 | ); |