To use the card read threshold feature effectively and to guarantee that the card clock does not stop because
of a FIFO Full condition in the middle of a block of data being read from the card, follow these steps:
†
1. Choose a block size that is a multiple of four bytes.
†
2. Enable card read threshold feature. The card read threshold can be enabled only if the block size for the
given transfer is less than or equal to the total depth of the FIFO buffer:
†
(block size / 4) ≤ 1024
†
3. Choose the card read threshold value:
†
• If (block size / 4) ≥ 512, choose
cardrdthreshold
such that:
†
•
cardrdthreshold
≤ (block size / 4) in bytes
†
• If (block size / 4) < 512, choose
cardrdthreshold
such that:
†
•
cardrdthreshold
= (block size / 4) in bytes
†
4. Set the
dw_dma_multiple_transaction_size
field in the
fifoth
register to the number of
transfers that make up a DMA transaction. For example, size = 1 means 4 bytes are moved. The possible
values for the size are 1, 4, 8, 16, 32, 64, 128, and 256 transfers. Select the size so that the value (block size
/ 4) is evenly divided by the size.
†
5. Set the
rx_wmark
field in the
fifoth
register to the size – 1.
†
For example, if your block size is 512 bytes, legal values of
dw_dma_multiple_transaction_size
and
rx_wmark
are listed in the following table.
Table 11-32: Legal Values of dw_dma_multiple_transaction_size and rx_wmark for Block Size = 512
†
rx_wmark
dw_dma_multiple_transaction_size
Block Size
0
1
512
3
4
512
7
8
512
15
16
512
31
32
512
63
64
512
127
128
512
Card Read Threshold Programming Examples
This section shows examples of how to program the card read threshold.
†
Altera Corporation
SD/MMC Controller
11-59
Card Read Threshold Programming Examples
cv_54011
2013.12.30