I have a question about using EDMA on the K2H device.
We are trying to implement a sequence of EDMA transfers using one EDMA channel and several link PaRAM sets, using linking and chaining. The idea is that the first PaRAM set copies data from L2 memory into another PaRAM set (actually a block of consecutive PaRAM sets), and then links to this PaRAM set in order to execute it. So this first PaRAM set looks like this:
prm->opt = 0x82418000;
prm->srcAddr = L2Addr;
prm->destAddr = PaRAMAddr;
prm->aCnt = 160;
prm->bCnt = 1;
prm->cCnt = 1;
prm->bCntReload = 0;
prm->srcBIdx = 0;
prm->destBIdx = 0;
prm->srcCIdx = 0;
prm->destCIdx = 0;
prm->linkAddr = (0xFFFFu) & PaRAMAddr;
Here L2Addr is an address in L2 memory corresponding to the head of a (potentially long) queue of PaRAM set parameters which have been prepared by the CPU. The idea is that to serve the next job on the queue, the CPU updates srcAddr in the above and then triggers the EDMA manually. The TCCHEN bit is set and TCC is set to chain to itself.
When we try this, what seems to happen is that the EDMA above executes successfully but the link to PaRAMAddr does not work. However we have found that if we modify prm->linkAddr in the above to link instead to the following dummy PaRAM set, which in turn links to PaRAMAddr, then it works.
prm->opt = 0x82418000;
prm->srcAddr = NULL;
prm->destAddr = NULL;
prm->aCnt = 1;
prm->bCnt = 0;
prm->cCnt = 0;
prm->bCntReload = 0;
prm->srcBIdx = 0;
prm->destBIdx = 0;
prm->srcCIdx = 0;
prm->destCIdx = 0;
prm->linkAddr = (0xFFFFu) & PaRAMAddr;
Is there a reason why this dummy transfer is needed? For example, is it illegal for destAddr and linkAddr in one PaRAM set to be the same?