summaryrefslogtreecommitdiff
path: root/src/southbridge/via/vt8237r
diff options
context:
space:
mode:
authorRudolf Marek <r.marek@assembler.cz>2011-04-22 20:48:21 +0200
committerStefan Reinauer <stefan.reinauer@coreboot.org>2012-01-18 23:01:36 +0100
commit0f1dc4eb5bb9941bdb8ff833ec745e1cfeaa9d28 (patch)
tree69242236ba5e229fc8222e328611fbe964bdaddf /src/southbridge/via/vt8237r
parentde64b8b6dbd7059d9e31ede0892ee2a5d6d45e33 (diff)
downloadcoreboot-0f1dc4eb5bb9941bdb8ff833ec745e1cfeaa9d28.tar.xz
Add subsystem callbacks for VT8237x and VT890 family of chipsets
Change-Id: Id34615f0c229d276d72cdf984cf82ea8cc1a85bb Signed-off-by: Rudolf Marek <r.marek@assembler.cz> Signed-off-by: Patrick Georgi <patrick@georgi-clan.de> Reviewed-on: http://review.coreboot.org/523 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Diffstat (limited to 'src/southbridge/via/vt8237r')
-rw-r--r--src/southbridge/via/vt8237r/lpc.c14
-rw-r--r--src/southbridge/via/vt8237r/sata.c15
-rw-r--r--src/southbridge/via/vt8237r/usb.c16
3 files changed, 41 insertions, 4 deletions
diff --git a/src/southbridge/via/vt8237r/lpc.c b/src/southbridge/via/vt8237r/lpc.c
index cd1064fade..d57d471e45 100644
--- a/src/southbridge/via/vt8237r/lpc.c
+++ b/src/southbridge/via/vt8237r/lpc.c
@@ -639,12 +639,24 @@ static void southbridge_init_common(struct device *dev)
init_keyboard(dev);
}
+
+static void vt8237_set_subsystem(device_t dev, unsigned vendor, unsigned device)
+{
+ pci_write_config16(dev, 0x70, vendor);
+ pci_write_config16(dev, 0x72, device);
+}
+
+static struct pci_operations lops_pci = {
+ .set_subsystem = vt8237_set_subsystem,
+};
+
static const struct device_operations vt8237r_lpc_ops_s = {
.read_resources = vt8237r_read_resources,
.set_resources = pci_dev_set_resources,
.enable_resources = pci_dev_enable_resources,
.init = vt8237s_init,
.scan_bus = scan_static_bus,
+ .ops_pci = &lops_pci,
};
static const struct device_operations vt8237r_lpc_ops_r = {
@@ -653,6 +665,7 @@ static const struct device_operations vt8237r_lpc_ops_r = {
.enable_resources = pci_dev_enable_resources,
.init = vt8237r_init,
.scan_bus = scan_static_bus,
+ .ops_pci = &lops_pci,
};
static const struct device_operations vt8237r_lpc_ops_a = {
@@ -661,6 +674,7 @@ static const struct device_operations vt8237r_lpc_ops_a = {
.enable_resources = pci_dev_enable_resources,
.init = vt8237a_init,
.scan_bus = scan_static_bus,
+ .ops_pci = &lops_pci,
};
static const struct pci_driver lpc_driver_r __pci_driver = {
diff --git a/src/southbridge/via/vt8237r/sata.c b/src/southbridge/via/vt8237r/sata.c
index 777d605a6b..2f07e692fb 100644
--- a/src/southbridge/via/vt8237r/sata.c
+++ b/src/southbridge/via/vt8237r/sata.c
@@ -95,13 +95,24 @@ static void sata_ii_init(struct device *dev)
}
}
+
+static void vt8237_set_subsystem(device_t dev, unsigned vendor, unsigned device)
+{
+ pci_write_config16(dev, 0xd4, vendor);
+ pci_write_config16(dev, 0xd6, device);
+}
+
+static struct pci_operations lops_pci = {
+ .set_subsystem = vt8237_set_subsystem,
+};
+
static const struct device_operations sata_i_ops = {
.read_resources = pci_dev_read_resources,
.set_resources = pci_dev_set_resources,
.enable_resources = pci_dev_enable_resources,
.init = sata_i_init,
.enable = 0,
- .ops_pci = 0,
+ .ops_pci = &lops_pci,
};
static const struct device_operations sata_ii_ops = {
@@ -110,7 +121,7 @@ static const struct device_operations sata_ii_ops = {
.enable_resources = pci_dev_enable_resources,
.init = sata_ii_init,
.enable = 0,
- .ops_pci = 0,
+ .ops_pci = &lops_pci,
};
static const struct pci_driver northbridge_driver_ii __pci_driver = {
diff --git a/src/southbridge/via/vt8237r/usb.c b/src/southbridge/via/vt8237r/usb.c
index 2bdcf9d4ba..ac27f4399c 100644
--- a/src/southbridge/via/vt8237r/usb.c
+++ b/src/southbridge/via/vt8237r/usb.c
@@ -158,13 +158,25 @@ static void vt8237_usb_ii_read_resources(struct device *dev)
return;
}
+static void vt8237_set_subsystem(device_t dev, unsigned vendor, unsigned device)
+{
+ pci_write_config32(dev, 0x42, pci_read_config32(dev, 0x42) | 0x10);
+ pci_write_config16(dev, 0x2c, vendor);
+ pci_write_config16(dev, 0x2e, device);
+ pci_write_config32(dev, 0x42, pci_read_config32(dev, 0x42) & ~0x10);
+}
+
+static struct pci_operations lops_pci = {
+ .set_subsystem = vt8237_set_subsystem,
+};
+
static const struct device_operations usb_i_ops = {
.read_resources = vt8237_usb_i_read_resources,
.set_resources = pci_dev_set_resources,
.enable_resources = pci_dev_enable_resources,
.init = usb_i_init,
.enable = 0,
- .ops_pci = 0,
+ .ops_pci = &lops_pci,
};
static const struct device_operations usb_ii_ops = {
@@ -173,7 +185,7 @@ static const struct device_operations usb_ii_ops = {
.enable_resources = pci_dev_enable_resources,
.init = usb_ii_init,
.enable = 0,
- .ops_pci = 0,
+ .ops_pci = &lops_pci,
};
static const struct pci_driver vt8237r_driver_usbii __pci_driver = {