ramips: add support for A5-V11 board (resubmit)
[openwrt/openwrt.git] / target / linux / brcm2708 / patches-3.10 / 0095-dwc_otg-Don-t-issue-traffic-to-LS-devices-in-FS-mode.patch
1 From 503ed51d257784037165695334e7a3d03d85d674 Mon Sep 17 00:00:00 2001
2 From: P33M <P33M@github.com>
3 Date: Fri, 27 Sep 2013 14:42:24 +0100
4 Subject: [PATCH 095/196] dwc_otg: Don't issue traffic to LS devices in FS mode
5
6 Issuing low-speed packets when the root port is in full-speed mode
7 causes the root port to stop responding. Explicitly fail when
8 enqueuing URBs to a LS endpoint on a FS bus.
9 ---
10 drivers/usb/host/dwc_otg/dwc_otg_hcd.c | 11 +++++++++++
11 1 file changed, 11 insertions(+)
12
13 diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd.c b/drivers/usb/host/dwc_otg/dwc_otg_hcd.c
14 index be1d25b..b3e1944 100644
15 --- a/drivers/usb/host/dwc_otg/dwc_otg_hcd.c
16 +++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd.c
17 @@ -501,6 +501,7 @@ int dwc_otg_hcd_urb_enqueue(dwc_otg_hcd_t * hcd,
18 dwc_otg_transaction_type_e tr_type;
19 dwc_otg_qtd_t *qtd;
20 gintmsk_data_t intr_mask = {.d32 = 0 };
21 + hprt0_data_t hprt0 = { .d32 = 0 };
22
23 #ifdef DEBUG /* integrity checks (Broadcom) */
24 if (NULL == hcd->core_if) {
25 @@ -515,6 +516,16 @@ int dwc_otg_hcd_urb_enqueue(dwc_otg_hcd_t * hcd,
26 return -DWC_E_NO_DEVICE;
27 }
28
29 + /* Some core configurations cannot support LS traffic on a FS root port */
30 + if ((hcd->fops->speed(hcd, dwc_otg_urb->priv) == USB_SPEED_LOW) &&
31 + (hcd->core_if->hwcfg2.b.fs_phy_type == 1) &&
32 + (hcd->core_if->hwcfg2.b.hs_phy_type == 1)) {
33 + hprt0.d32 = DWC_READ_REG32(hcd->core_if->host_if->hprt0);
34 + if (hprt0.b.prtspd == DWC_HPRT0_PRTSPD_FULL_SPEED) {
35 + return -DWC_E_NO_DEVICE;
36 + }
37 + }
38 +
39 qtd = dwc_otg_hcd_qtd_create(dwc_otg_urb, atomic_alloc);
40 if (qtd == NULL) {
41 DWC_ERROR("DWC OTG HCD URB Enqueue failed creating QTD\n");
42 --
43 1.9.1
44