- First pass through with with device tree enhancement merge.  Most of the mechanisms should
  be in place but don't expect anything to quite work yet.


git-svn-id: svn://svn.coreboot.org/coreboot/trunk@1662 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
diff --git a/src/include/device/pci.h b/src/include/device/pci.h
index ef18cb4..13414a7 100644
--- a/src/include/device/pci.h
+++ b/src/include/device/pci.h
@@ -21,13 +21,18 @@
 #include <device/pci_ops.h>
 
 
+/* Common pci operations without a standard interface */
+struct pci_operations {
+	void (*set_subsystem)(device_t dev, unsigned vendor, unsigned device);
+};
+
 struct pci_driver {
 	struct device_operations *ops;
 	unsigned short vendor;
 	unsigned short device;
 };
 
-#define __pci_driver __attribute__ ((unused,__section__(".rodata.pci_driver")))
+#define __pci_driver __attribute__ ((used,__section__(".rodata.pci_driver")))
 /** start of compile time generated pci driver array */
 extern struct pci_driver pci_drivers[];
 /** end of compile time generated pci driver array */
@@ -37,7 +42,6 @@
 struct device_operations default_pci_ops_dev;
 struct device_operations default_pci_ops_bus;
 
-
 void pci_dev_read_resources(device_t dev);
 void pci_bus_read_resources(device_t dev);
 void pci_dev_set_resources(device_t dev);
@@ -45,8 +49,19 @@
 void pci_bus_enable_resources(device_t dev);
 unsigned int pci_scan_bridge(device_t bus, unsigned int max);
 unsigned int pci_scan_bus(struct bus *bus, unsigned min_devfn, unsigned max_devfn, unsigned int max);
+struct resource *pci_get_resource(struct device *dev, unsigned long index);
 
 #define PCI_IO_BRIDGE_ALIGN 4096
 #define PCI_MEM_BRIDGE_ALIGN (1024*1024)
 
+static inline struct pci_operations *ops_pci(device_t dev)
+{
+	struct pci_operations *pops;
+	pops = 0;
+	if (dev && dev->ops) {
+		pops = dev->ops->ops_pci;
+	}
+	return pops;
+}
+
 #endif /* PCI_H */