diff options
| author | Greg Kroah-Hartman <gregkh@suse.de> | 2009-07-28 10:41:30 -0700 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-07-28 10:41:30 -0700 |
| commit | 078ab6446f8a0b8391aca88fa85f087f47de2183 (patch) | |
| tree | 250162e882b62b0e55e8f6e9bebacc83490f2b81 /usb | |
| parent | 3b615c5608e249ca355898353a0d7b06236827b3 (diff) | |
| download | patches-078ab6446f8a0b8391aca88fa85f087f47de2183.tar.gz | |
more patches
Diffstat (limited to 'usb')
4 files changed, 388 insertions, 0 deletions
diff --git a/usb/usb-at91-add-usb-ehci-driver-for-at91sam9g45-series.patch b/usb/usb-at91-add-usb-ehci-driver-for-at91sam9g45-series.patch new file mode 100644 index 00000000000000..f1dc844f75124e --- /dev/null +++ b/usb/usb-at91-add-usb-ehci-driver-for-at91sam9g45-series.patch @@ -0,0 +1,282 @@ +From david-b@pacbell.net Tue Jul 28 10:33:04 2009 +From: Nicolas Ferre <nicolas.ferre@atmel.com> +Date: Mon, 27 Jul 2009 14:47:40 -0700 +Subject: USB: at91: Add USB EHCI driver for at91sam9g45 series +To: Greg KH <greg@kroah.com> +Cc: Nicolas Ferre <nicolas.ferre@rfo.atmel.com>, patrice.vilchez@atmel.com, Haavard Skinnemoen <hskinnemoen@atmel.com> +Message-ID: <200907271447.40995.david-b@pacbell.net> + + +From: Nicolas Ferre <nicolas.ferre@atmel.com> + +Add host USB High speed driver for at91sam9g45 series. +The host driver is an EHCI with its companion OHCI. EHCI is +handled by the new ehci-atmel.c whereas the OHCI is always +handled by ohci-at91.c. + +Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com> +Acked-by: David Brownell <dbrownell@users.sourceforge.net> + +--- + drivers/usb/Kconfig | 1 + drivers/usb/host/ehci-atmel.c | 230 ++++++++++++++++++++++++++++++++++++++++++ + drivers/usb/host/ehci-hcd.c | 5 + 3 files changed, 236 insertions(+) + +--- /dev/null ++++ b/drivers/usb/host/ehci-atmel.c +@@ -0,0 +1,230 @@ ++/* ++ * Driver for EHCI UHP on Atmel chips ++ * ++ * Copyright (C) 2009 Atmel Corporation, ++ * Nicolas Ferre <nicolas.ferre@atmel.com> ++ * ++ * Based on various ehci-*.c drivers ++ * ++ * This file is subject to the terms and conditions of the GNU General Public ++ * License. See the file COPYING in the main directory of this archive for ++ * more details. ++ */ ++ ++#include <linux/clk.h> ++#include <linux/platform_device.h> ++ ++/* interface and function clocks */ ++static struct clk *iclk, *fclk; ++static int clocked; ++ ++/*-------------------------------------------------------------------------*/ ++ ++static void atmel_start_clock(void) ++{ ++ clk_enable(iclk); ++ clk_enable(fclk); ++ clocked = 1; ++} ++ ++static void atmel_stop_clock(void) ++{ ++ clk_disable(fclk); ++ clk_disable(iclk); ++ clocked = 0; ++} ++ ++static void atmel_start_ehci(struct platform_device *pdev) ++{ ++ dev_dbg(&pdev->dev, "start\n"); ++ atmel_start_clock(); ++} ++ ++static void atmel_stop_ehci(struct platform_device *pdev) ++{ ++ dev_dbg(&pdev->dev, "stop\n"); ++ atmel_stop_clock(); ++} ++ ++/*-------------------------------------------------------------------------*/ ++ ++static int ehci_atmel_setup(struct usb_hcd *hcd) ++{ ++ struct ehci_hcd *ehci = hcd_to_ehci(hcd); ++ int retval = 0; ++ ++ /* registers start at offset 0x0 */ ++ ehci->caps = hcd->regs; ++ ehci->regs = hcd->regs + ++ HC_LENGTH(ehci_readl(ehci, &ehci->caps->hc_capbase)); ++ dbg_hcs_params(ehci, "reset"); ++ dbg_hcc_params(ehci, "reset"); ++ ++ /* cache this readonly data; minimize chip reads */ ++ ehci->hcs_params = ehci_readl(ehci, &ehci->caps->hcs_params); ++ ++ retval = ehci_halt(ehci); ++ if (retval) ++ return retval; ++ ++ /* data structure init */ ++ retval = ehci_init(hcd); ++ if (retval) ++ return retval; ++ ++ ehci->sbrn = 0x20; ++ ++ ehci_reset(ehci); ++ ehci_port_power(ehci, 0); ++ ++ return retval; ++} ++ ++static const struct hc_driver ehci_atmel_hc_driver = { ++ .description = hcd_name, ++ .product_desc = "Atmel EHCI UHP HS", ++ .hcd_priv_size = sizeof(struct ehci_hcd), ++ ++ /* generic hardware linkage */ ++ .irq = ehci_irq, ++ .flags = HCD_MEMORY | HCD_USB2, ++ ++ /* basic lifecycle operations */ ++ .reset = ehci_atmel_setup, ++ .start = ehci_run, ++ .stop = ehci_stop, ++ .shutdown = ehci_shutdown, ++ ++ /* managing i/o requests and associated device resources */ ++ .urb_enqueue = ehci_urb_enqueue, ++ .urb_dequeue = ehci_urb_dequeue, ++ .endpoint_disable = ehci_endpoint_disable, ++ ++ /* scheduling support */ ++ .get_frame_number = ehci_get_frame, ++ ++ /* root hub support */ ++ .hub_status_data = ehci_hub_status_data, ++ .hub_control = ehci_hub_control, ++ .bus_suspend = ehci_bus_suspend, ++ .bus_resume = ehci_bus_resume, ++ .relinquish_port = ehci_relinquish_port, ++ .port_handed_over = ehci_port_handed_over, ++}; ++ ++static int __init ehci_atmel_drv_probe(struct platform_device *pdev) ++{ ++ struct usb_hcd *hcd; ++ const struct hc_driver *driver = &ehci_atmel_hc_driver; ++ struct resource *res; ++ int irq; ++ int retval; ++ ++ if (usb_disabled()) ++ return -ENODEV; ++ ++ pr_debug("Initializing Atmel-SoC USB Host Controller\n"); ++ ++ irq = platform_get_irq(pdev, 0); ++ if (irq <= 0) { ++ dev_err(&pdev->dev, ++ "Found HC with no IRQ. Check %s setup!\n", ++ dev_name(&pdev->dev)); ++ retval = -ENODEV; ++ goto fail_create_hcd; ++ } ++ ++ hcd = usb_create_hcd(driver, &pdev->dev, dev_name(&pdev->dev)); ++ if (!hcd) { ++ retval = -ENOMEM; ++ goto fail_create_hcd; ++ } ++ ++ res = platform_get_resource(pdev, IORESOURCE_MEM, 0); ++ if (!res) { ++ dev_err(&pdev->dev, ++ "Found HC with no register addr. Check %s setup!\n", ++ dev_name(&pdev->dev)); ++ retval = -ENODEV; ++ goto fail_request_resource; ++ } ++ hcd->rsrc_start = res->start; ++ hcd->rsrc_len = res->end - res->start + 1; ++ ++ if (!request_mem_region(hcd->rsrc_start, hcd->rsrc_len, ++ driver->description)) { ++ dev_dbg(&pdev->dev, "controller already in use\n"); ++ retval = -EBUSY; ++ goto fail_request_resource; ++ } ++ ++ hcd->regs = ioremap_nocache(hcd->rsrc_start, hcd->rsrc_len); ++ if (hcd->regs == NULL) { ++ dev_dbg(&pdev->dev, "error mapping memory\n"); ++ retval = -EFAULT; ++ goto fail_ioremap; ++ } ++ ++ iclk = clk_get(&pdev->dev, "ehci_clk"); ++ if (IS_ERR(iclk)) { ++ dev_err(&pdev->dev, "Error getting interface clock\n"); ++ retval = -ENOENT; ++ goto fail_get_iclk; ++ } ++ fclk = clk_get(&pdev->dev, "uhpck"); ++ if (IS_ERR(fclk)) { ++ dev_err(&pdev->dev, "Error getting function clock\n"); ++ retval = -ENOENT; ++ goto fail_get_fclk; ++ } ++ ++ atmel_start_ehci(pdev); ++ ++ retval = usb_add_hcd(hcd, irq, IRQF_SHARED); ++ if (retval) ++ goto fail_add_hcd; ++ ++ return retval; ++ ++fail_add_hcd: ++ atmel_stop_ehci(pdev); ++ clk_put(fclk); ++fail_get_fclk: ++ clk_put(iclk); ++fail_get_iclk: ++ iounmap(hcd->regs); ++fail_ioremap: ++ release_mem_region(hcd->rsrc_start, hcd->rsrc_len); ++fail_request_resource: ++ usb_put_hcd(hcd); ++fail_create_hcd: ++ dev_err(&pdev->dev, "init %s fail, %d\n", ++ dev_name(&pdev->dev), retval); ++ ++ return retval; ++} ++ ++static int __exit ehci_atmel_drv_remove(struct platform_device *pdev) ++{ ++ struct usb_hcd *hcd = platform_get_drvdata(pdev); ++ ++ ehci_shutdown(hcd); ++ usb_remove_hcd(hcd); ++ iounmap(hcd->regs); ++ release_mem_region(hcd->rsrc_start, hcd->rsrc_len); ++ usb_put_hcd(hcd); ++ ++ atmel_stop_ehci(pdev); ++ clk_put(fclk); ++ clk_put(iclk); ++ fclk = iclk = NULL; ++ ++ return 0; ++} ++ ++static struct platform_driver ehci_atmel_driver = { ++ .probe = ehci_atmel_drv_probe, ++ .remove = __exit_p(ehci_atmel_drv_remove), ++ .shutdown = usb_hcd_platform_shutdown, ++ .driver.name = "atmel-ehci", ++}; +--- a/drivers/usb/host/ehci-hcd.c ++++ b/drivers/usb/host/ehci-hcd.c +@@ -1135,6 +1135,11 @@ MODULE_LICENSE ("GPL"); + #define PLATFORM_DRIVER ehci_hcd_w90x900_driver + #endif + ++#ifdef CONFIG_ARCH_AT91 ++#include "ehci-atmel.c" ++#define PLATFORM_DRIVER ehci_atmel_driver ++#endif ++ + #if !defined(PCI_DRIVER) && !defined(PLATFORM_DRIVER) && \ + !defined(PS3_SYSTEM_BUS_DRIVER) && !defined(OF_PLATFORM_DRIVER) + #error "missing bus glue for ehci-hcd" +--- a/drivers/usb/Kconfig ++++ b/drivers/usb/Kconfig +@@ -60,6 +60,7 @@ config USB_ARCH_HAS_EHCI + default y if SOC_AU1200 + default y if ARCH_IXP4XX + default y if ARCH_W90X900 ++ default y if ARCH_AT91SAM9G45 + default PCI + + # ARM SA1111 chips have a non-PCI based "OHCI-compatible" USB host interface. diff --git a/usb/usb-at91-add-usb-gadget-driver-selection-for-at91sam9g45-series.patch b/usb/usb-at91-add-usb-gadget-driver-selection-for-at91sam9g45-series.patch new file mode 100644 index 00000000000000..cc58655d67ba60 --- /dev/null +++ b/usb/usb-at91-add-usb-gadget-driver-selection-for-at91sam9g45-series.patch @@ -0,0 +1,43 @@ +From david-b@pacbell.net Tue Jul 28 10:34:24 2009 +From: Nicolas Ferre <nicolas.ferre@atmel.com> +Date: Mon, 27 Jul 2009 15:00:35 -0700 +Subject: USB: at91: Add USB gadget driver selection for at91sam9g45 series +To: Greg KH <greg@kroah.com> +Cc: Nicolas Ferre <nicolas.ferre@rfo.atmel.com> +Message-ID: <200907271500.35221.david-b@pacbell.net> + +From: Nicolas Ferre <nicolas.ferre@atmel.com> + +Add gadget USB drivers for at91sam9g45 series. Those SOC include +high speed USB interfaces. +The gadget driver is the already available atmel_usba_udc. + +Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com> +Acked-by: David Brownell <dbrownell@users.sourceforge.net> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + + +--- + drivers/usb/gadget/Kconfig | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/usb/gadget/Kconfig ++++ b/drivers/usb/gadget/Kconfig +@@ -124,7 +124,7 @@ choice + + config USB_GADGET_AT91 + boolean "Atmel AT91 USB Device Port" +- depends on ARCH_AT91 && !ARCH_AT91SAM9RL && !ARCH_AT91CAP9 ++ depends on ARCH_AT91 && !ARCH_AT91SAM9RL && !ARCH_AT91CAP9 && !ARCH_AT91SAM9G45 + select USB_GADGET_SELECTED + help + Many Atmel AT91 processors (such as the AT91RM2000) have a +@@ -143,7 +143,7 @@ config USB_AT91 + config USB_GADGET_ATMEL_USBA + boolean "Atmel USBA" + select USB_GADGET_DUALSPEED +- depends on AVR32 || ARCH_AT91CAP9 || ARCH_AT91SAM9RL ++ depends on AVR32 || ARCH_AT91CAP9 || ARCH_AT91SAM9RL || ARCH_AT91SAM9G45 + help + USBA is the integrated high-speed USB Device controller on + the AT32AP700x, some AT91SAM9 and AT91CAP9 processors from Atmel. diff --git a/usb/usb-at91-modify-ohci-driver-to-allow-shared-interrupts.patch b/usb/usb-at91-modify-ohci-driver-to-allow-shared-interrupts.patch new file mode 100644 index 00000000000000..73de36b8db1e0a --- /dev/null +++ b/usb/usb-at91-modify-ohci-driver-to-allow-shared-interrupts.patch @@ -0,0 +1,37 @@ +From david-b@pacbell.net Tue Jul 28 10:34:49 2009 +From: Nicolas Ferre <nicolas.ferre@atmel.com> +Date: Mon, 27 Jul 2009 14:59:24 -0700 +Subject: USB: at91: modify OHCI driver to allow shared interrupts +To: Greg KH <greg@kroah.com> +Cc: Nicolas Ferre <nicolas.ferre@rfo.atmel.com> +Message-ID: <200907271459.24520.david-b@pacbell.net> +Content-Disposition: inline + + +From: Nicolas Ferre <nicolas.ferre@atmel.com> + +At91sam9g45 series has a set of high speed USB interfaces. +The host driver is an EHCI with its companion OHCI. OHCI is +always handled by ohci-at91.c. +This wrapper is just modified to allow IRQ sharing +between two controllers. + +Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com> +Acked-by: David Brownell <dbrownell@users.sourceforge.net> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/host/ohci-at91.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/usb/host/ohci-at91.c ++++ b/drivers/usb/host/ohci-at91.c +@@ -148,7 +148,7 @@ static int usb_hcd_at91_probe(const stru + at91_start_hc(pdev); + ohci_hcd_init(hcd_to_ohci(hcd)); + +- retval = usb_add_hcd(hcd, pdev->resource[1].start, IRQF_DISABLED); ++ retval = usb_add_hcd(hcd, pdev->resource[1].start, IRQF_SHARED); + if (retval == 0) + return retval; + diff --git a/usb/usb-uhci-rm-repeatedly-evaluation-for-urbp-qh.patch b/usb/usb-uhci-rm-repeatedly-evaluation-for-urbp-qh.patch new file mode 100644 index 00000000000000..bb5b3316b91623 --- /dev/null +++ b/usb/usb-uhci-rm-repeatedly-evaluation-for-urbp-qh.patch @@ -0,0 +1,26 @@ +From yjfpb04@gmail.com Tue Jul 28 10:08:23 2009 +From: Bob Liu <yjfpb04@gmail.com> +Date: Tue, 28 Jul 2009 22:31:06 +0800 +Subject: USB: uhci: rm repeatedly evaluation for urbp->qh +To: linux-usb@vger.kernel.org +Cc: Bob Liu <bo-liu@hotmail.com> +Message-ID: <1248791466-16279-1-git-send-email-bo-liu@hotmail.com> + +Signed-off-by: Bob Liu <yjfpb04@gmail.com> +Acked-by: Alan Stern <stern@rowland.harvard.edu> +Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> + +--- + drivers/usb/host/uhci-q.c | 1 - + 1 file changed, 1 deletion(-) + +--- a/drivers/usb/host/uhci-q.c ++++ b/drivers/usb/host/uhci-q.c +@@ -1422,7 +1422,6 @@ static int uhci_urb_enqueue(struct usb_h + goto err_submit_failed; + + /* Add this URB to the QH */ +- urbp->qh = qh; + list_add_tail(&urbp->node, &qh->queue); + + /* If the new URB is the first and only one on this QH then either |
