SPRUIL1D May 2019 – December 2024 DRA829J , DRA829J-Q1 , DRA829V , DRA829V-Q1 , TDA4VM , TDA4VM-Q1
As described in Section 12.3.7.5.2.1.3, UFS Host Data Structure, the host software presents a list of commands to the UFS host controller. Independent from the system host, this list is then being processed by the UFS host controller which asserts an interrupt line in case a command finishes.
On order to post new commands to the UFS host controller, the system host needs to find empty slots in the command list. In case no empty slot is available, the host thread needs to wait until a command finishes and the driver software has made a new slot available.
Nevertheless, the UFS host controller continuously looks at the UFS_UTRLDBR and UFS_UTMRLDBR registers to determine if there are commands ready to be processed. The processing order depends on three factors:
The processing rules are as follows:
While there is no indicator about active commands, it is not possible to know in advance when a particular command is being processed, or how the command will remain in the command list respectively.
To add an additional level of uncertainty, any UFS device is allowed to accept more than one command and is allowed to process those commands out-of-order. As a consequence, commands placed in the command list need to be robust enough to get arbitrarily re-ordered. In cases where this may cause problems, only one command at a time may be placed into the command list.
Section 12.3.7.5.2.2.1, Building a UTP Transfer Request provide more detail on the low-level driver to explain how the communication and data transfer is handled between system host, the UFS host controller, and UFS device.