USB OTG Controller Register Guide

= USB Vocabulary = HCD - Host Controller Driver

UDC - USB Device Controller

= USB OTG = All Allwinner A-series SoCs come with one USB OTG controller. The controller has been identified as a Mentor Graphics Inventra HDRC (High-speed Dual Role Controller), which is supported by the "musb" driver. However, the register addresses are scrambled.

The A20 manual lists the following features
 * Complies with USB 2.0 specification
 * Supports high-speed, full-speed, and low-speed in host mode
 * Supports high-speed and full-speed in device mode
 * 64 byte endpoint 0 for control transfer
 * Supports up to 5 user configurable endpoints for bulk, isochronous, control, and interrupt bi-directional transfers

The USB OTG controller is connected to a port controller. Only the data pins are exported from the SoC. The port controller is also used to control or tune the USB PHYs for the other USB host controllers.

Info

 * USB OTG Controller base address: 0x01c13000
 * USB Port Controller base address: 0x01c13400

Default Map
sun7i# md 0x01c13000 0x100 01c13000: 6f427dee 6f427dee 6f427dee 6f427dee   .}Bo.}Bo.}Bo.}Bo 01c13010: 6f427dee 6f427dee 00000000 00000000   .}Bo.}Bo........ 01c13020: 00000000 00000000 00000000 00000000   ................ 01c13030: 00000000 00000000 00000000 00000000   ................ 01c13040: 00008020 00000000 00000000 00000000    ............... 01c13050: 00000000 00000000 00000000 00000000   ................ 01c13060: 00000000 00000000 00000000 00000000   ................ 01c13070: 00000000 00000000 00000000 00000000   ................ 01c13080: 00000000 00000000 00000000 00000000   ................ 01c13090: 00000000 00000000 00000000 00000000   ................ 01c130a0: 00000000 00000000 00000000 00000000   ................ 01c130b0: 00000000 00000000 00000000 00000000   ................ 01c130c0: 000b55de 5c727780 0000003c 00000000   .U...wr\<....... 01c130d0: 00000000 05e64074 00000000 00000000   ....t@.......... 01c130e0: 00000000 00000000 00000000 00000000   ................ 01c130f0: 00000000 00000000 00000000 00000000   ................ 01c13100: 00000000 00000000 00000000 00000000   ................ 01c13110: 00000000 00000000 00000000 00000000   ................ 01c13120: 00000000 00000000 00000000 00000000   ................ 01c13130: 00000000 00000000 00000000 00000000   ................ 01c13140: 00000000 00000000 00000000 00000000   ................ 01c13150: 00000000 00000000 00000000 00000000   ................ 01c13160: 00000000 00000000 00000000 00000000   ................ 01c13170: 00000000 00000000 00000000 00000000   ................ 01c13180: 00000000 00000000 00000000 00000000   ................ 01c13190: 00000000 00000000 00000000 00000000   ................ 01c131a0: 00000000 00000000 00000000 00000000   ................ 01c131b0: 00000000 00000000 00000000 00000000   ................ 01c131c0: 00000000 00000000 00000000 00000000   ................ 01c131d0: 00000000 00000000 00000000 00000000   ................ 01c131e0: 00000000 00000000 00000000 00000000   ................ 01c131f0: 00000000 00000000 00000000 00000000   ................ 01c13200: 00000000 00000000 00000000 00000000   ................ 01c13210: 00000000 00000000 00000000 00000000   ................ 01c13220: 00000000 00000000 00000000 00000000   ................ 01c13230: 00000000 00000000 00000000 00000000   ................ 01c13240: 00000000 00000000 00000000 00000000   ................ 01c13250: 00000000 00000000 00000000 00000000   ................ 01c13260: 00000000 00000000 00000000 00000000   ................ 01c13270: 00000000 00000000 00000000 00000000   ................ 01c13280: 00000000 00000000 00000000 00000000   ................ 01c13290: 00000000 00000000 00000000 00000000   ................ 01c132a0: 00000000 00000000 00000000 00000000   ................ 01c132b0: 00000000 00000000 00000000 00000000   ................ 01c132c0: 00000000 00000000 00000000 00000000   ................ 01c132d0: 00000000 00000000 00000000 00000000   ................ 01c132e0: 00000000 00000000 00000000 00000000   ................ 01c132f0: 00000000 00000000 00000000 00000000   ................ 01c13300: 00000000 00000000 00000000.00000000   ................ 01c13310: 00000000 00000000 00000000 00000000   ................ 01c13320: 00000000 00000000 00000000 00000000   ................ 01c13330: 00000000 00000000 00000000 00000000   ................ 01c13340: 00000000 00000000 00000000 00000000   ................ 01c13350: 00000000 00000000 00000000 00000000   ................ 01c13360: 00000000 00000000 00000000 00000000   ................ 01c13370: 00000000 00000000 00000000 00000000   ................ 01c13380: 00000000 00000000 00000000 00000000   ................ 01c13390: 00000000 00000000 00000000 00000000   ................ 01c133a0: 00000000 00000000 00000000 00000000   ................ 01c133b0: 00000000 00000000 00000000 00000000   ................ 01c133c0: 00000000 00000000 00000000 00000000   ................ 01c133d0: 00000000 00000000 00000000 00000000   ................ 01c133e0: 00000000 00000000 00000000 00000000   ................ 01c133f0: 00000000 00000000 00000000 00000000   ................

PCTL / POWER
Default value: 0x20

Offset: 0x40

MUSB offset: 0x01

DEVCTL
Default value: 0x80

Offset: 0x41

MUSB offset: 0x60

VEND0
Default value: 0x20

Offset: 0x43

MUSB offset: 0x??

Endpoint Registers
To access these under indexed mode, you must first write the endpoint number to the INDEX register.

Default Map
sun7i# md 0x01c13400 0x4 01c13400: 40000000 00000000 00000000 00000000   ...@............

ISCR
Default value: 0x40000000

Offset: 0x0

PHY_CTRL
Default value: 0x0000

Offset: 0x4