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