From 35e1fca8f203792c7c2c79420843557f8d55b079 Mon Sep 17 00:00:00 2001 From: Werner Zeh Date: Tue, 20 Jul 2021 06:45:50 +0200 Subject: [PATCH] drivers/intel/i210: Set PCI bus master bit only if allowed Set the bus master bit only if the global Kconfig switch PCI_ALLOW_BUS_MASTER_ANY_DEVICE is enabled. For now the bus master bit is needed for i210 because of some old OS drivers that do not set it and won't work properly without it. Change-Id: I6f727e7f513f4320740fbf49e741cea86edb3247 Signed-off-by: Werner Zeh Reviewed-on: https://review.coreboot.org/c/coreboot/+/56441 Tested-by: build bot (Jenkins) Reviewed-by: Mario Scheithauer Reviewed-by: Nico Huber --- src/drivers/intel/i210/i210.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/drivers/intel/i210/i210.c b/src/drivers/intel/i210/i210.c index 8caa194a9e..32cae6f269 100644 --- a/src/drivers/intel/i210/i210.c +++ b/src/drivers/intel/i210/i210.c @@ -208,7 +208,8 @@ static void init(struct device *dev) static void enable_bus_master(struct device *dev) { - pci_or_config16(dev, PCI_COMMAND, PCI_COMMAND_MASTER); + if (CONFIG(PCI_ALLOW_BUS_MASTER_ANY_DEVICE)) + pci_or_config16(dev, PCI_COMMAND, PCI_COMMAND_MASTER); } static struct device_operations i210_ops = {