Files
OpenCellular/chip
Bill Richardson f72decc804 Cr50: Implement USB according to Programmer's Guide
This is a rewrite of the Cr50 USB Device Control Endpoint
implementation, using the instructions in the DWC USB 2.0 OTG
Programmer's Guide (such as they are). Some of the major
differences:

* Not every USB interrupt indicates the receipt of an incoming
  packet. Many merely provide updates on packet transfer status,
  transaction stages, or other activity. We handle those
  cases correctly.

* We may need to start a new Control transaction at any point,
  even in the middle of an existing transaction.

* Large IN data transfers can be handled with one interrupt by
  chaining multiple together.

* Logical separation of the phases of each transaction (Setup,
  Data, Status).

That said, while this CL matches the Programmer's Guide fairly
closely, that Guide is pretty crappy and this is just the first
commit. There is still a fair amount to do (marked with comments
and bug reports). However, it works at least as well as the
previous version and is much closer to what the supplier claims
is the correct implementation.

BUG=chrome-os-partner:34893
BRANCH=none
TEST=make buildall, manual

Connect the Cr50 to my workstation via USB:
* /bin/dmesg reports no errors
* verify EP0 with lsusb -v -d 18d1:5014
* verify EP1 with './extra/usb_console -e 1 -p 5014' (reverses
  case of input text)
* verify EP2 with the 'hid' command on the EC console (types a 'g')

We also connected this device to Windows, and Mac laptops (and a
Chromebook) and used a USB bus analyzer to monitor the behavior.
It works on machines those, too.

Change-Id: Ic515ea83e217a8d0552d61ac5eb19693661fcd15
Signed-off-by: Bill Richardson <wfrichar@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/318864
Reviewed-by: Dominic Rizzo <domrizzo@google.com>
2015-12-17 15:46:38 -08:00
..