From fb387dfb920f73abb144183b8a41dc917e2e32da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ky=C3=B6sti=20M=C3=A4lkki?= Date: Fri, 7 Jun 2013 22:16:52 +0300 Subject: usbdebug: Drop duplicates of EHCI BAR relocation code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Reviewed-on: http://review.coreboot.org/3412 Reviewed-by: Aaron Durbin Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel --- src/southbridge/intel/i82801ix/usb_ehci.c | 27 ++------------------------- 1 file changed, 2 insertions(+), 25 deletions(-) (limited to 'src/southbridge/intel/i82801ix') diff --git a/src/southbridge/intel/i82801ix/usb_ehci.c b/src/southbridge/intel/i82801ix/usb_ehci.c index 7f911746a1..b6c0eddf7d 100644 --- a/src/southbridge/intel/i82801ix/usb_ehci.c +++ b/src/southbridge/intel/i82801ix/usb_ehci.c @@ -58,29 +58,6 @@ static void usb_ehci_set_subsystem(device_t dev, unsigned vendor, unsigned devic pci_write_config8(dev, 0x80, access_cntl); } -static void usb_ehci_set_resources(struct device *dev) -{ -#if CONFIG_USBDEBUG - struct resource *res; - u32 base; - u32 usb_debug; - - usb_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(usb_debug); - if (!res) return; - base = res->base; - set_ehci_base(base); - report_resource_stored(dev, res, ""); -#endif -} - - static const unsigned short pci_device_ids[] = { 0x293a, 0x293c, @@ -92,8 +69,8 @@ static struct pci_operations lops_pci = { }; static struct device_operations usb_ehci_ops = { - .read_resources = pci_dev_read_resources, - .set_resources = usb_ehci_set_resources, + .read_resources = pci_ehci_read_resources, + .set_resources = pci_dev_set_resources, .enable_resources = pci_dev_enable_resources, .init = usb_ehci_init, .scan_bus = 0, -- cgit v1.2.3