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 | * |
Wolfgang Denk | d79de1d | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 5 | * SPDX-License-Identifier: GPL-2.0+ |
wdenk | cc1c8a1 | 2002-11-02 22:58:18 +0000 | [diff] [blame] | 6 | */ |
| 7 | |
| 8 | U-Boot console handling |
| 9 | ======================== |
| 10 | |
| 11 | HOW THE CONSOLE WORKS? |
| 12 | ---------------------- |
| 13 | |
| 14 | At system startup U-Boot initializes a serial console. When U-Boot |
| 15 | relocates itself to RAM, all console drivers are initialized (they |
| 16 | will register all detected console devices to the system for further |
| 17 | use). |
| 18 | |
| 19 | If not defined in the environment, the first input device is assigned |
| 20 | to the 'stdin' file, the first output one to 'stdout' and 'stderr'. |
| 21 | |
| 22 | You can use the command "coninfo" to see all registered console |
| 23 | devices and their flags. You can assign a standard file (stdin, |
| 24 | stdout or stderr) to any device you see in that list simply by |
| 25 | assigning its name to the corresponding environment variable. For |
| 26 | example: |
| 27 | |
| 28 | setenv stdin wl_kbd <- To use the wireless keyboard |
| 29 | setenv stdout video <- To use the video console |
| 30 | |
| 31 | Do a simple "saveenv" to save the console settings in the environment |
| 32 | and get them working on the next startup, too. |
| 33 | |
| 34 | HOW CAN I USE STANDARD FILE INTO THE SOURCES? |
| 35 | --------------------------------------------- |
| 36 | |
| 37 | You 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 | |
| 60 | Remember that all FILE-related functions CANNOT be used before |
Vladimir Zapolskiy | 57bd31c | 2011-09-05 07:25:04 +0000 | [diff] [blame] | 61 | U-Boot relocation (done in 'board_init_r' in arch/*/lib/board.c). |
wdenk | cc1c8a1 | 2002-11-02 22:58:18 +0000 | [diff] [blame] | 62 | |
| 63 | HOW CAN I USE STANDARD FILE INTO APPLICATIONS? |
| 64 | ---------------------------------------------- |
| 65 | |
| 66 | Use the 'bd_mon_fnc' field of the bd_t structure passed to the |
| 67 | application to do everything you want with the console. |
| 68 | |
| 69 | But REMEMBER that that will work only if you have not overwritten any |
| 70 | U-Boot code while loading (or uncompressing) the image of your |
| 71 | application. |
| 72 | |
| 73 | For example, you won't get the console stuff running in the Linux |
| 74 | kernel because the kernel overwrites U-Boot before running. Only |
| 75 | some parameters like the framebuffer descriptors are passed to the |
| 76 | kernel in the high memory area to let the applications (the kernel) |
| 77 | use the framebuffers initialized by U-Boot. |
| 78 | |
| 79 | SUPPORTED DRIVERS |
| 80 | ----------------- |
| 81 | |
| 82 | Working drivers: |
| 83 | |
Wolfgang Denk | a1be476 | 2008-05-20 16:00:29 +0200 | [diff] [blame] | 84 | serial (architecture dependent serial stuff) |
| 85 | video (mpc8xx video controller) |
wdenk | cc1c8a1 | 2002-11-02 22:58:18 +0000 | [diff] [blame] | 86 | |
| 87 | Work in progress: |
| 88 | |
| 89 | wl_kbd (Wireless 4PPM keyboard) |
| 90 | |
| 91 | Waiting for volounteers: |
| 92 | |
| 93 | lcd (mpc8xx lcd controller; to ) |
| 94 | |
| 95 | TESTED CONFIGURATIONS |
| 96 | --------------------- |
| 97 | |
| 98 | The driver has been tested with the following configurations (see |
| 99 | CREDITS for other contact informations): |
| 100 | |
Wolfgang Denk | a1be476 | 2008-05-20 16:00:29 +0200 | [diff] [blame] | 101 | - MPC823FADS with AD7176 on a PAL TV (YCbYCr) - arsenio@tin.it |
wdenk | cc1c8a1 | 2002-11-02 22:58:18 +0000 | [diff] [blame] | 102 | - GENIETV with AD7177 on a PAL TV (YCbYCr) - arsenio@tin.it |