EDMA3 Driver Porting
I-A-99
/**
* \brief EDMA3 Cache Invalidate
*
* This function invalidates the D cache.
*
* \param mem_start_ptr [IN] Starting adress of memory. Please note that this should be aligned according
* to the cache line size.
* \param num_bytes [IN] length of buffer
* \return EDMA3_DRV_SOK if success, else error code in case of error or non-alignment of buffers.
*
* Note: This function is required if the buffer is in DDR. For other cases, where buffer is NOT in DDR, user may
* or may not require the below implementation and should modify it according to her need.
*/
EDMA3_DRV_Result Edma3_CacheInvalidate(unsigned int mem_start_ptr,
unsigned int num_bytes)
{
EDMA3_DRV_Result cacheInvResult = EDMA3_DRV_SOK;
/* Verify whether the start address is cache aligned or not */
if((mem_start_ptr & (EDMA3_CACHE_LINE_SIZE_IN_BYTES-1u)) != 0)
{
#ifdef EDMA3_DRV_DEBUG
EDMA3_DRV_PRINTF("\r\n Cache : Memory is not %d bytes alinged\r\n",
EDMA3_CACHE_LINE_SIZE_IN_BYTES);
#endif
cacheInvResult = EDMA3_NON_ALIGNED_BUFFERS_ERROR;
}
else
{
BCACHE_inv((void *)mem_start_ptr, num_bytes, EDMA3_CACHE_WAIT);
}
return cacheInvResult;
}
/**
* \brief EDMA3 Cache Flush
*
* This function flushes (cleans) the Cache
*
* \param mem_start_ptr [IN] Starting adress of memory. Please note that this should be aligned according
* to the cache line size.
* \param num_bytes [IN] length of buffer
* \return EDMA3_DRV_SOK if success, else error code in case of error or non-alignment of buffers.
*
* Note: This function is required if the buffer is in DDR. For other cases, where buffer is NOT in DDR, user may
*or may not require the below implementation and should modify it according to her need.
*/
EDMA3_DRV_Result Edma3_CacheFlush(unsigned int mem_start_ptr,
unsigned int num_bytes)
{
EDMA3_DRV_Result cacheFlushResult = EDMA3_DRV_SOK;
/* Verify whether the start address is cache aligned or not */
if((mem_start_ptr & (EDMA3_CACHE_LINE_SIZE_IN_BYTES-1u)) != 0)
{
#ifdef EDMA3_DRV_DEBUG
EDMA3_DRV_PRINTF("\r\n Cache : Memory is not %d bytes alinged\r\n",
EDMA3_CACHE_LINE_SIZE_IN_BYTES);
#endif
cacheFlushResult = EDMA3_NON_ALIGNED_BUFFERS_ERROR;
}
else
{
BCACHE_wb ((void *)mem_start_ptr, num_bytes, EDMA3_CACHE_WAIT);
}
return cacheFlushResult;
}
Summary of Contents for EDMA3
Page 12: ......
Page 17: ...EDMA3 Driver Introduction I 1 5 ...
Page 20: ......
Page 40: ...Run Time Interfaces Integration Guide A 12 EDMA3_DRV_IOCTL_MAX_IOCTL Max IOCTL ...
Page 75: ...Run Time Interfaces Integration Guide I A 47 Errors EDMA3_DRV_E_INVALID_PARAM ...
Page 107: ...Run Time Interfaces Integration Guide I A 79 ...