u-boot-brain/drivers/usb
Stephen Warren 006c702688 usb: ci_udc: complete ep0 direction handling
handle_setup() currently assumes that the response to a Setup transaction
will be an OUT transaction, and any subsequent packet (if any) will be an
IN transaction. This appears to be valid in many cases; both USB
enumeration and Mass Storage work OK with this restriction. However, DFU
uses ep0 to transfer data in both directions. This renders the assumption
invalid; when sending data from device to host, the Data Stage is an IN
transaction, and the Status Stage is an OUT transaction. Enhance
handle_setup() to deduce the correct direction for the USB transactions
based on Setup transaction data.

ep0's request object only needs to be automatically re-queued when the
Data Stage completes, in order to implement the Status Stage. Once the
Status Stage transaction is complete, there is no need to re-queue the
USB request, so don't do that.

Don't sent USB request completion callbacks for Status Stage transactions.
These were queued by ci_udc itself, and only serve to confuse the USB
function code. For example, f_dfu attempts to interpret the 0-length data
buffers for Status Stage transactions as DFU packets. These buffers
contain stale data from the previous transaction. This causes f_dfu to
complain about a sequence number mismatch.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
2014-06-01 19:22:40 +02:00
..
eth usb: net: introduce support for Moschip USB ethernet 2014-03-12 17:04:31 -04:00
gadget usb: ci_udc: complete ep0 direction handling 2014-06-01 19:22:40 +02:00
host Merge branch 'u-boot-microblaze/zynq' into 'u-boot-arm/master' 2014-05-23 22:50:23 +02:00
musb usb: create common header virtual root hub descriptors 2014-03-10 18:53:36 +01:00
musb-new musb-new, dfu: first send request answer then call completions 2014-05-08 10:38:30 +02:00
phy drivers: usb: convert makefiles to Kbuild style 2013-10-31 13:25:38 -04:00
ulpi drivers: usb: convert makefiles to Kbuild style 2013-10-31 13:25:38 -04:00