[coreboot-gerrit] Change in coreboot[master]: mc_bdx1: Set bus master bit for on-board PCI devices

Werner Zeh (Code Review) gerrit at coreboot.org
Wed Jun 28 13:00:47 CEST 2017


Werner Zeh has uploaded this change for review. ( https://review.coreboot.org/20403


Change subject: mc_bdx1: Set bus master bit for on-board PCI devices
......................................................................

mc_bdx1: Set bus master bit for on-board PCI devices

There are up to two on-board PCI devices where bus master has to be
enabled in PCI config space. As there is no need for a complete PCI
driver for these devices just set the bus master bit in
mainboard_final().

Change-Id: Ic2896d5e7568a455737af26b14b2c398caae5f72
Signed-off-by: Werner Zeh <werner.zeh at siemens.com>
---
M src/mainboard/siemens/mc_bdx1/mainboard.c
1 file changed, 15 insertions(+), 0 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/03/20403/1

diff --git a/src/mainboard/siemens/mc_bdx1/mainboard.c b/src/mainboard/siemens/mc_bdx1/mainboard.c
index fe35fe1..c6b8b76 100644
--- a/src/mainboard/siemens/mc_bdx1/mainboard.c
+++ b/src/mainboard/siemens/mc_bdx1/mainboard.c
@@ -20,6 +20,7 @@
 #include <device/device.h>
 #include <device/pci_def.h>
 #include <device/pci_ops.h>
+#include <device/pci_ids.h>
 #include <console/console.h>
 #if CONFIG_VGA_ROM_RUN
 #include <x86emu/x86emu.h>
@@ -125,6 +126,20 @@
 	write16((spi_base + SPI_REG_OPTYPE), SPI_OPTYPE);
 	write32((spi_base + SPI_REG_OPMENU_L), SPI_OPMENU_LOWER);
 	write32((spi_base + SPI_REG_OPMENU_H), SPI_OPMENU_UPPER);
+
+	/*Set Master Enable for on-board PCI devices.*/
+	dev = dev_find_device(PCI_VENDOR_ID_SIEMENS, 0x403e, 0);
+	if (dev) {
+		uint16_t cmd = pci_read_config16(dev, PCI_COMMAND);
+		cmd |= PCI_COMMAND_MASTER;
+		pci_write_config16(dev, PCI_COMMAND, cmd);
+	}
+	dev = dev_find_device(PCI_VENDOR_ID_SIEMENS, 0x403f, 0);
+	if (dev) {
+		uint16_t cmd = pci_read_config16(dev, PCI_COMMAND);
+		cmd |= PCI_COMMAND_MASTER;
+		pci_write_config16(dev, PCI_COMMAND, cmd);
+	}
 }
 
 /** \brief This function can decide if a given MAC address is valid or not.

-- 
To view, visit https://review.coreboot.org/20403
To unsubscribe, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic2896d5e7568a455737af26b14b2c398caae5f72
Gerrit-Change-Number: 20403
Gerrit-PatchSet: 1
Gerrit-Owner: Werner Zeh <werner.zeh at siemens.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20170628/8ff6c86f/attachment.html>


More information about the coreboot-gerrit mailing list