s32k3xx: lpspi dma invalidate cache after exchange

This commit is contained in:
Peter van der Perk 2023-07-07 09:52:40 +02:00 committed by Alan Carvalho de Assis
parent 87a51f4faa
commit 755e3beba9

View File

@ -1757,12 +1757,6 @@ static void s32k3xx_lpspi_exchange(struct spi_dev_s *dev,
up_clean_dcache((uintptr_t)txbuffer, (uintptr_t)txbuffer + nbytes);
}
if (rxbuffer)
{
up_invalidate_dcache((uintptr_t)rxbuffer,
(uintptr_t)rxbuffer + nbytes);
}
/* Set up the DMA */
adjust = (priv->nbits > 8) ? 2 : 1;
@ -1825,6 +1819,12 @@ static void s32k3xx_lpspi_exchange(struct spi_dev_s *dev,
/* Disable DMA */
s32k3xx_lpspi_putreg32(priv, S32K3XX_LPSPI_DER_OFFSET, 0);
if (rxbuffer)
{
up_invalidate_dcache((uintptr_t)rxbuffer,
(uintptr_t)rxbuffer + nbytes);
}
}
#endif /* CONFIG_S32K3XX_SPI_DMA */