summaryrefslogtreecommitdiff
path: root/src/devices/pcix_device.c
diff options
context:
space:
mode:
authorMyles Watson <mylesgw@gmail.com>2010-06-09 22:41:35 +0000
committerMyles Watson <mylesgw@gmail.com>2010-06-09 22:41:35 +0000
commit894a34715f41f7c819a593dc3ff8e3033ffaa9fe (patch)
tree12ed2a5e10c6f181caa4c1add2ee8239abf82bfe /src/devices/pcix_device.c
parent6507b390467591928f16aab68f247321ad3f2262 (diff)
downloadcoreboot-894a34715f41f7c819a593dc3ff8e3033ffaa9fe.tar.xz
Same conversion as with resources from static arrays to lists, except
there is no free list. Converting resource arrays to lists reduced the size of each device struct from 1092 to 228 bytes. Converting link arrays to lists reduced the size of each device struct from 228 to 68 bytes. Signed-off-by: Myles Watson <mylesgw@gmail.com> Acked-by: Stefan Reinauer <stepan@coresystems.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5626 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'src/devices/pcix_device.c')
-rw-r--r--src/devices/pcix_device.c22
1 files changed, 6 insertions, 16 deletions
diff --git a/src/devices/pcix_device.c b/src/devices/pcix_device.c
index d3af53eed0..0fcedd5e45 100644
--- a/src/devices/pcix_device.c
+++ b/src/devices/pcix_device.c
@@ -61,20 +61,11 @@ static void pcix_tune_dev(device_t dev)
}
}
-unsigned int pcix_scan_bus(struct bus *bus,
- unsigned min_devfn, unsigned max_devfn, unsigned int max)
+static void pcix_tune_bus(struct bus *bus)
{
device_t child;
- max = pci_scan_bus(bus, min_devfn, max_devfn, max);
- for(child = bus->children; child; child = child->sibling) {
- if ( (child->path.pci.devfn < min_devfn) ||
- (child->path.pci.devfn > max_devfn))
- {
- continue;
- }
+ for(child = bus->children; child; child = child->sibling)
pcix_tune_dev(child);
- }
- return max;
}
const char *pcix_speed(unsigned sstatus)
@@ -124,18 +115,17 @@ unsigned int pcix_scan_bridge(device_t dev, unsigned int max)
unsigned pos;
unsigned sstatus;
+ max = do_pci_scan_bridge(dev, max, pci_scan_bus);
/* Find the PCI-X capability */
pos = pci_find_capability(dev, PCI_CAP_ID_PCIX);
sstatus = pci_read_config16(dev, pos + PCI_X_SEC_STATUS);
- if (PCI_X_SSTATUS_MFREQ(sstatus) == PCI_X_SSTATUS_CONVENTIONAL_PCI) {
- max = do_pci_scan_bridge(dev, max, pci_scan_bus);
- } else {
- max = do_pci_scan_bridge(dev, max, pcix_scan_bus);
+ if (PCI_X_SSTATUS_MFREQ(sstatus) != PCI_X_SSTATUS_CONVENTIONAL_PCI) {
+ pcix_tune_bus(dev->link_list);
}
/* Print the PCI-X bus speed */
- printk(BIOS_DEBUG, "PCI: %02x: %s\n", dev->link[0].secondary, pcix_speed(sstatus));
+ printk(BIOS_DEBUG, "PCI: %02x: %s\n", dev->link_list->secondary, pcix_speed(sstatus));
return max;
}