From: Albert H. <he...@us...> - 2009-12-09 18:40:18
|
Update of /cvsroot/gc-linux/linux/drivers/usb/host In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv21229/drivers/usb/host Modified Files: Kconfig Makefile ehci-hcd.c ehci.h ohci-hcd.c ohci-q.c ohci.h Log Message: Forward to v2.6.32. Index: ohci-q.c =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/usb/host/ohci-q.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ohci-q.c 9 Dec 2009 18:18:07 -0000 1.5 --- ohci-q.c 9 Dec 2009 18:40:10 -0000 1.6 *************** *** 50,56 **** case PIPE_ISOCHRONOUS: ohci_to_hcd(ohci)->self.bandwidth_isoc_reqs--; ! if (ohci_to_hcd(ohci)->self.bandwidth_isoc_reqs == 0 ! && quirk_amdiso(ohci)) ! quirk_amd_pll(1); break; case PIPE_INTERRUPT: --- 50,59 ---- case PIPE_ISOCHRONOUS: ohci_to_hcd(ohci)->self.bandwidth_isoc_reqs--; ! if (ohci_to_hcd(ohci)->self.bandwidth_isoc_reqs == 0) { ! if (quirk_amdiso(ohci)) ! quirk_amd_pll(1); ! if (quirk_amdprefetch(ohci)) ! sb800_prefetch(ohci, 0); ! } break; case PIPE_INTERRUPT: *************** *** 419,423 **** /* FIXME usbcore changes dev->devnum before SET_ADDRESS ! * suceeds ... otherwise we wouldn't need "pipe". */ info = usb_pipedevice (pipe); --- 422,426 ---- /* FIXME usbcore changes dev->devnum before SET_ADDRESS ! * succeeds ... otherwise we wouldn't need "pipe". */ info = usb_pipedevice (pipe); *************** *** 681,687 **** urb->iso_frame_desc [cnt].length, urb, cnt); } ! if (ohci_to_hcd(ohci)->self.bandwidth_isoc_reqs == 0 ! && quirk_amdiso(ohci)) ! quirk_amd_pll(0); periodic = ohci_to_hcd(ohci)->self.bandwidth_isoc_reqs++ == 0 && ohci_to_hcd(ohci)->self.bandwidth_int_reqs == 0; --- 684,693 ---- urb->iso_frame_desc [cnt].length, urb, cnt); } ! if (ohci_to_hcd(ohci)->self.bandwidth_isoc_reqs == 0) { ! if (quirk_amdiso(ohci)) ! quirk_amd_pll(0); ! if (quirk_amdprefetch(ohci)) ! sb800_prefetch(ohci, 1); ! } periodic = ohci_to_hcd(ohci)->self.bandwidth_isoc_reqs++ == 0 && ohci_to_hcd(ohci)->self.bandwidth_int_reqs == 0; Index: ehci.h =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/usb/host/ehci.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ehci.h 9 Dec 2009 18:18:07 -0000 1.6 --- ehci.h 9 Dec 2009 18:40:10 -0000 1.7 *************** *** 38,42 **** #endif ! /* statistics can be kept for for tuning/monitoring */ struct ehci_stats { /* irq usage */ --- 38,42 ---- #endif ! /* statistics can be kept for tuning/monitoring */ struct ehci_stats { /* irq usage */ *************** *** 119,122 **** --- 119,123 ---- unsigned random_frame; unsigned long next_statechange; + ktime_t last_periodic_enable; u32 command; *************** *** 127,130 **** --- 128,133 ---- unsigned big_endian_desc:1; unsigned has_amcc_usb23:1; + unsigned need_io_watchdog:1; + unsigned broken_periodic:1; /* required for usb32 quirk */ *************** *** 136,139 **** --- 139,143 ---- #define OHCI_HCCTRL_LEN 0x4 __hc32 *ohci_hcctrl_reg; + unsigned has_hostpc:1; u8 sbrn; /* packed release number */ *************** *** 299,304 **** */ ! struct ehci_qh { ! /* first part defined by EHCI spec */ __hc32 hw_next; /* see EHCI 3.6.1 */ __hc32 hw_info1; /* see EHCI 3.6.2 */ --- 303,308 ---- */ ! /* first part defined by EHCI spec */ ! struct ehci_qh_hw { __hc32 hw_next; /* see EHCI 3.6.1 */ __hc32 hw_info1; /* see EHCI 3.6.2 */ *************** *** 318,322 **** --- 322,329 ---- __hc32 hw_buf [5]; __hc32 hw_buf_hi [5]; + } __attribute__ ((aligned(32))); + struct ehci_qh { + struct ehci_qh_hw *hw; /* the rest is HCD-private */ dma_addr_t qh_dma; /* address of qh */ *************** *** 337,340 **** --- 344,348 ---- unsigned stamp; + u8 needs_rescan; /* Dequeue during giveback */ u8 qh_state; #define QH_STATE_LINKED 1 /* HC sees this */ *************** *** 358,362 **** struct usb_device *dev; /* access to TT */ unsigned clearing_tt:1; /* Clear-TT-Buf in progress */ ! } __attribute__ ((aligned (32))); /*-------------------------------------------------------------------------*/ --- 366,370 ---- struct usb_device *dev; /* access to TT */ unsigned clearing_tt:1; /* Clear-TT-Buf in progress */ ! }; /*-------------------------------------------------------------------------*/ *************** *** 545,549 **** { if (ehci_is_TDI(ehci)) { ! switch ((portsc>>26)&3) { case 0: return 0; --- 553,557 ---- { if (ehci_is_TDI(ehci)) { ! switch ((portsc >> (ehci->has_hostpc ? 25 : 26)) & 3) { case 0: return 0; Index: Kconfig =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/usb/host/Kconfig,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Kconfig 9 Dec 2009 18:18:07 -0000 1.13 --- Kconfig 9 Dec 2009 18:40:10 -0000 1.14 *************** *** 114,117 **** --- 114,123 ---- OpenFirmware platform bus. + config USB_W90X900_EHCI + bool "W90X900(W90P910) EHCI support" + depends on USB_EHCI_HCD && ARCH_W90X900 + ---help--- + Enables support for the W90X900 USB controller + config USB_OXU210HP_HCD tristate "OXU210HP HCD support" *************** *** 154,157 **** --- 160,175 ---- module will be called isp1760. + config USB_ISP1362_HCD + tristate "ISP1362 HCD support" + depends on USB + default N + ---help--- + Supports the Philips ISP1362 chip as a host controller + + This driver does not support isochronous transfers. + + To compile this driver as a module, choose M here: the + module will be called isp1362-hcd. + config USB_OHCI_HCD tristate "OHCI HCD support" *************** *** 337,347 **** module will be called r8a66597-hcd. - 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 tristate "Wireless USB Host Controller Interface (WHCI) driver (EXPERIMENTAL)" --- 355,358 ---- Index: Makefile =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/usb/host/Makefile,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Makefile 9 Dec 2009 18:18:07 -0000 1.10 --- Makefile 9 Dec 2009 18:40:10 -0000 1.11 *************** *** 22,25 **** --- 22,26 ---- obj-$(CONFIG_USB_OXU210HP_HCD) += oxu210hp-hcd.o obj-$(CONFIG_USB_ISP116X_HCD) += isp116x-hcd.o + obj-$(CONFIG_USB_ISP1362_HCD) += isp1362-hcd.o obj-$(CONFIG_USB_OHCI_HCD) += ohci-hcd.o obj-$(CONFIG_USB_UHCI_HCD) += uhci-hcd.o Index: ohci.h =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/usb/host/ohci.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** ohci.h 9 Dec 2009 18:18:07 -0000 1.5 --- ohci.h 9 Dec 2009 18:40:10 -0000 1.6 *************** *** 403,406 **** --- 403,407 ---- #define OHCI_QUIRK_HUB_POWER 0x100 /* distrust firmware power/oc setup */ #define OHCI_QUIRK_AMD_ISO 0x200 /* ISO transfers*/ + #define OHCI_QUIRK_AMD_PREFETCH 0x400 /* pre-fetch for ISO transfer */ // there are also chip quirks/bugs in init logic *************** *** 434,437 **** --- 435,442 ---- return ohci->flags & OHCI_QUIRK_AMD_ISO; } + static inline int quirk_amdprefetch(struct ohci_hcd *ohci) + { + return ohci->flags & OHCI_QUIRK_AMD_PREFETCH; + } #else static inline int quirk_nec(struct ohci_hcd *ohci) *************** *** 447,450 **** --- 452,459 ---- return 0; } + static inline int quirk_amdprefetch(struct ohci_hcd *ohci) + { + return 0; + } #endif Index: ohci-hcd.c =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/usb/host/ohci-hcd.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ohci-hcd.c 9 Dec 2009 18:18:07 -0000 1.6 --- ohci-hcd.c 9 Dec 2009 18:40:10 -0000 1.7 *************** *** 35,39 **** #include <linux/dma-mapping.h> #include <linux/dmapool.h> - #include <linux/reboot.h> #include <linux/workqueue.h> #include <linux/debugfs.h> --- 35,38 ---- *************** *** 89,92 **** --- 88,92 ---- static void quirk_amd_pll(int state); static void amd_iso_dev_put(void); + static void sb800_prefetch(struct ohci_hcd *ohci, int on); #else static inline void quirk_amd_pll(int state) *************** *** 98,101 **** --- 98,105 ---- return; } + static inline void sb800_prefetch(struct ohci_hcd *ohci, int on) + { + return; + } #endif Index: ehci-hcd.c =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/usb/host/ehci-hcd.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ehci-hcd.c 9 Dec 2009 18:18:07 -0000 1.6 --- ehci-hcd.c 9 Dec 2009 18:40:10 -0000 1.7 *************** *** 29,35 **** #include <linux/init.h> #include <linux/timer.h> #include <linux/list.h> #include <linux/interrupt.h> - #include <linux/reboot.h> #include <linux/usb.h> #include <linux/moduleparam.h> --- 29,35 ---- #include <linux/init.h> #include <linux/timer.h> + #include <linux/ktime.h> #include <linux/list.h> #include <linux/interrupt.h> #include <linux/usb.h> #include <linux/moduleparam.h> *************** *** 128,131 **** --- 128,133 ---- switch (action) { case TIMER_IO_WATCHDOG: + if (!ehci->need_io_watchdog) + return; t = EHCI_IO_JIFFIES; break; *************** *** 240,243 **** --- 242,250 ---- u32 command = ehci_readl(ehci, &ehci->regs->command); + /* If the EHCI debug controller is active, special care must be + * taken before and after a host controller reset */ + if (ehci->debug && !dbgp_reset_prep()) + ehci->debug = NULL; + command |= CMD_RESET; dbg_cmd (ehci, "reset", command); *************** *** 248,251 **** --- 255,264 ---- CMD_RESET, 0, 250 * 1000); + if (ehci->has_hostpc) { + ehci_writel(ehci, USBMODE_EX_HC | USBMODE_EX_VBPS, + (u32 __iomem *)(((u8 *)ehci->regs) + USBMODE_EX)); + ehci_writel(ehci, TXFIFO_DEFAULT, + (u32 __iomem *)(((u8 *)ehci->regs) + TXFILLTUNING)); + } if (retval) return retval; *************** *** 254,257 **** --- 267,273 ---- tdi_reset (ehci); + if (ehci->debug) + dbgp_external_startup(); + return retval; } *************** *** 506,512 **** --- 522,533 ---- int retval; u32 hcc_params; + struct ehci_qh_hw *hw; spin_lock_init(&ehci->lock); + /* + * keep io watchdog by default, those good HCDs could turn off it later + */ + ehci->need_io_watchdog = 1; init_timer(&ehci->watchdog); ehci->watchdog.function = ehci_watchdog; *************** *** 545,554 **** */ ehci->async->qh_next.qh = NULL; ! ehci->async->hw_next = QH_NEXT(ehci, ehci->async->qh_dma); ! ehci->async->hw_info1 = cpu_to_hc32(ehci, QH_HEAD); ! ehci->async->hw_token = cpu_to_hc32(ehci, QTD_STS_HALT); ! ehci->async->hw_qtd_next = EHCI_LIST_END(ehci); ehci->async->qh_state = QH_STATE_LINKED; ! ehci->async->hw_alt_next = QTD_NEXT(ehci, ehci->async->dummy->qtd_dma); /* clear interrupt enables, set irq latency */ --- 566,576 ---- */ ehci->async->qh_next.qh = NULL; ! hw = ehci->async->hw; ! hw->hw_next = QH_NEXT(ehci, ehci->async->qh_dma); ! hw->hw_info1 = cpu_to_hc32(ehci, QH_HEAD); ! hw->hw_token = cpu_to_hc32(ehci, QTD_STS_HALT); ! hw->hw_qtd_next = EHCI_LIST_END(ehci); ehci->async->qh_state = QH_STATE_LINKED; ! hw->hw_alt_next = QTD_NEXT(ehci, ehci->async->dummy->qtd_dma); /* clear interrupt enables, set irq latency */ *************** *** 656,659 **** --- 678,682 ---- msleep(5); up_write(&ehci_cf_port_reset_rwsem); + ehci->last_periodic_enable = ktime_get_real(); temp = HC_VERSION(ehci_readl(ehci, &ehci->caps->hc_capbase)); *************** *** 851,860 **** end_unlink_async(ehci); ! /* if it's not linked then there's nothing to do */ ! if (qh->qh_state != QH_STATE_LINKED) ! ; /* defer till later if busy */ ! else if (ehci->reclaim) { struct ehci_qh *last; --- 874,889 ---- end_unlink_async(ehci); ! /* If the QH isn't linked then there's nothing we can do ! * unless we were called during a giveback, in which case ! * qh_completions() has to deal with it. ! */ ! if (qh->qh_state != QH_STATE_LINKED) { ! if (qh->qh_state == QH_STATE_COMPLETING) ! qh->needs_rescan = 1; ! return; ! } /* defer till later if busy */ ! if (ehci->reclaim) { struct ehci_qh *last; *************** *** 916,921 **** switch (qh->qh_state) { case QH_STATE_LINKED: intr_deschedule (ehci, qh); ! /* FALL THROUGH */ case QH_STATE_IDLE: qh_completions (ehci, qh); --- 945,951 ---- switch (qh->qh_state) { case QH_STATE_LINKED: + case QH_STATE_COMPLETING: intr_deschedule (ehci, qh); ! break; case QH_STATE_IDLE: qh_completions (ehci, qh); *************** *** 926,946 **** goto done; } - - /* reschedule QH iff another request is queued */ - if (!list_empty (&qh->qtd_list) - && HC_IS_RUNNING (hcd->state)) { - rc = qh_schedule(ehci, qh); - - /* An error here likely indicates handshake failure - * or no space left in the schedule. Neither fault - * should happen often ... - * - * FIXME kill the now-dysfunctional queued urbs - */ - if (rc != 0) - ehci_err(ehci, - "can't reschedule qh %p, err %d", - qh, rc); - } break; --- 956,959 ---- *************** *** 980,984 **** * accelerate iso completions ... so spin a while. */ ! if (qh->hw_info1 == 0) { ehci_vdbg (ehci, "iso delay\n"); goto idle_timeout; --- 993,997 ---- * accelerate iso completions ... so spin a while. */ ! if (qh->hw->hw_info1 == 0) { ehci_vdbg (ehci, "iso delay\n"); goto idle_timeout; *************** *** 989,992 **** --- 1002,1006 ---- switch (qh->qh_state) { case QH_STATE_LINKED: + case QH_STATE_COMPLETING: for (tmp = ehci->async->qh_next.qh; tmp && tmp != qh; *************** *** 1053,1057 **** 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 --- 1067,1072 ---- if (!list_empty(&qh->qtd_list)) { WARN_ONCE(1, "clear_halt for a busy endpoint\n"); ! } else if (qh->qh_state == QH_STATE_LINKED || ! qh->qh_state == QH_STATE_COMPLETING) { /* The toggle value in the QH can't be updated *************** *** 1059,1068 **** * 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); - } } } --- 1074,1081 ---- * re-linking will call qh_refresh(). */ ! if (eptype == USB_ENDPOINT_XFER_BULK) unlink_async(ehci, qh); ! else intr_deschedule(ehci, qh); } } *************** *** 1118,1121 **** --- 1131,1144 ---- #endif + #ifdef CONFIG_USB_W90X900_EHCI + #include "ehci-w90x900.c" + #define PLATFORM_DRIVER ehci_hcd_w90x900_driver + #endif + + #ifdef CONFIG_ARCH_AT91 + #include "ehci-atmel.c" + #define PLATFORM_DRIVER ehci_atmel_driver + #endif + #if !defined(PCI_DRIVER) && !defined(PLATFORM_DRIVER) && \ !defined(PS3_SYSTEM_BUS_DRIVER) && !defined(OF_PLATFORM_DRIVER) |