summaryrefslogtreecommitdiff
path: root/src/southbridge/amd/sb700/usb.c
diff options
context:
space:
mode:
authorKyösti Mälkki <kyosti.malkki@gmail.com>2013-06-07 22:16:52 +0300
committerAaron Durbin <adurbin@google.com>2013-07-01 17:10:55 +0200
commitfb387dfb920f73abb144183b8a41dc917e2e32da (patch)
tree27f1947471fc8bae8944b892c16719c0856f3724 /src/southbridge/amd/sb700/usb.c
parent0d8d482f6316885d7e553d9aeb538ce5bbd2fbba (diff)
downloadcoreboot-fb387dfb920f73abb144183b8a41dc917e2e32da.tar.xz
usbdebug: Drop duplicates of EHCI BAR relocation code
All the additional work that needs to be done in EHCI BAR relocation is independent of the hardware platform and was functionally identical in all the copies removed. When USBDEBUG is not selected, PCI EHCI controllers use standard pci_dev_read_resources() call. With USBDEBUG selected, PCI EHCI controller's device_operations .read_resources is replaced with pci_ehci_read_resources() call, which in turn will replace the device_operations .set_resources call. The replacement for .set_resources reconfigures usbdebug driver side, and calls the original .set_resources to configure hardware side. Change-Id: I8e136a5da4efedf60b6dd7068c0488153efaaf8e Signed-off-by: Kyösti Mälkki <kyosti.malkki@gmail.com> Reviewed-on: http://review.coreboot.org/3412 Reviewed-by: Aaron Durbin <adurbin@google.com> Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Diffstat (limited to 'src/southbridge/amd/sb700/usb.c')
-rw-r--r--src/southbridge/amd/sb700/usb.c31
1 files changed, 4 insertions, 27 deletions
diff --git a/src/southbridge/amd/sb700/usb.c b/src/southbridge/amd/sb700/usb.c
index 44f0caab7b..d3a9f3ede7 100644
--- a/src/southbridge/amd/sb700/usb.c
+++ b/src/southbridge/amd/sb700/usb.c
@@ -182,32 +182,9 @@ static void usb_init2(struct device *dev)
printk(BIOS_DEBUG, "rpr 6.23, final dword=%x\n", dword);
}
-static void usb_set_resources(struct device *dev)
-{
-#if CONFIG_USBDEBUG
- struct resource *res;
- u32 base;
- u32 old_debug;
-
- old_debug = get_ehci_debug();
- set_ehci_debug(0);
-#endif
- pci_dev_set_resources(dev);
-
-#if CONFIG_USBDEBUG
- res = find_resource(dev, 0x10);
- set_ehci_debug(old_debug);
- if (!res)
- return;
- base = res->base;
- set_ehci_base(base);
- report_resource_stored(dev, res, "");
-#endif
-}
-
static struct device_operations usb_ops = {
- .read_resources = pci_dev_read_resources,
- .set_resources = usb_set_resources, /* pci_dev_set_resources, */
+ .read_resources = pci_ehci_read_resources,
+ .set_resources = pci_dev_set_resources,
.enable_resources = pci_dev_enable_resources,
.init = usb_init,
.scan_bus = 0,
@@ -247,8 +224,8 @@ static const struct pci_driver usb_4_driver __pci_driver = {
};
static struct device_operations usb_ops2 = {
- .read_resources = pci_dev_read_resources,
- .set_resources = usb_set_resources, /* pci_dev_set_resources, */
+ .read_resources = pci_ehci_read_resources,
+ .set_resources = pci_dev_set_resources,
.enable_resources = pci_dev_enable_resources,
.init = usb_init2,
.scan_bus = 0,