SPRUIE9D May 2017 – May 2024 DRA74P , DRA75P , DRA76P , DRA77P
The eMMC/SD/SDIOi host controller uses a data buffer. This buffer transfers data from one data bus (interconnect) to another data bus (SD/SDIO or MMC card bus) and vice versa.
The buffer is the heart of the interface and ensures the transfer between the two interfaces (interconnect and the card).
To enhance performance, the data buffer is completed by a prefetch register and a post-write buffer that are not accessible by the host controller.
The read access time of the prefetch register is faster than that of the data buffer. The prefetch register allows data to be read from the data buffer at an increased speed by preloading data into the prefetch register.
The entry point of the prefetch buffer and the post-write buffer is the 32-bit MMCi.MMCHS_DATA register. A write access to the MMCi.MMCHS_DATA register followed by a read access from the MMCi.MMCHS_DATA register corresponds to a write access to the post-write buffer followed by a read access to the prefetch buffer. As a consequence, it is normal that the data of the write access to the MMCi.MMCHS_DATA register and the data of the read access to the MMCi.MMCHS_DATA register are different.
The number of 32-bit accesses to the MMCi.MMCHS_DATA register that are needed to read (or write) a data block with a size of the MMCi.MMCHS_BLK[11:0] BLEN bit field is equal to the rounded up result of BLEN divided by 4.
The maximum block size supported by the host controller is hard-coded in the MMCi.MMCHS_CAPA[17:16] MBL bit field and cannot be changed.
A read access to the MMCi.MMCHS_DATA register is allowed only when the buffer read-enable status is set to 1 (the MMCi.MMCHS_PSTATE[11] BRE bit); otherwise, a bad access (the MMCi.MMCHS_STAT[29] BADA bit) is signaled.
A write access to the MMCi.MMCHS_DATA register is allowed only when the buffer write-enable status is set to 1 (the MMCi.MMCHS_PSTATE[10] BWE bit); otherwise, a bad access (the MMCi.MMCHS_STAT[29] BADA bit) is signaled and the data are not written.
The data buffer has two modes of operation to store and read of the first and second portions of the data buffer:
The MMCi.MMCHS_CMD[4] DDIR bit must be configured before a transfer to indicate the direction of the transfer.
Figure 27-20 and Figure 27-21 show the buffer management for a write and a read, respectively.
In this mode, a bad access (the MMCi.MMCHS_STAT[29] BADA bit) is signaled when two data transfers occur at the same time from one data bus to the other data bus, and vice versa.