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
This commit is contained in:
Jonathan Kollasch 2010-10-29 20:40:06 +00:00 committed by Jonathan A. Kollasch
parent c7f3f80cf0
commit dca8b1b599
12 changed files with 20 additions and 93 deletions

View File

@ -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,

View File

@ -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

View File

@ -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 = {

View File

@ -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 = {

View File

@ -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 = {

View File

@ -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,

View File

@ -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 = {

View File

@ -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 = {

View File

@ -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 = {

View File

@ -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 = {

View File

@ -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 = {

View File

@ -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 = {