8697f033865e8b6e7560885a5a6066d8b68acd24
[openwrt/staging/wigyori.git] / target / linux / mcs814x / patches-3.18 / 013-ohci_workarounds.patch
1 --- a/drivers/usb/host/ohci.h
2 +++ b/drivers/usb/host/ohci.h
3 @@ -122,7 +122,7 @@ struct td {
4 /* PSW is only for ISO. Only 1 PSW entry is used, but on
5 * big-endian PPC hardware that's the second entry.
6 */
7 -#define MAXPSW 2
8 +#define MAXPSW 8
9 __hc16 hwPSW [MAXPSW];
10
11 /* rest are purely for the driver's use */
12 --- a/drivers/usb/host/ohci-hcd.c
13 +++ b/drivers/usb/host/ohci-hcd.c
14 @@ -441,6 +441,7 @@ static int ohci_init (struct ohci_hcd *o
15 {
16 int ret;
17 struct usb_hcd *hcd = ohci_to_hcd(ohci);
18 + u32 hcca_area;
19
20 /* Accept arbitrarily long scatter-gather lists */
21 hcd->self.sg_tablesize = ~0;
22 @@ -501,11 +502,13 @@ static int ohci_init (struct ohci_hcd *o
23 (unsigned long) ohci);
24 set_timer_slack(&ohci->io_watchdog, msecs_to_jiffies(20));
25
26 - ohci->hcca = dma_alloc_coherent (hcd->self.controller,
27 - sizeof(*ohci->hcca), &ohci->hcca_dma, GFP_KERNEL);
28 + hcca_area = ohci_readl(ohci, &ohci->regs->hcca);
29 + ohci->hcca = ioremap_nocache(hcca_area, sizeof *ohci->hcca);
30 if (!ohci->hcca)
31 return -ENOMEM;
32
33 + ohci->hcca_dma = hcca_area;
34 +
35 if ((ret = ohci_mem_init (ohci)) < 0)
36 ohci_stop (hcd);
37 else {
38 @@ -523,6 +526,7 @@ static int ohci_init (struct ohci_hcd *o
39 */
40 static int ohci_run (struct ohci_hcd *ohci)
41 {
42 + int i = 0;
43 u32 mask, val;
44 int first = ohci->fminterval == 0;
45 struct usb_hcd *hcd = ohci_to_hcd(ohci);
46 @@ -573,6 +577,8 @@ static int ohci_run (struct ohci_hcd *oh
47 msleep(val);
48
49 memset (ohci->hcca, 0, sizeof (struct ohci_hcca));
50 + for (i = 0; i < NUM_INTS; i++)
51 + ohci->hcca->int_table[i] = 0;
52
53 /* 2msec timelimit here means no irqs/preempt */
54 spin_lock_irq (&ohci->lock);
55 @@ -984,9 +990,6 @@ static void ohci_stop (struct usb_hcd *h
56 remove_debug_files (ohci);
57 ohci_mem_cleanup (ohci);
58 if (ohci->hcca) {
59 - dma_free_coherent (hcd->self.controller,
60 - sizeof *ohci->hcca,
61 - ohci->hcca, ohci->hcca_dma);
62 ohci->hcca = NULL;
63 ohci->hcca_dma = 0;
64 }