summaryrefslogtreecommitdiff
path: root/src/southbridge/ricoh/rl5c476
diff options
context:
space:
mode:
authorSven Schnelle <svens@stackframe.org>2011-02-28 18:09:58 +0000
committerSven Schnelle <svens@stackframe.org>2011-02-28 18:09:58 +0000
commitd175f44139d07d07db3595658d02adcd3e4090c4 (patch)
tree951c050550122b6806faabd88028d61ba426d9a6 /src/southbridge/ricoh/rl5c476
parentb6711723208e35451f1f65910a50e8c2a3f6eb3b (diff)
downloadcoreboot-d175f44139d07d07db3595658d02adcd3e4090c4.tar.xz
add functions to set Subsystem Vendor/Device to rl5c746
Signed-off-by: Sven Schnelle <svens@stackframe.org> Acked-by: Peter Stuge <peter@stuge.se> git-svn-id: svn://svn.coreboot.org/coreboot/trunk@6412 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'src/southbridge/ricoh/rl5c476')
-rw-r--r--src/southbridge/ricoh/rl5c476/rl5c476.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/southbridge/ricoh/rl5c476/rl5c476.c b/src/southbridge/ricoh/rl5c476/rl5c476.c
index 0c8916b742..0efcafa36c 100644
--- a/src/southbridge/ricoh/rl5c476/rl5c476.c
+++ b/src/southbridge/ricoh/rl5c476/rl5c476.c
@@ -198,12 +198,29 @@ static void rl5c476_set_resources(device_t dev)
}
+static void rl5c476_set_subsystem(device_t dev, unsigned vendor, unsigned device)
+{
+ u16 miscreg = pci_read_config16(dev, 0x82);
+ /* Enable subsystem id register writes */
+ pci_write_config16(dev, 0x82, miscreg | 0x40);
+
+ pci_write_config16(dev, 0x40, vendor);
+ pci_write_config16(dev, 0x42, device);
+ /* restore original contents */
+ pci_write_config16(dev, 0x82, miscreg);
+}
+
+static struct pci_operations rl5c476_pci_ops = {
+ .set_subsystem = rl5c476_set_subsystem,
+};
+
static struct device_operations ricoh_rl5c476_ops = {
.read_resources = rl5c476_read_resources,
.set_resources = rl5c476_set_resources,
.enable_resources = cardbus_enable_resources,
.init = rl5c476_init,
.scan_bus = pci_scan_bridge,
+ .ops_pci = &rl5c476_pci_ops,
};
static const struct pci_driver ricoh_rl5c476_driver __pci_driver = {