From 22390df92d0d232ef5a0fcc27f345b946ea20da3 Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Fri, 2 Dec 2022 04:45:23 -0800 Subject: [PATCH] s32k3xx:EDMA fix DMAMUX1 access violation --- arch/arm/src/s32k3xx/s32k3xx_edma.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/arm/src/s32k3xx/s32k3xx_edma.c b/arch/arm/src/s32k3xx/s32k3xx_edma.c index a28af16895..c4baf4ec2c 100644 --- a/arch/arm/src/s32k3xx/s32k3xx_edma.c +++ b/arch/arm/src/s32k3xx/s32k3xx_edma.c @@ -1017,8 +1017,8 @@ DMACH_HANDLE s32k3xx_dmach_alloc(uint16_t dmamux, uint8_t dchpri) /* Make sure that the channel is disabled. */ - putreg8(EDMA_CH_INT, S32K3XX_EDMA_TCD[dmach->chan] + - S32K3XX_EDMA_CH_INT_OFFSET); + putreg32(EDMA_CH_INT, S32K3XX_EDMA_TCD[dmach->chan] + + S32K3XX_EDMA_CH_INT_OFFSET); /* Disable the associated DMAMUX for now */ @@ -1085,8 +1085,8 @@ void s32k3xx_dmach_free(DMACH_HANDLE handle) /* Make sure that the channel is disabled. */ - putreg8(EDMA_CH_INT, S32K3XX_EDMA_TCD[dmach->chan] - + S32K3XX_EDMA_CH_INT_OFFSET); + putreg32(EDMA_CH_INT, S32K3XX_EDMA_TCD[dmach->chan] + + S32K3XX_EDMA_CH_INT_OFFSET); /* Disable the associated DMAMUX */ @@ -1096,7 +1096,7 @@ void s32k3xx_dmach_free(DMACH_HANDLE handle) } else { - putreg8(0, S32K3XX_DMAMUX1_CHCFG(dmach->chan)); + putreg8(0, S32K3XX_DMAMUX1_CHCFG(dmach->chan - 16)); } } @@ -1554,7 +1554,7 @@ void s32k3xx_dmasample(DMACH_HANDLE handle, struct s32k3xx_dmaregs_s *regs) } else { - regs->dmamux = getreg32(S32K3XX_DMAMUX1_CHCFG(chan)); /* Channel configuration */ + regs->dmamux = getreg32(S32K3XX_DMAMUX1_CHCFG(chan - 16)); /* Channel configuration */ } spin_unlock_irqrestore(NULL, flags);