Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kinetis s32k1 s32k3:edma {s|d}last needs to be total xfer size #9346

Merged
merged 3 commits into from May 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 5 additions & 2 deletions arch/arm/src/kinetis/kinetis_edma.c
Expand Up @@ -364,7 +364,9 @@ static inline void kinetis_tcd_configure(struct kinetis_edmatcd_s *tcd,
tcd->attr = EDMA_TCD_ATTR_SSIZE(config->ssize) | /* Transfer Attributes */
EDMA_TCD_ATTR_DSIZE(config->dsize);
tcd->nbytes = config->nbytes;
tcd->slast = config->flags & EDMA_CONFIG_LOOPSRC ? -config->iter : 0;
tcd->slast = config->flags & EDMA_CONFIG_LOOPSRC ?
-(config->iter * config->nbytes) : 0;

tcd->daddr = config->daddr;
tcd->doff = config->doff;
tcd->citer = config->iter & EDMA_TCD_CITER_CITER_MASK;
Expand All @@ -373,7 +375,8 @@ static inline void kinetis_tcd_configure(struct kinetis_edmatcd_s *tcd,
0 : EDMA_TCD_CSR_DREQ;
tcd->csr |= config->flags & EDMA_CONFIG_INTHALF ?
EDMA_TCD_CSR_INTHALF : 0;
tcd->dlastsga = config->flags & EDMA_CONFIG_LOOPDEST ? -config->iter : 0;
tcd->dlastsga = config->flags & EDMA_CONFIG_LOOPDEST ?
-(config->iter * config->nbytes) : 0;

/* And special case flags */

Expand Down
6 changes: 4 additions & 2 deletions arch/arm/src/s32k1xx/s32k1xx_edma.c
Expand Up @@ -362,7 +362,8 @@ static inline void s32k1xx_tcd_configure(struct s32k1xx_edmatcd_s *tcd,
tcd->attr = EDMA_TCD_ATTR_SSIZE(config->ssize) | /* Transfer Attributes */
EDMA_TCD_ATTR_DSIZE(config->dsize);
tcd->nbytes = config->nbytes;
tcd->slast = config->flags & EDMA_CONFIG_LOOPSRC ? -config->iter : 0;
tcd->slast = config->flags & EDMA_CONFIG_LOOPSRC ?
-(config->iter * config->nbytes) : 0;
tcd->daddr = config->daddr;
tcd->doff = config->doff;
tcd->citer = config->iter & EDMA_TCD_CITER_CITER_MASK;
Expand All @@ -371,7 +372,8 @@ static inline void s32k1xx_tcd_configure(struct s32k1xx_edmatcd_s *tcd,
0 : EDMA_TCD_CSR_DREQ;
tcd->csr |= config->flags & EDMA_CONFIG_INTHALF ?
EDMA_TCD_CSR_INTHALF : 0;
tcd->dlastsga = config->flags & EDMA_CONFIG_LOOPDEST ? -config->iter : 0;
tcd->dlastsga = config->flags & EDMA_CONFIG_LOOPDEST ?
-(config->iter * config->nbytes) : 0;

/* And special case flags */

Expand Down
7 changes: 5 additions & 2 deletions arch/arm/src/s32k3xx/s32k3xx_edma.c
Expand Up @@ -616,7 +616,9 @@ static inline void s32k3xx_tcd_configure(struct s32k3xx_edmatcd_s *tcd,
EDMA_TCD_ATTR_DMOD(config->dmod);
#endif
tcd->nbytes = config->nbytes;
tcd->slast = config->flags & EDMA_CONFIG_LOOPSRC ? -config->iter : 0;
tcd->slast = config->flags & EDMA_CONFIG_LOOPSRC ?
-(config->iter * config->nbytes) : 0;

tcd->daddr = config->daddr;
tcd->doff = config->doff;
tcd->citer = config->iter & EDMA_TCD_CITER_MASK;
Expand All @@ -625,7 +627,8 @@ static inline void s32k3xx_tcd_configure(struct s32k3xx_edmatcd_s *tcd,
0 : EDMA_TCD_CSR_DREQ;
tcd->csr |= config->flags & EDMA_CONFIG_INTHALF ?
EDMA_TCD_CSR_INTHALF : 0;
tcd->dlastsga = config->flags & EDMA_CONFIG_LOOPDEST ? -config->iter : 0;
tcd->dlastsga = config->flags & EDMA_CONFIG_LOOPDEST ?
-(config->iter * config->nbytes) : 0;

#ifdef CONFIG_S32K3XX_DTCM_HEAP
/* Remap address to backdoor address for eDMA */
Expand Down