In order to initiate transfer, host
issues CMD53 with the following parameters:
Table 21-3 CMD53 Parameters
| CMD53 |
Function = #1 |
Write flag = 0x1 |
Mode = Block Mode |
Block Count = [L/B] |
Address = 0x00 (TX FIFO) |
- SDIO PHY parse the command, if it's valid and addressed to fucntion#1, it sends
response to the host and issues an OCP write commands towards SDIO FIFO.
- After seeing the command response, the host starts sending data blocks to SDIO
PHY.
- The SDIO PHY transmits this data to the SDIO FIFO: for each 8 bits of received
data, it issues write command and at the same time transmits the address and the
data byte (using the OCP interface). The address is the SDIO RX FIFO address
(0x0) and the data is the host's data. SDIO FIFO responds to every command with
'command accept S'. At this point in time, host data bytes are accumulating in
the SDIO RX FIFO.
- RX FIFO has a configurable
threshold associated with it to generate "Not Empty" IRQ to SW. This threshold
is configurable.
- Once triggered, SW first mask
"Not empty" IRQ. According to the received length as well as a const max packet
size value, SW:
- Allocates an empty memory
space
- Prepare a DMA transaction
to copy new packet from RX FIFO to memory.
- Kick the DMA transfer.
- At this point in time, the DMA
copies the entire packet to memory. SW continues it's other tasks.
- Upon copy completion, DMA would
generate "DMA DONE" IRQ to SW. SW then checks the RX FIFO contents. If the FIFO
is not empty another DMA copy is prepared. If not, "Not Empty" IRQ is unmasked.
- SW forwards the packet to next
stage in the pipeline.
Note:
- Packet of length L is being divided into as many SDIO blocks of length B as
possible ([L/B], B < L). If there is a remaining data, the remainder of
the packet is sent via a following CMD53 in byte mode. The SDIO FIFO is
completely agnostic to this fact, since the remainder (L mod B) is being
taken care of by the DMA as part of the total copy transfer.
- At the end of each data block
(in block-basis operations) or data transaction (in byte-basis operations),
the host sends CRC. The SDIO PHY checks the CRC and sends response to the
host, including CRC_OK field. The CRC_OK status is given to the SDIO FIFO as
well, using a dedicated status line in the PHY interface. If the CRC is not
okay SW needs to handle CRC error.