Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 264906
b: refs/heads/master
c: 72246da
h: refs/heads/master
v: v3
  • Loading branch information
Felipe Balbi authored and Greg Kroah-Hartman committed Aug 22, 2011
1 parent 7c463b7 commit 53deae4
Show file tree
Hide file tree
Showing 17 changed files with 5,713 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 500fdf8becb9c8d51970c7ac6a4fa308a5481ebe
refs/heads/master: 72246da40f3719af3bfd104a2365b32537c27d83
53 changes: 53 additions & 0 deletions trunk/Documentation/usb/dwc3.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@

TODO
~~~~~~
Please pick something while reading :)

- Implement streaming support for BULK endpoints
Tatyana's patch "usb: Add streams support to the gadget framework"
introduces streaming support for the gadget driver.
Every usb_request has new field called stream_id which holds its id.
Every usb_ep has a field num_supported_strms which describes the max
number of streams supported (for this ep).
UAS is AFAIK the only gadget with streaming support.

- Convert interrupt handler to per-ep-thread-irq

As it turns out some DWC3-commands ~1ms to complete. Currently we spin
until the command completes which is bad.

Implementation idea:
- dwc core implements a demultiplexing irq chip for interrupts per
endpoint. The interrupt numbers are allocated during probe and belong
to the device. If MSI provides per-endpoint interrupt this dummy
interrupt chip can be replaced with "real" interrupts.
- interrupts are requested / allocated on usb_ep_enable() and removed on
usb_ep_disable(). Worst case are 32 interrupts, the lower limit is two
for ep0/1.
- dwc3_send_gadget_ep_cmd() will sleep in wait_for_completion_timeout()
until the command completes.
- the interrupt handler is split into the following pieces:
- primary handler of the device
goes through every event and calls generic_handle_irq() for event
it. On return from generic_handle_irq() in acknowledges the event
counter so interrupt goes away (eventually).

- threaded handler of the device
none

- primary handler of the EP-interrupt
reads the event and tries to process it. Everything that requries
sleeping is handed over to the Thread. The event is saved in an
per-endpoint data-structure.
We probably have to pay attention not to process events once we
handed something to thread so we don't process event X prio Y
where X > Y.

- threaded handler of the EP-interrupt
handles the remaining EP work which might sleep such as waiting
for command completion.

Latency:
There should be no increase in latency since the interrupt-thread has a
high priority and will be run before an average task in user land
(except the user changed priorities).
2 changes: 2 additions & 0 deletions trunk/drivers/usb/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,8 @@ config USB

source "drivers/usb/core/Kconfig"

source "drivers/usb/dwc3/Kconfig"

source "drivers/usb/mon/Kconfig"

source "drivers/usb/wusbcore/Kconfig"
Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/usb/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

obj-$(CONFIG_USB) += core/

obj-$(CONFIG_USB_DWC3) += dwc3/

obj-$(CONFIG_USB_MON) += mon/

obj-$(CONFIG_PCI) += host/
Expand Down
25 changes: 25 additions & 0 deletions trunk/drivers/usb/dwc3/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
config USB_DWC3
tristate "DesignWare USB3 DRD Core Support"
depends on (USB || USB_GADGET)
select USB_OTG_UTILS
help
Say Y or M here if your system has a Dual Role SuperSpeed
USB controller based on the DesignWare USB3 IP Core.

If you choose to build this driver is a dynamically linked
module, the module will be called dwc3.ko.

if USB_DWC3

config USB_DWC3_DEBUG
bool "Enable Debugging Messages"
help
Say Y here to enable debugging messages on DWC3 Driver.

config USB_DWC3_VERBOSE
bool "Enable Verbose Debugging Messages"
depends on USB_DWC3_DEBUG
help
Say Y here to enable verbose debugging messages on DWC3 Driver.

endif
36 changes: 36 additions & 0 deletions trunk/drivers/usb/dwc3/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
ccflags-$(CONFIG_USB_DWC3_DEBUG) := -DDEBUG
ccflags-$(CONFIG_USB_DWC3_VERBOSE) += -DVERBOSE_DEBUG

obj-$(CONFIG_USB_DWC3) += dwc3.o

dwc3-y := core.o

ifneq ($(CONFIG_USB_GADGET_DWC3),)
dwc3-y += gadget.o ep0.o
endif

ifneq ($(CONFIG_DEBUG_FS),)
dwc3-y += debugfs.o
endif

##
# Platform-specific glue layers go here
#
# NOTICE: Make sure your glue layer doesn't depend on anything
# which is arch-specific and that it compiles on all situations.
#
# We want to keep this requirement in order to be able to compile
# the entire driver (with all its glue layers) on several architectures
# and make sure it compiles fine. This will also help with allmodconfig
# and allyesconfig builds.
#
# The only exception is the PCI glue layer, but that's only because
# PCI doesn't provide nops if CONFIG_PCI isn't enabled.
##

obj-$(CONFIG_USB_DWC3) += dwc3-omap.o

ifneq ($(CONFIG_PCI),)
obj-$(CONFIG_USB_DWC3) += dwc3-pci.o
endif

Loading

0 comments on commit 53deae4

Please sign in to comment.