这里具体DMA
Atomic
Data
Request
DMA
RELOAD:在reload模式下,当transfer
Req&Ack:DMA请求和应答的协议有两种,Demard
传输总长度:DMA一次整体服务传输的总长度为:
2410的DMA支持四类DMA传输:系统总线到系统总线(ASB/AHB to ASB/AHB),系统总线到外设总线(ASB/AHB to APB),外设总线到系统总线(APB to ASB/AHB),外设总线到外设总线(APB to APB)。
2410共有四条DMA通道,每条通道5个请求源。
Ch0:nXDREQ0,UART0,SDI,Timer,USB EP1
Ch1: nXDREQ1,UART1,I2SSDI,SPI0,USB EP2
Ch2:I2SSDO,I2SSDI,SDI,Timer, USB EP3
Ch3:UART1,SDI,SPI1,Timer, USB EP4
2410 DMA 三个比较重要的信号,引用2410官方文档:
DMA REQ: In the Single service mode, these three states of main FSM are performed and then stops, and waits for another DMA REQ. And if DMA REQ comes in, all three states are repeated.
DMA ACK: DMA ACK is asserted and then deasserted for each atomic transfer. In contrast, in the Whole service mode, main FSM waits at state-3 until CURR_TC becomes 0. Therefore, DMA ACK is asserted during all the transfers and then deasserted when TC reaches 0.
INT REQ: INT REQ is asserted only if CURR_TC becomes 0 regardless of the service mode (Single service mode or Whole service mode).
2410 DMA状态机:
2410 的DMA使用一个具有三个状态的有限状态机进行DMA 传输的流程控制,引用2410官方文档:
State-1. As an initial state, the DMA waits for a DMA request. If it comes, it goes to state-2. At this state, DMA ACK and INT REQ are 0.
State-2. In this state, DMA ACK becomes 1 and the counter (CURR_TC) is loaded from DCON[19:0] register. Note that the DMA ACK remains 1 until it is cleared later.
State-3. In this state, sub-FSM handling the atomic operation of DMA is initiated. The sub-FSM reads the data from the source address and then writes it to destination address. In this operation, data size and transfer size(single or burst) are considered.
每当一次DMA操作结束,不管是使用什么服务模式,DMA状态机都会自动地从状态三回到状态一,开始另一次操作。注意这里信号是DMA REQ 和 DMA ACK,而最终引脚信号是nXDREQ 和 nXDACK,所以最后实际输出的电平与这里的描述是相反的。
2410 DMA 的服务模式:
共有两种服务模式,一种是单一服务模式(single service),另外一种是整体服务模式(whole service)。
在单一服务模式下,不使用传统的DMA计数器,三个DMA状态被顺序执行一次后停止,等待DMA 请求再一次来临后再重新开始另一次循环。
在整体服务模式下,使用传统的DMA 计数器,状态机会停留在状态三,直到DMA计数器的值减为零,再回到状态一,等待下一次DMA请求。
2410 DMA 数据传输模式:
共有两种数据传输模式:
单位数据传输模式:执行一次读操作和一次写操作。
并发数据传输模式:执行四次读操作和四次写操作。
2410 DMA 的基本时序:
nXDREQ请求生效并经过2CLK周期同步后,nXDACK响应并开始生效,但至少还要经过3CLK的周期延迟,DMA控制器才可获得总线的控制权,并开始数据传输。
2410 DMA 的两种协议模式:
请求模式:If XnXDREQ remains asserted, the next transfer starts immediately. Otherwise it waits for XnXDREQ to be asserted.
握手模式:If XnXDREQ is deasserted, DMA deasserts XnXDACK in 2cycles. Otherwise it waits until XnXDREQ is deasserted.
2410 DMA REQ与ACK 协议类型:
共有三种协议类型:
单一服务请求:
单一服务握手:
整体服务握手:
根据上面所说的服务模式和协议模式,很容易推知这三种协议的时序分别是什么。