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