From 87fcffac82a4e3b24e152678e73cd7e6c2f1dcad Mon Sep 17 00:00:00 2001 From: Patrick Georgi Date: Thu, 3 Feb 2011 09:14:40 +0000 Subject: 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 Acked-by: Joseph Kellermann git-svn-id: svn://svn.coreboot.org/coreboot/trunk@6329 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- src/devices/pci_device.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'src/devices') diff --git a/src/devices/pci_device.c b/src/devices/pci_device.c index 0b39faa8b2..b6a8078be7 100644 --- a/src/devices/pci_device.c +++ b/src/devices/pci_device.c @@ -586,6 +586,16 @@ void pci_dev_set_resources(struct device *dev) 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 @@ void pci_dev_enable_resources(struct device *dev) 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; -- cgit v1.2.3