DSP里面QDMA配置,代码如下:
#define DM81XX_EDMA3_CC_BASE (0x49000000)
#define DM81XX_EDMA3_QCHMAP0 (DM81XX_EDMA3_CC_BASE + 0x0200)
#define DM81XX_EDMA3_PARAM_BASE (DM81XX_EDMA3_CC_BASE + 0x4000)
#define OPT (0x00)
#define SRC (0x04)
#define A_B_CNT (0x08)
#define DST (0x0C)
#define SRC_DST_BIDX (0x10)
#define LINK_BCNTRLD (0x14)
#define SRC_DST_CIDX (0x18)
#define CCNT (0x1C)
volatile unsigned int PaRAMEntryAddr = DM81XX_EDMA3_PARAM_BASE + (chId * 0x20);
volatile unsigned int qchmapChId = DM81XX_EDMA3_QCHMAP0 + (chId * 4);
*((volatile unsigned int *) DM81XX_EDMA3_QEESR) |= (1 << chId);
*((volatile unsigned int *) qchmapChId) = (chId << 5) | 0x1C;
*((volatile unsigned int *) (PaRAMEntryAddr + OPT)) = 0x00100008;
*((volatile unsigned int *) (PaRAMEntryAddr + SRC)) = srcAddr;
*((volatile unsigned int *) (PaRAMEntryAddr + A_B_CNT)) = (qdmaHeight << 16) | (qdmaWidth);
*((volatile unsigned int *) (PaRAMEntryAddr + DST)) = dstAddr;
*((volatile unsigned int *) (PaRAMEntryAddr + SRC_DST_BIDX)) = (dstLineOffset << 16) | (srcLineOffset);
*((volatile unsigned int *) (PaRAMEntryAddr + LINK_BCNTRLD)) = (0 << 16) | 0xFFFF;
*((volatile unsigned int *) (PaRAMEntryAddr + SRC_DST_CIDX)) = (0 << 16) | 0;
*((volatile unsigned int *) (PaRAMEntryAddr + CCNT)) = 1;
这样设置,调用之后,并未触发DMA,请问是哪里配置错了吗?
Armstrong:
QDMA 触发必须要设置触发字!
1.
你代码中似乎没有指定那个word为触发word。
2.
代码中启动触发的函数似乎没有啊
Micky xie:
回复 Armstrong:
谢谢
是我理解有误?
volatile unsigned int qchmapChId = DM81XX_EDMA3_QCHMAP0 + (chId * 4);
*((volatile unsigned int *) qchmapChId) = (chId << 5) | 0x1C;
对CHMAP0赋的0x1C的值不是设置触发字吗?
而最终对0x1C所对应的CCNT的赋值,不是可以触发吗?
*((volatile unsigned int *) (PaRAMEntryAddr + CCNT)) = 1;
Micky xie:
本帖配置并未出错,已查到原因为opt的配置不够全面
*((volatile unsigned int *) (PaRAMEntryAddr + OPT)) = 0x00100008;
*((volatile unsigned int *) (PaRAMEntryAddr + OPT)) = ((0) | // SAM (0 << 1) | // DAM (1 << 2) | // SYNCDIM (0 << 3) | // STATIC (4 << 8) | // FWID (0 << 11) | // TCCMODE (chId << 12) | // TCC (0 << 20) | // TCINTEN (0 << 21) | // ITCINTEN (0 << 22) | // TCCHEN (0 << 23) | // ITCCHEN (0 << 24)); // PRIVID
Armstrong:
回复 Micky xie:
Micky xie
本帖配置并未出错,已查到原因为opt的配置不够全面
*((volatile unsigned int *) (PaRAMEntryAddr + OPT)) = 0x00100008;
*((volatile unsigned int *) (PaRAMEntryAddr + OPT)) = ((0) | // SAM (0 << 1) | // DAM (1 << 2) | // SYNCDIM (0 << 3) | // STATIC (4 << 8) | // FWID (0 << 11) | // TCCMODE (chId << 12) | // TCC (0 << 20) | // TCINTEN (0 << 21) | // ITCINTEN (0 << 22) | // TCCHEN (0 << 23) | // ITCCHEN (0 << 24)); // PRIVID
Micky xie:
回复 Armstrong:
用0x00100008是不全的,得用下面那个配置,你需要去查文档熟悉OPT各项。
Armstrong:
回复 Micky xie:
Micky xie
用0x00100008是不全的,得用下面那个配置,你需要去查文档熟悉OPT各项。