xref: /openbmc/u-boot/doc/README.console (revision 1e52fea3)
1/*
2 * (C) Copyright 2000
3 * Paolo Scaffardi, AIRVENT SAM s.p.a - RIMINI(ITALY), arsenio@tin.it
4 *
5 * See file CREDITS for list of people who contributed to this
6 * project.
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License as
10 * published by the Free Software Foundation; either version 2 of
11 * the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
21 * MA 02111-1307 USA
22 */
23
24U-Boot console handling
25========================
26
27HOW THE CONSOLE WORKS?
28----------------------
29
30At system startup U-Boot initializes a serial console. When U-Boot
31relocates itself to RAM, all console drivers are initialized (they
32will register all detected console devices to the system for further
33use).
34
35If not defined in the environment, the first input device is assigned
36to the 'stdin' file, the first output one to 'stdout' and 'stderr'.
37
38You can use the command "coninfo" to see all registered console
39devices and their flags. You can assign a standard file (stdin,
40stdout or stderr) to any device you see in that list simply by
41assigning its name to the corresponding environment variable. For
42example:
43
44    setenv stdin wl_kbd		<- To use the wireless keyboard
45    setenv stdout video		<- To use the video console
46
47Do a simple "saveenv" to save the console settings in the environment
48and get them working on the next startup, too.
49
50HOW CAN I USE STANDARD FILE INTO THE SOURCES?
51---------------------------------------------
52
53You can use the following functions to access the console:
54
55* STDOUT:
56    putc	(to put a char to stdout)
57    puts	(to put a string to stdout)
58    printf	(to format and put a string to stdout)
59
60* STDIN:
61    tstc	(to test for the presence of a char in stdin)
62    getc	(to get a char from stdin)
63
64* STDERR:
65    eputc	(to put a char to stderr)
66    eputs	(to put a string to stderr)
67    eprintf	(to format and put a string to stderr)
68
69* FILE (can be 'stdin', 'stdout', 'stderr'):
70    fputc	(like putc but redirected to a file)
71    fputs	(like puts but redirected to a file)
72    fprintf	(like printf but redirected to a file)
73    ftstc	(like tstc but redirected to a file)
74    fgetc	(like getc but redirected to a file)
75
76Remember that all FILE-related functions CANNOT be used before
77U-Boot relocation (done in 'board_init_r' in arch/*/lib/board.c).
78
79HOW CAN I USE STANDARD FILE INTO APPLICATIONS?
80----------------------------------------------
81
82Use the 'bd_mon_fnc' field of the bd_t structure passed to the
83application to do everything you want with the console.
84
85But REMEMBER that that will work only if you have not overwritten any
86U-Boot code while loading (or uncompressing) the image of your
87application.
88
89For example, you won't get the console stuff running in the Linux
90kernel because the kernel overwrites U-Boot before running. Only
91some parameters like the framebuffer descriptors are passed to the
92kernel in the high memory area to let the applications (the kernel)
93use the framebuffers initialized by U-Boot.
94
95SUPPORTED DRIVERS
96-----------------
97
98Working drivers:
99
100    serial	(architecture dependent serial stuff)
101    video	(mpc8xx video controller)
102
103Work in progress:
104
105    wl_kbd	(Wireless 4PPM keyboard)
106
107Waiting for volounteers:
108
109    lcd	(mpc8xx lcd controller; to )
110
111TESTED CONFIGURATIONS
112---------------------
113
114The driver has been tested with the following configurations (see
115CREDITS for other contact informations):
116
117- MPC823FADS with AD7176 on a PAL TV (YCbYCr)	- arsenio@tin.it
118- GENIETV    with AD7177 on a PAL TV (YCbYCr)	- arsenio@tin.it
119