[coreboot-gerrit] Change in coreboot[master]: pci_device: Write vendor ID to subsystem vendor ID

Martin Roth (Code Review) gerrit at coreboot.org
Mon May 1 01:06:08 CEST 2017


Martin Roth has submitted this change and it was merged. ( https://review.coreboot.org/19467 )

Change subject: pci_device: Write vendor ID to subsystem vendor ID
......................................................................


pci_device: Write vendor ID to subsystem vendor ID

Write vendor/device id to subsystem vendor/device id
if they are not provided.

Change-Id: I5027331a6adf9109767415ba22dfcb17b35ef54b
Signed-off-by: Rizwan Qureshi <rizwan.qureshi at intel.com>
Reviewed-on: https://review.coreboot.org/19467
Reviewed-by: Aaron Durbin <adurbin at chromium.org>
Tested-by: build bot (Jenkins)
Reviewed-by: Philippe Mathieu-Daudé <philippe.mathieu.daude at gmail.com>
---
M src/device/pci_device.c
1 file changed, 7 insertions(+), 0 deletions(-)

Approvals:
  Aaron Durbin: Looks good to me, approved
  Philippe Mathieu-Daudé: Looks good to me, but someone else must approve
  build bot (Jenkins): Verified



diff --git a/src/device/pci_device.c b/src/device/pci_device.c
index b2e3c9a..e423151 100644
--- a/src/device/pci_device.c
+++ b/src/device/pci_device.c
@@ -599,8 +599,15 @@
 	if (dev->on_mainboard && ops && ops->set_subsystem) {
 		if (CONFIG_SUBSYSTEM_VENDOR_ID)
 			dev->subsystem_vendor = CONFIG_SUBSYSTEM_VENDOR_ID;
+		else if (!dev->subsystem_vendor)
+			dev->subsystem_vendor = pci_read_config16(dev,
+							PCI_VENDOR_ID);
 		if (CONFIG_SUBSYSTEM_DEVICE_ID)
 			dev->subsystem_device = CONFIG_SUBSYSTEM_DEVICE_ID;
+		else if (!dev->subsystem_device)
+			dev->subsystem_device = pci_read_config16(dev,
+							PCI_DEVICE_ID);
+
 		printk(BIOS_DEBUG, "%s subsystem <- %04x/%04x\n",
 			dev_path(dev), dev->subsystem_vendor,
 			dev->subsystem_device);

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I5027331a6adf9109767415ba22dfcb17b35ef54b
Gerrit-PatchSet: 8
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Owner: Rizwan Qureshi <rizwan.qureshi at intel.com>
Gerrit-Reviewer: Aamir Bohra <aamir.bohra at intel.com>
Gerrit-Reviewer: Aaron Durbin <adurbin at chromium.org>
Gerrit-Reviewer: Bora Guvendik <bora.guvendik at intel.com>
Gerrit-Reviewer: Hannah Williams <hannah.williams at intel.com>
Gerrit-Reviewer: Martin Roth <martinroth at google.com>
Gerrit-Reviewer: Paul Menzel <paulepanter at users.sourceforge.net>
Gerrit-Reviewer: Philippe Mathieu-Daudé <philippe.mathieu.daude at gmail.com>
Gerrit-Reviewer: Rizwan Qureshi <rizwan.qureshi at intel.com>
Gerrit-Reviewer: Subrata Banik <subrata.banik at intel.com>
Gerrit-Reviewer: build bot (Jenkins)



More information about the coreboot-gerrit mailing list