diff options
author | Rizwan Qureshi <rizwan.qureshi@intel.com> | 2017-04-26 21:00:37 +0530 |
---|---|---|
committer | Martin Roth <martinroth@google.com> | 2017-05-01 01:06:02 +0200 |
commit | fd891291ed4db76f08cd897561489e3ed76f40cf (patch) | |
tree | 5c4e9f25dcbab87ca34fdd8c9430d96aed753455 /src/device/pci_device.c | |
parent | 852debe648251bc507736fce355d9bb9102c5aaa (diff) | |
download | coreboot-fd891291ed4db76f08cd897561489e3ed76f40cf.tar.xz |
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@intel.com>
Reviewed-on: https://review.coreboot.org/19467
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Tested-by: build bot (Jenkins)
Reviewed-by: Philippe Mathieu-Daudé <philippe.mathieu.daude@gmail.com>
Diffstat (limited to 'src/device/pci_device.c')
-rw-r--r-- | src/device/pci_device.c | 7 |
1 files changed, 7 insertions, 0 deletions
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); |