use #define macro for pci class ids

git-svn-id: svn://svn.coreboot.org/coreboot/trunk@1563 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
This commit is contained in:
Li-Ta Lo 2004-05-14 17:20:29 +00:00
parent 13318d9fea
commit 54f05f6c5c

View file

@ -19,6 +19,7 @@
#include <arch/io.h> #include <arch/io.h>
#include <device/device.h> #include <device/device.h>
#include <device/pci.h> #include <device/pci.h>
#include <device/pci_ids.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
@ -385,15 +386,14 @@ static void allocate_vga_resource(void)
#warning "This function knows to much about PCI stuff, it should be just a ietrator/visitor." #warning "This function knows to much about PCI stuff, it should be just a ietrator/visitor."
/* FIXME handle the VGA pallette snooping */ /* FIXME handle the VGA pallette snooping */
struct device *dev, *vga; struct device *dev, *vga = 0;
struct bus *bus; struct bus *bus = 0;
bus = 0;
vga = 0; for (dev = all_devices; dev; dev = dev->next) {
for(dev = all_devices; dev; dev = dev->next) { if (((dev->class >> 16) == PCI_BASE_CLASS_DISPLAY) &&
if (((dev->class >> 16) == 0x03) && ((dev->class >> 8) != PCI_CLASS_DISPLAY_OTHER)) {
((dev->class >> 8) != 0x380)) {
if (!vga) { if (!vga) {
printk_debug("Allocating VGA resource\n"); printk_debug("Allocating VGA resource %s\n", dev_path(dev));
vga = dev; vga = dev;
} }
if (vga == dev) { if (vga == dev) {
@ -408,8 +408,9 @@ static void allocate_vga_resource(void)
if (vga) { if (vga) {
bus = vga->bus; bus = vga->bus;
} }
/* Now walk up the bridges setting the VGA enable */ /* Now walk up the bridges setting the VGA enable */
while(bus) { while (bus) {
bus->bridge_ctrl |= PCI_BRIDGE_CTL_VGA; bus->bridge_ctrl |= PCI_BRIDGE_CTL_VGA;
bus = (bus == bus->dev->bus)? 0 : bus->dev->bus; bus = (bus == bus->dev->bus)? 0 : bus->dev->bus;
} }
@ -511,8 +512,7 @@ void dev_configure(void)
{ {
struct device *root = &dev_root; struct device *root = &dev_root;
printk_info("Allocating resources..."); printk_info("Allocating resources...\n");
printk_debug("\n");
root->ops->read_resources(root); root->ops->read_resources(root);