device: Add support for multiple PCI segment groups
Add initial support for multiple PCI segment groups. Instead of modifying secondary in the bus struct introduce a new segment_group struct element and keep existing common code. Since all platforms currently only use 1 segment this is not a functional change. On platforms that support more than 1 segment the segment has to be set when creating the PCI domain. Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com> Signed-off-by: Felix Held <felix-coreboot@felixheld.de> Change-Id: Ied3313c41896362dd989ee2ab1b1bcdced840aa8 Reviewed-on: https://review.coreboot.org/c/coreboot/+/79927 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nico Huber <nico.h@gmx.de> Reviewed-by: Martin Roth <martin.roth@amd.corp-partner.google.com>
This commit is contained in:
@@ -35,6 +35,7 @@ static DEVTREE_CONST struct device *dev_find_slot(unsigned int bus,
|
||||
for (dev = all_devices; dev; dev = dev->next) {
|
||||
if ((dev->path.type == DEVICE_PATH_PCI) &&
|
||||
(dev->bus->secondary == bus) &&
|
||||
(dev->bus->segment_group == 0) &&
|
||||
(dev->path.pci.devfn == devfn)) {
|
||||
result = dev;
|
||||
break;
|
||||
@@ -233,7 +234,7 @@ DEVTREE_CONST struct device *pcidev_path_on_bus(unsigned int bus, pci_devfn_t de
|
||||
dev = dev->next;
|
||||
continue;
|
||||
}
|
||||
if (dev->bus->secondary == bus)
|
||||
if (dev->bus->secondary == bus && dev->bus->segment_group == 0)
|
||||
return pcidev_path_behind(dev->bus, devfn);
|
||||
dev = dev->next;
|
||||
}
|
||||
|
Reference in New Issue
Block a user