There is a difference in the set up in DMA0 and DMA1 when using the DMA mux, please see the following -
Following are the key differences,
1) During TCD configuration of DMA0, say if channel N(0<=N<=16) of DMA_CH_MUX0 has been used, we are going to program all TCD(N) of DMA0
But for DMA1, since DMA_CH_MUX3 has been used, and say if channel N (0<=N<=16) of DMA_CH_MUX3 has been used, we would be programming TCD(N+16) registers of DMA1
The following piece of code can illustrate it,
if(DMA_CH_MUX_NO == 1 || DMA_CH_MUX_NO ==3) {
channel_num = channel_num + 16;
}
#define DMA_TCD_ADDR (SPP_DMA20_BASEADDRESS + 0x1000) + (0x20 * channel_num) + ((DMA_NO)*0x80000) ; // DMA_NO is 0 or 1
PROGRAM DMA TCD registers
2) FOR DMA_CH_MUX configuration, programming is tantamount, but for first case we program DMA_CH_MUX0, and for the other case, we program DMA_CH_MUX3
So, to summarize, the cardinal thing to take care,
DMA0 + DMA_CH_MUX0 - Program channel N in DMA_CH_MUX, N in DMA
DMA0 + DMA_CH_MUX1 - Program channel N in DMA_CH_MUX, (N+16) in DMA
DMA1 + DMA_CH_MUX2 - Program channel N in DMA_CH_MUX, N in DMA
DMA1 + DMA_CH_MUX3 - Program channel N in DMA_CH_MUX, (N+16) in DMA