diff options
author | Li-Ta Lo <ollie@lanl.gov> | 2005-01-10 23:16:22 +0000 |
---|---|---|
committer | Li-Ta Lo <ollie@lanl.gov> | 2005-01-10 23:16:22 +0000 |
commit | 883b8793c9777544101261ebcbed6088e0df1593 (patch) | |
tree | 821dfaf9181d0f5be523c21f3c75cc77fbce427f /src/devices/pci_device.c | |
parent | 7ee97999ad03c2134049ba4554e1f5036924cd6d (diff) |
added PCI expansion ROM support,
works for some ATI and Nvidia AGP cards now.
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@1851 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'src/devices/pci_device.c')
-rw-r--r-- | src/devices/pci_device.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/devices/pci_device.c b/src/devices/pci_device.c index c024eb4757..7471694737 100644 --- a/src/devices/pci_device.c +++ b/src/devices/pci_device.c @@ -548,13 +548,24 @@ void pci_bus_enable_resources(struct device *dev) enable_childrens_resources(dev); } - void pci_dev_set_subsystem(device_t dev, unsigned vendor, unsigned device) { pci_write_config32(dev, PCI_SUBSYSTEM_VENDOR_ID, ((device & 0xffff) << 16) | (vendor & 0xffff)); } +void pci_dev_init(struct device *dev) +{ + struct rom_header *rom, *ram; + + rom = pci_rom_probe(dev); + if (rom == NULL) + return; + ram = pci_rom_load(dev, rom); + + run_bios(dev, ram); +} + /** Default device operation for PCI devices */ static struct pci_operations pci_dev_ops_pci = { .set_subsystem = pci_dev_set_subsystem, @@ -564,7 +575,7 @@ 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, - .init = 0, + .init = pci_dev_init, .scan_bus = 0, .enable = 0, .ops_pci = &pci_dev_ops_pci, @@ -574,6 +585,7 @@ struct device_operations default_pci_ops_dev = { static struct pci_operations pci_bus_ops_pci = { .set_subsystem = 0, }; + struct device_operations default_pci_ops_bus = { .read_resources = pci_bus_read_resources, .set_resources = pci_dev_set_resources, |