aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/mcs814x/patches-3.14/013-ohci_workarounds.patch
blob: 691e7e412a46a7390b2ef43d9f1e82c283a020dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
--- a/drivers/usb/host/ohci.h
+++ b/drivers/usb/host/ohci.h
@@ -114,7 +114,7 @@ struct td {
 	/* PSW is only for ISO.  Only 1 PSW entry is used, but on
 	 * big-endian PPC hardware that's the second entry.
 	 */
-#define MAXPSW	2
+#define MAXPSW	8
 	__hc16		hwPSW [MAXPSW];
 
 	/* rest are purely for the driver's use */
--- a/drivers/usb/host/ohci-hcd.c
+++ b/drivers/usb/host/ohci-hcd.c
@@ -505,6 +505,7 @@ static int ohci_init (struct ohci_hcd *o
 {
 	int ret;
 	struct usb_hcd *hcd = ohci_to_hcd(ohci);
+	u32 hcca_area;
 
 	if (distrust_firmware)
 		ohci->flags |= OHCI_QUIRK_HUB_POWER;
@@ -558,11 +559,13 @@ static int ohci_init (struct ohci_hcd *o
 	if (ohci->hcca)
 		return 0;
 
-	ohci->hcca = dma_alloc_coherent (hcd->self.controller,
-			sizeof *ohci->hcca, &ohci->hcca_dma, 0);
+	hcca_area = ohci_readl(ohci, &ohci->regs->hcca);
+	ohci->hcca = ioremap_nocache(hcca_area, sizeof *ohci->hcca);
 	if (!ohci->hcca)
 		return -ENOMEM;
 
+	ohci->hcca_dma = hcca_area;
+
 	if ((ret = ohci_mem_init (ohci)) < 0)
 		ohci_stop (hcd);
 	else {
@@ -580,6 +583,7 @@ static int ohci_init (struct ohci_hcd *o
  */
 static int ohci_run (struct ohci_hcd *ohci)
 {
+	int			i = 0;
 	u32			mask, val;
 	int			first = ohci->fminterval == 0;
 	struct usb_hcd		*hcd = ohci_to_hcd(ohci);
@@ -630,6 +634,8 @@ static int ohci_run (struct ohci_hcd *oh
 	msleep(val);
 
 	memset (ohci->hcca, 0, sizeof (struct ohci_hcca));
+	for (i = 0; i < NUM_INTS; i++)
+		ohci->hcca->int_table[i] = 0;
 
 	/* 2msec timelimit here means no irqs/preempt */
 	spin_lock_irq (&ohci->lock);
@@ -943,9 +949,6 @@ static void ohci_stop (struct usb_hcd *h
 	remove_debug_files (ohci);
 	ohci_mem_cleanup (ohci);
 	if (ohci->hcca) {
-		dma_free_coherent (hcd->self.controller,
-				sizeof *ohci->hcca,
-				ohci->hcca, ohci->hcca_dma);
 		ohci->hcca = NULL;
 		ohci->hcca_dma = 0;
 	}