From fd891291ed4db76f08cd897561489e3ed76f40cf Mon Sep 17 00:00:00 2001 From: Rizwan Qureshi Date: Wed, 26 Apr 2017 21:00:37 +0530 Subject: pci_device: Write vendor ID to subsystem vendor ID MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Write vendor/device id to subsystem vendor/device id if they are not provided. Change-Id: I5027331a6adf9109767415ba22dfcb17b35ef54b Signed-off-by: Rizwan Qureshi Reviewed-on: https://review.coreboot.org/19467 Reviewed-by: Aaron Durbin Tested-by: build bot (Jenkins) Reviewed-by: Philippe Mathieu-Daudé --- src/device/pci_device.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'src/device') diff --git a/src/device/pci_device.c b/src/device/pci_device.c index b2e3c9ac64..e42315166d 100644 --- a/src/device/pci_device.c +++ b/src/device/pci_device.c @@ -599,8 +599,15 @@ void pci_dev_enable_resources(struct device *dev) 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); -- cgit v1.2.3