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>
This commit is contained in:
Rizwan Qureshi 2017-04-26 21:00:37 +05:30 committed by Martin Roth
parent 852debe648
commit fd891291ed
1 changed files with 7 additions and 0 deletions

View File

@ -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);