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