Ameba-D User Manual
User Manual All information provided in this document is subject to legal disclaimers. © REALTEK 2019. All rights reserved.
180
DSTATARx register. For conditions under which the destination status information is fetched from system memory, refer to the Write
Back column of Table 9-19.
(10)
If gather is enabled (DMAH_CHx_SRC_GAT_EN = True and CTLx.SRC_GATHER_EN is enabled), program the SGRx register for channel x.
(11)
If scatter is enabled (DMAH_CHx_DST_SCA_EN = True and CTLx.DST_SCATTER_EN is enabled) program the DSRx register for channel x.
(12)
Clear any pending interrupts on the channel from the previous DMA transfer by writing to the Interrupt Clear registers: ClearTfr,
ClearBlock, ClearSrcTran, ClearDstTran, and ClearErr. Reading the Interrupt Raw Status and Interrupt Status registers confirms that all
interrupts have been cleared.
(13)
Program the CTLx and CFGx registers according to Row 10, as shown in Table 9-19.
(14)
Program the LLPx register with LLP(0), the pointer to the first linked list item.
(15)
Finally, enable the channel by writing a 1 to the ChEnReg.CH_EN bit; the transfer is performed.
(16)
The DMAC fetches the first LLI from the location pointed to by LLPx(0).
Note
: The LLI.SARx, LLI.DARx, LLI.LLPx, and LLI.CTLx registers are fetched. The DMAC automatically reprograms the SARx, DARx, LLPx, and
CTLx channel registers from the LLPx(0).
(17)
Source and destination request single and burst DMA transactions to transfer the block of data (assuming non-memory peripheral). The
DMAC acknowledges at the completion of every transaction (burst and single) in the block and carries out the block transfer.
(18)
Once the block of data is transferred, the source status information is fetched from the location pointed to by the SSTATARx register and
stored in the SSTATx register if DMAH_CHx_CTL_WB_EN = True, DMAH_CHx_STAT_SRC = True, and CFGx.SS_UPD_EN is enabled. For
conditions under which the source status information is fetched from system memory, refer to the Write Back column of Table 9-19.
The destination status information is fetched from the location pointed to by the DSTATARx register and stored in the DSTATx register if
DMAH_CHx_CTL_WB_EN = True, DMAH_CH
x
_STAT_DST = True, and CFG
x
.DS_UPD_EN is enabled. For conditions under which the
destination status information is fetched from system memory, refer to the Write Back column of Table 9-19.
(19)
If DMAH_CHx_CTL_WB_EN = True, then the CTLx[63:32] register is written out to system memory. For conditions under which the
CTLx[63:32] register is written out to system memory, refer to the Write Back column of Table 9-19.
The CTLx[63:32] register is written out to the same location on the same layer (LLPx.LMS) where it was originally fetched; that is, the
location of the CTLx register of the linked list item fetched prior to the start of the block transfer. Only the second word of the CTL
x
register
is written out – CTL
x
[63:32] – because only the CTL
x
.BLOCK_TS and CTL
x
.DONE fields have been updated by the DMAC hardware.
Additionally, the CTLx.DONE bit is asserted to indicate block completion. Therefore, software can poll the LLI.CTL
x
.DONE bit of the CTL
x
register in the LLI to ascertain when a block transfer has completed.
Note
: Do not poll the CTLx.DONE bit in the DMAC memory map; instead, poll the LLI.CTLx.DONE bit in the LLI for that block. If the polled
LLI.CTLx.DONE bit is asserted, then this block transfer has completed. This LLI.CTLx.DONE bit was cleared at the start of the transfer (Step
.
(20)
The SSTATx register is now written out to system memory if DMAH_CHx_CTL_WB_EN = True, DMAH_CHx_STAT_SRC = True, and
CFGx.SS_UPD_EN is enabled. It is written to the SSTATx register location of the LLI pointed to by the previously saved LLPx.LOC register.
The DSTATx register is now written out to system memory if DMAH_CHx_CTL_WB_EN = True, DMAH_CH
x
_STAT_DST = True, and
CFG
x
.DS_UPD_EN is enabled. It is written to the DSTAT
x
register location of the LLI pointed to by the previously saved LLP
x
.LOC register.
The end-of-block interrupt, int_block, is generated after the write-back of the control and status registers has completed.
Note
: The write-back location for the control and status registers is the LLI pointed to by the previous value of the LLPx.LOC register, not
the LLI pointed to by the current value of the LLPx.LOC register
.
(21)
The DMAC does not wait for the block interrupt to be cleared, but continues fetching the next LLI from the memory location pointed to
by the current LLPx register and automatically reprograms the SARx, DARx, LLPx, and CTLx channel registers. The DMA transfer continues
until the DMAC determines that the CTLx and LLPx registers at the end of a block transfer match the ones described in Row 1 or Row 5 of
Table 9-19 (as discussed earlier). The DMAC then knows that the previously transferred block was the last block in the DMA transfer.
The DMA transfer might look like that shown in Fig 9-50.
Realtek confidential files
The document authorized to
SZ99iot
2019-05-15 10:08:03