README.console 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. SPDX-License-Identifier: GPL-2.0+
  2. /*
  3. * (C) Copyright 2000
  4. * Paolo Scaffardi, AIRVENT SAM s.p.a - RIMINI(ITALY), arsenio@tin.it
  5. */
  6. U-Boot console handling
  7. ========================
  8. HOW THE CONSOLE WORKS?
  9. ----------------------
  10. At system startup U-Boot initializes a serial console. When U-Boot
  11. relocates itself to RAM, all console drivers are initialized (they
  12. will register all detected console devices to the system for further
  13. use).
  14. If not defined in the environment, the first input device is assigned
  15. to the 'stdin' file, the first output one to 'stdout' and 'stderr'.
  16. You can use the command "coninfo" to see all registered console
  17. devices and their flags. You can assign a standard file (stdin,
  18. stdout or stderr) to any device you see in that list simply by
  19. assigning its name to the corresponding environment variable. For
  20. example:
  21. setenv stdin serial <- To use the serial input
  22. setenv stdout video <- To use the video console
  23. Do a simple "saveenv" to save the console settings in the environment
  24. and get them working on the next startup, too.
  25. HOW CAN I USE STANDARD FILE INTO THE SOURCES?
  26. ---------------------------------------------
  27. You can use the following functions to access the console:
  28. * STDOUT:
  29. putc (to put a char to stdout)
  30. puts (to put a string to stdout)
  31. printf (to format and put a string to stdout)
  32. * STDIN:
  33. tstc (to test for the presence of a char in stdin)
  34. getc (to get a char from stdin)
  35. * STDERR:
  36. eputc (to put a char to stderr)
  37. eputs (to put a string to stderr)
  38. eprintf (to format and put a string to stderr)
  39. * FILE (can be 'stdin', 'stdout', 'stderr'):
  40. fputc (like putc but redirected to a file)
  41. fputs (like puts but redirected to a file)
  42. fprintf (like printf but redirected to a file)
  43. ftstc (like tstc but redirected to a file)
  44. fgetc (like getc but redirected to a file)
  45. Remember that all FILE-related functions CANNOT be used before
  46. U-Boot relocation (done in 'board_init_r' in arch/*/lib/board.c).
  47. HOW CAN I USE STANDARD FILE INTO APPLICATIONS?
  48. ----------------------------------------------
  49. Use the 'bd_mon_fnc' field of the bd_info structure passed to the
  50. application to do everything you want with the console.
  51. But REMEMBER that that will work only if you have not overwritten any
  52. U-Boot code while loading (or uncompressing) the image of your
  53. application.
  54. For example, you won't get the console stuff running in the Linux
  55. kernel because the kernel overwrites U-Boot before running. Only
  56. some parameters like the framebuffer descriptors are passed to the
  57. kernel in the high memory area to let the applications (the kernel)
  58. use the framebuffers initialized by U-Boot.
  59. SUPPORTED DRIVERS
  60. -----------------
  61. Working drivers:
  62. serial (architecture dependent serial stuff)
  63. video (mpc8xx video controller)
  64. Work in progress:
  65. wl_kbd (Wireless 4PPM keyboard)
  66. Waiting for volounteers:
  67. lcd (mpc8xx lcd controller; to )
  68. TESTED CONFIGURATIONS
  69. ---------------------
  70. The driver has been tested with the following configurations (see
  71. CREDITS for other contact informations):
  72. - MPC823FADS with AD7176 on a PAL TV (YCbYCr) - arsenio@tin.it