diff options
author | Werner Zeh <werner.zeh@siemens.com> | 2021-06-11 07:05:06 +0200 |
---|---|---|
committer | Paul Fagerburg <pfagerburg@chromium.org> | 2021-08-02 15:08:43 +0000 |
commit | 78ec750610e1b7fd07804c4baee260b712c45bfb (patch) | |
tree | 39291a16f3f615703cfa544550d5c8b8d19ca1fa /src/mainboard/siemens | |
parent | 4cec1a2770c1ac5257e704eda4117477d5d28d69 (diff) |
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>
Diffstat (limited to 'src/mainboard/siemens')
-rw-r--r-- | src/mainboard/siemens/mc_ehl/mainboard.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/mainboard/siemens/mc_ehl/mainboard.c b/src/mainboard/siemens/mc_ehl/mainboard.c index 4cc5490f2a..d3475678bc 100644 --- a/src/mainboard/siemens/mc_ehl/mainboard.c +++ b/src/mainboard/siemens/mc_ehl/mainboard.c @@ -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); |