device: Allow configuring bus mastering for PCI bridges conditionally
Change-Id: Ic7cacce28f473dda76ca203016dbb8e00149a990
Signed-off-by: Felix Singer <felix.singer@secunet.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/45150
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
diff --git a/src/device/pci_device.c b/src/device/pci_device.c
index 6075ebe..f4608fc 100644
--- a/src/device/pci_device.c
+++ b/src/device/pci_device.c
@@ -542,7 +542,8 @@
dev->command |= PCI_COMMAND_MEMORY;
if (resource->flags & IORESOURCE_IO)
dev->command |= PCI_COMMAND_IO;
- if (resource->flags & IORESOURCE_PCI_BRIDGE)
+ if (resource->flags & IORESOURCE_PCI_BRIDGE &&
+ CONFIG(PCI_SET_BUS_MASTER_PCI_BRIDGES))
dev->command |= PCI_COMMAND_MASTER;
}