diff options
author | Marcel Apfelbaum <marcel@redhat.com> | 2015-02-16 19:29:20 +0200 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2015-03-06 07:50:05 +0100 |
commit | 0fe4c9ee7af5f6bb3a1fcbf1d39116a894600c90 (patch) | |
tree | c66e9d1d03cf0802fbc6658a70dab999fd286b09 | |
parent | 5cc7eece39721f20b417770374a4112c454be801 (diff) | |
download | seabios-0fe4c9ee7af5f6bb3a1fcbf1d39116a894600c90.zip seabios-0fe4c9ee7af5f6bb3a1fcbf1d39116a894600c90.tar.gz seabios-0fe4c9ee7af5f6bb3a1fcbf1d39116a894600c90.tar.bz2 |
fw/pci: map memory and IO regions for multiple pci root buses
For resource sizing and mapping purposes treat devices on extra root
buses as if they are on the default root bus (bus 0).
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Signed-off-by: Marcel Apfelbaum <marcel@redhat.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
-rw-r--r-- | src/fw/pciinit.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/fw/pciinit.c b/src/fw/pciinit.c index cc3ef77..ac39d23 100644 --- a/src/fw/pciinit.c +++ b/src/fw/pciinit.c @@ -681,6 +681,11 @@ static int pci_bios_check_devices(struct pci_bus *busses) busses[pci->secondary_bus].bus_dev = pci; struct pci_bus *bus = &busses[pci_bdf_to_bus(pci->bdf)]; + if (!bus->bus_dev) + /* + * Resources for all root busses go in busses[0] + */ + bus = &busses[0]; int i; for (i = 0; i < PCI_NUM_REGIONS; i++) { if ((pci->class == PCI_CLASS_BRIDGE_PCI) && @@ -711,6 +716,11 @@ static int pci_bios_check_devices(struct pci_bus *busses) if (!s->bus_dev) continue; struct pci_bus *parent = &busses[pci_bdf_to_bus(s->bus_dev->bdf)]; + if (!parent->bus_dev) + /* + * Resources for all root busses go in busses[0] + */ + parent = &busses[0]; int type; int hotplug_support = pci_bus_hotplug_support(s); for (type = 0; type < PCI_REGION_TYPE_COUNT; type++) { |