From: Albert H. <he...@us...> - 2009-10-25 18:57:06
|
Update of /cvsroot/gc-linux/linux/drivers/usb/host In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv32669/drivers/usb/host Modified Files: Kconfig Makefile ehci-hcd.c ehci.h ohci-hcd.c Log Message: Forward to v2.6.31. Index: ehci.h =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/usb/host/ehci.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ehci.h 25 Oct 2009 18:53:45 -0000 1.3 --- ehci.h 25 Oct 2009 18:56:56 -0000 1.4 *************** *** 117,120 **** --- 117,121 ---- unsigned long actions; unsigned stamp; + unsigned random_frame; unsigned long next_statechange; u32 command; *************** *** 354,358 **** --- 355,361 ---- unsigned short start; /* where polling starts */ #define NO_FRAME ((unsigned short)~0) /* pick new start */ + struct usb_device *dev; /* access to TT */ + unsigned clearing_tt:1; /* Clear-TT-Buf in progress */ } __attribute__ ((aligned (32))); Index: Kconfig =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/usb/host/Kconfig,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Kconfig 25 Oct 2009 18:53:45 -0000 1.10 --- Kconfig 25 Oct 2009 18:56:56 -0000 1.11 *************** *** 18,21 **** --- 18,41 ---- module will be called c67x00. + config USB_XHCI_HCD + tristate "xHCI HCD (USB 3.0) support (EXPERIMENTAL)" + depends on USB && PCI && EXPERIMENTAL + ---help--- + The eXtensible Host Controller Interface (xHCI) is standard for USB 3.0 + "SuperSpeed" host controller hardware. + + To compile this driver as a module, choose M here: the + module will be called xhci-hcd. + + config USB_XHCI_HCD_DEBUGGING + bool "Debugging for the xHCI host controller" + depends on USB_XHCI_HCD + ---help--- + Say 'Y' to turn on debugging for the xHCI host controller driver. + This will spew debugging output, even in interrupt context. + This should only be used for debugging xHCI driver bugs. + + If unsure, say N. + config USB_EHCI_HCD tristate "EHCI HCD (USB 2.0) support" *************** *** 162,185 **** STB03xxx processor chip. If unsure, say Y. - config USB_OHCI_HCD_PPC_OF - bool "OHCI support for PPC USB controller on OF platform bus" - depends on USB_OHCI_HCD && PPC_OF - default y - ---help--- - Enables support for the USB controller PowerPC present on the - OpenFirmware platform bus. - config USB_OHCI_HCD_PPC_OF_BE ! bool "Support big endian HC" ! depends on USB_OHCI_HCD_PPC_OF ! default y select USB_OHCI_BIG_ENDIAN_DESC select USB_OHCI_BIG_ENDIAN_MMIO config USB_OHCI_HCD_PPC_OF_LE ! bool "Support little endian HC" ! depends on USB_OHCI_HCD_PPC_OF ! default n select USB_OHCI_LITTLE_ENDIAN config USB_OHCI_HCD_PCI --- 182,206 ---- STB03xxx processor chip. If unsure, say Y. config USB_OHCI_HCD_PPC_OF_BE ! bool "OHCI support for OF platform bus (big endian)" ! depends on USB_OHCI_HCD && PPC_OF select USB_OHCI_BIG_ENDIAN_DESC select USB_OHCI_BIG_ENDIAN_MMIO + ---help--- + Enables support for big-endian USB controllers present on the + OpenFirmware platform bus. config USB_OHCI_HCD_PPC_OF_LE ! bool "OHCI support for OF platform bus (little endian)" ! depends on USB_OHCI_HCD && PPC_OF select USB_OHCI_LITTLE_ENDIAN + ---help--- + Enables support for little-endian USB controllers present on the + OpenFirmware platform bus. + + config USB_OHCI_HCD_PPC_OF + bool + depends on USB_OHCI_HCD && PPC_OF + default USB_OHCI_HCD_PPC_OF_BE || USB_OHCI_HCD_PPC_OF_LE config USB_OHCI_HCD_PCI *************** *** 318,325 **** config SUPERH_ON_CHIP_R8A66597 boolean "Enable SuperH on-chip R8A66597 USB" ! depends on USB_R8A66597_HCD && (CPU_SUBTYPE_SH7366 || CPU_SUBTYPE_SH7723) help This driver enables support for the on-chip R8A66597 in the ! SH7366 and SH7723 processors. config USB_WHCI_HCD --- 339,346 ---- config SUPERH_ON_CHIP_R8A66597 boolean "Enable SuperH on-chip R8A66597 USB" ! depends on USB_R8A66597_HCD && (CPU_SUBTYPE_SH7366 || CPU_SUBTYPE_SH7723 || CPU_SUBTYPE_SH7724) help This driver enables support for the on-chip R8A66597 in the ! SH7366, SH7723 and SH7724 processors. config USB_WHCI_HCD Index: Makefile =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/usb/host/Makefile,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Makefile 25 Oct 2009 18:53:45 -0000 1.7 --- Makefile 25 Oct 2009 18:56:56 -0000 1.8 *************** *** 13,16 **** --- 13,17 ---- fhci-objs += fhci-dbg.o endif + xhci-objs := xhci-hcd.o xhci-mem.o xhci-pci.o xhci-ring.o xhci-hub.o xhci-dbg.o obj-$(CONFIG_USB_WHCI_HCD) += whci/ *************** *** 24,27 **** --- 25,29 ---- obj-$(CONFIG_USB_UHCI_HCD) += uhci-hcd.o obj-$(CONFIG_USB_FHCI_HCD) += fhci.o + obj-$(CONFIG_USB_XHCI_HCD) += xhci.o obj-$(CONFIG_USB_SL811_HCD) += sl811-hcd.o obj-$(CONFIG_USB_SL811_CS) += sl811_cs.o Index: ohci-hcd.c =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/usb/host/ohci-hcd.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ohci-hcd.c 25 Oct 2009 18:53:45 -0000 1.3 --- ohci-hcd.c 25 Oct 2009 18:56:56 -0000 1.4 *************** *** 572,576 **** static int ohci_run (struct ohci_hcd *ohci) { ! u32 mask, temp; int first = ohci->fminterval == 0; struct usb_hcd *hcd = ohci_to_hcd(ohci); --- 572,576 ---- static int ohci_run (struct ohci_hcd *ohci) { ! u32 mask, val; int first = ohci->fminterval == 0; struct usb_hcd *hcd = ohci_to_hcd(ohci); *************** *** 581,586 **** if (first) { ! temp = ohci_readl (ohci, &ohci->regs->fminterval); ! ohci->fminterval = temp & 0x3fff; if (ohci->fminterval != FI) ohci_dbg (ohci, "fminterval delta %d\n", --- 581,586 ---- if (first) { ! val = ohci_readl (ohci, &ohci->regs->fminterval); ! ohci->fminterval = val & 0x3fff; if (ohci->fminterval != FI) ohci_dbg (ohci, "fminterval delta %d\n", *************** *** 601,605 **** switch (ohci->hc_control & OHCI_CTRL_HCFS) { case OHCI_USB_OPER: ! temp = 0; break; case OHCI_USB_SUSPEND: --- 601,605 ---- switch (ohci->hc_control & OHCI_CTRL_HCFS) { case OHCI_USB_OPER: ! val = 0; break; case OHCI_USB_SUSPEND: *************** *** 607,611 **** ohci->hc_control &= OHCI_CTRL_RWC; ohci->hc_control |= OHCI_USB_RESUME; ! temp = 10 /* msec wait */; break; // case OHCI_USB_RESET: --- 607,611 ---- ohci->hc_control &= OHCI_CTRL_RWC; ohci->hc_control |= OHCI_USB_RESUME; ! val = 10 /* msec wait */; break; // case OHCI_USB_RESET: *************** *** 613,617 **** ohci->hc_control &= OHCI_CTRL_RWC; ohci->hc_control |= OHCI_USB_RESET; ! temp = 50 /* msec wait */; break; } --- 613,617 ---- ohci->hc_control &= OHCI_CTRL_RWC; ohci->hc_control |= OHCI_USB_RESET; ! val = 50 /* msec wait */; break; } *************** *** 619,623 **** // flush the writes (void) ohci_readl (ohci, &ohci->regs->control); ! msleep(temp); memset (ohci->hcca, 0, sizeof (struct ohci_hcca)); --- 619,623 ---- // flush the writes (void) ohci_readl (ohci, &ohci->regs->control); ! msleep(val); memset (ohci->hcca, 0, sizeof (struct ohci_hcca)); *************** *** 629,635 **** /* HC Reset requires max 10 us delay */ ohci_writel (ohci, OHCI_HCR, &ohci->regs->cmdstatus); ! temp = 30; /* ... allow extra time */ while ((ohci_readl (ohci, &ohci->regs->cmdstatus) & OHCI_HCR) != 0) { ! if (--temp == 0) { spin_unlock_irq (&ohci->lock); ohci_err (ohci, "USB HC reset timed out!\n"); --- 629,635 ---- /* HC Reset requires max 10 us delay */ ohci_writel (ohci, OHCI_HCR, &ohci->regs->cmdstatus); ! val = 30; /* ... allow extra time */ while ((ohci_readl (ohci, &ohci->regs->cmdstatus) & OHCI_HCR) != 0) { ! if (--val == 0) { spin_unlock_irq (&ohci->lock); ohci_err (ohci, "USB HC reset timed out!\n"); *************** *** 700,710 **** /* handle root hub init quirks ... */ ! temp = roothub_a (ohci); ! temp &= ~(RH_A_PSM | RH_A_OCPM); if (ohci->flags & OHCI_QUIRK_SUPERIO) { /* NSC 87560 and maybe others */ ! temp |= RH_A_NOCP; ! temp &= ~(RH_A_POTPGT | RH_A_NPS); ! ohci_writel (ohci, temp, &ohci->regs->roothub.a); } else if ((ohci->flags & OHCI_QUIRK_AMD756) || (ohci->flags & OHCI_QUIRK_HUB_POWER)) { --- 700,710 ---- /* handle root hub init quirks ... */ ! val = roothub_a (ohci); ! val &= ~(RH_A_PSM | RH_A_OCPM); if (ohci->flags & OHCI_QUIRK_SUPERIO) { /* NSC 87560 and maybe others */ ! val |= RH_A_NOCP; ! val &= ~(RH_A_POTPGT | RH_A_NPS); ! ohci_writel (ohci, val, &ohci->regs->roothub.a); } else if ((ohci->flags & OHCI_QUIRK_AMD756) || (ohci->flags & OHCI_QUIRK_HUB_POWER)) { *************** *** 712,720 **** * Mac platforms. ganged overcurrent reporting, if any. */ ! temp |= RH_A_NPS; ! ohci_writel (ohci, temp, &ohci->regs->roothub.a); } ohci_writel (ohci, RH_HS_LPSC, &ohci->regs->roothub.status); ! ohci_writel (ohci, (temp & RH_A_NPS) ? 0 : RH_B_PPCM, &ohci->regs->roothub.b); // flush those writes --- 712,720 ---- * Mac platforms. ganged overcurrent reporting, if any. */ ! val |= RH_A_NPS; ! ohci_writel (ohci, val, &ohci->regs->roothub.a); } ohci_writel (ohci, RH_HS_LPSC, &ohci->regs->roothub.status); ! ohci_writel (ohci, (val & RH_A_NPS) ? 0 : RH_B_PPCM, &ohci->regs->roothub.b); // flush those writes *************** *** 725,729 **** // POTPGT delay is bits 24-31, in 2 ms units. ! mdelay ((temp >> 23) & 0x1fe); hcd->state = HC_STATE_RUNNING; --- 725,729 ---- // POTPGT delay is bits 24-31, in 2 ms units. ! mdelay ((val >> 23) & 0x1fe); hcd->state = HC_STATE_RUNNING; *************** *** 1106,1110 **** #ifdef DEBUG ! ohci_debug_root = debugfs_create_dir("ohci", NULL); if (!ohci_debug_root) { retval = -ENOENT; --- 1106,1110 ---- #ifdef DEBUG ! ohci_debug_root = debugfs_create_dir("ohci", usb_debug_root); if (!ohci_debug_root) { retval = -ENOENT; Index: ehci-hcd.c =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/usb/host/ehci-hcd.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** ehci-hcd.c 25 Oct 2009 18:53:45 -0000 1.3 --- ehci-hcd.c 25 Oct 2009 18:56:56 -0000 1.4 *************** *** 904,908 **** break; case QH_STATE_IDLE: ! WARN_ON(1); break; } --- 904,909 ---- break; case QH_STATE_IDLE: ! /* QH might be waiting for a Clear-TT-Buffer */ ! qh_completions(ehci, qh); break; } *************** *** 1004,1007 **** --- 1005,1010 ---- goto rescan; case QH_STATE_IDLE: /* fully unlinked */ + if (qh->clearing_tt) + goto idle_timeout; if (list_empty (&qh->qtd_list)) { qh_put (qh); *************** *** 1025,1028 **** --- 1028,1073 ---- } + static void + ehci_endpoint_reset(struct usb_hcd *hcd, struct usb_host_endpoint *ep) + { + struct ehci_hcd *ehci = hcd_to_ehci(hcd); + struct ehci_qh *qh; + int eptype = usb_endpoint_type(&ep->desc); + int epnum = usb_endpoint_num(&ep->desc); + int is_out = usb_endpoint_dir_out(&ep->desc); + unsigned long flags; + + if (eptype != USB_ENDPOINT_XFER_BULK && eptype != USB_ENDPOINT_XFER_INT) + return; + + spin_lock_irqsave(&ehci->lock, flags); + qh = ep->hcpriv; + + /* For Bulk and Interrupt endpoints we maintain the toggle state + * in the hardware; the toggle bits in udev aren't used at all. + * When an endpoint is reset by usb_clear_halt() we must reset + * the toggle bit in the QH. + */ + if (qh) { + usb_settoggle(qh->dev, epnum, is_out, 0); + if (!list_empty(&qh->qtd_list)) { + WARN_ONCE(1, "clear_halt for a busy endpoint\n"); + } else if (qh->qh_state == QH_STATE_LINKED) { + + /* The toggle value in the QH can't be updated + * while the QH is active. Unlink it now; + * re-linking will call qh_refresh(). + */ + if (eptype == USB_ENDPOINT_XFER_BULK) { + unlink_async(ehci, qh); + } else { + intr_deschedule(ehci, qh); + (void) qh_schedule(ehci, qh); + } + } + } + spin_unlock_irqrestore(&ehci->lock, flags); + } + static int ehci_get_frame (struct usb_hcd *hcd) { *************** *** 1098,1102 **** #ifdef DEBUG ! ehci_debug_root = debugfs_create_dir("ehci", NULL); if (!ehci_debug_root) { retval = -ENOENT; --- 1143,1147 ---- #ifdef DEBUG ! ehci_debug_root = debugfs_create_dir("ehci", usb_debug_root); if (!ehci_debug_root) { retval = -ENOENT; |