diff options
author | Florian Fainelli <florian@openwrt.org> | 2012-09-05 20:19:29 +0000 |
---|---|---|
committer | Florian Fainelli <florian@openwrt.org> | 2012-09-05 20:19:29 +0000 |
commit | de8a1fe7015e3aa793bb36a4a83152c2099927fd (patch) | |
tree | 5a0f4aea9d74d030bb8f72076566d00066527c75 /target/linux/mcs814x/patches-3.3 | |
parent | d4ae3a4ae2b7641cc61ae6c8a019cc63601e852f (diff) | |
download | upstream-de8a1fe7015e3aa793bb36a4a83152c2099927fd.tar.gz upstream-de8a1fe7015e3aa793bb36a4a83152c2099927fd.tar.bz2 upstream-de8a1fe7015e3aa793bb36a4a83152c2099927fd.zip |
[mcs814x] add some ohci workarounds to make ohci work
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@33323 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'target/linux/mcs814x/patches-3.3')
-rw-r--r-- | target/linux/mcs814x/patches-3.3/013-ohci_workarounds.patch | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/target/linux/mcs814x/patches-3.3/013-ohci_workarounds.patch b/target/linux/mcs814x/patches-3.3/013-ohci_workarounds.patch new file mode 100644 index 0000000000..9b905a7529 --- /dev/null +++ b/target/linux/mcs814x/patches-3.3/013-ohci_workarounds.patch @@ -0,0 +1,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 +@@ -497,6 +497,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; +@@ -550,11 +551,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 { +@@ -572,6 +575,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); +@@ -622,6 +626,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); +@@ -909,9 +915,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; + } |