S32K3XX EDMA Set Backdoor for DTCM memory map

This commit is contained in:
Peter van der Perk 2022-12-05 10:07:28 +01:00 committed by Xiang Xiao
parent b526e06de1
commit e7449cf97a
1 changed files with 22 additions and 0 deletions

View File

@ -154,6 +154,12 @@ struct s32k3xx_edma_s
struct s32k3xx_dmach_s dmach[S32K3XX_EDMA_NCHANNELS];
};
#ifdef CONFIG_S32K3XX_DTCM_HEAP
extern uint8_t DTCM_BASE_ADDR[];
extern uint8_t DTCM_END_ADDR[];
#define DTCM_BACKDOOR_OFFSET 0x1000000
#endif
/****************************************************************************
* Private Data
****************************************************************************/
@ -614,6 +620,22 @@ static inline void s32k3xx_tcd_configure(struct s32k3xx_edmatcd_s *tcd,
EDMA_TCD_CSR_INTHALF : 0;
tcd->dlastsga = config->flags & EDMA_CONFIG_LOOPDEST ? -config->iter : 0;
#ifdef CONFIG_S32K3XX_DTCM_HEAP
/* Remap address to backdoor address for eDMA */
if (tcd->saddr >= (uint32_t)DTCM_BASE_ADDR
&& tcd->saddr < (uint32_t)DTCM_END_ADDR)
{
tcd->saddr += DTCM_BACKDOOR_OFFSET;
}
if (tcd->daddr >= (uint32_t)DTCM_BASE_ADDR
&& tcd->daddr < (uint32_t)DTCM_END_ADDR)
{
tcd->daddr += DTCM_BACKDOOR_OFFSET;
}
#endif
/* And special case flags */
#ifdef CONFIG_S32K3XX_EDMA_ELINK