Add coreboot framebuffer support to libpayload

Signed-off-by: Stefan Reinauer <stepan@coresystems.de>
Acked-by: Patrick Georgi <patrick.georgi@coresystems.de> 



git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5295 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
This commit is contained in:
Stefan Reinauer
2010-03-25 18:56:26 +00:00
committed by Stefan Reinauer
parent 7208f6e031
commit b700254aa5
11 changed files with 359 additions and 17 deletions

View File

@@ -35,6 +35,10 @@
extern struct video_console geodelx_video_console;
#endif
#ifdef CONFIG_COREBOOT_VIDEO_CONSOLE
extern struct video_console coreboot_video_console;
#endif
#ifdef CONFIG_VGA_VIDEO_CONSOLE
extern struct video_console vga_video_console;
#endif
@@ -44,6 +48,9 @@ static struct video_console *console_list[] =
#ifdef CONFIG_GEODELX_VIDEO_CONSOLE
&geodelx_video_console,
#endif
#ifdef CONFIG_COREBOOT_VIDEO_CONSOLE
&coreboot_video_console,
#endif
#ifdef CONFIG_VGA_VIDEO_CONSOLE
&vga_video_console,
#endif
@@ -66,12 +73,12 @@ static void video_console_fixup_cursor(void)
if (cursory < 0)
cursory = 0;
if (cursorx >= VIDEO_COLS) {
if (cursorx >= console->columns) {
cursorx = 0;
cursory++;
}
while(cursory >= VIDEO_ROWS) {
while(cursory >= console->rows) {
console->scroll_up();
cursory--;
}
@@ -112,10 +119,12 @@ void video_console_putc(u8 row, u8 col, unsigned int ch)
void video_console_putchar(unsigned int ch)
{
/* replace black-on-black with light-gray-on-black.
do it here, instead of in libc/console.c */
* do it here, instead of in libc/console.c
*/
if ((ch & 0xFF00) == 0) {
ch |= 0x0700;
}
switch(ch & 0xFF) {
case '\r':
cursorx = 0;
@@ -129,12 +138,12 @@ void video_console_putchar(unsigned int ch)
cursorx--;
if (cursorx < 0) {
cursory--;
cursorx = VIDEO_COLS;
cursorx = console->columns;
}
break;
case '\t':
while(cursorx % 8 && cursorx < VIDEO_COLS) {
while(cursorx % 8 && cursorx < console->columns) {
if (console)
console->putc(cursory, cursorx, (ch & 0xFF00) | ' ');