chapter-26-usb-otg-2-0
chapter-26-usb-otg-2-0
26.1 Overview
USB OTG 2.0 is a Dual-Role Device controller, which supports both device and
host functions and is fully compliant with OTG Supplement to USB2.0
specification, and support high-speed (480Mbps), full-speed (12Mbps),
low-speed (1.5Mbps) transfer.
USB OTG 2.0 is optimized for portable electronic devices, point-to-point
applications (no hub, direct connection to device) and multi-point applications
to devices. USB OTG 2.0 interface supports both device and host functions and
is fully compliant with OTG Supplement to USB2.0 specification, and support
high-speed (480Mbps), full-speed (12Mbps), low-speed (1.5Mbps) transfer. It
is optimized for portable electronic device, point-to-point applications (no hub,
direct connection to device) and multi-point applications to devices.
26.1.1 Features
USB OTG
USB BUS USB OTG
UTMI 2.0 AHB
2.0 PHY
CONTROLLER
The USB OTG 2.0 Controller controls SIE (Serial Interface Engine) logic, the
endpoint logic, the channel logic and the internal DMA logic.
The SIE logic contains the USB PID and address recognition logic, and other
sequencing and state machine logic to handle USB packets and transactions.
High Performance and Low-power Processor for Digital Media Application 1036
RK3128 Technical Reference Manual Rev 1.0
Generally the SIE Logic is required for any USB implementation while the
number and types of endpoints will vary as function of application and
performance requirements.
The endpoint logic contains the endpoint specific logic: endpoint number
recognition, FIFOs and FIFO control, etc.
The channel Logic contains the channel tasks schedule, FIFOs and FIFO control,
etc.
The internal DMA logic controls data transaction between system memory and
USB FIFOs.
26.2.2 USB OTG 2.0 PHY Function
The USB OTG 2.0 PHY handles the low level USB protocol and signaling. This
includes features such as; data serialization and deserialization, bit stuffing and
clock recovery and synchronization. The primary focus of this block is to shift
the clock domain of the data from the USB 2.0 rate to the frequency of UTMI
clock which is 30MHz.
26.2.3 UTMI Interface
Transmit
Transmit must be asserted to enable any transmissions.
The USB OTG2.0 CONTROLLER asserts TXValid to begin a transmission and
negates TXValid to end a transmission. After the USB OTG2.0 CONTROLLER
asserts TXValid it can assume that the transmission has started when it detects
TXReady asserted.
The USB OTG2.0 CONTROLLER assumes that the USB OTG2.0 PHY has
consumed a data byte if TXReady and TXValid are asserted.
The USB OTG2.0 CONTROLLER must have valid packet information (PID)
asserted on the Data In bus coincident with the assertion of TXValid. Depending
on the USB OTG2.0 PHY implementation, TXReady may be asserted by the
Transmit State Machine as soon as one CLK after the assertion of TXValid.
TXValid and TXReady are sampled on the rising edge of CLK.
The Transmit State Machine does NOT automatically generate Packet ID's (PIDs)
or CRC. When transmitting, the USB OTG2.0 CONTROLLER is always expected
to present a PID as the first byte of the data stream and if appropriate, CRC as
the last bytes of the data stream.
The USB OTG2.0 CONTROLLER must use LineState to verify a Bus Idle condition
before asserting TXValid in the TX Wait state.
The state of TXReady in the TX Wait and Send SYNC states is undefined. An MTU
implementation may prepare for the next transmission immediately after the
Send EOP state and assert TXReady in the TX Wait state. An MTU
implementation may also assert TXReady in the Send SYNC state. The first
assertion of TXReady is Macrocell implementation dependent. The USB OTG2.0
CONTROLLER must prepare DataIn for the first byte to be transmitted before
asserting TXValid.
High Performance and Low-power Processor for Digital Media Application 1037
RK3128 Technical Reference Manual Rev 1.0
Receive
RXActive and RXValid are sampled on the rising edge of CLK.
In the RX Wait state the receiver is always looking for SYNC.
The USB OTG 2.0 PHY asserts RXActive when SYNC is detected (Strip SYNC
state).
The USB OTG 2.0 PHY negates RXActive when an EOP is detected (Strip EOP
state).
When RxActive is asserted, RXValid will be asserted if the RX Holding Register is
full.
RXValid will be negated if the RX Holding Register was not loaded during the
previous byte time.
This will occur if 8 stuffed bits have been accumulated.
The USB OTG2.0 Controller must be ready to consume a data byte if RXActive
and RXValid are asserted (RX Data state).
In FS mode, if a bit stuff error is detected then the Receive State Machine will
negate RXActive and RXValid, and return to the RX Wait state.
Fig.26-4 shows the main components and flow of the USB OTG 2.0 controller
High Performance and Low-power Processor for Digital Media Application 1038
RK3128 Technical Reference Manual Rev 1.0
system.
High Performance and Low-power Processor for Digital Media Application 1039
RK3128 Technical Reference Manual Rev 1.0
The host uses one transmit FIFO for all non-periodic OUT transactions and one
transmit FIFO for all periodic OUT transactions. These transmit FIFOs are used
as transmit buffers to hold the data (payload of the transmit packet) to be
transmitted over USB.
High Performance and Low-power Processor for Digital Media Application 1040
RK3128 Technical Reference Manual Rev 1.0
The host pipes the USB transactions through Request queues (one for periodic
and one for non-periodic). Each entry in the Request - queue holds the IN or
OUT channel number along with other information to perform a transaction on
the USB. The order in which the requests are written into the queue determines
the sequence of transactions on the USB. The host processes the periodic
Request queue first, followed by the non-periodic Request queue, at the
beginning of each (micro) frame.
The host uses one Receive-FIFO for all periodic and non-periodic transactions.
The FIFO is used as a Receive-buffer to hold the received data (payload of the
received packet) from the USB until it is transferred to the system memory. The
status of each packet received also goes into the FIFO. The status entry holds
the IN channel number along with other information, such as received byte
count and validity status, to perform a transaction on the AHB.
The core uses Dedicated Transmit FIFO Operation. In this mode, there are
individual transmit FIFOs for each IN endpoint.
The OTG device uses a single receive FIFO to receive the data for all the OUT
endpoints. The receive FIFO holds the status of the received data packet, such
as byte count, data PID and the validity of the received data. The DMA or the
application reads the data out of the receive FIFO as it is received.
High Performance and Low-power Processor for Digital Media Application 1041
RK3128 Technical Reference Manual Rev 1.0
Fig. 26-6 USB OTG 2.0 Controller host mode FIFO address mapping
Note: When the device is operating in Internal DMA mode, the last locations of the SPRAM are
used to store the DMAADDR values for each channel.
High Performance and Low-power Processor for Digital Media Application 1042
RK3128 Technical Reference Manual Rev 1.0
Fig. 26-7 USB OTG 2.0 Controller device mode FIFO address mapping
Note: When the device is operating in non-Scatter Gather Internal DMA mode, the last
locations of the SPRAM are used to store the DMAADDR values for each Endpoint (1 location
per endpoint). When the device is operating in Scatter Gather mode, then the last locations
of the SPRAM store the Base Descriptor address, Current Descriptor address, Current Buffer
address, and status quadlet information for each endpoint direction (4 locations per
Endpoint). If an Endpoint is bidirectional, then 4 locations will be used for IN, and another 4
for OUT).
USB PHY supports dual OTG ports’ functions and is fully compliant with USB2.0
specification, and support High-speed (480Mbps), full-speed (12Mbps),
low-speed (1.5Mbps) transfer. It provides a complete on-chip transceiver
physical solution with ESD protection. A minimum number of external
components are needed, which include a 45 ohm resistor for resistance
calibration purpose. Its feature contains:
• provide dual UTMI ports
• OTG0 Support UART Bypass Function
• Fully compliant with USB specifications Rev 2.0, 1.1 HOST/Device and OTG
V1.2.
• Supports 480Mbps (HS), 12Mbps (FS) & 1.5Mbps(LS) serial data transmission
• Supports low latency hub mode with 40 bit time round trip delay
• 8 bit or 16 bit UTMI interface compliant with UTMI+ specification level 3 Rev 1.
• Loop back BIST mode supported
• Built-in I/O and ESD structure
High Performance and Low-power Processor for Digital Media Application 1043
RK3128 Technical Reference Manual Rev 1.0
HS AFE
The HS AFE contains the low-level analog circuitry, and also the HS differential
data transmitter and receiver, to perform HS transmission envelope detection
and host disconnection detection. It works in HS mode only.
HS Transmit driver
The HS transmit driver is active only when transmit is asserted. In HS
transceiver enabled mode and the transmit state machine has data to send, the
XCVR selects input. Data from transmit data path will be driven onto the DP/DM
signal lines when enabled.
HS Differential Receiver
High Performance and Low-power Processor for Digital Media Application 1044
RK3128 Technical Reference Manual Rev 1.0
When enabled, received HS data will be multiplexed through the receive data
path to the receive shift and hold registers. It is active only in HS mode.
transmission envelope detector (Squelch detector)
When the amplitude of the differential signal at a receiver’s inputs falls below
the squelch threshold, the envelope detector will indicate the invalid data. It
must indicate squelch when the signal drops below 100mV differential
amplitude, and also, it must indicate that the line is not in the squelch state
when the signal exceeds 150mV differential amplitude.
Disconnection envelope detector
In host mode, this envelope detector is active to detect the high speed
disconnect state on the line. Disconnection must be indicated when the
amplitude of the differential signal at the downstream facing driver’s connector
is more than 625 mV, and it must not be indicated when the signal amplitude is
less than525 mV.
FS/LS AFE
In FS or LS mode, the FS/LS AFE is active to send and receive the FS or LS data
on the USB bus. Also it supports the reset, suspend and resume detection
through the data line single ended receivers.
FS/LS Transmitter
The FS/LHS transmitter is active only when transmit is asserted. In FS or LS
transceiver enabled mode and the transmit state machine has data to send, the
XCVR selects input. Data from transmit data path will be driven onto the DP/DM
signal lines when enabled.
FS/LS Differential Receiver
When enabled, received FS or LS data will be multiplexed through the receive
data path to the receive shift and hold registers. It is active only in FS or LS
modes.
Single ended receivers
The single ended receivers are used for low-speed and full-speed signaling
detection.
Digital Core TX Path
The digital core TX path has some blocks responsible for SYNC and EOP
generation, data encoding, bit stuffing and data serialization. And meanwhile,
also a TX state machine is involved to manage the communication with the
controller.
TX Shift/Hold Register
The TX shift/Hold register module consists of an 8-bit primary shift register for
parallel/serial conversion and 8-bit hold register used to buffer the next data to
serialize. This module is responsible for reading parallel data from the parallel
application bus interface upon command and serializing for transmission over
USB.
Bit stuffer
To ensure adequate signal transitions, when sending a packet on USB, a bit
stuffer is employed by the transmitter. A ‘0’ has to be inserted after every six
consecutive ones in the data stream before the data in NRZI encoded, to force
a transition in the NRZI data stream.
High Performance and Low-power Processor for Digital Media Application 1045
RK3128 Technical Reference Manual Rev 1.0
NRZI Encoder
The High speed, Full speed or low speed serial transmitted data are encoded by
The NRZI encoder. As a state transition, a ‘0’ is encoded, and as no state
transition, a ‘1’ is encoded.
Transmit state machine
The communication between the controller and the PHY in TX path is controlled
by the transmit state machine, which synchronizes the Data with the Sync and
the EOP, and also supports the LS, FS and HS Modes.
Digital Core RX Path
The digital core RX path includes blocks responsible for SYNC and EOP detection
and stripping, data decoding, bit un-stuffing and data de-serialization. Also a RX
state machine is involved to manage the communication with the controller.
FS/LS data and clock is recovered in this section.
Elasticity buffer
To compensate for differences between transmitting and receiving clocks, the
Elasticity Buffer is used to synchronize the HS extracted data with the PLL
internal clock.
Mux
The Mux block allows the data from the HS or FS/LS receivers to be routed to the
shared receive logic. The state of the Mux is determined by the Xcvr Select
input.
NRZI Decoder
The NRZI is responsible for decoding the High speed or Full speed received NRZI
encoded data. A change in level is decoded as ‘0’ and no change in level is
decoded as ‘1’.
Bit Un-stuffer
The Bit Un-stuffer not only recognizes the stuffed bits from the data stream, but
also discards them. Also it detects bit stuff error, which is interpreted as HS EOP.
RX Shift/Hold Register
This module de-serializes received data and transmits 8-bit parallel data to the
application bus interface. It consists of an 8-bit primary shit register for serial to
parallel conversion and an 8-bit hold register for buffering the last de-serialized
data byte.
Receiver state machine
The receiver state machine controls the communication between the controller
and the PHY in the RX path, strips the SYNC and the EOP from the Data and
supports the LS, FS and HS Modes.
PLL Clock Multiplier
This module is composed of the off-chip crystal and the on-chip clock multiplier.
It generates the appropriate internal clocks for the UTM and the CLK output
signal. All data transfer signals are synchronized with the CLK signal.
External Crystal
The external crystal is composed of a precise resonance frequency crystal and a
crystal oscillator. It is optional to have this crystal oscillator integrated on-chip
High Performance and Low-power Processor for Digital Media Application 1046
RK3128 Technical Reference Manual Rev 1.0
High Performance and Low-power Processor for Digital Media Application 1047
RK3128 Technical Reference Manual Rev 1.0
High Performance and Low-power Processor for Digital Media Application 1048
RK3128 Technical Reference Manual Rev 1.0
3. To ensure that the XO, Bias, and PLL blocks are powered down in Suspend
mode, set COMMONONN to 1’b1.
4. Place the USB PHY in Suspend mode by setting SUSPENDM0 to 1’b0.
5. Set BYPASSSEL0 to 1’b1.
6. To transmit data, controls BYPASSDMEN0, and BYPASSDMDATA0.
To receive data, monitor FSVPLUS0.
Reset
Name Offset Size Description
Value
USBOTG_GOTGCTL 0x0000 W 0x00000000 Control and Status Register
USBOTG_GOTGINT 0x0004 W 0x00000000 Interrupt Register
USBOTG_GAHBCFG 0x0008 W 0x00000000 AHB Configuration Register
USBOTG_GUSBCFG 0x000c W 0x00001400 USB Configuration Register
USBOTG_GRSTCTL 0x0010 W 0x80000000 Reset Register
USBOTG_GINTSTS 0x0014 W 0x00000000 Interrupt Register
USBOTG_GINTMSK 0x0018 W 0x00000000 Interrupt Mask Register
Receive Status Debug Read
USBOTG_GRXSTSR 0x001c W 0x00000000
Register
Receive Status Read and Pop
USBOTG_GRXSTSP 0x0020 W 0x00000000
Register
USBOTG_GRXFSIZ 0x0024 W 0x00000000 Receive FIFO Size Register
Non-Periodic Transmit FIFO
USBOTG_GNPTXFSIZ 0x0028 W 0x00000000
Size Register
Non-Periodic Transmit
USBOTG_GNPTXSTS 0x002c W 0x00000000
FIFO/Queue Status Register
USBOTG_GI2CCTL 0x0030 W 0x11000000 I2C Address Register
USBOTG_GPVNDCTL 0x0034 W 0x00000000 PHY Vendor Control Register
General Purpose Input /
USBOTG_GGPIO 0x0038 W 0x00000000
Output Register
USBOTG_GUID 0x003c W 0x00000000 User ID Register
USBOTG_GSNPSID 0x0040 W 0x00004f54 Core ID Register
USBOTG_GHWCFG1 0x0044 W 0x00000000 User HW Config1 Register
USBOTG_GHWCFG2 0x0048 W 0x00000000 User HW Config2 Register
USBOTG_GHWCFG3 0x004c W 0x00000000 User HW Config3 Register
USBOTG_GHWCFG4 0x0050 W 0x00000000 User HW Config4 Register
High Performance and Low-power Processor for Digital Media Application 1049
RK3128 Technical Reference Manual Rev 1.0
Reset
Name Offset Size Description
Value
Core LPM Configuration
USBOTG_GLPMCFG 0x0054 W 0x00000000
Register
USBOTG_GPWRDN 0x0058 W 0x00000000 Global Power Down Register
USBOTG_GDFIFOCF Global DFIFO Software
0x005c W 0x00000000
G Configuration Register
ADP Timer, Control and
USBOTG_GADPCTL 0x0060 W 0x00000000
Status Register
Host Periodic Transmit FIFO
USBOTG_HPTXFSIZ 0x0100 W 0x00000000
Size Register
0x0104 Device Periodic Transmit
USBOTG_DIEPTXFn +4*(n- W 0x00000000 FIFO-n Size Register
1) n = 1 - 15
USBOTG_HCFG 0x0400 W 0x00000000 Host Configuration Register
USBOTG_HFIR 0x0404 W 0x00000000 Host Frame Interval Register
Host Frame Number/Frame
USBOTG_HFNUM 0x0408 W 0x0000ffff
Time Remaining Register
Host Periodic Transmit
USBOTG_HPTXSTS 0x0410 W 0x00000000
FIFO/Queue Status Register
Host All Channels Interrupt
USBOTG_HAINT 0x0414 W 0x00000000
Register
Host All Channels Interrupt
USBOTG_HAINTMSK 0x0418 W 0x00000000
Mask Register
Host Port Control and Status
USBOTG_HPRT 0x0440 W 0x00000000
Register
0x0500 Host Channel-n
USBOTG_HCCHARn +0x20 W 0x00000000 Characteristics Register
*n n = 0 - 15
0x0504 Host Channel-n Split Control
USBOTG_HCSPLTn +0x20 W 0x00000000 Register
*n n = 0 - 15
0x0508 Host Channel-n Interrupt
USBOTG_HCINTn +0x20 W 0x00000000 Register
*n n = 0 - 15
0x050c Host Channel-n Interrupt
USBOTG_HCINTMSK
+0x20 W 0x00000000 Mask Register
n
*n n = 0 - 15
0x0510 Host Channel-n Transfer Size
USBOTG_HCTSIZn +0x20 W 0x00000000 Register
*n n = 0 - 15
0x0514 Host Channel-n DMA Address
USBOTG_HCDMAn +0x20 W 0x00000000 Register
*n n = 0 - 15
0x051c Host Channel-n DMA Buffer
USBOTG_HCDMABn +0x20 W 0x00000000 Address Register
*n n = 0 - 15
USBOTG_DCFG 0x0800 W 0x08200000 Device Configuration Register
USBOTG_DCTL 0x0804 W 0x00002000 Device Control Register
USBOTG_DSTS 0x0808 W 0x00000000 Device Status Register
Device IN Endpoint common
USBOTG_DIEPMSK 0x0810 W 0x00000000
interrupt mask register
High Performance and Low-power Processor for Digital Media Application 1050
RK3128 Technical Reference Manual Rev 1.0
Reset
Name Offset Size Description
Value
Device OUT Endpoint
USBOTG_DOEPMSK 0x0814 W 0x00000000 common interrupt mask
register
Device All Endpoints interrupt
USBOTG_DAINT 0x0818 W 0x00000000
register
Device All Endpoint interrupt
USBOTG_DAINTMSK 0x081c W 0x00000000
mask register
Device IN token sequence
USBOTG_DTKNQR1 0x0820 W 0x00000000
learning queue read register1
Device IN token sequence
USBOTG_DTKNQR2 0x0824 W 0x00000000
learning queue read register2
Device VBUS discharge time
USBOTG_DVBUSDIS 0x0828 W 0x00000b8f
register
USBOTG_DVBUSPUL Device VBUS Pulsing Timer
0x082c W 0x00000000
SE Register
Device Threshold Control
USBOTG_DTHRCTL 0x0830 W 0x08100020
Register
Device IN endpoint FIFO
USBOTG_DIEPEMPM
0x0834 W 0x00000000 empty interrupt mask
SK
register
Device each endpoint
USBOTG_DEACHINT 0x0838 W 0x00000000
interrupt register
USBOTG_DEACHINT Device each endpoint
0x083c W 0x00000000
MSK interrupt register mask
Device each IN endpoint -n
USBOTG_DIEPEACH 0x0840
W 0x00000000 interrupt Register
MSKn +4*n
n = 0 - 15
Device each out endpoint-n
USBOTG_DOEPEACH 0x0880
W 0x00000000 interrupt register
MSKn +4*n
n = 0 - 15
Device control IN endpoint 0
USBOTG_DIEPCTL0 0x0900 W 0x00008000
control register
0x0908 Device Endpoint-n Interrupt
USBOTG_DIEPINTn +0x20 W 0x00000000 Register
*n n = 0 - 15
0x0910 Device endpoint n transfer
USBOTG_DIEPTSIZn +0x20 W 0x00000000 size register
*n n = 0 - 15
0x0914 Device endpoint-n DMA
USBOTG_DIEPDMAn +0x20 W 0x00000000 address register
*n n = 0 - 15
0x0918 Device IN endpoint transmit
USBOTG_DTXFSTSn +0x20 W 0x00000000 FIFO status register
*n n = 0 - 15
USBOTG_DIEPDMAB Device endpoint-n DMA buffer
0x091c W 0x00000000
n address register
0x0920 Device endpoint-n control
USBOTG_DIEPCTLn +0x20 W 0x00000000 register
*(n-1) n = 1 - 15
Device control OUT endpoint
USBOTG_DOEPCTL0 0x0b00 W 0x00000000
0 control register
High Performance and Low-power Processor for Digital Media Application 1051
RK3128 Technical Reference Manual Rev 1.0
Reset
Name Offset Size Description
Value
0x0b08 Device endpoint-n control
USBOTG_DOEPINTn +0x20 W
0x00000000 register
*n n = 0 - 15
0x0b10 Device endpoint n transfer
USBOTG_DOEPTSIZn +0x20
W 0x00000000 size register
*n n = 0 - 15
0x0b14 Device Endpoint-n DMA
USBOTG_DOEPDMAn +0x20
W 0x00000000 Address Register
*n n = 0 - 15
0x0b1c Device endpoint-n DMA buffer
USBOTG_DOEPDMAB
+0x20
W 0x00000000 address register
n
*n n = 0 - 15
0x0b20 Device endpoint-n control
USBOTG_DOEPCTLn +0x20
W 0x00000000 register
*(n-1) n = 1 - 15
Power and clock gating
USBOTG_PCGCR 0x0b24 W 0x200b8000
control register
Notes: Size : B - Byte (8 bits) access, HW - Half WORD (16 bits) access, W
-WORD (32 bits) access
USBOTG_GOTGCTL
Address: Operational Base + offset (0x0000)
Control and Status Register
Bit Attr Reset Value Description
31:28 RO 0x0 reserved
ChirpEn
Chirp on enable
This bit when programmed to 1'b1 results in
the core asserting chirp_on before sending an
27 RW 0x0
actual Chirp "K" signal on USB. This bit is
present only if OTG_BC_SUPPORT = 1. If
OTG_BC_SUPPORT != 1, this bit is a reserved
bit.
MultValidBc
Multi Valued ID pin
Battery Charger ACA inputs in the following
order:
Bit 26 - rid_float.
Bit 25 - rid_gnd
26:22 RO 0x00
Bit 24 - rid_a
Bit 23 - rid_b
Bit 22 - rid_c
These bits are present only if
OTG_BC_SUPPORT = 1. Otherwise, these bits
are reserved and will read 5'h0.
21 RO 0x0 reserved
High Performance and Low-power Processor for Digital Media Application 1052
RK3128 Technical Reference Manual Rev 1.0
High Performance and Low-power Processor for Digital Media Application 1053
RK3128 Technical Reference Manual Rev 1.0
High Performance and Low-power Processor for Digital Media Application 1054
RK3128 Technical Reference Manual Rev 1.0
USBOTG_GOTGINT
Address: Operational Base + offset (0x0004)
Interrupt Register
Bit Attr Reset Value Description
31:21 RO 0x0 reserved
MultiValueChg
Multi-Valued input changed
This bit when set indicates that there is a
20 W1C 0x0 change in the value of at least one ACA pin
value. This bit is present only if
OTG_BC_SUPPORT = 1, otherwise it is
reserved.
DbnceDone
Debounce Done
The core sets this bit when the debounce is
completed after the device connection. The
application can start driving USB reset after
19 W1C 0x0
seeing this interrupt. This bit is only valid
when the HNP Capable or SRP Capable bit is
set in the Core USB Configuration register
(GUSBCFG.HNPCap or GUSBCFG.SRPCap,
respectively).
ADevTOUTChg
A-Device Timeout Change
18 W1C 0x0 The core sets this bit to indicate that the
A-device has timed out while waiting for the
B-device to connect.
HstNegDet
Host Negotiation Detected
17 W1C 0x0
The core sets this bit when it detects a host
negotiation request on the USB
16:10 RO 0x0 reserved
HstNegSucStsChng
Host Negotiation Success Status Change
The core sets this bit on the success or failure
of a USB host negotiation request. The
9 W1C 0x0
application must read the Host Negotiation
Success bit of the OTG Control and Status
register (GOTGCTL.HstNegScs) to check for
success or failure
High Performance and Low-power Processor for Digital Media Application 1055
RK3128 Technical Reference Manual Rev 1.0
USBOTG_GAHBCFG
Address: Operational Base + offset (0x0008)
AHB Configuration Register
Bit Attr Reset Value Description
31:23 RO 0x0 reserved
NotiAllDmaWrit
Notify All Dma Write Transactions
This bit is programmed to enable the System
DMA Done functionality for all the DMA write
Transactions corresponding to the
Channel/Endpoint. This bit is valid only when
GAHBCFG.RemMemSupp is set to 1.
GAHBCFG.NotiAllDmaWrit = 1.
HSOTG core asserts int_dma_req for all the
DMA write transactions on the AHB interface
along with int_dma_done, chep_last_transact
22 RW 0x0 and chep_number signal informations. The
core waits for sys_dma_done signal for all the
DMA write transactions in order to complete
the transfer of a particular Channel/Endpoint.
GAHBCFG.NotiAllDmaWrit = 0.
HSOTG core asserts int_dma_req signal only
for the last transaction of DMA write transfer
corresponding to a particular
Channel/Endpoint. Similarly, the core waits
for sys_dma_done signal only for that
transaction of DMA write to complete the
transfer of a particular Channel/Endpoint.
High Performance and Low-power Processor for Digital Media Application 1056
RK3128 Technical Reference Manual Rev 1.0
High Performance and Low-power Processor for Digital Media Application 1057
RK3128 Technical Reference Manual Rev 1.0
High Performance and Low-power Processor for Digital Media Application 1058
RK3128 Technical Reference Manual Rev 1.0
USBOTG_GUSBCFG
Address: Operational Base + offset (0x000c)
USB Configuration Register
Bit Attr Reset Value Description
CorruptTxpacket
Corrupt Tx packet
31 RW 0x0
This bit is for debug purposes only. Never set
this bit to 1.
High Performance and Low-power Processor for Digital Media Application 1059
RK3128 Technical Reference Manual Rev 1.0
High Performance and Low-power Processor for Digital Media Application 1060
RK3128 Technical Reference Manual Rev 1.0
High Performance and Low-power Processor for Digital Media Application 1061
RK3128 Technical Reference Manual Rev 1.0
High Performance and Low-power Processor for Digital Media Application 1062
RK3128 Technical Reference Manual Rev 1.0
High Performance and Low-power Processor for Digital Media Application 1063
RK3128 Technical Reference Manual Rev 1.0
High Performance and Low-power Processor for Digital Media Application 1064
RK3128 Technical Reference Manual Rev 1.0
High Performance and Low-power Processor for Digital Media Application 1065
RK3128 Technical Reference Manual Rev 1.0
USBOTG_GRSTCTL
Address: Operational Base + offset (0x0010)
Reset Register
Bit Attr Reset Value Description
AHBIdle
AHB Master Idle
31 RO 0x1
Indicates that the AHB Master State Machine
is in the IDLE condition.
DMAReq
DMA Request Signal
30 RO 0x0
Indicates that the DMA request is in progress.
Used for debug.
29:11 RO 0x0 reserved
High Performance and Low-power Processor for Digital Media Application 1066
RK3128 Technical Reference Manual Rev 1.0
High Performance and Low-power Processor for Digital Media Application 1067
RK3128 Technical Reference Manual Rev 1.0
High Performance and Low-power Processor for Digital Media Application 1068
RK3128 Technical Reference Manual Rev 1.0
USBOTG_GINTSTS
High Performance and Low-power Processor for Digital Media Application 1069
RK3128 Technical Reference Manual Rev 1.0
High Performance and Low-power Processor for Digital Media Application 1070
RK3128 Technical Reference Manual Rev 1.0
High Performance and Low-power Processor for Digital Media Application 1071
RK3128 Technical Reference Manual Rev 1.0
High Performance and Low-power Processor for Digital Media Application 1072
RK3128 Technical Reference Manual Rev 1.0
High Performance and Low-power Processor for Digital Media Application 1073
RK3128 Technical Reference Manual Rev 1.0
High Performance and Low-power Processor for Digital Media Application 1074
RK3128 Technical Reference Manual Rev 1.0
High Performance and Low-power Processor for Digital Media Application 1075
RK3128 Technical Reference Manual Rev 1.0
USBOTG_GINTMSK
Address: Operational Base + offset (0x0018)
Interrupt Mask Register
Bit Attr Reset Value Description
WkUpIntMsk
31 RW 0x0 Resume/Remote Wakeup Detected Interrupt
Mask
SessReqIntMsk
30 RW 0x0 Session Request/New Session Detected
Interrupt Mask
DisconnIntMsk
29 RW 0x0
Disconnect Detected Interrupt Mask
ConIDStsChngMsk
28 RW 0x0
Connector ID Status Change Mask
LPM_IntMsk
27 RW 0x0
LPM Transaction Received Interrupt Mask
PTxFEmpMsk
26 RW 0x0
Periodic TxFIFO Empty Mask
HChIntMsk
25 RW 0x0
Host Channels Interrupt Mask
PrtIntMsk
24 RW 0x0
Host Port Interrupt Mask
ResetDetMsk
23 RW 0x0
Reset Detected Interrupt Mask
FetSuspMsk
22 RW 0x0
Data Fetch Suspended Mask
incomplPMsk_incompISOOUTMsk
Incomplete Periodic Transfer Mask(Host only)
21 RW 0x0
Incomplete Isochronous OUT Transfer
Mask(Device only)
incompISOINMsk
20 RW 0x0
Incomplete Isochronous IN Transfer Mask
OEPIntMsk
19 RW 0x0
OUT Endpoints Interrupt Mask
High Performance and Low-power Processor for Digital Media Application 1076
RK3128 Technical Reference Manual Rev 1.0
USBOTG_GRXSTSR
Address: Operational Base + offset (0x001c)
Receive Status Debug Read Register
Bit Attr Reset Value Description
31:25 RO 0x0 reserved
High Performance and Low-power Processor for Digital Media Application 1077
RK3128 Technical Reference Manual Rev 1.0
USBOTG_GRXSTSP
Address: Operational Base + offset (0x0020)
Receive Status Read and Pop Register
High Performance and Low-power Processor for Digital Media Application 1078
RK3128 Technical Reference Manual Rev 1.0
USBOTG_GRXFSIZ
High Performance and Low-power Processor for Digital Media Application 1079
RK3128 Technical Reference Manual Rev 1.0
USBOTG_GNPTXFSIZ
Address: Operational Base + offset (0x0028)
Non-Periodic Transmit FIFO Size Register
Bit Attr Reset Value Description
NPTxFDep
Non-periodic TxFIFO
For host mode, this field is always valid. For
Device mode, this field is valid only when
OTG_EN_DED_TX_FIFO==0. This value is in
terms of 32-bit words. Minimum value is 16
Maximum value is 32,768
This field is determined by Enable Dynamic
FIFO Sizing.
OTG_DFIFO_DYNAMIC = 0: These flops are
optimized, and reads return the
Power on value.
31:16 RW 0x0000 OTG_DFIFO_DYNAMIC = 1: The application
can write a new value in this field.
Programmed values must not exceed the
power-on value.
The power-on reset value of this field is
specified by OTG_EN_DED_TX_FIFO:
OTG_EN_DED_TX_FIFO = 0:The reset value
is the Largest Non-periodic Tx
Data FIFO Depth parameter,
OTG_TX_NPERIO_DFIFO_DEPTH.
OTG_EN_DED_TX_FIFO = 1: The reset value
is parameter
OTG_TX_HNPERIO_DFIFO_DEPTH.
High Performance and Low-power Processor for Digital Media Application 1080
RK3128 Technical Reference Manual Rev 1.0
USBOTG_GNPTXSTS
Address: Operational Base + offset (0x002c)
Non-Periodic Transmit FIFO/Queue Status Register
Bit Attr Reset Value Description
31 RO 0x0 reserved
NPTxQTop
Top of the Non-periodic Transmit Request
Queue
Entry in the Non-periodic Tx Request Queue
that is currently being processed by the MAC.
Bits [30:27]: Channel/endpoint number
Bits [26:25]:
30:24 RO 0x00
2'b00: IN/OUT token
2'b01: Zero-length transmit packet (device
IN/host OUT)
2'b10: PING/CSPLIT token
2'b11: Channel halt command
Bit [24]: Terminate (last entry for selected
channel/endpoint)
NPTxQSpcAvail
Non-periodic Transmit Request Queue Space
Available
Indicates the amount of free space available in
the Non-periodic Transmit Request Queue.
This queue holds both IN and OUT requests in
Host mode. Device mode has only IN
23:16 RO 0x00
requests.
8'h0: Non-periodic Transmit Request Queue
is full
8'h1: 1 location available
8'h2: 2 locations available
n: n locations available (0 <=n <= 8)
Others: Reserved
High Performance and Low-power Processor for Digital Media Application 1081
RK3128 Technical Reference Manual Rev 1.0
USBOTG_GI2CCTL
Address: Operational Base + offset (0x0030)
I2C Address Register
Bit Attr Reset Value Description
BsyDne
I2C Busy/Done
The application sets this bit to 1'b1 to start a
request on the I2C interface. When the
31 R/WSC 0x0
transfer is complete, the core de-asserts this
bit to 1'b0. As long as the bit is set, indicating
that the I2C interface is busy, the application
cannot start another request on the interface.
RW
Read/Write Indicator
Indicates whether a read or write register
transfer must be performed on the interface.
30 RW 0x0
Read/write bursting is not supported for
registers.
1'b1: Read
1'b0: Write
29 RO 0x0 reserved
I2CDatSe0
I2C DatSe0 USB Mode
28 RW 0x1 Selects the FS interface USB mode.
1'b1: VP_VM USB mode
1'b0: DAT_SE0 USB mode
I2CDevAdr
I2C Device Address
Selects the address of the I2C Slave on the
USB 1.1 full-speed serial transceiver that the
27:26 RW 0x0 core uses for OTG signaling.
2'b00: 7'h2C
2'b01: 7'h2D
2'b10: 7'h2E
2'b11: 7'h2F
High Performance and Low-power Processor for Digital Media Application 1082
RK3128 Technical Reference Manual Rev 1.0
USBOTG_GPVNDCTL
Address: Operational Base + offset (0x0034)
PHY Vendor Control Register
Bit Attr Reset Value Description
High Performance and Low-power Processor for Digital Media Application 1083
RK3128 Technical Reference Manual Rev 1.0
High Performance and Low-power Processor for Digital Media Application 1084
RK3128 Technical Reference Manual Rev 1.0
USBOTG_GGPIO
Address: Operational Base + offset (0x0038)
General Purpost Input/Output Register
Bit Attr Reset Value Description
GPO
General Purpose Output
This field is driven as an output from the core,
31:16 RW 0x0000
gp_o[15:0]. The application can program this
field to determine the corresponding value on
the gp_o[15:0] output.
GPI
General Purpose Input
15:0 RO 0x0000
This field's read value reflects the gp_i[15:0]
core input value.
USBOTG_GUID
Address: Operational Base + offset (0x003c)
User ID Register
Bit Attr Reset Value Description
UserID
31:0 RW 0x00000000
Application-programmable ID field.
USBOTG_GSNPSID
Address: Operational Base + offset (0x0040)
Core ID Register
Bit Attr Reset Value Description
CoreID
31:0 RO 0x00004f54
Release number of the core being used
USBOTG_GHWCFG1
Address: Operational Base + offset (0x0044)
User HW Config1 Register
Bit Attr Reset Value Description
epdir
Endpoint Direction
This 32-bit field uses two bits per endpoint to
determine the endpoint direction.
Endpoint
Bits [31:30]: Endpoint 15 direction
Bits [29:28]: Endpoint 14 direction
...
31:0 RO 0x00000000
Bits [3:2]: Endpoint 1 direction
Bits[1:0]: Endpoint 0 direction (always
BIDIR)
Direction
2'b00: BIDIR (IN and OUT) endpoint
2'b01: IN endpoint
2'b10: OUT endpoint
2'b11: Reserved
High Performance and Low-power Processor for Digital Media Application 1085
RK3128 Technical Reference Manual Rev 1.0
USBOTG_GHWCFG2
Address: Operational Base + offset (0x0048)
User HW Config2 Register
Bit Attr Reset Value Description
OTG_ENABLE_IC_USB
IC_USB mode specified for mode of operation
(parameter OTG_ENABLE_IC_USB). To
31 RO 0x0
choose IC_USB_MODE, both
OTG_FSPHY_INTERFACE and
OTG_ENABLE_IC_USB must be 1.
TknQDepth
Device Mode IN Token Sequence Learning
30:26 RO 0x00
Queue Depth
Range: 0-30
PTxQDepth
Host Mode Periodic Request Queue Depth
2'b00: 2
25:24 RO 0x0
2'b01: 4
2'b10: 8
Others: Reserved
NPTxQDepth
Non-periodic Request Queue Depth
2'b00: 2
23:22 RO 0x0
2'b01: 4
2'b10: 8
Others: Reserved
21 RO 0x0 reserved
MultiProcIntrpt
Multi-Processor Interrupt Enabled
20 RO 0x0
1'b0: No
1'b1: Yes
DynFifoSizing
Dynamic FIFO Sizing Enabled
19 RO 0x0
1'b0: No
1'b1: Yes
PerioSupport
Periodic OUT Channels Supported in Host
18 RO 0x0 Mode
1'b0: No
1'b1: Yes
NumHstChnl
Number of Host Channels
Indicates the number of host channels
17:14 RO 0x0
supported by the core in Host mode. The
range of this field is 0-15: 0 specifies 1
channel, 15 specifies 16 channels.
NumDevEps
Number of Device Endpoints
Indicates the number of device endpoints
13:10 RO 0x0
supported by the core in Device mode in
addition to control endpoint 0. The range of
this field is 1-15.
High Performance and Low-power Processor for Digital Media Application 1086
RK3128 Technical Reference Manual Rev 1.0
USBOTG_GHWCFG3
Address: Operational Base + offset (0x004c)
User HW Config3 Register
Bit Attr Reset Value Description
DfifoDepth
DFIFO Depth
31:16 RO 0x0000 This value is in terms of 32-bit words.
Minimum value is 32
Maximum value is 32,768
OTG_ENABLE_LPM
15 RO 0x0 LPM mode specified for Mode of Operation
(parameter OTG_ENABLE_LPM).
High Performance and Low-power Processor for Digital Media Application 1087
RK3128 Technical Reference Manual Rev 1.0
High Performance and Low-power Processor for Digital Media Application 1088
RK3128 Technical Reference Manual Rev 1.0
USBOTG_GHWCFG4
Address: Operational Base + offset (0x0050)
User HW Config4 Register
Bit Attr Reset Value Description
SGDMA
31 RO 0x0 Scatter/Gather DMA
1'b1: Dynamic configuration
SGDMACon
Scatter/Gather DMA configuration
30 RO 0x0
1'b0: Non-Scatter/Gather DMA configuration
1'b1: Scatter/Gather DMA configuration
INEps
Number of Device Mode IN Endpoints
Including Control Endpoint
Range 0 -15
29:26 RO 0x0
0:1 IN Endpoint
1:2 IN Endpoints
....
15:16 IN Endpoints
DedFifoMode
Enable Dedicated Transmit FIFO for device IN
Endpoints
25 RW 0x0 1'b0: Dedicated Transmit FIFO Operation not
enabled.
1'b1: Dedicated Transmit FIFO Operation
enabled.
SessEndFltr
session_end Filter Enabled
24 RW 0x0
1'b0: No filter
1'b1: Filter
High Performance and Low-power Processor for Digital Media Application 1089
RK3128 Technical Reference Manual Rev 1.0
USBOTG_GLPMCFG
Address: Operational Base + offset (0x0054)
Core LPM Configuration Register
Bit Attr Reset Value Description
High Performance and Low-power Processor for Digital Media Application 1090
RK3128 Technical Reference Manual Rev 1.0
High Performance and Low-power Processor for Digital Media Application 1091
RK3128 Technical Reference Manual Rev 1.0
High Performance and Low-power Processor for Digital Media Application 1092
RK3128 Technical Reference Manual Rev 1.0
High Performance and Low-power Processor for Digital Media Application 1093
RK3128 Technical Reference Manual Rev 1.0
High Performance and Low-power Processor for Digital Media Application 1094
RK3128 Technical Reference Manual Rev 1.0
High Performance and Low-power Processor for Digital Media Application 1095
RK3128 Technical Reference Manual Rev 1.0
High Performance and Low-power Processor for Digital Media Application 1096
RK3128 Technical Reference Manual Rev 1.0
USBOTG_GPWRDN
Address: Operational Base + offset (0x0058)
Global Power Down Register
Bit Attr Reset Value Description
31:29 RO 0x0 reserved
MultValIdBC
Multi Valued ID pin
Battery Charger ACA inputs in the following
order:
Bit 26 - rid_float.
Bit 25 - rid_gnd
28:24 RO 0x00 Bit 24 - rid_a
Bit 23 - rid_b
Bit 22 - rid_c
These bits are present only if
OTG_BC_SUPPORT = 1.
Otherwise, these bits are reserved and will
read 5'h0.
ADPInt
23 W1C 0x0 ADP Interupt
This bit is set whenever there is a ADP event.
BSessVld
B Session Valid
This field reflects the B session valid status
signal from the PHY.
22 RO 0x0
1'b0: B-Valid is 0.
1'b1: B-Valid is 1.
This bit is valid only when GPWRDN.PMUActv
is 1.
High Performance and Low-power Processor for Digital Media Application 1097
RK3128 Technical Reference Manual Rev 1.0
High Performance and Low-power Processor for Digital Media Application 1098
RK3128 Technical Reference Manual Rev 1.0
High Performance and Low-power Processor for Digital Media Application 1099
RK3128 Technical Reference Manual Rev 1.0
High Performance and Low-power Processor for Digital Media Application 1100
RK3128 Technical Reference Manual Rev 1.0
USBOTG_GDFIFOCFG
Address: Operational Base + offset (0x005c)
Global DFIFO Software Config Register
Bit Attr Reset Value Description
EPInfoBaseAddr
31:16 RW 0x0000 This field provides the start address of the EP
info controller.
GDFIFOCfg
This field is for dynamic programming of the
DFIFO Size. This value takes effect
15:0 RW 0x0000 only when the application programs a
non-zero value to this register. The core does
not have any corrective logic if the FIFO sizes
are programmed incorrectly.
USBOTG_GADPCTL
Address: Operational Base + offset (0x0060)
ADP Timer,Control and Status Register
Bit Attr Reset Value Description
31:29 RO 0x0 reserved
AR
Access Request
2'b00 Read/Write Valid (updated by the
28:27 R/WSC 0x0 core)
2'b01 Read
2'b10 Write
2'b11 Reserved
AdpTmoutMsk
ADP Timeout Interrupt Mask
26 RW 0x0 When this bit is set, it unmasks the interrupt
because of AdpTmoutInt. This bit is valid only
if OTG_Ver = 1'b1(GOTGCTL[20]).
High Performance and Low-power Processor for Digital Media Application 1101
RK3128 Technical Reference Manual Rev 1.0
High Performance and Low-power Processor for Digital Media Application 1102
RK3128 Technical Reference Manual Rev 1.0
High Performance and Low-power Processor for Digital Media Application 1103
RK3128 Technical Reference Manual Rev 1.0
USBOTG_HPTXFSIZ
Address: Operational Base + offset (0x0100)
Host Periodic Transmit FIFO Size Register
Bit Attr Reset Value Description
PTxFSize
Host Periodic TxFIFO Depth
This value is in terms of 32-bit words.
Minimum value is 16
Maximum value is 32,768
The power-on reset value of this register is
specified as the Largest Host Mode Periodic Tx
Data FIFO Depth (parameter
31:16 RW 0x0000 OTG_TX_HPERIO_DFIFO_DEPTH). If Enable
Dynamic FIFO Sizing? Was deselected
(parameter OTG_DFIFO_DYNAMIC = 0),
these flops are optimized, and reads return
the power-on value. If Enable Dynamic FIFO
Sizing? was selected (parameter
OTG_DFIFO_DYNAMIC = 1), you can write a
new value in this field. Programmed values
must not exceed the power-on value set .
High Performance and Low-power Processor for Digital Media Application 1104
RK3128 Technical Reference Manual Rev 1.0
USBOTG_DIEPTXFn
Address: Operational Base + offset (0x0104+0x4*(n-1)), n = 1 - 15
Device Periodic Transmit FIFO-n Size Register
Bit Attr Reset Value Description
INEP1TxFDep
IN Endpoint TxFIFO Depth
This value is in terms of 32-bit words.
Minimum value is 16
Maximum value is 32,768
The power-on reset value of this register is
specified as the Largest IN Endpoint FIFO
number Depth (parameter
OTG_TX_DINEP_DFIFO_DEPTH_n)(0 < n <=
15).
31:16 RW 0x0000
If Enable Dynamic FIFO Sizing? was
deselected (parameter
OTG_DFIFO_DYNAMIC = 0), these flops are
optimized, and reads return the
Power-on value.
If Enable Dynamic FIFO Sizing? was selected
(parameter OTG_DFIFO_DYNAMIC = 1), you
can write a new value in this field.
Programmed values must not exceed the
Power-on value .
High Performance and Low-power Processor for Digital Media Application 1105
RK3128 Technical Reference Manual Rev 1.0
USBOTG_HCFG
Address: Operational Base + offset (0x0400)
Host Configuration Register
Bit Attr Reset Value Description
31:27 RO 0x0 reserved
PerSchedEna
Enable Periodic Scheduling
Applicable in Scatter/Gather DMA mode only.
Enables periodic scheduling within the core.
Initially, the bit is reset. The core will not
process any periodic channels. As soon as this
bit is set, the core will get ready to start
scheduling periodic channels and sets
HCFG.PerSchedStat. The setting of
26 RW 0x0
HCFG.PerSchedStat indicates the core has
enabled periodic scheduling. Once
HCFG.PerSchedEna is set, the application is
not supposed to again reset the bit unless
HCFG.PerSchedStat is set. As soon as this bit
is reset, the core will get ready to stop
scheduling periodic channels and resets
HCFG.PerSchedStat. In non-Scatter/Gather
DMA mode, this bit is reserved.
High Performance and Low-power Processor for Digital Media Application 1106
RK3128 Technical Reference Manual Rev 1.0
High Performance and Low-power Processor for Digital Media Application 1107
RK3128 Technical Reference Manual Rev 1.0
USBOTG_HFIR
Address: Operational Base + offset (0x0404)
Host Frame Interval Register
Bit Attr Reset Value Description
31:16 RO 0x0 reserved
FrInt
Frame Interval
The value that the application programs to
this field specifies the interval between two
consecutive SOFs (FS) or micro-SOFs (HS) or
Keep-Alive tokens (HS). This field contains the
number of PHY clocks that constitute the
required frame interval. The default value set
in this field for a FS operation when the PHY
clock frequency is 60 MHz. The application can
15:0 RW 0x0000 write a value to this register only after the Port
Enable bit of the Host Port Control and Status
register (HPRT.PrtEnaPort) has been set. If no
value is programmed, the core calculates the
value based on the PHY clock specified in the
FS/LS PHY Clock Select field of the Host
Configuration register (HCFG.FSLSPclkSel).
Do not change the value of this field after the
initial configuration.
125 us * (PHY clock frequency for HS)
1 ms * (PHY clock frequency for FS/LS)
USBOTG_HFNUM
Address: Operational Base + offset (0x0408)
Host Frame Number/Frame Time Remaining Register
Bit Attr Reset Value Description
High Performance and Low-power Processor for Digital Media Application 1108
RK3128 Technical Reference Manual Rev 1.0
USBOTG_HPTXSTS
Address: Operational Base + offset (0x0410)
Host Periodic Transmit FIFO/Queue Status Register
Bit Attr Reset Value Description
PTxQTop
Top of the Periodic Transmit Request Queue
This indicates the entry in the Periodic Tx
Request Queue that is currently being
processed by the MAC. This register is used for
debugging.
Bit [31]: Odd/Even (micro)frame
1'b0: send in even (micro)frame
31:24 RO 0x00 1'b1: send in odd (micro)frame
Bits [30:27]: Channel/endpoint number
Bits [26:25]: Type
2'b00: IN/OUT
2'b01: Zero-length packet
2'b10: CSPLIT
2'b11: Disable channel command
Bit [24]: Terminate (last entry for the
selected channel/endpoint)
High Performance and Low-power Processor for Digital Media Application 1109
RK3128 Technical Reference Manual Rev 1.0
USBOTG_HAINT
Address: Operational Base + offset (0x0414)
Host All Channels Interrupt Reigster
Bit Attr Reset Value Description
31:16 RO 0x0 reserved
HAINT
Channel Interrupts
One bit per channel:
15:0 RO 0x0000 Bit 0 for Channel 0
Bit 1 for Channel 1
…...
Bit 15 for Channel 15
USBOTG_HAINTMSK
Address: Operational Base + offset (0x0418)
Host All Channels Interrupt Mask Register
Bit Attr Reset Value Description
31:16 RO 0x0 reserved
HAINTMsk
Channel Interrupt Mask
15:0 RW 0x0000
One bit per channel: Bit 0 for channel 0, bit 15
for channel 15
High Performance and Low-power Processor for Digital Media Application 1110
RK3128 Technical Reference Manual Rev 1.0
USBOTG_HPRT
Address: Operational Base + offset (0x0440)
Host Port Control and Status Register
Bit Attr Reset Value Description
31:19 RO 0x0 reserved
PrtSpd
Port Speed
Indicates the speed of the device attached to
this port.
18:17 RO 0x0
2'b00: High speed
2'b01: Full speed
2'b10: Low speed
2'b11: Reserved
PrtTstCtl
Port Test Control
The application writes a nonzero value to this
field to put the port into a Test mode,and the
corresponding pattern is signaled on the port.
4'b0000: Test mode disabled
16:13 RW 0x0
4'b0001: Test_J mode
4'b0010: Test_K mode
4'b0011: Test_SE0_NAK mode
4'b0100: Test_Packet mode
4'b0101: Test_Force_Enable
Others: Reserved
PrtPwr
Port Power
The application uses this field to control power
to this port (write 1'b1 to set to 1'b1and write
12 R/WSC 0x0
1'b0 to set to 1'b0), and the core can clear this
bit on an over current condition.
1'b0: Power off
1'b1: Power on
PrtLnSts
Port Line Status
11:10 RO 0x0 Indicates the current logic level USB data lines
Bit [10]: Logic level of D+
Bit [11]: Logic level of D
9 RO 0x0 reserved
High Performance and Low-power Processor for Digital Media Application 1111
RK3128 Technical Reference Manual Rev 1.0
High Performance and Low-power Processor for Digital Media Application 1112
RK3128 Technical Reference Manual Rev 1.0
High Performance and Low-power Processor for Digital Media Application 1113
RK3128 Technical Reference Manual Rev 1.0
USBOTG_HCCHARn
Address: Operational Base + offset (0x0500)
Host Channel-n Characteristics Register
Bit Attr Reset Value Description
ChEna
Channel Enable
When Scatter/Gather mode is enabled
1'b0: Indicates that the descriptor structure
is not yet ready.
1'b1: Indicates that the descriptor structure
31 R/WSC 0x0 and data buffer with data is setup and this
channel can access the descriptor.
When Scatter/Gather mode is disabled, This
field is set by the application and cleared by
the OTG host.
1'b0: Channel disabled
1'b1: Channel enabled
ChDis
Channel Disable
The application sets this bit to stop
transmitting/receiving data on a channel,
30 R/WSC 0x0
even before the transfer for that channel is
complete. The application must wait for the
Channel Disabled interrupt before treating the
channel as disabled.
High Performance and Low-power Processor for Digital Media Application 1114
RK3128 Technical Reference Manual Rev 1.0
High Performance and Low-power Processor for Digital Media Application 1115
RK3128 Technical Reference Manual Rev 1.0
USBOTG_HCSPLTn
Address: Operational Base + offset (0x0504)
Host Channel-n Split Control Register
Bit Attr Reset Value Description
SpltEna
Split Enable
31 RW 0x0 The application sets this field to indicate that
this channel is enabled to perform split
transactions.
30:17 RO 0x0 reserved
CompSplt
Do Complete Split
16 RW 0x0 The application sets this field to request the
OTG host to perform a complete split
transaction.
XactPos
Transaction Position
This field is used to determine whether to send
all, first, middle, or last payloads with each
OUT transaction.
2'b11: All. This is the entire data payload is of
this transaction (which is less than or equal to
188 bytes).
15:14 RW 0x0
2'b10: Begin. This is the first data payload of
this transaction (which is larger than 188
bytes).
2'b00: Mid. This is the middle payload of this
transaction (which is larger than 188bytes).
2'b01: End. This is the last payload of this
transaction (which is larger than 188
bytes).
HubAddr
Hub Address
13:7 RW 0x00
This field holds the device address of the
transaction translator's hub.
High Performance and Low-power Processor for Digital Media Application 1116
RK3128 Technical Reference Manual Rev 1.0
USBOTG_HCINTn
Address: Operational Base + offset (0x0508)
Host Channel-n Interrupt Register
Bit Attr Reset Value Description
31:14 RO 0x0 reserved
DESC_LST_ROLLIntr
Descriptor rollover interrupt
This bit is valid only when Scatter/Gather DMA
13 W1C 0x0 mode is enabled. The core sets this bit when
the corresponding channel's descriptor list
rolls over. For non-Scatter/Gather DMA mode,
this bit is reserved.
XCS_XACT_ERR
Excessive Transaction Error
This bit is valid only when Scatter/Gather DMA
mode is enabled. The core sets this bit when 3
12 W1C 0x0 consecutive transaction errors occurred on
the USB bus. XCS_XACT_ERR will not be
generated for Isochronous channels. For
non-Scatter/Gather DMA mode, this bit is
reserved.
BNAIntr
BNA (Buffer Not Available) Interrupt
This bit is valid only when Scatter/Gather DMA
mode is enabled. The core generates this
11 W1C 0x0 interrupt when the descriptor accessed is not
ready for the Core to process. BNA will not be
generated for Isochronous channels. For
non-Scatter/Gather DMA mode, this bit is
reserved.
DataTglErr
Data Toggle Error
10 W1C 0x0
In Scatter/Gather DMA mode, the interrupt
due to this bit is masked in the core.
FrmOvrun
Frame Overrun
9 W1C 0x0
In Scatter/Gather DMA mode, the interrupt
due to this bit is masked in the core
BblErr
Babble Error
8 W1C 0x0
In Scatter/Gather DMA mode, the interrupt
due to this bit is masked in the core.
High Performance and Low-power Processor for Digital Media Application 1117
RK3128 Technical Reference Manual Rev 1.0
High Performance and Low-power Processor for Digital Media Application 1118
RK3128 Technical Reference Manual Rev 1.0
USBOTG_HCINTMSKn
Address: Operational Base + offset (0x050c)
Host Channel-n Interrupt Mask Register
Bit Attr Reset Value Description
31:14 RO 0x0 reserved
DESC_LST_ROLLIntrMsk
Descriptor rollover interrupt Mask register
13 RW 0x0 This bit is valid only when Scatter/Gather DMA
mode is enabled. In non-Scatter/Gather DMA
mode, this bit is reserved.
12 RO 0x0 reserved
BNAIntrMsk
BNA (Buffer Not Available) Interrupt mask
register
11 RW 0x0
This bit is valid only when Scatter/Gather DMA
mode is enabled. In non-Scatter/Gather DMA
mode, this bit is reserved.
DataTglErrMsk
Data Toggle Error Mask
10 RW 0x0
This bit is not applicable in Scatter/Gather
DMA mode.
FrmOvrunMsk
Frame Overrun Mask
9 RW 0x0
This bit is not applicable in Scatter/Gather
DMA mode.
BblErrMsk
Babble Error Mask
8 RW 0x0
This bit is not applicable in Scatter/Gather
DMA mode.
XactErrMsk
Transaction Error Mask
7 RW 0x0
This bit is not applicable in Scatter/Gather
DMA mode
NyetMsk
NYET Response Received Interrupt Mask
6 RW 0x0
This bit is not applicable in Scatter/Gather
DMA mode.
AckMsk
ACK Response Received/Transmitted
5 RW 0x0 Interrupt Mask
This bit is not applicable in Scatter/Gather
DMA mode.
NakMsk
NAK Response Received Interrupt Mask
4 RW 0x0
This bit is not applicable in Scatter/Gather
DMA mode.
StallMsk
STALL Response Received Interrupt Mask
3 RW 0x0
This bit is not applicable in Scatter/Gather
DMA mode.
High Performance and Low-power Processor for Digital Media Application 1119
RK3128 Technical Reference Manual Rev 1.0
USBOTG_HCTSIZn
Address: Operational Base + offset (0x0510)
Host Channel-n Transfer Size Register
Bit Attr Reset Value Description
DoPng
Do Ping
This bit is used only for OUT transfers. Setting
31 RW 0x0 this field to 1 directs the host to do PING
protocol. Note: Do not set this bit for IN
transfers. If this bit is set for IN transfers it
disables the channel.
Pid
PID
The application programs this field with the
type of PID to use for the initial transaction.
The host maintains this field for the rest of the
30:29 RW 0x0
transfer.
2'b00: DATA0
2'b01: DATA2
2'b10: DATA1
2'b11: MDATA (non-control)/SETUP (control)
PktCnt
Packet Count
This field is programmed by the application
with the expected number of packets to be
transmitted (OUT) or received (IN).The host
decrements this count on every successful
28:19 RW 0x000
transmission or reception of an OUT/IN
packet. Once this count reaches zero, the
application is interrupted to indicate normal
completion. The width of this counter is
specified as Width of Packet Counters
(parameter OTG_PACKET_COUNT_WIDTH).
High Performance and Low-power Processor for Digital Media Application 1120
RK3128 Technical Reference Manual Rev 1.0
USBOTG_HCDMAn
Address: Operational Base + offset (0x0514)
Host Channel-n DMA Address Register
Bit Attr Reset Value Description
DMAAddr
DMA Address
This field holds the start address in the
31:0 RW 0x00000000 external memory from which the data for
the endpoint must be fetched or to which it
must be stored. This register is
incremented on every AHB transaction.
USBOTG_HCDMABn
Address: Operational Base + offset (0x051c)
Host Channel-n DMA Buffer Address Register
Bit Attr Reset Value Description
HCDMABn
Holds the current buffer address
This register is updated as and when the data
31:0 RO 0x00000000 transfer for the corresponding end point is in
progress. This register is present only in
Scatter/Gather DMA mode. Otherwise this
field is reserved.
USBOTG_DCFG
Address: Operational Base + offset (0x0800)
Device Cconfiguration Register
Bit Attr Reset Value Description
ResValid
Resume Validation Period
This field controls the period when the core
resumes from a suspend. When this bit is set,
31:26 RW 0x02
the core counts for the ResValid number of
clock cycles to detect a valid resume. This field
is effective only when DCFG.Ena32KHzSusp is
set.
High Performance and Low-power Processor for Digital Media Application 1121
RK3128 Technical Reference Manual Rev 1.0
High Performance and Low-power Processor for Digital Media Application 1122
RK3128 Technical Reference Manual Rev 1.0
High Performance and Low-power Processor for Digital Media Application 1123
RK3128 Technical Reference Manual Rev 1.0
USBOTG_DCTL
Address: Operational Base + offset (0x0804)
Device Control Register
Bit Attr Reset Value Description
31:17 RO 0x0 reserved
NakOnBble
Set NAK automatically on babble
16 RW 0x0
The core sets NAK automatically for the
endpoint on which babble is received.
High Performance and Low-power Processor for Digital Media Application 1124
RK3128 Technical Reference Manual Rev 1.0
High Performance and Low-power Processor for Digital Media Application 1125
RK3128 Technical Reference Manual Rev 1.0
High Performance and Low-power Processor for Digital Media Application 1126
RK3128 Technical Reference Manual Rev 1.0
USBOTG_DSTS
Address: Operational Base + offset (0x0808)
Device Status Register
Bit Attr Reset Value Description
High Performance and Low-power Processor for Digital Media Application 1127
RK3128 Technical Reference Manual Rev 1.0
USBOTG_DIEPMSK
Address: Operational Base + offset (0x0810)
High Performance and Low-power Processor for Digital Media Application 1128
RK3128 Technical Reference Manual Rev 1.0
USBOTG_DOEPMSK
Address: Operational Base + offset (0x0814)
Device OUT Endpoint common interrupt mask register
Bit Attr Reset Value Description
31:15 RO 0x0 reserved
NYETMsk
14 RW 0x0
NYET Interrupt Mask
NAKMsk
13 RW 0x0
NAK Interrupt Mask
BbleErrMsk
12 RW 0x0
Babble Interrupt Mask
11:10 RO 0x0 reserved
BnaOutIntrMsk
9 RW 0x0
BNA interrupt Mask
OutPktErrMsk
8 RW 0x0
OUT Packet Error Mask
7 RO 0x0 reserved
Back2BackSETup
6 RW 0x0 Back-to-Back SETUP Packets Received Mask
Applies to control OUT endpoints only.
5 RO 0x0 reserved
OUTTknEPdisMsk
OUT Token Received when Endpoint Disabled
4 RW 0x0
Mask
Applies to control OUT endpoints only.
High Performance and Low-power Processor for Digital Media Application 1129
RK3128 Technical Reference Manual Rev 1.0
USBOTG_DAINT
Address: Operational Base + offset (0x0818)
Device All Endpoints interrupt register
Bit Attr Reset Value Description
OutEPInt
OUT Endpoint Interrupt Bits
31:16 RO 0x0000
One bit per OUT endpoint: Bit 16 for OUT
endpoint 0, bit 31 for OUT endpoint 15
InEpInt
IN Endpoint Interrupt Bits
15:0 RO 0x0000
One bit per IN Endpoint: Bit 0 for IN endpoint
0, bit 15 for endpoint 15
USBOTG_DAINTMSK
Address: Operational Base + offset (0x081c)
Device All Endpoint interrupt mask register
Bit Attr Reset Value Description
OutEpMsk
OUT EP Interrupt Mask Bits
31:16 RW 0x0000
One per OUT Endpoint: Bit 16 for OUT EP 0, bit
31 for OUT EP 15
InEpMsk
IN EP Interrupt Mask Bits
15:0 RW 0x0000
One bit per IN Endpoint: Bit 0 for IN EP 0, bit
15 for IN EP 15
USBOTG_DTKNQR1
Address: Operational Base + offset (0x0820)
Device IN token sequence learning queue read register1
Bit Attr Reset Value Description
EPTkn
Endpoint Token
Four bits per token represent the endpoint
number of the token:
31:8 RO 0x000000 Bits [31:28]: Endpoint number of Token 5
Bits [27:24]: Endpoint number of Token 4
.......
Bits [15:12]: Endpoint number of Token 1
Bits [11:8]: Endpoint number of Token 0
High Performance and Low-power Processor for Digital Media Application 1130
RK3128 Technical Reference Manual Rev 1.0
USBOTG_DTKNQR2
Address: Operational Base + offset (0x0824)
Device IN token sequence learning queue read register2
Bit Attr Reset Value Description
EPTkn
Endpoint Token
Four bits per token represent the endpoint
number of the token:
31:0 RW 0x00000000 Bits [31:28]: Endpoint number of Token 13
Bits [27:24]: Endpoint number of Token 12
.......
Bits [7:4]: Endpoint number of Token 7
Bits [3:0]: Endpoint number of Token 6
USBOTG_DVBUSDIS
Address: Operational Base + offset (0x0828)
Device VBUS discharge time register
Bit Attr Reset Value Description
31:16 RO 0x0 reserved
DVBUSDis
Device VBUS Discharge Time
Specifies the VBUS discharge time after VBUS
pulsing during SRP. This value
equals: VBUS discharge time in PHY clocks /
15:0 RW 0x0b8f
1,024.The value you use depends whether the
PHY is operating at 30 MHz (16-bit data width)
or 60 MHz (8-bit data width). Depending on
your VBUS load, this value can need
adjustment.
USBOTG_DVBUSPULSE
Address: Operational Base + offset (0x082c)
Device VBUS Pulsing Timer Register
Bit Attr Reset Value Description
31:12 RO 0x0 reserved
High Performance and Low-power Processor for Digital Media Application 1131
RK3128 Technical Reference Manual Rev 1.0
USBOTG_DTHRCTL
Address: Operational Base + offset (0x0830)
Device Threshold Control Register
Bit Attr Reset Value Description
31:28 RO 0x0 reserved
ArbPrkEn
Arbiter Parking Enable
This bit controls internal DMA arbiter parking
for IN endpoints. When threshold is enabled
27 RW 0x1 and this bit is set to one, then the arbiter
parks on the IN endpoint for which there is a
token received on the USB. This is done to
avoid getting into under-run conditions. By
default the parking is enabled.
26 RO 0x0 reserved
RxThrLen
Receive Threshold Length
This field specifies Receive threshold size in
DWORDS. This field also specifies the amount
of data received on the USB before the core
25:17 RW 0x008 can start transmitting on the AHB. The
threshold length has to be at least eight
DWORDS.
The recommended value for ThrLen is to be
the same as the programmed AHB Burst
Length (GAHBCFG.HBstLen).
RxThrEn
Receive Threshold Enable
16 RW 0x0
When this bit is set, the core enables
thresholding in the receive direction.
15:13 RO 0x0 reserved
High Performance and Low-power Processor for Digital Media Application 1132
RK3128 Technical Reference Manual Rev 1.0
USBOTG_DIEPEMPMSK
Address: Operational Base + offset (0x0834)
Device IN endpoint FIFO empty interrupt mask register
High Performance and Low-power Processor for Digital Media Application 1133
RK3128 Technical Reference Manual Rev 1.0
USBOTG_DEACHINT
Address: Operational Base + offset (0x0838)
Device each endpoint interrupt register
Bit Attr Reset Value Description
EchOutEPInt
OUT Endpoint Interrupt Bits
One bit per OUT endpoint:
31:16 RO 0x0000
Bit 16 for OUT endpoint 0
...
Bit 31 for OUT endpoint 15
EchInEpInt
IN Endpoint Interrupt Bits
One bit per IN Endpoint:
15:0 RO 0x0000
Bit 0 for IN endpoint 0
...
Bit 15 for endpoint 15
USBOTG_DEACHINTMSK
Address: Operational Base + offset (0x083c)
Device each endpoint interrupt register mask
Bit Attr Reset Value Description
EchOutEpMsk
OUT EP Interrupt Mask Bits
One per OUT Endpoint:
31:16 RW 0x0000
Bit 16 for IN endpoint 0
...
Bit 31 for endpoint 15
EchInEpMsk
IN EP Interrupt Mask Bits
One bit per IN Endpoint:
15:0 RW 0x0000
Bit 0 for IN endpoint 0
...
Bit 15 for endpoint 15
USBOTG_DIEPEACHMSKn
Address: Operational Base + offset (0x0840)
Device each IN endpoint -n interrupt Register
Bit Attr Reset Value Description
31:14 RO 0x0 reserved
High Performance and Low-power Processor for Digital Media Application 1134
RK3128 Technical Reference Manual Rev 1.0
USBOTG_DOEPEACHMSKn
Address: Operational Base + offset (0x0880)
Device each out endpoint-n interrupt register
Bit Attr Reset Value Description
31:15 RO 0x0 reserved
NYETMsk
14 RW 0x0
NYET interrupt Mask
NAKMsk
13 RW 0x0
NAK interrupt Mask
BbleErrMsk
12 RW 0x0
Babble interrupt Mask
11:10 RO 0x0 reserved
BnaOutIntrMsk
9 RW 0x0
BNA interrupt Mask
OutPktErrMsk
8 RW 0x0
OUT Packet Error Mask
7 RO 0x0 reserved
Back2BackSETup
6 RW 0x0 Back-to-Back SETUP Packets Received Mask
Applies to control OUT endpoints only.
5 RO 0x0 reserved
OUTTknEPdisMsk
OUT Token Received when Endpoint Disabled
4 RW 0x0
Mask
Applies to control OUT endpoints only.
High Performance and Low-power Processor for Digital Media Application 1135
RK3128 Technical Reference Manual Rev 1.0
USBOTG_DIEPCTL0
Address: Operational Base + offset (0x0900)
Device control IN endpoint 0 control register
Bit Attr Reset Value Description
EPEna
Endpoint Enable
When Scatter/Gather DMA mode is enabled,
for IN endpoints this bit indicates that the
descriptor structure and data buffer with data
ready to transmit is setup. When
31 R/WSC 0x0 Scatter/Gather DMA mode is disabled-such as
in buffer-pointer based
DMA mode-this bit indicates that data is ready
to be transmitted on the endpoint.
The core clears this bit before setting the
following interrupts on this endpoint:
Endpoint Disabled; Transfer Completed.
EPDis
Endpoint Disable
The application sets this bit to stop
transmitting data on an endpoint, even before
the transfer for that endpoint is complete. The
application must wait for the Endpoint
30 R/WSC 0x0
Disabled interrupt before treating the
endpoint as disabled. The core clears this bit
before setting the Endpoint Disabled
Interrupt. The application must set this bit
only if Endpoint Enable is already set for this
endpoint.
29:28 RO 0x0 reserved
SNAK
Set NAK
A write to this bit sets the NAK bit for the
endpoint. Using this bit, the application can
27 WO 0x0
control the transmission of NAK handshakes
on an endpoint. The core can also set this bit
for an endpoint after a SETUP packet is
received on that endpoint.
High Performance and Low-power Processor for Digital Media Application 1136
RK3128 Technical Reference Manual Rev 1.0
High Performance and Low-power Processor for Digital Media Application 1137
RK3128 Technical Reference Manual Rev 1.0
USBOTG_DIEPINTn
Address: Operational Base + offset (0x0908)
Device Endpoint-n Interrupt Register
Bit Attr Reset Value Description
31:15 RO 0x0 reserved
NYETIntrpt
NYET interrupt
14 W1C 0x0 The core generates this interrupt when a NYET
response is transmitted for a non-
isochronous OUT endpoint.
NAKIntrpt
NAK interrupt
The core generates this interrupt when a NAK
is transmitted or received by the device. In
13 W1C 0x0
case of isochronous IN endpoints the interrupt
gets generated when a zero length packet is
transmitted due to un-availability of data in
the TXFifo.
BbleErrIntrpt
BbleErr (Babble Error) interrupt
12 W1C 0x0
The core generates this interrupt when babble
is received for the endpoint.
High Performance and Low-power Processor for Digital Media Application 1138
RK3128 Technical Reference Manual Rev 1.0
High Performance and Low-power Processor for Digital Media Application 1139
RK3128 Technical Reference Manual Rev 1.0
High Performance and Low-power Processor for Digital Media Application 1140
RK3128 Technical Reference Manual Rev 1.0
High Performance and Low-power Processor for Digital Media Application 1141
RK3128 Technical Reference Manual Rev 1.0
USBOTG_DIEPTSIZn
Address: Operational Base + offset (0x0910)
Device endpoint n transfer size register
Bit Attr Reset Value Description
31 RO 0x0 reserved
High Performance and Low-power Processor for Digital Media Application 1142
RK3128 Technical Reference Manual Rev 1.0
High Performance and Low-power Processor for Digital Media Application 1143
RK3128 Technical Reference Manual Rev 1.0
USBOTG_DIEPDMAn
Address: Operational Base + offset (0x0914)
Device endpoint-n DMA address register
Bit Attr Reset Value Description
DMAAddr
DMA Address
Holds the start address of the external
memory for storing or fetching endpoint
data. Note: For control endpoints, this field
stores control OUT data packets as well as
SETUP transaction data packets. When more
than three SETUP packets are received
back-to-back, the SETUP data packet in the
31:0 RW 0x00000000
memory is overwritten.
This register is incremented on every AHB
transaction. The application can give
only a DWORD-aligned address. When
Scatter/Gather DMA mode is not enabled, the
application programs the start address value
in this field. When Scatter/Gather DMA mode
is enabled, this field indicates the base pointer
for the descriptor list.
USBOTG_DTXFSTSn
Address: Operational Base + offset (0x0918)
Device IN endpoint transmit FIFO status register
Bit Attr Reset Value Description
31:16 RO 0x0 reserved
High Performance and Low-power Processor for Digital Media Application 1144
RK3128 Technical Reference Manual Rev 1.0
USBOTG_DIEPDMABn
Address: Operational Base + offset (0x091c)
Device endpoint-n DMA buffer address register
Bit Attr Reset Value Description
DMABufferAddr
DMA Buffer Address
Holds the current buffer address.This register
is updated as and when the data
31:0 RO 0x00000000
transfer for the corresponding end point is in
progress. This register is present only in
Scatter/Gather DMA mode. Otherwise this
field is reserved.
USBOTG_DIEPCTLn
Address: Operational Base + offset (0x0920)
Device endpoint-n control register
Bit Attr Reset Value Description
High Performance and Low-power Processor for Digital Media Application 1145
RK3128 Technical Reference Manual Rev 1.0
High Performance and Low-power Processor for Digital Media Application 1146
RK3128 Technical Reference Manual Rev 1.0
High Performance and Low-power Processor for Digital Media Application 1147
RK3128 Technical Reference Manual Rev 1.0
High Performance and Low-power Processor for Digital Media Application 1148
RK3128 Technical Reference Manual Rev 1.0
High Performance and Low-power Processor for Digital Media Application 1149
RK3128 Technical Reference Manual Rev 1.0
High Performance and Low-power Processor for Digital Media Application 1150
RK3128 Technical Reference Manual Rev 1.0
USBOTG_DOEPCTL0
Address: Operational Base + offset (0x0b00)
Device control OUT endpoint 0 control register
Bit Attr Reset Value Description
EPEna
Endpoint Enable
When Scatter/Gather DMA mode is enabled,
for OUT endpoints this bit indicates that the
descriptor structure and data buffer to receive
data is setup. When Scatter/Gather DMA
mode is disabled? such as for buffer-pointer
based DMA mode)-this bit indicates that the
31 R/WSC 0x0 application has allocated the memory to
start receiving data from the USB. The core
clears this bit before setting any of the
following interrupts on this endpoint: SETUP
Phase Done, Endpoint Disabled, Transfer
Completed.
Note: In DMA mode, this bit must be set for
the core to transfer SETUP data packets into
memory.
EPDis
Endpoint Disable
30 WO 0x0
The application cannot disable control OUT
endpoint 0.
29:28 RO 0x0 reserved
SNAK
Set NAK
A write to this bit sets the NAK bit for the
endpoint. Using this bit, the application can
27 WO 0x0
control the transmission of NAK handshakes
on an endpoint. The core can also set bit on a
Transfer Completed interrupt, or after a
SETUP is received on the endpoint.
High Performance and Low-power Processor for Digital Media Application 1151
RK3128 Technical Reference Manual Rev 1.0
High Performance and Low-power Processor for Digital Media Application 1152
RK3128 Technical Reference Manual Rev 1.0
USBOTG_DOEPINTn
Address: Operational Base + offset (0x0b08)
Device endpoint-n control register
Bit Attr Reset Value Description
31:15 RO 0x0 reserved
NYETIntrpt
NYET interrupt
14 W1C 0x0 The core generates this interrupt when a NYET
response is transmitted for a non-isochronous
OUT endpoint.
NAKIntrpt
NAK interrupt
The core generates this interrupt when a NAK
is transmitted or received by the device. In
13 W1C 0x0
case of isochronous IN endpoints the interrupt
gets generated when a zero length packet is
transmitted due to un-availability of data in
the TXFifo.
BbleErrIntrpt
BbleErr (Babble Error) interrupt
12 W1C 0x0
The core generates this interrupt when babble
is received for the endpoint.
PktDrpSts
Packet Dropped Status
This bit indicates to the application that an
ISOC OUT packet has been dropped. This bit
11 W1C 0x0 does not have an associated mask bit and
does not generate an interrupt. Dependency:
This bit is valid in non-Scatter/Gather DMA
mode when periodic transfer interrupt feature
is selected.
10 RO 0x0 reserved
BNAIntr
BNA (Buffer Not Available) Interrupt
The core generates this interrupt when the
9 W1C 0x0 descriptor accessed is not ready for the Core
to process, such as Host busy or DMA done.
Dependency: This bit is valid only when
Scatter/Gather DMA mode is enabled.
High Performance and Low-power Processor for Digital Media Application 1153
RK3128 Technical Reference Manual Rev 1.0
High Performance and Low-power Processor for Digital Media Application 1154
RK3128 Technical Reference Manual Rev 1.0
High Performance and Low-power Processor for Digital Media Application 1155
RK3128 Technical Reference Manual Rev 1.0
USBOTG_DOEPTSIZn
Address: Operational Base + offset (0x0b10)
Device endpoint n transfer size register
Bit Attr Reset Value Description
31 RO 0x0 reserved
High Performance and Low-power Processor for Digital Media Application 1156
RK3128 Technical Reference Manual Rev 1.0
High Performance and Low-power Processor for Digital Media Application 1157
RK3128 Technical Reference Manual Rev 1.0
USBOTG_DOEPDMAn
Address: Operational Base + offset (0x0b14)
Device Endpoint-n DMA Address Register
Bit Attr Reset Value Description
DMAAddr
DMA Address
Holds the start address of the external
memory for storing or fetching endpoint
data. Note: For control endpoints, this field
stores control OUT data packets as well as
SETUP transaction data packets. When more
than three SETUP packets are received
back-to-back, the SETUP data packet in the
31:0 RW 0x00000000
memory is overwritten.
This register is incremented on every AHB
transaction. The application can give only a
DWORD-aligned address. When
Scatter/Gather DMA mode is not enabled, the
application programs the start address value
in this field. When Scatter/Gather DMA mode
is enabled, this field indicates the base pointer
for the descriptor list.
USBOTG_DOEPDMABn
Address: Operational Base + offset (0x0b1c)
Device endpoint-n DMA buffer address register
Bit Attr Reset Value Description
High Performance and Low-power Processor for Digital Media Application 1158
RK3128 Technical Reference Manual Rev 1.0
USBOTG_DOEPCTLn
Address: Operational Base + offset (0x0b20)
Device endpoint-n control register
Bit Attr Reset Value Description
EPEna
Endpoint Enable
Applies to IN and OUT endpoints. When
Scatter/Gather DMA mode is enabled,
For IN endpoints this bit indicates that the
descriptor structure and data buffer with data
ready to transmit is setup. For OUT endpoint it
indicates that the descriptor structure and
data buffer to receive data is setup. When
Scatter/Gather DMA mode is enabled-such as
for buffer-pointer based DMA mode:
31 R/WSC 0x0
For IN endpoints, this bit indicates that data
is ready to be transmitted on the
endpoint; For OUT endpoints, this bit indicates
that the application has allocated the memory
to start receiving data from the USB. The core
clears this bit before setting any of the
following interrupts on this endpoint: SETUP
Phase Done, Endpoint Disabled, Transfer
Completed. Note: For control endpoints in
DMA mode, this bit must be set to be able to
transfer SETUP data packets in memory.
EPDis
Endpoint Disable
Applies to IN and OUT endpoints. The
application sets this bit to stop
transmitting/receiving data on an endpoint,
even before the transfer for that endpoint is
30 R/WSC 0x0 complete. The application must wait for the
Endpoint Disabled interrupt before treating
the endpoint as disabled. The core clears this
bit before setting the Endpoint Disabled
interrupt. The application must set this bit
only if Endpoint Enable is already set for this
endpoint.
High Performance and Low-power Processor for Digital Media Application 1159
RK3128 Technical Reference Manual Rev 1.0
High Performance and Low-power Processor for Digital Media Application 1160
RK3128 Technical Reference Manual Rev 1.0
High Performance and Low-power Processor for Digital Media Application 1161
RK3128 Technical Reference Manual Rev 1.0
High Performance and Low-power Processor for Digital Media Application 1162
RK3128 Technical Reference Manual Rev 1.0
High Performance and Low-power Processor for Digital Media Application 1163
RK3128 Technical Reference Manual Rev 1.0
USBOTG_PCGCR
Address: Operational Base + offset (0x0b24)
Power and clock gating control register
Bit Attr Reset Value Description
High Performance and Low-power Processor for Digital Media Application 1164
RK3128 Technical Reference Manual Rev 1.0
High Performance and Low-power Processor for Digital Media Application 1165
RK3128 Technical Reference Manual Rev 1.0
High Performance and Low-power Processor for Digital Media Application 1166
RK3128 Technical Reference Manual Rev 1.0
High Performance and Low-power Processor for Digital Media Application 1167
RK3128 Technical Reference Manual Rev 1.0
❖ Transmission:
✦ FS device: After the controller sets both TXVALID and TXVALIDH to 1’b0,
followed by a minimum of 3 μs of stable SE0 on LINESTATE [1:0]
✦ FS/LS host: After the controller sets both TXVALID0 and TXVALIDH0 to
1’b0, followed by a minimum of 8 bit times of J state on LINESTATE [1:0]
✦ HS host/device: A minimum of 150 μs after the controller sets both
TXVALID0 and TXVALIDH0 to 1’b0. The preceding requirements ensure that
there is no activity on the USB when PORTRESET0 is de-asserted.
To avoid any data glitches during port reset, the controller must place the
USB 2.0 PHY into a safe state. A safe state for host and device ports is
defined as follows:
❖ Host: The USB 2.0 PHY is set to Non-Driving (OPMODE [1:0] = 2’b01),
and the 15-kΩ pull-down resistors are enabled (DPPULLDOWN and
High Performance and Low-power Processor for Digital Media Application 1168
RK3128 Technical Reference Manual Rev 1.0
DMPULLDOWN = 1’b1).
❖ Device: The USB 2.0 PHY is set to Non-Driving (OPMODE [1:0] = 2’b01),
which disconnects the 1.5-kΩ resistor from the D+ line.
High Performance and Low-power Processor for Digital Media Application 1169
RK3128 Technical Reference Manual Rev 1.0
High Performance and Low-power Processor for Digital Media Application 1170