aboutsummaryrefslogtreecommitdiff
path: root/src/devices/pci_device.c
diff options
context:
space:
mode:
authorYinghai Lu <yinghailu@gmail.com>2005-01-14 22:04:49 +0000
committerYinghai Lu <yinghailu@gmail.com>2005-01-14 22:04:49 +0000
commit9e4faef7dbb6848c1ea6a21994031d191b209c34 (patch)
tree38d887e3ac28c223f2737b40a60bd05f5855193d /src/devices/pci_device.c
parent688238a50c61993db8667552cdae624e73310239 (diff)
CONFIG_PCI_ROM_RUN
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@1875 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'src/devices/pci_device.c')
-rw-r--r--src/devices/pci_device.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/devices/pci_device.c b/src/devices/pci_device.c
index 8bd6ec846e..4aef2229b3 100644
--- a/src/devices/pci_device.c
+++ b/src/devices/pci_device.c
@@ -551,10 +551,12 @@ void pci_bus_enable_resources(struct device *dev)
{
uint16_t ctrl;
+#if CONFIG_CONSOLE_VGA == 1
/* enable IO in command register if there is VGA card
* connected with (even it does not claim IO resource) */
if (dev->link[0].bridge_ctrl & PCI_BRIDGE_CTL_VGA)
dev->command |= PCI_COMMAND_IO;
+#endif
ctrl = pci_read_config16(dev, PCI_BRIDGE_CONTROL);
ctrl |= dev->link[0].bridge_ctrl;
@@ -573,6 +575,7 @@ void pci_dev_set_subsystem(device_t dev, unsigned vendor, unsigned device)
((device & 0xffff) << 16) | (vendor & 0xffff));
}
+#if CONFIG_PCI_ROM_RUN == 1
void pci_dev_init(struct device *dev)
{
struct rom_header *rom, *ram;
@@ -581,9 +584,12 @@ void pci_dev_init(struct device *dev)
if (rom == NULL)
return;
ram = pci_rom_load(dev, rom);
+ if (ram == NULL)
+ return;
run_bios(dev, ram);
}
+#endif
/** Default device operation for PCI devices */
static struct pci_operations pci_dev_ops_pci = {
@@ -594,7 +600,11 @@ struct device_operations default_pci_ops_dev = {
.read_resources = pci_dev_read_resources,
.set_resources = pci_dev_set_resources,
.enable_resources = pci_dev_enable_resources,
+#if CONFIG_PCI_ROM_RUN == 1
.init = pci_dev_init,
+#else
+ .init = 0,
+#endif
.scan_bus = 0,
.enable = 0,
.ops_pci = &pci_dev_ops_pci,