summaryrefslogtreecommitdiff
path: root/src/console/vga_console.c
diff options
context:
space:
mode:
authorStefan Reinauer <stepan@coreboot.org>2010-11-22 08:09:50 +0000
committerStefan Reinauer <stepan@openbios.org>2010-11-22 08:09:50 +0000
commitabc0c8551604933ca54e9eaa48c3f00e4915dc90 (patch)
tree2b8b2b7c07329b72f9adeea737e5049435fe4549 /src/console/vga_console.c
parente9c447326a0ff5565886b0c18c806c77c4a03cb8 (diff)
Printing coreboot debug messages on VGA console is pretty much useless, since
initializing VGA happens pretty much as the last thing before starting the payload. Hence, drop VGA console support, as we did in coreboot v3. - Drop VGA and BTEXT console support. Console is meant to be debugging only, and by the time graphics comes up 99% of the risky stuff has already happened. Note: This patch does not remove hardware init but only the actual output functionality. The ragexl driver needs some extra love, but that's for another day - factor out die() and post() - drop some leftover RAMBASE < 0x100000 checks. Signed-off-by: Stefan Reinauer <stepan@coreboot.org> Acked-by: QingPei Wang<wangqingpei@gmail.com> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@6111 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'src/console/vga_console.c')
-rw-r--r--src/console/vga_console.c104
1 files changed, 0 insertions, 104 deletions
diff --git a/src/console/vga_console.c b/src/console/vga_console.c
deleted file mode 100644
index 0a749f653c..0000000000
--- a/src/console/vga_console.c
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- *
- * modified from original freebios code
- * by Steve M. Gehlbach <steve@kesa.com>
- *
- */
-
-/*
- * TODO:
- * * make vga_console_init take FB location, columns, lines and starting
- * column/line.
- * * track a word offset, and not columns/lines. The offset is needed more
- * often than columns/lines and the latter two can be calculated easily.
- * * then implement real vga scrolling, instead of memcpying stuff around.
- *
- * -- libv.
- */
-
-#include <arch/io.h>
-#include <string.h>
-#include <pc80/vga_io.h>
-#include <pc80/vga.h>
-#include <console/console.h>
-
-/* The video buffer, should be replaced by symbol in ldscript.ld */
-static char *vidmem;
-static int total_lines, total_columns;
-static int current_line, current_column;
-static int vga_console_inited = 0;
-
-/*
- *
- */
-void vga_console_init(void)
-{
- vidmem = (char *) VGA_FB;
- total_columns = VGA_COLUMNS;
- total_lines = VGA_LINES;
- current_column = 0;
- current_line = 0;
-
- vga_console_inited = 1;
-}
-
-static void vga_scroll(void)
-{
- int i;
-
- memcpy(vidmem, vidmem + total_columns * 2, (total_lines - 1) * total_columns * 2);
- for (i = (total_lines - 1) * total_columns * 2; i < total_lines * total_columns * 2; i += 2)
- vidmem[i] = ' ';
-}
-
-static void
-vga_tx_byte(unsigned char byte)
-{
- if (!vga_console_inited)
- return;
-
- switch (byte) {
- case '\n':
- current_line++;
- current_column = 0;
- break;
- case '\r':
- current_column = 0;
- break;
- case '\b':
- current_column--;
- break;
- case '\t':
- current_column += 4;
- break;
- case '\a': /* beep */
- break;
- default:
- vidmem[((current_column + (current_line * total_columns)) * 2)] = byte;
- vidmem[((current_column + (current_line * total_columns)) * 2) +1] = 0x07;
- current_column++;
- break;
- }
-
- if (current_column < 0)
- current_column = 0;
- if (current_column >= total_columns) {
- current_line++;
- current_column = 0;
- }
- if (current_line >= total_lines) {
- vga_scroll();
- current_line--;
- }
-
- /* move the cursor */
- vga_cr_write(0x0E, (current_column + (current_line * total_columns)) >> 8);
- vga_cr_write(0x0F, (current_column + (current_line * total_columns)) & 0x0ff);
-}
-
-static const struct console_driver vga_console __console ={
- .init = 0,
- .tx_byte = vga_tx_byte,
- .rx_byte = 0,
- .tst_byte = 0,
-};