mb/siemens/mc_apl{1,2,3,5,6}: Set PCI bus master bit only if allowed

Take Kconfig switch PCI_ALLOW_BUS_MASTER into account and set the PCI
bus master bit for legacy devices only if it is allowed.

Change-Id: I7798a767d528419bb093f301140ab68cc8b9c5ae
Signed-off-by: Werner Zeh <werner.zeh@siemens.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/56442
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Mario Scheithauer <mario.scheithauer@siemens.com>
Reviewed-by: Paul Menzel <paulepanter@mailbox.org>
diff --git a/src/mainboard/siemens/mc_apl1/variants/mc_apl2/mainboard.c b/src/mainboard/siemens/mc_apl1/variants/mc_apl2/mainboard.c
index 1baa8ec..7d8b9f5 100644
--- a/src/mainboard/siemens/mc_apl1/variants/mc_apl2/mainboard.c
+++ b/src/mainboard/siemens/mc_apl1/variants/mc_apl2/mainboard.c
@@ -10,9 +10,11 @@
 {
 	struct device *dev;
 
-	/* Set Master Enable for on-board PCI device. */
-	dev = dev_find_device(PCI_VENDOR_ID_SIEMENS, 0x403e, 0);
-	if (dev) {
-		pci_or_config16(dev, PCI_COMMAND, PCI_COMMAND_MASTER);
+	if (CONFIG(PCI_ALLOW_BUS_MASTER)) {
+		/* Set Master Enable for on-board PCI device if allowed. */
+		dev = dev_find_device(PCI_VENDOR_ID_SIEMENS, 0x403e, 0);
+		if (dev) {
+			pci_or_config16(dev, PCI_COMMAND, PCI_COMMAND_MASTER);
+		}
 	}
 }