aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/brcm63xx/patches-3.10/206-USB-EHCI-allow-limiting-ports-for-ehci-platform.patch
diff options
context:
space:
mode:
authorJonas Gorski <jogo@openwrt.org>2014-01-19 13:46:14 +0000
committerJonas Gorski <jogo@openwrt.org>2014-01-19 13:46:14 +0000
commit0a591288e2848c7af3730c5a976a9b1669a0cbd7 (patch)
tree935343f31de70908ebf673193a9b28119f17b358 /target/linux/brcm63xx/patches-3.10/206-USB-EHCI-allow-limiting-ports-for-ehci-platform.patch
parent97174e266fee6435c065f227804c8d5bf2fc0ead (diff)
downloadmaster-187ad058-0a591288e2848c7af3730c5a976a9b1669a0cbd7.tar.gz
master-187ad058-0a591288e2848c7af3730c5a976a9b1669a0cbd7.tar.bz2
master-187ad058-0a591288e2848c7af3730c5a976a9b1669a0cbd7.zip
brcm63xx: allow setting the number of usb host ports for boards
Allow setting the number of available usb host ports for boards with additional sanity checks to allow using the second port on devices where it is available. Signed-off-by: Jonas Gorski <jogo@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@39324 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/brcm63xx/patches-3.10/206-USB-EHCI-allow-limiting-ports-for-ehci-platform.patch')
-rw-r--r--target/linux/brcm63xx/patches-3.10/206-USB-EHCI-allow-limiting-ports-for-ehci-platform.patch65
1 files changed, 65 insertions, 0 deletions
diff --git a/target/linux/brcm63xx/patches-3.10/206-USB-EHCI-allow-limiting-ports-for-ehci-platform.patch b/target/linux/brcm63xx/patches-3.10/206-USB-EHCI-allow-limiting-ports-for-ehci-platform.patch
new file mode 100644
index 0000000000..b6e44a7078
--- /dev/null
+++ b/target/linux/brcm63xx/patches-3.10/206-USB-EHCI-allow-limiting-ports-for-ehci-platform.patch
@@ -0,0 +1,65 @@
+From 6ac09efa8f0e189ffe7dd7b0889289de56ee44cc Mon Sep 17 00:00:00 2001
+From: Jonas Gorski <jogo@openwrt.org>
+Date: Sun, 19 Jan 2014 12:18:03 +0100
+Subject: [PATCH] USB: EHCI: allow limiting ports for ehci-platform
+
+In the same way as the ohci platform driver allows limiting ports,
+enable the same for ehci. This prevents a mismatch in the available
+ports between ehci/ohci on USB 2.0 controllers.
+
+This is needed if the USB host controller always reports the maximum
+number of ports regardless of the number of available ports (because
+one might be set to be usb device).
+
+Signed-off-by: Jonas Gorski <jogo@openwrt.org>
+---
+ drivers/usb/host/ehci-hcd.c | 4 ++++
+ drivers/usb/host/ehci-platform.c | 2 ++
+ drivers/usb/host/ehci.h | 1 +
+ include/linux/usb/ehci_pdriver.h | 1 +
+ 4 files changed, 8 insertions(+)
+
+--- a/drivers/usb/host/ehci-hcd.c
++++ b/drivers/usb/host/ehci-hcd.c
+@@ -661,6 +661,10 @@ int ehci_setup(struct usb_hcd *hcd)
+
+ /* cache this readonly data; minimize chip reads */
+ ehci->hcs_params = ehci_readl(ehci, &ehci->caps->hcs_params);
++ if (ehci->num_ports) {
++ ehci->hcs_params &= ~0xf; /* bits 3:0, ports on HC */
++ ehci->hcs_params |= ehci->num_ports;
++ }
+
+ ehci->sbrn = HCD_USB2;
+
+--- a/drivers/usb/host/ehci-platform.c
++++ b/drivers/usb/host/ehci-platform.c
+@@ -48,6 +48,8 @@ static int ehci_platform_reset(struct us
+ ehci->big_endian_desc = pdata->big_endian_desc;
+ ehci->big_endian_mmio = pdata->big_endian_mmio;
+ ehci->ignore_oc = pdata->ignore_oc;
++ if (pdata->num_ports && pdata->num_ports <= 15)
++ ehci->num_ports = pdata->num_ports;
+
+ ehci->caps = hcd->regs + pdata->caps_offset;
+ retval = ehci_setup(hcd);
+--- a/drivers/usb/host/ehci.h
++++ b/drivers/usb/host/ehci.h
+@@ -188,6 +188,7 @@ struct ehci_hcd { /* one per controlle
+ u32 command;
+
+ /* SILICON QUIRKS */
++ unsigned int num_ports;
+ unsigned no_selective_suspend:1;
+ unsigned has_fsl_port_bug:1; /* FreeScale */
+ unsigned big_endian_mmio:1;
+--- a/include/linux/usb/ehci_pdriver.h
++++ b/include/linux/usb/ehci_pdriver.h
+@@ -37,6 +37,7 @@
+ */
+ struct usb_ehci_pdata {
+ int caps_offset;
++ unsigned int num_ports;
+ unsigned has_tt:1;
+ unsigned has_synopsys_hc_bug:1;
+ unsigned big_endian_desc:1;