Author: oxygene Date: Thu Feb 3 10:14:40 2011 New Revision: 6329 URL: https://tracker.coreboot.org/trac/coreboot/changeset/6329
Log: Wrap CONFIG_MAINBOARD_PCI_SUBSYSTEM_{VENDOR,DEVICE}_ID in weak functions
This is so that boards can determine them on runtime based on hardware properties, if so desired.
Signed-off-by: Patrick Georgi patrick.georgi@secunet.com Acked-by: Joseph Kellermann Joseph.Kellermann@heitec.de
Modified: trunk/src/devices/pci_device.c trunk/src/include/device/pci.h trunk/src/southbridge/intel/i82801gx/pci.c
Modified: trunk/src/devices/pci_device.c ============================================================================== --- trunk/src/devices/pci_device.c Thu Feb 3 00:56:15 2011 (r6328) +++ trunk/src/devices/pci_device.c Thu Feb 3 10:14:40 2011 (r6329) @@ -586,6 +586,16 @@ pci_write_config8(dev, PCI_CACHE_LINE_SIZE, 64 >> 2); }
+unsigned __attribute__((weak)) mainboard_pci_subsystem_vendor_id(__attribute__((unused)) struct device *dev) +{ + return CONFIG_MAINBOARD_PCI_SUBSYSTEM_VENDOR_ID; +} + +unsigned __attribute__((weak)) mainboard_pci_subsystem_device_id(__attribute__((unused)) struct device *dev) +{ + return CONFIG_MAINBOARD_PCI_SUBSYSTEM_DEVICE_ID; +} + void pci_dev_enable_resources(struct device *dev) { const struct pci_operations *ops; @@ -595,11 +605,11 @@ ops = ops_pci(dev); if (dev->on_mainboard && ops && ops->set_subsystem) { printk(BIOS_DEBUG, "%s subsystem <- %02x/%02x\n", dev_path(dev), - CONFIG_MAINBOARD_PCI_SUBSYSTEM_VENDOR_ID, - CONFIG_MAINBOARD_PCI_SUBSYSTEM_DEVICE_ID); + mainboard_pci_subsystem_vendor_id(dev), + mainboard_pci_subsystem_device_id(dev)); ops->set_subsystem(dev, - CONFIG_MAINBOARD_PCI_SUBSYSTEM_VENDOR_ID, - CONFIG_MAINBOARD_PCI_SUBSYSTEM_DEVICE_ID); + mainboard_pci_subsystem_vendor_id(dev), + mainboard_pci_subsystem_device_id(dev)); } command = pci_read_config16(dev, PCI_COMMAND); command |= dev->command;
Modified: trunk/src/include/device/pci.h ============================================================================== --- trunk/src/include/device/pci.h Thu Feb 3 00:56:15 2011 (r6328) +++ trunk/src/include/device/pci.h Thu Feb 3 10:14:40 2011 (r6329) @@ -103,4 +103,7 @@ return bops; }
+unsigned mainboard_pci_subsystem_vendor_id(struct device *dev); +unsigned mainboard_pci_subsystem_device_id(struct device *dev); + #endif /* PCI_H */
Modified: trunk/src/southbridge/intel/i82801gx/pci.c ============================================================================== --- trunk/src/southbridge/intel/i82801gx/pci.c Thu Feb 3 00:56:15 2011 (r6328) +++ trunk/src/southbridge/intel/i82801gx/pci.c Thu Feb 3 10:14:40 2011 (r6329) @@ -73,11 +73,11 @@ if (dev->on_mainboard && ops && ops->set_subsystem) { printk(BIOS_DEBUG, "%s subsystem <- %02x/%02x\n", dev_path(dev), - CONFIG_MAINBOARD_PCI_SUBSYSTEM_VENDOR_ID, - CONFIG_MAINBOARD_PCI_SUBSYSTEM_DEVICE_ID); + mainboard_pci_subsystem_vendor_id(dev), + mainboard_pci_subsystem_device_id(dev)); ops->set_subsystem(dev, - CONFIG_MAINBOARD_PCI_SUBSYSTEM_VENDOR_ID, - CONFIG_MAINBOARD_PCI_SUBSYSTEM_DEVICE_ID); + mainboard_pci_subsystem_vendor_id(dev), + mainboard_pci_subsystem_device_id(dev)); }
command = pci_read_config16(dev, PCI_COMMAND);