summaryrefslogtreecommitdiff
path: root/src/southbridge/nvidia
diff options
context:
space:
mode:
authorJonathan Kollasch <jakllsch@kollasch.net>2010-10-29 20:40:06 +0000
committerJonathan A. Kollasch <jakllsch@kollasch.net>2010-10-29 20:40:06 +0000
commitdca8b1b5995291e9ee610e178e1fc7b3f710aeb9 (patch)
treeebb30e42da816acaced534c02e36185feb127ab3 /src/southbridge/nvidia
parentc7f3f80cf06165fc4e645a88590d7d8c982395de (diff)
downloadcoreboot-dca8b1b5995291e9ee610e178e1fc7b3f710aeb9.tar.xz
Use common code to set PCI subsystem in mcp55.
Signed-off-by: Jonathan Kollasch <jakllsch@kollasch.net> Acked-by: Uwe Hermann <uwe@hermann-uwe.de> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@6003 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'src/southbridge/nvidia')
-rw-r--r--src/southbridge/nvidia/mcp55/mcp55.c10
-rw-r--r--src/southbridge/nvidia/mcp55/mcp55.h1
-rw-r--r--src/southbridge/nvidia/mcp55/mcp55_ht.c11
-rw-r--r--src/southbridge/nvidia/mcp55/mcp55_ide.c11
-rw-r--r--src/southbridge/nvidia/mcp55/mcp55_lpc.c14
-rw-r--r--src/southbridge/nvidia/mcp55/mcp55_nic.c12
-rw-r--r--src/southbridge/nvidia/mcp55/mcp55_pci.c5
-rw-r--r--src/southbridge/nvidia/mcp55/mcp55_pcie.c5
-rw-r--r--src/southbridge/nvidia/mcp55/mcp55_sata.c11
-rw-r--r--src/southbridge/nvidia/mcp55/mcp55_smbus.c11
-rw-r--r--src/southbridge/nvidia/mcp55/mcp55_usb.c11
-rw-r--r--src/southbridge/nvidia/mcp55/mcp55_usb2.c11
12 files changed, 20 insertions, 93 deletions
diff --git a/src/southbridge/nvidia/mcp55/mcp55.c b/src/southbridge/nvidia/mcp55/mcp55.c
index aa86cf3bc7..11dc5b2cd2 100644
--- a/src/southbridge/nvidia/mcp55/mcp55.c
+++ b/src/southbridge/nvidia/mcp55/mcp55.c
@@ -242,6 +242,16 @@ void mcp55_enable(device_t dev)
}
+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,
diff --git a/src/southbridge/nvidia/mcp55/mcp55.h b/src/southbridge/nvidia/mcp55/mcp55.h
index acb291a1d0..e746cb6398 100644
--- a/src/southbridge/nvidia/mcp55/mcp55.h
+++ b/src/southbridge/nvidia/mcp55/mcp55.h
@@ -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
diff --git a/src/southbridge/nvidia/mcp55/mcp55_ht.c b/src/southbridge/nvidia/mcp55/mcp55_ht.c
index a05bd59df0..8b0248f8a6 100644
--- a/src/southbridge/nvidia/mcp55/mcp55_ht.c
+++ b/src/southbridge/nvidia/mcp55/mcp55_ht.c
@@ -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 = {
diff --git a/src/southbridge/nvidia/mcp55/mcp55_ide.c b/src/southbridge/nvidia/mcp55/mcp55_ide.c
index fac5997513..90dd2bf48d 100644
--- a/src/southbridge/nvidia/mcp55/mcp55_ide.c
+++ b/src/southbridge/nvidia/mcp55/mcp55_ide.c
@@ -69,15 +69,6 @@ static void ide_init(struct device *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 ide_ops = {
.read_resources = pci_dev_read_resources,
.set_resources = pci_dev_set_resources,
@@ -85,7 +76,7 @@ static struct device_operations ide_ops = {
.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 = {
diff --git a/src/southbridge/nvidia/mcp55/mcp55_lpc.c b/src/southbridge/nvidia/mcp55/mcp55_lpc.c
index 0fb77c3e38..3132eedbd2 100644
--- a/src/southbridge/nvidia/mcp55/mcp55_lpc.c
+++ b/src/southbridge/nvidia/mcp55/mcp55_lpc.c
@@ -253,16 +253,6 @@ static void mcp55_lpc_enable_resources(device_t dev)
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 @@ static struct device_operations lpc_ops = {
.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 @@ static struct device_operations lpc_slave_ops = {
.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 = {
diff --git a/src/southbridge/nvidia/mcp55/mcp55_nic.c b/src/southbridge/nvidia/mcp55/mcp55_nic.c
index 4a9b003384..3533e4e25a 100644
--- a/src/southbridge/nvidia/mcp55/mcp55_nic.c
+++ b/src/southbridge/nvidia/mcp55/mcp55_nic.c
@@ -180,16 +180,6 @@ static void nic_init(struct device *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 nic_ops = {
.read_resources = pci_dev_read_resources,
.set_resources = pci_dev_set_resources,
@@ -197,7 +187,7 @@ static struct device_operations nic_ops = {
.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,
diff --git a/src/southbridge/nvidia/mcp55/mcp55_pci.c b/src/southbridge/nvidia/mcp55/mcp55_pci.c
index 02b0124884..510d21d10b 100644
--- a/src/southbridge/nvidia/mcp55/mcp55_pci.c
+++ b/src/southbridge/nvidia/mcp55/mcp55_pci.c
@@ -85,10 +85,6 @@ static void pci_init(struct device *dev)
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 @@ static struct device_operations pci_ops = {
.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 = {
diff --git a/src/southbridge/nvidia/mcp55/mcp55_pcie.c b/src/southbridge/nvidia/mcp55/mcp55_pcie.c
index ecc82ec058..cb60f3143a 100644
--- a/src/southbridge/nvidia/mcp55/mcp55_pcie.c
+++ b/src/southbridge/nvidia/mcp55/mcp55_pcie.c
@@ -42,10 +42,6 @@ static void pcie_init(struct device *dev)
}
-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 @@ static struct device_operations pcie_ops = {
.init = pcie_init,
.scan_bus = pci_scan_bridge,
// .enable = mcp55_enable,
- .ops_pci = &lops_pci,
};
static const struct pci_driver pciebc_driver __pci_driver = {
diff --git a/src/southbridge/nvidia/mcp55/mcp55_sata.c b/src/southbridge/nvidia/mcp55/mcp55_sata.c
index 8df5f6bcbd..eebc61e26f 100644
--- a/src/southbridge/nvidia/mcp55/mcp55_sata.c
+++ b/src/southbridge/nvidia/mcp55/mcp55_sata.c
@@ -69,15 +69,6 @@ static void sata_init(struct device *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 sata_ops = {
.read_resources = pci_dev_read_resources,
.set_resources = pci_dev_set_resources,
@@ -85,7 +76,7 @@ static struct device_operations sata_ops = {
// .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 = {
diff --git a/src/southbridge/nvidia/mcp55/mcp55_smbus.c b/src/southbridge/nvidia/mcp55/mcp55_smbus.c
index 8e049a76a7..47c422f08a 100644
--- a/src/southbridge/nvidia/mcp55/mcp55_smbus.c
+++ b/src/southbridge/nvidia/mcp55/mcp55_smbus.c
@@ -123,15 +123,6 @@ static void mcp55_sm_init(device_t dev)
#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 @@ static struct device_operations smbus_ops = {
.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 = {
diff --git a/src/southbridge/nvidia/mcp55/mcp55_usb.c b/src/southbridge/nvidia/mcp55/mcp55_usb.c
index d64f2b8e52..c005c91743 100644
--- a/src/southbridge/nvidia/mcp55/mcp55_usb.c
+++ b/src/southbridge/nvidia/mcp55/mcp55_usb.c
@@ -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 @@ static struct device_operations usb_ops = {
.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 = {
diff --git a/src/southbridge/nvidia/mcp55/mcp55_usb2.c b/src/southbridge/nvidia/mcp55/mcp55_usb2.c
index 78d6d6d469..cd4fe25f17 100644
--- a/src/southbridge/nvidia/mcp55/mcp55_usb2.c
+++ b/src/southbridge/nvidia/mcp55/mcp55_usb2.c
@@ -62,15 +62,6 @@ static void usb2_set_resources(struct device *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 usb2_ops = {
.read_resources = pci_dev_read_resources,
.set_resources = usb2_set_resources,
@@ -78,7 +69,7 @@ static struct device_operations usb2_ops = {
.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 = {