console.c 1.0 KB

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