USB

USB Host Hardware
USB Host 1 --> USB PORT ---                                  VBUS_POWER1--^ CLK2 ---> | EHCI | OHCI | < CLK1 ---                |     PHY1    | <| ---                     |                        ^-RESET1                  | |CLK5 USB Host 2---+-> USB PORT ---                     |            VBUS_POWER2--^ CLK4 ---> | EHCI | OHCI | <--- CLK3           | ---                     |                 |     PHY2    | <| -                       ^-RESET2

USB Host Status in Mainline Kernel / U-Boot
Currently only EHCI support is added. It is trivial to add OHCI support. It will be added once all the EHCI bugs are squashed. If you want OHCI support now, please submit patches.

Patches

 * Up to date patches against sunxi-next can be found here https://github.com/arokux/linux

Supported SoCs

 * A10
 * A20
 * A13
 * (A31 very preliminary work has been posted to the ML by bamvor)

USB devices known to work

 * USB Keyboard
 * USB 2 Ethernet adapter
 * USB Stick/HDD (This allows you to have your rootfs on a USB stick/HDD. Add root=/dev/sda1 rootwait to your cmdline.)

Known issues

 * On-board WiFi module (idVendor=0bda, idProduct=8176) is identified and causes "detected XactErr len 0/0 retry" but works, see dmesg.
 * U-Boot output weired error messages if a USB sound card or USB midi device is plugged in on boot, both are full speed devices

Reporting USB problem
If reporting USB Host related problems please turn on the following options in the menuconfig
 * Device Drivers > USB support > USB verbose debug messages
 * Device Drivers > USB support > USB announce new devices
 * Change 0 to 1 at the line #37 of the drivers/usb/host/sw_hci_sunxi.h

Afterwards rebuild and boot a new kernel and submit the following information
 * The exact tag or hash of the Linux kernel you are using
 * Your .config
 * Output of dmesg
 * Output of cat /proc/ccmu
 * Output of the following
 * devmem2 0x01c14800
 * devmem2 0x01c1c800
 * devmem2 0x01c200cc
 * devmem2 0x01c20060

Tipp: You can use sprunge.us paste service easily from the command line, for example cat .config | curl -F 'sprunge=<-' http://sprunge.us

TODO

 * U-Boot: A13: Modify a GPIO that controls power to VBUS