esp32s3/dma: Fix loading the DMA descriptor address

The macro `SET_BITS` only sets the bits according to the bit mask
and, once it's being used to set the address field of the GDMA
inlink/outlink register, it's necessary to clean all the bits
corresponding to that field that were eventually setup previously
to avoid messing with the bits that correspond to the current
address being setup.
This commit is contained in:
Tiago Medicci Serrano 2023-08-23 16:44:54 -03:00 committed by Xiang Xiao
parent 9357d70c25
commit d26212bd39

View File

@ -242,6 +242,7 @@ uint32_t esp32s3_dma_setup(int chan, bool tx,
/* Set the descriptor link base address for TX channel */
regval = (uint32_t)dmadesc & DMA_OUTLINK_ADDR_CH0;
CLR_BITS(DMA_OUT_LINK_CH0_REG, chan, DMA_OUTLINK_ADDR_CH0);
SET_BITS(DMA_OUT_LINK_CH0_REG, chan, regval);
}
else
@ -254,6 +255,7 @@ uint32_t esp32s3_dma_setup(int chan, bool tx,
/* Set the descriptor link base address for RX channel */
regval = (uint32_t)dmadesc & DMA_INLINK_ADDR_CH0;
CLR_BITS(DMA_IN_LINK_CH0_REG, chan, DMA_INLINK_ADDR_CH0);
SET_BITS(DMA_IN_LINK_CH0_REG, chan, regval);
}