mb/siemens/mc_apl{1,2,3,5,6}: Set PCI bus master bit only if allowed

Take Kconfig switch PCI_ALLOW_BUS_MASTER into account and set the PCI
bus master bit for legacy devices only if it is allowed.

Change-Id: I7798a767d528419bb093f301140ab68cc8b9c5ae
Signed-off-by: Werner Zeh <werner.zeh@siemens.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/56442
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Mario Scheithauer <mario.scheithauer@siemens.com>
Reviewed-by: Paul Menzel <paulepanter@mailbox.org>
This commit is contained in:
Werner Zeh 2021-07-20 07:33:20 +02:00 committed by Patrick Georgi
parent 061a93f93d
commit 1412ffab19
5 changed files with 21 additions and 14 deletions

View File

@ -215,11 +215,13 @@ static void mainboard_final(void *chip_info)
/* Do board specific things */
variant_mainboard_final();
/* Set Master Enable for on-board PCI device. */
/* Set Master Enable for on-board PCI device if allowed. */
if (CONFIG(PCI_ALLOW_BUS_MASTER)) {
dev = dev_find_device(PCI_VENDOR_ID_SIEMENS, 0x403f, 0);
if (dev) {
pci_or_config16(dev, PCI_COMMAND, PCI_COMMAND_MASTER);
}
}
/* Set up SPI OPCODE menu before the controller is locked. */
fast_spi_set_opcode_menu();

View File

@ -10,9 +10,11 @@ void variant_mainboard_final(void)
{
struct device *dev;
/* Set Master Enable for on-board PCI device. */
if (CONFIG(PCI_ALLOW_BUS_MASTER)) {
/* Set Master Enable for on-board PCI device if allowed. */
dev = dev_find_device(PCI_VENDOR_ID_SIEMENS, 0x403e, 0);
if (dev) {
pci_or_config16(dev, PCI_COMMAND, PCI_COMMAND_MASTER);
}
}
}

View File

@ -36,9 +36,10 @@ void variant_mainboard_final(void)
*/
pcr_or32(PID_LPC, PCR_LPC_PRC, (PCR_LPC_CCE_EN | PCR_LPC_PCE_EN));
/* Set Master Enable for on-board PCI device. */
/* Set Master Enable for on-board PCI device if allowed. */
dev = dev_find_device(PCI_VENDOR_ID_SIEMENS, 0x403e, 0);
if (dev) {
if (CONFIG(PCI_ALLOW_BUS_MASTER))
pci_or_config16(dev, PCI_COMMAND, PCI_COMMAND_MASTER);
/* Disable clock outputs 0 and 2-4 (CLKOUT) for upstream

View File

@ -43,9 +43,10 @@ void variant_mainboard_final(void)
*/
pcr_rmw32(PID_MODPHY, TX_DWORD3, (0x00 << 16), (0x4a << 16));
/* Set Master Enable for on-board PCI device. */
/* Set Master Enable for on-board PCI device if allowed. */
dev = dev_find_device(PCI_VENDOR_ID_SIEMENS, 0x403e, 0);
if (dev) {
if (CONFIG(PCI_ALLOW_BUS_MASTER))
pci_or_config16(dev, PCI_COMMAND, PCI_COMMAND_MASTER);
/* Disable clock outputs 0-3 (CLKOUT) for upstream XIO2001 PCIe

View File

@ -36,9 +36,10 @@ void variant_mainboard_final(void)
*/
pcr_or32(PID_LPC, PCR_LPC_PRC, (PCR_LPC_CCE_EN | PCR_LPC_PCE_EN));
/* Set Master Enable for on-board PCI device. */
/* Set Master Enable for on-board PCI device if allowed. */
dev = dev_find_device(PCI_VENDOR_ID_SIEMENS, 0x403e, 0);
if (dev) {
if (CONFIG(PCI_ALLOW_BUS_MASTER))
pci_or_config16(dev, PCI_COMMAND, PCI_COMMAND_MASTER);
/* Disable clock outputs 0-3 (CLKOUT) for upstream