===================================================================
@@ -26,6 +26,7 @@
#ifndef __PRE_RAM__
void mcp55_enable(device_t dev);
+extern struct pci_operations mcp55_pci_ops;
#else
void enable_fid_change_on_sb(unsigned sbbusn, unsigned sbdn);
#endif
===================================================================
@@ -69,15 +69,6 @@
}
-static void lpci_set_subsystem(device_t dev, unsigned vendor, unsigned device)
-{
- pci_write_config32(dev, 0x40,
- ((device & 0xffff) << 16) | (vendor & 0xffff));
-}
-static struct pci_operations lops_pci = {
- .set_subsystem = lpci_set_subsystem,
-};
-
static struct device_operations sata_ops = {
.read_resources = pci_dev_read_resources,
.set_resources = pci_dev_set_resources,
@@ -85,7 +76,7 @@
// .enable = mcp55_enable,
.init = sata_init,
.scan_bus = 0,
- .ops_pci = &lops_pci,
+ .ops_pci = &mcp55_pci_ops,
};
static const struct pci_driver sata0_driver __pci_driver = {
===================================================================
@@ -123,15 +123,6 @@
#endif
}
-static void lpci_set_subsystem(device_t dev, unsigned vendor, unsigned device)
-{
- pci_write_config32(dev, 0x40,
- ((device & 0xffff) << 16) | (vendor & 0xffff));
-}
-
-static struct pci_operations lops_pci = {
- .set_subsystem = lpci_set_subsystem,
-};
static struct device_operations smbus_ops = {
.read_resources = mcp55_sm_read_resources,
.set_resources = pci_dev_set_resources,
@@ -139,7 +130,7 @@
.init = mcp55_sm_init,
.scan_bus = scan_static_bus,
// .enable = mcp55_enable,
- .ops_pci = &lops_pci,
+ .ops_pci = &mcp55_pci_ops,
.ops_smbus_bus = &lops_smbus_bus,
};
static const struct pci_driver smbus_driver __pci_driver = {
===================================================================
@@ -28,15 +28,6 @@
#include <device/pci_ops.h>
#include "mcp55.h"
-static void lpci_set_subsystem(device_t dev, unsigned vendor, unsigned device)
-{
- pci_write_config32(dev, 0x40,
- ((device & 0xffff) << 16) | (vendor & 0xffff));
-}
-static struct pci_operations lops_pci = {
- .set_subsystem = lpci_set_subsystem,
-};
-
static struct device_operations usb_ops = {
.read_resources = pci_dev_read_resources,
.set_resources = pci_dev_set_resources,
@@ -44,7 +35,7 @@
.init = 0,
// .enable = mcp55_enable,
.scan_bus = 0,
- .ops_pci = &lops_pci,
+ .ops_pci = &mcp55_pci_ops,
};
static const struct pci_driver usb_driver __pci_driver = {
===================================================================
@@ -69,15 +69,6 @@
}
-static void lpci_set_subsystem(device_t dev, unsigned vendor, unsigned device)
-{
- pci_write_config32(dev, 0x40,
- ((device & 0xffff) << 16) | (vendor & 0xffff));
-}
-static struct pci_operations lops_pci = {
- .set_subsystem = lpci_set_subsystem,
-};
-
static struct device_operations ide_ops = {
.read_resources = pci_dev_read_resources,
.set_resources = pci_dev_set_resources,
@@ -85,7 +76,7 @@
.init = ide_init,
.scan_bus = 0,
// .enable = mcp55_enable,
- .ops_pci = &lops_pci,
+ .ops_pci = &mcp55_pci_ops,
};
static const struct pci_driver ide_driver __pci_driver = {
===================================================================
@@ -180,16 +180,6 @@
}
-static void lpci_set_subsystem(device_t dev, unsigned vendor, unsigned device)
-{
- pci_write_config32(dev, 0x40,
- ((device & 0xffff) << 16) | (vendor & 0xffff));
-}
-
-static struct pci_operations lops_pci = {
- .set_subsystem = lpci_set_subsystem,
-};
-
static struct device_operations nic_ops = {
.read_resources = pci_dev_read_resources,
.set_resources = pci_dev_set_resources,
@@ -197,7 +187,7 @@
.init = nic_init,
.scan_bus = 0,
// .enable = mcp55_enable,
- .ops_pci = &lops_pci,
+ .ops_pci = &mcp55_pci_ops,
};
static const struct pci_driver nic_driver __pci_driver = {
.ops = &nic_ops,
===================================================================
@@ -28,22 +28,13 @@
#include <device/pci_ops.h>
#include "mcp55.h"
-static void lpci_set_subsystem(device_t dev, unsigned vendor, unsigned device)
-{
- pci_write_config32(dev, 0x40,
- ((device & 0xffff) << 16) | (vendor & 0xffff));
-}
-static struct pci_operations lops_pci = {
- .set_subsystem = lpci_set_subsystem,
-};
-
static struct device_operations ht_ops = {
.read_resources = pci_dev_read_resources,
.set_resources = pci_dev_set_resources,
.enable_resources = pci_dev_enable_resources,
.init = 0,
.scan_bus = 0,
- .ops_pci = &lops_pci,
+ .ops_pci = &mcp55_pci_ops,
};
static const struct pci_driver ht_driver __pci_driver = {
===================================================================
@@ -85,10 +85,6 @@
pci_write_config32(dev, 0x50, dword); /* TOM */
}
-static struct pci_operations lops_pci = {
- .set_subsystem = 0,
-};
-
static struct device_operations pci_ops = {
.read_resources = pci_bus_read_resources,
.set_resources = pci_dev_set_resources,
@@ -97,7 +93,6 @@
.scan_bus = pci_scan_bridge,
// .enable = mcp55_enable,
.reset_bus = pci_bus_reset,
- .ops_pci = &lops_pci,
};
static const struct pci_driver pci_driver __pci_driver = {
===================================================================
@@ -62,15 +62,6 @@
}
-static void lpci_set_subsystem(device_t dev, unsigned vendor, unsigned device)
-{
- pci_write_config32(dev, 0x40,
- ((device & 0xffff) << 16) | (vendor & 0xffff));
-}
-static struct pci_operations lops_pci = {
- .set_subsystem = lpci_set_subsystem,
-};
-
static struct device_operations usb2_ops = {
.read_resources = pci_dev_read_resources,
.set_resources = usb2_set_resources,
@@ -78,7 +69,7 @@
.init = usb2_init,
// .enable = mcp55_enable,
.scan_bus = 0,
- .ops_pci = &lops_pci,
+ .ops_pci = &mcp55_pci_ops,
};
static const struct pci_driver usb2_driver __pci_driver = {
===================================================================
@@ -253,16 +253,6 @@
mcp55_lpc_enable_childrens_resources(dev);
}
-static void lpci_set_subsystem(device_t dev, unsigned vendor, unsigned device)
-{
- pci_write_config32(dev, 0x40,
- ((device & 0xffff) << 16) | (vendor & 0xffff));
-}
-
-static struct pci_operations lops_pci = {
- .set_subsystem = lpci_set_subsystem,
-};
-
static struct device_operations lpc_ops = {
.read_resources = mcp55_lpc_read_resources,
.set_resources = pci_dev_set_resources,
@@ -270,7 +260,7 @@
.init = lpc_init,
.scan_bus = scan_static_bus,
// .enable = mcp55_enable,
- .ops_pci = &lops_pci,
+ .ops_pci = &mcp55_pci_ops,
};
static const struct pci_driver lpc_driver __pci_driver = {
.ops = &lpc_ops,
@@ -316,7 +306,7 @@
.enable_resources = pci_dev_enable_resources,
.init = lpc_slave_init,
// .enable = mcp55_enable,
- .ops_pci = &lops_pci,
+ .ops_pci = &mcp55_pci_ops,
};
static const struct pci_driver lpc_driver_slave __pci_driver = {
===================================================================
@@ -242,6 +242,16 @@
}
+static void mcp55_set_subsystem(device_t dev, unsigned vendor, unsigned device)
+{
+ pci_write_config32(dev, 0x40,
+ ((device & 0xffff) << 16) | (vendor & 0xffff));
+}
+
+struct pci_operations mcp55_pci_ops = {
+ .set_subsystem = mcp55_set_subsystem,
+};
+
struct chip_operations southbridge_nvidia_mcp55_ops = {
CHIP_NAME("NVIDIA MCP55 Southbridge")
.enable_dev = mcp55_enable,
===================================================================
@@ -42,10 +42,6 @@
}
-static struct pci_operations lops_pci = {
- .set_subsystem = 0,
-};
-
static struct device_operations pcie_ops = {
.read_resources = pci_bus_read_resources,
.set_resources = pci_dev_set_resources,
@@ -53,7 +49,6 @@
.init = pcie_init,
.scan_bus = pci_scan_bridge,
// .enable = mcp55_enable,
- .ops_pci = &lops_pci,
};
static const struct pci_driver pciebc_driver __pci_driver = {
Use common code to set PCI subsystem in mcp55. Signed-off-by: Jonathan Kollasch <jakllsch@kollasch.net> ---