According to section 67.4.1 (Data Buffer) of the i.MX6 DQ Reference Manual :
“CPU polling mode:
* For a host read operation, when the number of words received in the buffer
meets or exceeds the RD_WML watermark value, by polling the BRR bit, the
Host Driver can read the Buffer Data Port register to fetch the amount of words
set in the RD_WML register from the buffer. The write operation is similar.”
This means, as stated in section 67.4.1.1 (Write Operation Sequence) :
“When the internal DMA is not used, (the DMAEN bit in the Transfer Type register is not
set when the command is sent), the uSDHC asserts a DMA request when the amount of
buffer space exceeds the value set in the WR_WML register, and is ready for receiving
new data. At the same time, the uSDHC sets the BWR bit. The buffer write ready
interrupt will be generated if it is enabled by software.”
So, please use the BWR bit before FIFO filling.
Next, as for the DTOE event -”the uSDHC will not start data transmission until the number
of words set in the WR_WML register can be held in the buffer. If the buffer is empty and the
Host System does not write data in time, the uSDHC will stop the CLK to avoid the data buffer
underrun situation.”