Felix Singer has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/42459 )
Change subject: [RFC] device: Add method for configuring bus master based on config option ......................................................................
[RFC] device: Add method for configuring bus master based on config option
The bus master bit is set at many places in coreboots code, but the reason for that is not quite clear. Therefore we examined not setting the bus master bit and tried booting without it, which worked fine.
To have some sort of "backwards compatibility", add a method which configures the bus master bit based on an additional config option.
Change-Id: I876c48ea3fb4f9cf7b6a5c2dcaeda07ea36cbed3 Signed-off-by: Felix Singer felix.singer@secunet.com --- M src/device/Kconfig M src/device/pci_device.c M src/include/device/pci.h 3 files changed, 12 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/59/42459/1
diff --git a/src/device/Kconfig b/src/device/Kconfig index f7f4b90..38bc4eb 100644 --- a/src/device/Kconfig +++ b/src/device/Kconfig @@ -516,6 +516,10 @@ bool default y
+config PCI_ALLOW_BUS_MASTER + bool "Enable PCI bus master" + default n + endif # PCI
if PCIEXP_PLUGIN_SUPPORT diff --git a/src/device/pci_device.c b/src/device/pci_device.c index 032e15c..2ec78fc 100644 --- a/src/device/pci_device.c +++ b/src/device/pci_device.c @@ -1649,3 +1649,9 @@ pci_update_config16(dev, PCI_COMMAND, ~PCI_COMMAND_MASTER, 0x0); } #endif + +void pci_configure_bus_master(const struct device *dev) +{ + if (CONFIG(PCI_ALLOW_BUS_MASTER)) + pci_or_config16(dev, PCI_COMMAND, PCI_COMMAND_MASTER); +} diff --git a/src/include/device/pci.h b/src/include/device/pci.h index 4529074..abc1523 100644 --- a/src/include/device/pci.h +++ b/src/include/device/pci.h @@ -132,4 +132,6 @@
void pci_early_bridge_init(void);
+void pci_configure_bus_master(const struct device *device); + #endif /* PCI_H */