summaryrefslogtreecommitdiff
path: root/drivers/usb/dwc3/ep0.c
AgeCommit message (Collapse)AuthorFilesLines
2011-10-04usb: dwc3: convert structures into bitshiftsFelipe Balbi1-4/+2
our parameter structures need to be written to HW, so instead of assuming little endian, we convert those into bit shifts. Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-04usb: dwc3: gadget: fix DEPSTARTCFG for non-EP0 EPsPaul Zimmerman1-0/+1
DEPSTARTCFG for non-EP0 EPs must only be sent once per config [ balbi@ti.com : changed config_start to start_config_issued ] Signed-off-by: Paul Zimmerman <paulz@synopsys.com> Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-04usb: dwc: remove "All rights reserved" statement.Sebastian Andrzej Siewior1-1/+0
Some people think that this line is not compatible with the GPL. The statement was required due to the Buenos Aires Convention and is now deprecated. I remove it because it is said that it is pointless nowdays. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-04usb: dwc3: ep0: fix debug outputSebastian Andrzej Siewior1-1/+1
Use "ep0in" and "ep0out" instead "ep1in" and "ep0out" which is confusing and not consistent with the remaining output. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-04usb: dwc3: ep0: remove second giveback in error caseSebastian Andrzej Siewior1-1/+0
We already give requests back in dwc3_ep0_stall_and_restart() so doing it again here will most likely corrupt the list. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-04usb: dwc3: ep0: fix debug messageFelipe Balbi1-4/+4
The way it was before was really meaningless. Now it looks saner. Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-04usb: dwc3: ep0: ignore direction on 2-stage transferFelipe Balbi1-4/+4
We don't need to care about direction on a two stage transfer. Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-04usb: dwc3: ep0: Make USB30CV happy with SetAddressFelipe Balbi1-22/+9
According to USB 3.0 Specification, a SetAddress() while device is in Configured State has an unspecified behavior (see Section 9.4.6). Still USB30CV wasn't happy with my Stall reply. To make that thing happy, just accept the SetAddress() always. No problems have been observed thus far. Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-09usb: dwc3: ep0: introduce ep0_expect_in flagFelipe Balbi1-0/+16
This flag will tell us which direction we're expecting on the next (data or status) phase. It will help us catching errors of host going crazy and requesting data of the wrong direction. Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-09-09usb: dwc3: ep0: giveback requests on stall_and_restartFelipe Balbi1-0/+10
if we don't, the list will be busy forever. Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-09-09usb: dwc3: use ep0_next_event fieldFelipe Balbi1-4/+36
Start tracking the next expected event and act on the error conditions as suggested by databook. Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-09-09usb: dwc3: drop EP0_STALL stateFelipe Balbi1-2/+0
Whenever we issue a Set Stall command on EP0, the state machine will be restarted and Stall is cleared automatically, when core receives the next SETUP packet. There's no need to track that EP0_STALL state. Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-09-09usb: dwc3: ep0: clear all EP0 flagsFelipe Balbi1-1/+1
when we're going to issue Set Stall command, we should clear DWC3_EP_STALL flag, but also we should clear BUSY, HALTED and all others. Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-09-09usb: dwc3: ep0: fix Get Status handlingFelipe Balbi1-1/+1
data was prepared on setup_buf but transfer was started on ctrl_req, fix it. Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-09-09usb: dwc3: ep0: simplify EP0 state machineFelipe Balbi1-204/+159
The DesignWare USB3 core tells us which phase of a control transfer should be started, it also tells us which physical endpoint needs that transfer. With these two informations, we have all we need to simply EP0 handling quite a lot and get rid rid of the SW state machine tracking ep0 states. For achieving this perfectly, we needed to add support for situations where we get XferNotReady while endpoint is still busy and XferNotReady while gadget driver still hasn't queued a request. Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-09-09usb: dwc3: ep0: add handling for unaligned OUT transfersFelipe Balbi1-5/+32
In case we have transfers which aren't aligned to wMaxPacketSize, we need to be careful with how we start the transfer with the HW. OUT transfers _must_ be aligned with wMaxPacketSize and in order to guarantee that, we use a bounce buffer. Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-09-09usb: dwc3: ep0: fix 'transfered' typoFelipe Balbi1-3/+3
trivial patch. No functional changes. Signed-off-by: Felipe Balbi <balbi@ti.com>
2011-08-23usb: Introduce DesignWare USB3 DRD DriverFelipe Balbi1-0/+782
The DesignWare USB3 is a highly configurable IP Core which can be instantiated as Dual-Role Device (DRD), Peripheral Only and Host Only (XHCI) configurations. Several other parameters can be configured like amount of FIFO space, amount of TX and RX endpoints, amount of Host Interrupters, etc. The current driver has been validated with a virtual model of version 1.73a of that core and with an FPGA burned with version 1.83a of the DRD core. We have support for PCIe bus, which is used on FPGA prototyping, and for the OMAP5, more adaptation (or glue) layers can be easily added and the driver is half prepared to handle any possible configuration the HW engineer has chosen considering we have the information on one of the GHWPARAMS registers to do runtime checking of certain features. More runtime checks can, and should, be added in order to make this driver even more flexible with regards to number of endpoints, FIFO sizes, transfer types, etc. While this supports only the device side, for now, we will add support for Host side (xHCI - see the updated series Sebastian has sent [1]) and OTG after we have it all stabilized. [1] http://marc.info/?l=linux-usb&m=131341992020339&w=2 Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>