summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBin Meng <bmeng.cn@gmail.com>2015-04-13 19:05:02 +0800
committerSimon Glass <sjg@chromium.org>2015-04-29 18:51:48 -0600
commit5098d73e86d23d9b76eafcaa6c5bce9e2ef6f6c4 (patch)
tree04771d23b94a99b97c90d2b4a67d8d64be64ed3d
parent4a705b12c6731c16403206a2a62b0ba75fa414eb (diff)
downloadu-boot-5098d73e86d23d9b76eafcaa6c5bce9e2ef6f6c4.tar.gz
x86: Remove the old VGA driver
CONFIG_VIDEO_VGA is no longer needed thus remove it. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Acked-by: Simon Glass <sjg@chromium.org>
-rw-r--r--README6
-rw-r--r--arch/x86/lib/Makefile1
-rw-r--r--arch/x86/lib/video.c205
3 files changed, 0 insertions, 212 deletions
diff --git a/README b/README
index ee65fdb4c6..79589214a8 100644
--- a/README
+++ b/README
@@ -1873,12 +1873,6 @@ CBFS (Coreboot Filesystem) support
boot. See the documentation file README.video for a
description of this variable.
- CONFIG_VIDEO_VGA
-
- Enable the VGA video / BIOS for x86. The alternative if you
- are using coreboot is to use the coreboot frame buffer
- driver.
-
- Keyboard Support:
CONFIG_KEYBOARD
diff --git a/arch/x86/lib/Makefile b/arch/x86/lib/Makefile
index 6c571dd9c1..e49de05c26 100644
--- a/arch/x86/lib/Makefile
+++ b/arch/x86/lib/Makefile
@@ -27,7 +27,6 @@ obj-y += physmem.o
obj-$(CONFIG_X86_RAMTEST) += ramtest.o
obj-y += string.o
obj-$(CONFIG_SYS_X86_TSC_TIMER) += tsc_timer.o
-obj-$(CONFIG_VIDEO_VGA) += video.o
obj-$(CONFIG_CMD_ZBOOT) += zimage.o
obj-$(CONFIG_HAVE_FSP) += fsp/
diff --git a/arch/x86/lib/video.c b/arch/x86/lib/video.c
deleted file mode 100644
index 975949daa3..0000000000
--- a/arch/x86/lib/video.c
+++ /dev/null
@@ -1,205 +0,0 @@
-/*
- * (C) Copyright 2002
- * Daniel Engström, Omicron Ceti AB, <daniel@omicron.se>
- *
- * SPDX-License-Identifier: GPL-2.0+
- */
-
-#include <common.h>
-#include <pci.h>
-#include <stdio_dev.h>
-#include <i8042.h>
-#include <asm/ptrace.h>
-#include <asm/io.h>
-#include <asm/pci.h>
-
-/* basic textmode I/O from linux kernel */
-static char *vidmem = (char *)0xb8000;
-static int vidport;
-static int lines, cols;
-static int orig_x, orig_y;
-
-static void beep(int dur)
-{
- int i;
-
- outb_p(3, 0x61);
- for (i = 0; i < 10*dur; i++)
- udelay(1000);
-
- outb_p(0, 0x61);
-}
-
-static void scroll(void)
-{
- int i;
-
- memcpy(vidmem, vidmem + cols * 2, (lines - 1) * cols * 2);
- for (i = (lines - 1) * cols * 2; i < lines * cols * 2; i += 2)
- vidmem[i] = ' ';
-}
-
-static void __video_putc(const char c, int *x, int *y)
-{
- if (c == '\n') {
- (*x) = 0;
- if (++(*y) >= lines) {
- scroll();
- (*y)--;
- }
- } else if (c == '\b') {
- if ((*x) != 0) {
- --(*x);
- vidmem[((*x) + cols * (*y)) * 2] = ' ';
- }
- } else if (c == '\r') {
- (*x) = 0;
-
- } else if (c == '\a') {
- beep(3);
-
- } else if (c == '\t') {
- __video_putc(' ', x, y);
- __video_putc(' ', x, y);
- __video_putc(' ', x, y);
- __video_putc(' ', x, y);
- __video_putc(' ', x, y);
- __video_putc(' ', x, y);
- __video_putc(' ', x, y);
- __video_putc(' ', x, y);
- } else if (c == '\v') {
- switch ((*x) % 8) {
- case 0:
- __video_putc(' ', x, y);
- case 7:
- __video_putc(' ', x, y);
- case 6:
- __video_putc(' ', x, y);
- case 5:
- __video_putc(' ', x, y);
- case 4:
- __video_putc(' ', x, y);
- case 3:
- __video_putc(' ', x, y);
- case 2:
- __video_putc(' ', x, y);
- case 1:
- __video_putc(' ', x, y);
- }
- } else if (c == '\f') {
- int i;
- for (i = 0; i < lines * cols * 2; i += 2)
- vidmem[i] = 0;
- (*x) = 0;
- (*y) = 0;
- } else {
- vidmem[((*x) + cols * (*y)) * 2] = c;
- if (++(*x) >= cols) {
- (*x) = 0;
- if (++(*y) >= lines) {
- scroll();
- (*y)--;
- }
- }
- }
-}
-
-static void video_putc(struct stdio_dev *dev, const char c)
-{
- int x, y, pos;
-
- x = orig_x;
- y = orig_y;
-
- __video_putc(c, &x, &y);
-
- orig_x = x;
- orig_y = y;
-
- pos = (x + cols * y) * 2; /* Update cursor position */
- outb_p(14, vidport);
- outb_p(0xff & (pos >> 9), vidport+1);
- outb_p(15, vidport);
- outb_p(0xff & (pos >> 1), vidport+1);
-}
-
-static void video_puts(struct stdio_dev *dev, const char *s)
-{
- int x, y, pos;
- char c;
-
- x = orig_x;
- y = orig_y;
-
- while ((c = *s++) != '\0')
- __video_putc(c, &x, &y);
-
- orig_x = x;
- orig_y = y;
-
- pos = (x + cols * y) * 2; /* Update cursor position */
- outb_p(14, vidport);
- outb_p(0xff & (pos >> 9), vidport+1);
- outb_p(15, vidport);
- outb_p(0xff & (pos >> 1), vidport+1);
-}
-
-int video_init(void)
-{
- u16 pos;
-
- static struct stdio_dev vga_dev;
- static struct stdio_dev kbd_dev;
-
- vidmem = (char *) 0xb8000;
- vidport = 0x3d4;
-
- lines = 25;
- cols = 80;
-
- outb_p(14, vidport);
- pos = inb_p(vidport+1);
- pos <<= 8;
- outb_p(15, vidport);
- pos |= inb_p(vidport+1);
-
- orig_x = pos%cols;
- orig_y = pos/cols;
-
-#if 0
- printf("pos %x %d %d\n", pos, orig_x, orig_y);
-#endif
- if (orig_y > lines)
- orig_x = orig_y = 0;
-
- memset(&vga_dev, 0, sizeof(vga_dev));
- strcpy(vga_dev.name, "vga");
- vga_dev.ext = 0;
- vga_dev.flags = DEV_FLAGS_OUTPUT | DEV_FLAGS_SYSTEM;
- vga_dev.putc = video_putc; /* 'putc' function */
- vga_dev.puts = video_puts; /* 'puts' function */
-
- if (stdio_register(&vga_dev) == 0)
- return 1;
-
- if (i8042_kbd_init())
- return 1;
-
- memset(&kbd_dev, 0, sizeof(kbd_dev));
- strcpy(kbd_dev.name, "kbd");
- kbd_dev.ext = 0;
- kbd_dev.flags = DEV_FLAGS_INPUT | DEV_FLAGS_SYSTEM;
- kbd_dev.tstc = i8042_tstc; /* 'tstc' function */
- kbd_dev.getc = i8042_getc; /* 'getc' function */
-
- if (stdio_register(&kbd_dev) == 0)
- return 1;
-
- return 0;
-}
-
-
-int drv_video_init(void)
-{
- return video_init();
-}