# DesignWare On-The-Go USB Host Controller notes

The driver for the DWC controller in Dusk OS is a port from Plan 9 (9legacy
version).

The datasheets for this controller, which is the USB controller on the Raspberry
Pi, aren't publicly available. To whoever is involved in this decision: fuck you
dearly, there's some people stuck with your crappy hardware out there.

The Linux kernel DWC driver has been written by Synopsys itself, which should
normally be a good source of information about the driver. In a sense, it is,
but the driver is so complicated that, well, in the end, it's not. Plan 9's
version is much more approachable.

## Indirect information

When I was looking for information about this controller, I was studying QEMU's
dwc2 code for clues and did a "git blame" for fun. Bingo! Paul Zimmerman (big
thanks Paul!), the author of the DWC2 emulator, mentions his source information
(huge thanks for mentioning this Paul!) in his commit.

http://www.capital-micro.com/PDF/CME-M7_Family_User_Guide_EN.pdf page 370.

At the time of this writing, the direct link is broken, but you can get the PDF
from the Internet Archive. and... bingo! This is it! The specs for that damn
controller. Now *this* is of tremendous help!

## Driver usage

The DWC driver is a USB controller driver, so it works as described in
[doc/hw/usb]. You load it through [drv/rpi/dwc.fs] and initialize it through
"dwc$". Once that initialization has been done, the DWC root hub will be in the
hub list, which will allow device enumeration through "usbwork".
