![Altera Cyclone V Device Handbook Download Page 683](http://html1.mh-extra.com/html/altera/cyclone-v/cyclone-v_device-handbook_2910791683.webp)
• Slave interface
• Register block
• FIFO buffer
• Internal DMA controller
Slave Interface
The host processor accesses the SD/MMC controller registers and data FIFO buffers through the slave
interface.
Register Block
The register block is part of the BIU and provides read and write access to the CSRs.
†
All registers reside in the BIU clock domain. When a command is sent to a card by setting the start command
bit (
start_cmd
) of the command register (
cmd
) to 1, all relevant registers needed for the CIU operation
are transferred to the CIU block. During this time, software must not write to the registers that are transferred
from the BIU to the CIU. The software must wait for the hardware to reset the
start_cmd
bit to 0 before
writing to these registers again. The register unit has a hardware locking feature to prevent illegal writes to
registers.
†
Registers Locked Out Pending Command Acceptance
After a command start is issued by setting the
start_cmd
bit of the
cmd
register, the following registers
cannot be rewritten until the command is accepted by the CIU:
†
• Command (
cmd
)
†
• Command argument (
cmdarg
)
†
• Byte count (
bytcnt
)
†
• Block size (
blksiz
)
†
• Clock divider (
clkdiv
)
†
• Clock enable (
clkena
)
†
• Clock source (
clksrc
)
†
• Timeout (
tmout
)
†
• Card type (
ctype
)
†
The hardware resets the
start_cmd
bit after the CIU accepts the command. If a host write to any of these
registers is attempted during this locked time, the write is ignored and the hardware lock write error bit
(
hle
) is set to 1 in the raw interrupt status register (
rintsts
). Additionally, if the interrupt is enabled and
not masked for a hardware lock error, an interrupt is sent to the host.
†
After a command is accepted, you can send another command to the CIU—which has a one-deep command
queue—under the following conditions:
†
• If the previous command is not a data transfer command, the new command is sent to the SD/MMC/CE-
ATA card once the previous command completes.
†
• If the previous command is a data transfer command and if the wait previous data complete bit
(
wait_prvdata_complete
) of the
cmd
register is set to 1 for the new command, the new command
is sent to the SD/MMC/CE-ATA card only when the data transfer completes.
†
• If the
wait_prvdata_complete
bit is 0, the new command is sent to the SD/MMC/CE-ATA card
as soon as the previous command is sent. Typically, use this feature to stop or abort a previous data
transfer or query the card status in the middle of a data transfer.
†
Altera Corporation
SD/MMC Controller
11-5
Slave Interface
cv_54011
2013.12.30