Revision: linuxbios@linuxbios.org--devel/freebios--devel--2.0--patch-44

Creator:  Li-Ta Lo <ollie@lanl.gov>

Correct VGA support

Make the VGA support for both VGA and no VGA cases.


git-svn-id: svn://svn.coreboot.org/coreboot/trunk@1960 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
This commit is contained in:
arch import user (historical) 2005-07-06 17:16:09 +00:00
parent 785b1b6e99
commit dc81118570
3 changed files with 12 additions and 10 deletions

View File

@ -10,14 +10,16 @@
#include <pc80/vga.h> #include <pc80/vga.h>
#include <console/console.h> #include <console/console.h>
//extern void beep(int ms);
/* The video buffer, should be replaced by symbol in ldscript.ld */ /* The video buffer, should be replaced by symbol in ldscript.ld */
static char *vidmem; static char *vidmem;
int vga_line, vga_col; int vga_line, vga_col;
#if CONFIG_CONSOLE_VGA == 1
extern int vga_inited; // it will be changed in pci_rom.c extern int vga_inited; // it will be changed in pci_rom.c
#else
int vga_inited = 0;
#endif
static int vga_console_inited = 0; static int vga_console_inited = 0;

View File

@ -363,6 +363,7 @@ void compute_allocate_resource(
} }
#if CONFIG_CONSOLE_VGA == 1 #if CONFIG_CONSOLE_VGA == 1
device_t vga_pri = 0; device_t vga_pri = 0;
static void allocate_vga_resource(void) static void allocate_vga_resource(void)
@ -377,14 +378,13 @@ static void allocate_vga_resource(void)
vga = 0; vga = 0;
vga_onboard = 0; vga_onboard = 0;
for (dev = all_devices; dev; dev = dev->next) { for (dev = all_devices; dev; dev = dev->next) {
if ( !dev->enabled ) continue; if (!dev->enabled) continue;
if (((dev->class >> 16) == PCI_BASE_CLASS_DISPLAY) && if (((dev->class >> 16) == PCI_BASE_CLASS_DISPLAY) &&
((dev->class >> 8) != PCI_CLASS_DISPLAY_OTHER)) { ((dev->class >> 8) != PCI_CLASS_DISPLAY_OTHER)) {
if (!vga) { if (!vga) {
if (dev->on_mainboard) { if (dev->on_mainboard) {
vga_onboard = dev; vga_onboard = dev;
} } else {
else {
vga = dev; vga = dev;
} }
} }
@ -397,7 +397,8 @@ static void allocate_vga_resource(void)
vga = vga_onboard; vga = vga_onboard;
} }
if (vga) { // vga is first add on card or the only onboard vga if (vga) {
// vga is first add on card or the only onboard vga
printk_debug("Allocating VGA resource %s\n", dev_path(vga)); printk_debug("Allocating VGA resource %s\n", dev_path(vga));
vga->command |= (PCI_COMMAND_MEMORY | PCI_COMMAND_IO); vga->command |= (PCI_COMMAND_MEMORY | PCI_COMMAND_IO);
vga_pri = vga; vga_pri = vga;
@ -411,7 +412,6 @@ static void allocate_vga_resource(void)
bus = (bus == bus->dev->bus)? 0 : bus->dev->bus; bus = (bus == bus->dev->bus)? 0 : bus->dev->bus;
} }
} }
#endif #endif

View File

@ -53,7 +53,7 @@ struct rom_header * pci_rom_probe(struct device *dev)
if (dev->class != ((rom_data->class_hi << 8) | rom_data->class_lo)) { if (dev->class != ((rom_data->class_hi << 8) | rom_data->class_lo)) {
printk_err("Class Code mismatch ROM %08x, dev %08x\n", printk_err("Class Code mismatch ROM %08x, dev %08x\n",
(rom_data->class_hi << 8) | rom_data->class_lo, dev->class); (rom_data->class_hi << 8) | rom_data->class_lo, dev->class);
// return NULL; //return NULL;
} }
return rom_header; return rom_header;
@ -62,8 +62,8 @@ struct rom_header * pci_rom_probe(struct device *dev)
static void *pci_ram_image_start = PCI_RAM_IMAGE_START; static void *pci_ram_image_start = PCI_RAM_IMAGE_START;
#if CONFIG_CONSOLE_VGA == 1 #if CONFIG_CONSOLE_VGA == 1
int vga_inited = 0; // it will be used by vga_console int vga_inited = 0; // used by vga_console.c
extern device_t vga_pri; // The only VGA extern device_t vga_pri; // the primary vga device, defined in device.c
#endif #endif
struct rom_header *pci_rom_load(struct device *dev, struct rom_header *rom_header) struct rom_header *pci_rom_load(struct device *dev, struct rom_header *rom_header)