mb/siemens/mc_ehl: Enable master bit in PCI config space if allowed

Some legacy devices need to have the master bit set in the PCI config
due to old drivers not setting it correctly. Set the master bit if the
feature is enabled via Kconfig switch PCI_ALLOW_BUS_MASTER_ANY_DEVICE.

For now, the PCI devices with the ID 110a:403e and 110a:403f needs this
master bit to be set.

Change-Id: Id3f6bda97e5f47d0613a1db8f8adac0b158ab8b1
Signed-off-by: Werner Zeh <werner.zeh@siemens.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/56632
Reviewed-by: Paul Menzel <paulepanter@mailbox.org>
Reviewed-by: Mario Scheithauer <mario.scheithauer@siemens.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Werner Zeh 2021-06-11 07:05:06 +02:00 committed by Paul Fagerburg
parent 4cec1a2770
commit 78ec750610
1 changed files with 21 additions and 1 deletions

View File

@ -4,6 +4,9 @@
#include <bootstate.h>
#include <console/console.h>
#include <device/device.h>
#include <device/pci_def.h>
#include <device/pci_ops.h>
#include <device/pci_ids.h>
#include <hwilib.h>
#include <i210.h>
#include <soc/gpio.h>
@ -120,8 +123,25 @@ static void mainboard_init(void *chip_info)
gpio_configure_pads(pads, num);
}
static void mainboard_final(void *chip_info)
{
struct device *dev;
if (CONFIG(PCI_ALLOW_BUS_MASTER_ANY_DEVICE)) {
/* Set Master Enable for on-board PCI devices if allowed. */
dev = dev_find_device(PCI_VENDOR_ID_SIEMENS, 0x403e, 0);
if (dev)
pci_or_config16(dev, PCI_COMMAND, PCI_COMMAND_MASTER);
dev = dev_find_device(PCI_VENDOR_ID_SIEMENS, 0x403f, 0);
if (dev)
pci_or_config16(dev, PCI_COMMAND, PCI_COMMAND_MASTER);
}
}
struct chip_operations mainboard_ops = {
.init = mainboard_init,
.init = mainboard_init,
.final = mainboard_final
};
BOOT_STATE_INIT_ENTRY(BS_DEV_ENUMERATE, BS_ON_ENTRY, wait_for_legacy_dev, NULL);