From 714e2a1ac1c41f2150231766fcdb216633fab8c9 Mon Sep 17 00:00:00 2001 From: Stefan Reinauer Date: Sat, 24 Apr 2010 23:15:23 +0000 Subject: drop all duplicate copies of vgabios.c in favor of devices/oprom/x86.c. We have some tests on hardware. Moving RAMBASE to 1MB needs to wait a bit until C7 cache_as_ram.inc has been adapted to cache that area or things will become incredibly slow (1.5s boot time instead of 0.5) Signed-off-by: Stefan Reinauer Acked-by: Stefan Reinauer git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5488 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- src/northbridge/via/cn700/vga.c | 59 ++++++++++++++++++++++++++++++++--------- 1 file changed, 47 insertions(+), 12 deletions(-) (limited to 'src/northbridge/via/cn700/vga.c') diff --git a/src/northbridge/via/cn700/vga.c b/src/northbridge/via/cn700/vga.c index 789dbfb480..69f188b01e 100644 --- a/src/northbridge/via/cn700/vga.c +++ b/src/northbridge/via/cn700/vga.c @@ -33,28 +33,65 @@ #include #include #include +#include #include "chip.h" #include "northbridge.h" #include "cn700.h" -#include "vgachip.h" -void write_protect_vgabios(void) +static int via_cn700_int15_handler(struct eregs *regs) { - /* Don't bother for now. */ + int res=-1; + printk(BIOS_DEBUG, "via_cn700_int15_handler\n"); + switch(regs->eax & 0xffff) { + case 0x5f19: + break; + case 0x5f18: + regs->eax=0x5f; + regs->ebx=0x545; // MCLK = 133, 32M frame buffer, 256 M main memory + regs->ecx=0x060; + res=0; + break; + case 0x5f00: + regs->eax = 0x8600; + break; + case 0x5f01: + regs->eax = 0x5f; + regs->ecx = (regs->ecx & 0xffffff00 ) | 2; // panel type = 2 = 1024 * 768 + res = 0; + break; + case 0x5f02: + regs->eax=0x5f; + regs->ebx= (regs->ebx & 0xffff0000) | 2; + regs->ecx= (regs->ecx & 0xffff0000) | 0x401; // PAL + crt only + regs->edx= (regs->edx & 0xffff0000) | 0; // TV Layout - default + res=0; + break; + case 0x5f0f: + regs->eax=0x860f; + break; + default: + printk(BIOS_DEBUG, "Unknown INT15 function %04x!\n", + regs->eax & 0xffff); + break; + } + return res; } static void vga_init(device_t dev) { u8 reg8; + mainboard_interrupt_handlers(0x15, &via_cn700_int15_handler); + +#undef OLD_BOCHS_METHOD +#ifdef OLD_BOCHS_METHOD print_debug("Copying BOCHS BIOS to 0xf000\n"); /* * Copy BOCHS BIOS from 4G-CONFIG_ROM_SIZE-64k (in flash) to 0xf0000 (in RAM) * This is for compatibility with the VGA ROM's BIOS callbacks. */ memcpy((void *)0xf0000, (const void *)(0xffffffff - CONFIG_ROM_SIZE - 0xffff), 0x10000); - - printk(BIOS_DEBUG, "Initializing VGA\n"); +#endif /* Set memory rate to 200 MHz. */ outb(0x3d, CRTM_INDEX); @@ -74,13 +111,9 @@ static void vga_init(device_t dev) pci_write_config32(dev, 0x10, 0xf4000008); pci_write_config32(dev, 0x14, 0xfb000000); - printk(BIOS_DEBUG, "INSTALL REAL-MODE IDT\n"); - setup_realmode_idt(); - printk(BIOS_DEBUG, "DO THE VGA BIOS\n"); - do_vgabios(); - /* VGA seems to work without this, but crash & burn with it. */ - // printk(BIOS_DEBUG, "Enable VGA console\n"); - // vga_enable_console(); + printk(BIOS_DEBUG, "Initializing VGA...\n"); + + pci_dev_init(dev); /* It's not clear if these need to be programmed before or after * the VGA BIOS runs. Try both, clean up later. */ @@ -97,8 +130,10 @@ static void vga_init(device_t dev) outb(0x39, SR_INDEX); outb(reg8, SR_DATA); +#ifdef OLD_BOCHS_METHOD /* Clear the BOCHS BIOS out of memory, so it doesn't confuse Linux. */ memset((void *)0xf0000, 0, 0x10000); +#endif } static const struct device_operations vga_operations = { -- cgit v1.2.3