Skip to content

Commit

Permalink
kinetis:spi remove ttype & do cache ops
Browse files Browse the repository at this point in the history
  • Loading branch information
davids5 authored and xiaoxiang781216 committed Aug 9, 2022
1 parent 2258058 commit 050ce3e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions arch/arm/src/kinetis/kinetis_spi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1222,13 +1222,16 @@ static void spi_exchange(struct spi_dev_s *dev, const void *txbuffer,
config.flags = EDMA_CONFIG_LINKTYPE_LINKNONE;
config.ssize = adjust == 1 ? EDMA_8BIT : EDMA_16BIT;
config.dsize = adjust == 1 ? EDMA_8BIT : EDMA_16BIT;
config.ttype = EDMA_PERIPH2MEM;
config.nbytes = adjust;
#ifdef CONFIG_KINETIS_EDMA_ELINK
config.linkch = NULL;
#endif
kinetis_dmach_xfrsetup(priv->rxdma, &config);

up_invalidate_dcache((uintptr_t)config.daddr,
(uintptr_t)config.daddr +
config.iter * config.nbytes);

config.saddr = (uint32_t) (txbuffer ? txbuffer : &txdummy);
config.daddr = priv->spibase + KINETIS_SPI_PUSHR_OFFSET;
config.soff = txbuffer ? adjust : 0;
Expand All @@ -1237,11 +1240,14 @@ static void spi_exchange(struct spi_dev_s *dev, const void *txbuffer,
config.flags = EDMA_CONFIG_LINKTYPE_LINKNONE;
config.ssize = adjust == 1 ? EDMA_8BIT : EDMA_16BIT;
config.dsize = adjust == 1 ? EDMA_8BIT : EDMA_16BIT;
config.ttype = EDMA_MEM2PERIPH;
config.nbytes = adjust;
#ifdef CONFIG_KINETIS_EDMA_ELINK
config.linkch = NULL;
#endif

up_clean_dcache((uintptr_t)config.saddr,
(uintptr_t)config.saddr + nbytes * adjust);

kinetis_dmach_xfrsetup(priv->txdma, &config);

spi_modifyreg(priv, KINETIS_SPI_RSER_OFFSET, 0 ,
Expand Down

0 comments on commit 050ce3e

Please sign in to comment.