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