arch/arm/src/imxrt/imxrt_edma.c: Fix some issues with adding a new TCD to the end of a scatter/gather chain: Was not correctly writing back the new tail pointer; Need to flush the previous TCD in the chain whose fields were modify to link to the new TCD.

This commit is contained in:
Gregory Nutt 2018-05-23 20:29:20 -06:00
parent b3f20f8c5b
commit c9be3dd387

View File

@ -518,7 +518,7 @@ static void imxrt_dmaterminate(struct imxrt_dmach_s *dmach, int result)
regaddr = IMXRT_EDMA_TCD_CSR(chan);
putreg16(0, regaddr);
/* Cancel all next TCD transfer. */
/* Cancel next TCD transfer. */
regaddr = IMXRT_EDMA_TCD_DLASTSGA(chan);
putreg16(0, regaddr);
@ -1101,6 +1101,11 @@ int imxrt_dmach_xfrsetup(DMACH_HANDLE *handle,
prev->csr = regval16;
prev->dlastsga = (uint32_t)tcd;
dmach->tail = tcd;
/* Clean cache associated with the previous TCD memory */
arch_clean_dcache(prev, sizeof(struct imxrt_edmatcd_s));
/* Check if the TCD block in the DMA channel registers is the same as
* the previous previous TCD. This can happen if the previous TCD was