Control will be given back to the software by
assertion of the Transfer Request Completion Status interrupt (UFS_IS[0] UTRCS). The
UFS_IS[0] UTRCS bit is set when at least one of the following 4 conditions is met:
- The UTRD.I bit is set
(Interrupt Command).
- The counter, after
incrementing, reaches the value configured in the UFS_UTRIACR[12-8] IACTH
bit filed.
- The IA (Interrupt
Aggregation) timer reaches the value configured in the UFS_UTRIACR[7-0]
IATOVAL bit field (this event may occur at any time, not necessarily coupled
with request completion).
- The Overall Command Status
(OCS) of the completed command is unequal to "SUCCESS".
An interrupt is generated by the write operation
if the completion interrupt is not masked (disabled) by the UFS_IE[0] UTRCE bit.
The host software processes the interrupt
generated by the UFS host controller for command completion. In the interrupt
service routine, the host software checks the UFS_IS register to determine if there
is an interrupt pending. If the UFS host controller has an interrupt pending:
- If there were errors, noted
in the UFS_IS register, the host software performs error recovery
actions.
- In the case of the Transfer
Request Completion Status interrupt (UFS_IS[0] UTRCS), the host software
clears the interrupt and then may use one of two methods to determine which
UTP transfer requests (TRs) have completed:
- Read the UFS_UTRLDBR
register, and compare the current value to the list of commands
previously issued by the host software that are still outstanding.
For any transfer request which is outstanding, a value of 0h in bit
i (where i is the UTRL slot through which the TR
is issued) of the UFS_UTRLDBR register means that the TR has
completed. The UFS_UTRLDBR register is a volatile. The software
should only use its value to determine commands that have completed,
not to determine which commands have previously been issued.
- Read the UTP Transfer
Request List Completion Notification register (UFS_UTRLCNR). For any
TR, a value of 1h in bit i (where i is the UTRL slot
through which the TR is issued) of the UFS_UTRLCNR register means
that the TR has completed.
- For every TR i whose
completion is detected, the software repeats the following steps:
- Processes the request
completion as required by higher OS layers (for example: file
system).
- Clears bit i
of the UFS_UTRLCNR register, by writing 1h to it.
- Marks slot i
as available for reuse (software only).
- After processing all
previously detected TRs, the software may reset and restart Interrupt
Aggregation mechanism by writing 80010000h to the UFS_UTRIACR register.
- The software determines if
new TRs have completed since step 2, by repeating one of the two
methods described in step 2. If new TRs have completed, the software
repeats the sequence from step 3.