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> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@6329 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
This commit is contained in:
parent
539500ee33
commit
87fcffac82
|
@ -586,6 +586,16 @@ void pci_dev_set_resources(struct device *dev)
|
||||||
pci_write_config8(dev, PCI_CACHE_LINE_SIZE, 64 >> 2);
|
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)
|
void pci_dev_enable_resources(struct device *dev)
|
||||||
{
|
{
|
||||||
const struct pci_operations *ops;
|
const struct pci_operations *ops;
|
||||||
|
@ -595,11 +605,11 @@ void pci_dev_enable_resources(struct device *dev)
|
||||||
ops = ops_pci(dev);
|
ops = ops_pci(dev);
|
||||||
if (dev->on_mainboard && ops && ops->set_subsystem) {
|
if (dev->on_mainboard && ops && ops->set_subsystem) {
|
||||||
printk(BIOS_DEBUG, "%s subsystem <- %02x/%02x\n", dev_path(dev),
|
printk(BIOS_DEBUG, "%s subsystem <- %02x/%02x\n", dev_path(dev),
|
||||||
CONFIG_MAINBOARD_PCI_SUBSYSTEM_VENDOR_ID,
|
mainboard_pci_subsystem_vendor_id(dev),
|
||||||
CONFIG_MAINBOARD_PCI_SUBSYSTEM_DEVICE_ID);
|
mainboard_pci_subsystem_device_id(dev));
|
||||||
ops->set_subsystem(dev,
|
ops->set_subsystem(dev,
|
||||||
CONFIG_MAINBOARD_PCI_SUBSYSTEM_VENDOR_ID,
|
mainboard_pci_subsystem_vendor_id(dev),
|
||||||
CONFIG_MAINBOARD_PCI_SUBSYSTEM_DEVICE_ID);
|
mainboard_pci_subsystem_device_id(dev));
|
||||||
}
|
}
|
||||||
command = pci_read_config16(dev, PCI_COMMAND);
|
command = pci_read_config16(dev, PCI_COMMAND);
|
||||||
command |= dev->command;
|
command |= dev->command;
|
||||||
|
|
|
@ -103,4 +103,7 @@ static inline const struct pci_bus_operations *ops_pci_bus(struct bus *bus)
|
||||||
return bops;
|
return bops;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsigned mainboard_pci_subsystem_vendor_id(struct device *dev);
|
||||||
|
unsigned mainboard_pci_subsystem_device_id(struct device *dev);
|
||||||
|
|
||||||
#endif /* PCI_H */
|
#endif /* PCI_H */
|
||||||
|
|
|
@ -73,11 +73,11 @@ static void ich_pci_dev_enable_resources(struct device *dev)
|
||||||
if (dev->on_mainboard && ops && ops->set_subsystem) {
|
if (dev->on_mainboard && ops && ops->set_subsystem) {
|
||||||
printk(BIOS_DEBUG, "%s subsystem <- %02x/%02x\n",
|
printk(BIOS_DEBUG, "%s subsystem <- %02x/%02x\n",
|
||||||
dev_path(dev),
|
dev_path(dev),
|
||||||
CONFIG_MAINBOARD_PCI_SUBSYSTEM_VENDOR_ID,
|
mainboard_pci_subsystem_vendor_id(dev),
|
||||||
CONFIG_MAINBOARD_PCI_SUBSYSTEM_DEVICE_ID);
|
mainboard_pci_subsystem_device_id(dev));
|
||||||
ops->set_subsystem(dev,
|
ops->set_subsystem(dev,
|
||||||
CONFIG_MAINBOARD_PCI_SUBSYSTEM_VENDOR_ID,
|
mainboard_pci_subsystem_vendor_id(dev),
|
||||||
CONFIG_MAINBOARD_PCI_SUBSYSTEM_DEVICE_ID);
|
mainboard_pci_subsystem_device_id(dev));
|
||||||
}
|
}
|
||||||
|
|
||||||
command = pci_read_config16(dev, PCI_COMMAND);
|
command = pci_read_config16(dev, PCI_COMMAND);
|
||||||
|
|
Loading…
Reference in New Issue