wdenk | cc1c8a1 | 2002-11-02 22:58:18 +0000 | [diff] [blame] | 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 | |
| 24 | U-Boot console handling |
| 25 | ======================== |
| 26 | |
| 27 | HOW THE CONSOLE WORKS? |
| 28 | ---------------------- |
| 29 | |
| 30 | At system startup U-Boot initializes a serial console. When U-Boot |
| 31 | relocates itself to RAM, all console drivers are initialized (they |
| 32 | will register all detected console devices to the system for further |
| 33 | use). |
| 34 | |
| 35 | If not defined in the environment, the first input device is assigned |
| 36 | to the 'stdin' file, the first output one to 'stdout' and 'stderr'. |
| 37 | |
| 38 | You can use the command "coninfo" to see all registered console |
| 39 | devices and their flags. You can assign a standard file (stdin, |
| 40 | stdout or stderr) to any device you see in that list simply by |
| 41 | assigning its name to the corresponding environment variable. For |
| 42 | example: |
| 43 | |
| 44 | setenv stdin wl_kbd <- To use the wireless keyboard |
| 45 | setenv stdout video <- To use the video console |
| 46 | |
| 47 | Do a simple "saveenv" to save the console settings in the environment |
| 48 | and get them working on the next startup, too. |
| 49 | |
| 50 | HOW CAN I USE STANDARD FILE INTO THE SOURCES? |
| 51 | --------------------------------------------- |
| 52 | |
| 53 | You 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 | |
| 76 | Remember that all FILE-related functions CANNOT be used before |
Vladimir Zapolskiy | 7de1778 | 2011-09-05 07:25:04 +0000 | [diff] [blame] | 77 | U-Boot relocation (done in 'board_init_r' in arch/*/lib/board.c). |
wdenk | cc1c8a1 | 2002-11-02 22:58:18 +0000 | [diff] [blame] | 78 | |
| 79 | HOW CAN I USE STANDARD FILE INTO APPLICATIONS? |
| 80 | ---------------------------------------------- |
| 81 | |
| 82 | Use the 'bd_mon_fnc' field of the bd_t structure passed to the |
| 83 | application to do everything you want with the console. |
| 84 | |
| 85 | But REMEMBER that that will work only if you have not overwritten any |
| 86 | U-Boot code while loading (or uncompressing) the image of your |
| 87 | application. |
| 88 | |
| 89 | For example, you won't get the console stuff running in the Linux |
| 90 | kernel because the kernel overwrites U-Boot before running. Only |
| 91 | some parameters like the framebuffer descriptors are passed to the |
| 92 | kernel in the high memory area to let the applications (the kernel) |
| 93 | use the framebuffers initialized by U-Boot. |
| 94 | |
| 95 | SUPPORTED DRIVERS |
| 96 | ----------------- |
| 97 | |
| 98 | Working drivers: |
| 99 | |
Wolfgang Denk | 53677ef | 2008-05-20 16:00:29 +0200 | [diff] [blame] | 100 | serial (architecture dependent serial stuff) |
| 101 | video (mpc8xx video controller) |
wdenk | cc1c8a1 | 2002-11-02 22:58:18 +0000 | [diff] [blame] | 102 | |
| 103 | Work in progress: |
| 104 | |
| 105 | wl_kbd (Wireless 4PPM keyboard) |
| 106 | |
| 107 | Waiting for volounteers: |
| 108 | |
| 109 | lcd (mpc8xx lcd controller; to ) |
| 110 | |
| 111 | TESTED CONFIGURATIONS |
| 112 | --------------------- |
| 113 | |
| 114 | The driver has been tested with the following configurations (see |
| 115 | CREDITS for other contact informations): |
| 116 | |
Wolfgang Denk | 53677ef | 2008-05-20 16:00:29 +0200 | [diff] [blame] | 117 | - MPC823FADS with AD7176 on a PAL TV (YCbYCr) - arsenio@tin.it |
wdenk | cc1c8a1 | 2002-11-02 22:58:18 +0000 | [diff] [blame] | 118 | - GENIETV with AD7177 on a PAL TV (YCbYCr) - arsenio@tin.it |