blob: 93dc5050567d972364355ff924756445982c7227 [file] [log] [blame]
wdenk38635852002-08-27 05:55:31 +00001/*
2 * (C) Copyright 2000
3 * Wolfgang Denk, DENX Software Engineering, wd@denx.de.
4 *
Wolfgang Denk1a459662013-07-08 09:37:19 +02005 * SPDX-License-Identifier: GPL-2.0+
wdenk38635852002-08-27 05:55:31 +00006 */
7
8/*
9 * Boot support
10 */
11#include <common.h>
12#include <command.h>
Jean-Christophe PLAGNIOL-VILLARD52cb4d42009-05-16 12:14:54 +020013#include <stdio_dev.h>
wdenk38635852002-08-27 05:55:31 +000014
wdenk38635852002-08-27 05:55:31 +000015extern void _do_coninfo (void);
Kim Phillips088f1b12012-10-29 13:34:31 +000016static int do_coninfo(cmd_tbl_t *cmd, int flag, int argc, char * const argv[])
wdenk38635852002-08-27 05:55:31 +000017{
Jean-Christophe PLAGNIOL-VILLARDc1de7a62008-08-31 04:24:55 +020018 int l;
Jean-Christophe PLAGNIOL-VILLARD52cb4d42009-05-16 12:14:54 +020019 struct list_head *list = stdio_get_list();
Jean-Christophe PLAGNIOL-VILLARDc1de7a62008-08-31 04:24:55 +020020 struct list_head *pos;
Jean-Christophe PLAGNIOL-VILLARD52cb4d42009-05-16 12:14:54 +020021 struct stdio_dev *dev;
wdenk38635852002-08-27 05:55:31 +000022
23 /* Scan for valid output and input devices */
24
wdenkaa5590b2004-06-09 12:42:26 +000025 puts ("List of available devices:\n");
wdenk38635852002-08-27 05:55:31 +000026
Jean-Christophe PLAGNIOL-VILLARDc1de7a62008-08-31 04:24:55 +020027 list_for_each(pos, list) {
Jean-Christophe PLAGNIOL-VILLARD52cb4d42009-05-16 12:14:54 +020028 dev = list_entry(pos, struct stdio_dev, list);
wdenk38635852002-08-27 05:55:31 +000029
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}
wdenk8bde7f72003-06-27 21:31:46 +000046
47
48/***************************************************/
49
wdenk0d498392003-07-01 21:06:45 +000050U_BOOT_CMD(
51 coninfo, 3, 1, do_coninfo,
Peter Tyser2fb26042009-01-27 18:03:12 -060052 "print console devices and information",
wdenk8bde7f72003-06-27 21:31:46 +000053 ""
54);