device: Enable bus mastering on system-class devices conditionally

Devices of class type "system" are arbitrary devices and it's not clear
which of them need bus mastering. Therefore, enable bus mastering
conditionally based on Kconfig option PCI_ALLOW_BUS_MASTER_ANY_DEVICE.

Change-Id: Ia04e83606a0a081c0758ec59e52627aa1dbd2622
Signed-off-by: Felix Singer <felix.singer@secunet.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/45151
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Nico Huber <nico.h@gmx.de>
This commit is contained in:
Felix Singer 2020-09-07 16:15:14 +02:00 committed by Patrick Georgi
parent 205b53ee77
commit d3d0fd7d5e
1 changed files with 2 additions and 1 deletions

View File

@ -1129,7 +1129,8 @@ struct device *pci_probe_dev(struct device *dev, struct bus *bus,
dev->class = class >> 8; dev->class = class >> 8;
/* Architectural/System devices always need to be bus masters. */ /* Architectural/System devices always need to be bus masters. */
if ((dev->class >> 16) == PCI_BASE_CLASS_SYSTEM) if ((dev->class >> 16) == PCI_BASE_CLASS_SYSTEM &&
CONFIG(PCI_ALLOW_BUS_MASTER_ANY_DEVICE))
dev->command |= PCI_COMMAND_MASTER; dev->command |= PCI_COMMAND_MASTER;
/* /*