1*83d290c5STom RiniSPDX-License-Identifier: GPL-2.0+ 2cc1c8a13Swdenk/* 3cc1c8a13Swdenk * (C) Copyright 2000 4cc1c8a13Swdenk * Paolo Scaffardi, AIRVENT SAM s.p.a - RIMINI(ITALY), arsenio@tin.it 5cc1c8a13Swdenk */ 6cc1c8a13Swdenk 7cc1c8a13SwdenkU-Boot console handling 8cc1c8a13Swdenk======================== 9cc1c8a13Swdenk 10cc1c8a13SwdenkHOW THE CONSOLE WORKS? 11cc1c8a13Swdenk---------------------- 12cc1c8a13Swdenk 13cc1c8a13SwdenkAt system startup U-Boot initializes a serial console. When U-Boot 14cc1c8a13Swdenkrelocates itself to RAM, all console drivers are initialized (they 15cc1c8a13Swdenkwill register all detected console devices to the system for further 16cc1c8a13Swdenkuse). 17cc1c8a13Swdenk 18cc1c8a13SwdenkIf not defined in the environment, the first input device is assigned 19cc1c8a13Swdenkto the 'stdin' file, the first output one to 'stdout' and 'stderr'. 20cc1c8a13Swdenk 21cc1c8a13SwdenkYou can use the command "coninfo" to see all registered console 22cc1c8a13Swdenkdevices and their flags. You can assign a standard file (stdin, 23cc1c8a13Swdenkstdout or stderr) to any device you see in that list simply by 24cc1c8a13Swdenkassigning its name to the corresponding environment variable. For 25cc1c8a13Swdenkexample: 26cc1c8a13Swdenk 27dc2164daSMasahiro Yamada setenv stdin serial <- To use the serial input 28cc1c8a13Swdenk setenv stdout video <- To use the video console 29cc1c8a13Swdenk 30cc1c8a13SwdenkDo a simple "saveenv" to save the console settings in the environment 31cc1c8a13Swdenkand get them working on the next startup, too. 32cc1c8a13Swdenk 33cc1c8a13SwdenkHOW CAN I USE STANDARD FILE INTO THE SOURCES? 34cc1c8a13Swdenk--------------------------------------------- 35cc1c8a13Swdenk 36cc1c8a13SwdenkYou can use the following functions to access the console: 37cc1c8a13Swdenk 38cc1c8a13Swdenk* STDOUT: 39cc1c8a13Swdenk putc (to put a char to stdout) 40cc1c8a13Swdenk puts (to put a string to stdout) 41cc1c8a13Swdenk printf (to format and put a string to stdout) 42cc1c8a13Swdenk 43cc1c8a13Swdenk* STDIN: 44cc1c8a13Swdenk tstc (to test for the presence of a char in stdin) 45cc1c8a13Swdenk getc (to get a char from stdin) 46cc1c8a13Swdenk 47cc1c8a13Swdenk* STDERR: 48cc1c8a13Swdenk eputc (to put a char to stderr) 49cc1c8a13Swdenk eputs (to put a string to stderr) 50cc1c8a13Swdenk eprintf (to format and put a string to stderr) 51cc1c8a13Swdenk 52cc1c8a13Swdenk* FILE (can be 'stdin', 'stdout', 'stderr'): 53cc1c8a13Swdenk fputc (like putc but redirected to a file) 54cc1c8a13Swdenk fputs (like puts but redirected to a file) 55cc1c8a13Swdenk fprintf (like printf but redirected to a file) 56cc1c8a13Swdenk ftstc (like tstc but redirected to a file) 57cc1c8a13Swdenk fgetc (like getc but redirected to a file) 58cc1c8a13Swdenk 59cc1c8a13SwdenkRemember that all FILE-related functions CANNOT be used before 607de17781SVladimir ZapolskiyU-Boot relocation (done in 'board_init_r' in arch/*/lib/board.c). 61cc1c8a13Swdenk 62cc1c8a13SwdenkHOW CAN I USE STANDARD FILE INTO APPLICATIONS? 63cc1c8a13Swdenk---------------------------------------------- 64cc1c8a13Swdenk 65cc1c8a13SwdenkUse the 'bd_mon_fnc' field of the bd_t structure passed to the 66cc1c8a13Swdenkapplication to do everything you want with the console. 67cc1c8a13Swdenk 68cc1c8a13SwdenkBut REMEMBER that that will work only if you have not overwritten any 69cc1c8a13SwdenkU-Boot code while loading (or uncompressing) the image of your 70cc1c8a13Swdenkapplication. 71cc1c8a13Swdenk 72cc1c8a13SwdenkFor example, you won't get the console stuff running in the Linux 73cc1c8a13Swdenkkernel because the kernel overwrites U-Boot before running. Only 74cc1c8a13Swdenksome parameters like the framebuffer descriptors are passed to the 75cc1c8a13Swdenkkernel in the high memory area to let the applications (the kernel) 76cc1c8a13Swdenkuse the framebuffers initialized by U-Boot. 77cc1c8a13Swdenk 78cc1c8a13SwdenkSUPPORTED DRIVERS 79cc1c8a13Swdenk----------------- 80cc1c8a13Swdenk 81cc1c8a13SwdenkWorking drivers: 82cc1c8a13Swdenk 83cc1c8a13Swdenk serial (architecture dependent serial stuff) 84cc1c8a13Swdenk video (mpc8xx video controller) 85cc1c8a13Swdenk 86cc1c8a13SwdenkWork in progress: 87cc1c8a13Swdenk 88cc1c8a13Swdenk wl_kbd (Wireless 4PPM keyboard) 89cc1c8a13Swdenk 90cc1c8a13SwdenkWaiting for volounteers: 91cc1c8a13Swdenk 92cc1c8a13Swdenk lcd (mpc8xx lcd controller; to ) 93cc1c8a13Swdenk 94cc1c8a13SwdenkTESTED CONFIGURATIONS 95cc1c8a13Swdenk--------------------- 96cc1c8a13Swdenk 97cc1c8a13SwdenkThe driver has been tested with the following configurations (see 98cc1c8a13SwdenkCREDITS for other contact informations): 99cc1c8a13Swdenk 100cc1c8a13Swdenk- MPC823FADS with AD7176 on a PAL TV (YCbYCr) - arsenio@tin.it 101