Skip to content

Auto CMD23 feature

Azamat Beksadaev edited this page Nov 10, 2016 · 1 revision

###Description Auto CMD23 is a feature that automatically issues a CMD23 before a CMD18 or CMD25 is sent. Objective of this function is to avoid performance deterioration during memory access by removing the interrupt service of CMD23. Argument1 register is used for CMD18 or CMD25. Then Argument2 register for CMD23. The Host Controller does not use Argument2 register for counting data transfer length. SDMA is not intended to use Auto CMD23. ADMA and Non-ADMA transfer can use Auto CMD23. ###The feature work principles Figure1 and Figure2 illustrate the difference between feature and non-feature work flow. S_AXI_WDATA channel in the figures displays the overall issue commands. Definitely the box illustrated in this channel includes writing all related registers like Block Count, Block Size, Transfer Mode, Argument1, before issuing the command.
Figure1 shows non-feature work flow. Host driver sends CMD23 before multiple blocks data transaction (CMD18 or CMD25).
Figure2 shows feature work flow. Host driver sends only CMDxData, it can be CMD18 or CMD25. Host Controller sends CMD23 by itself and than after the response check passing, it sends initial CMDxData command. In that case the flow becomes less to one external interrupt and saves the time is taken to clear it.

alt text
CMD23 - SET_BLOCK_COUNT. Specify block count for CMD18 and CMD25.
CMD18 - READ_MULTIPLE_BLOCK. Continuously transfers data blocks from card to host until interrupted by a STOP_TRANSMISSION command.
CMD25 - WRITE_MULTIPLE_BLOCK. Continuously writes blocks of data until a STOP_TRANSMISSION follows.
CMDxData - Commands with multiple block transfer. It can be either CMD18 or CMD25. ###Feature Implementation The feature is implemented in S00_AXI module. It has a sate machine consists of three states as shown in figure3. The controller recognises the feature usage from the Auto CMD Enable field in Transfer Mode register. So long as '10' value is not written to the that field the feature state machine stay on ACMDE state.
In ACMDC state controller sends CMDxData command and goes to ACMDS state if response for previous command is 0x0900. Otherwise it generates Auto CMD Error Interrupt in Normal Interrupt Status register and goes back to state ACMDE.
ACMDS state waits CMDxData command interrupt clearing and changes state to ACMDE.

alt text

ACMDE - AutoCMD23 Enable wait state;
ACMDC - AutoCMD23 Completion wait state;
ACMDS - Associated CMDxData command Send state;

Feature switches command arguments, command index and interrupt outputting signals:

assign command_o = cmd_sel ? 14'h171a : slv_reg3 [29:16];  
assign argument_o = arg_sel ? slv_reg0 : slv_reg2;  
assign cmd_compl_int = cc_int_sel ? 1'b0 : cmd_int_st[`INT_CMD_CC];