AM62x MCU+ SDK  09.02.01

Introduction

This is UDMA driver utilty parameters and API

Files

file  udma_utils.h
 UDMA utility API to make TR, get TR descriptor memory requirement.
 

Functions

uint32_t UdmaUtils_getRingMemSize (uint8_t mode, uint32_t elemCnt, uint8_t elemSize)
 UDMA get ring size utility API. More...
 
void UdmaUtils_makeTrpdTr15 (uint8_t *trpdMem, uint32_t trCnt, uint32_t cqRingNum)
 UDMA utility API to make TRPD with TR15 TR type. Other TRPD make APIs should be called only after this API. More...
 
void UdmaUtils_makeTrpd (uint8_t *trpdMem, uint32_t trType, uint32_t trCnt, uint32_t cqRingNum)
 UDMA utility API to make TRPD. Other TRPD make APIs should be called only after this API. More...
 
uint32_t UdmaUtils_getTrSizeEncoded (uint32_t trType)
 Returns the size of TR (encoded) based on the type. More...
 
uint32_t UdmaUtils_getTrSizeBytes (uint32_t trType)
 Returns the size of TR in bytes based on the type. More...
 
int32_t UdmaUtils_mapLocaltoGlobalEvent (Udma_DrvHandle drvHandle, Udma_ChHandle chHandle, uint32_t localeventID, uint32_t eventMode)
 Map L2G event for BCDMA trigger. More...
 
int32_t UdmaUtils_setTrpdReload (uint8_t *trpdMem, uint32_t reloadEnable, uint32_t reloadIdx)
 Sets the reload count and index for the TRPD. More...
 
static uint32_t UdmaUtils_getTrpdTr15Response (const uint8_t *trpdMem, uint32_t trCnt, uint32_t trIndex)
 Returns the TR response in the TRPD memory based on the index. More...
 
static CSL_UdmapTR15 * UdmaUtils_getTrpdTr15Pointer (uint8_t *trpdMem, uint32_t trIndex)
 Returns the TR15 pointer in the TRPD memory based on the index. More...
 
static CSL_UdmapTR1 * UdmaUtils_getTrpdTr1Pointer (uint8_t *trpdMem, uint32_t trIndex)
 Returns the TR1 pointer in the TRPD memory based on the index. More...
 
static CSL_UdmapTR3 * UdmaUtils_getTrpdTr3Pointer (uint8_t *trpdMem, uint32_t trIndex)
 

Macros

#define UDMA_GET_TRPD_TR15_SIZE(n)   (UDMA_ALIGN_SIZE(sizeof(CSL_UdmapTR15) + ((n) * (sizeof(CSL_UdmapTR15) + 4U))))
 UDMA TR15 packet descriptor memory size in bytes. This contains the CSL_UdmapCppi5TRPD + Padding to sizeof(CSL_UdmapTR15) + N* Type_15 TR (CSL_UdmapTR15) + N* TR response of 4 bytes. Since CSL_UdmapCppi5TRPD header is less than CSL_UdmapTR15, CSL_UdmapTR15 itself is used for size alignment. More...
 
#define UDMA_GET_TRPD_TR3_SIZE(n)   (UDMA_ALIGN_SIZE(sizeof(CSL_UdmapTR3) + ((n) * (sizeof(CSL_UdmapTR3) + 4U))))
 UDMA TR3 packet descriptor memory size in bytes. This contains the CSL_UdmapCppi5TRPD + Padding to sizeof(CSL_UdmapTR3) + N* Type_3 TR (CSL_UdmapTR3) + N* TR response of 4 bytes. Since CSL_UdmapCppi5TRPD header is less than CSL_UdmapTR3, CSL_UdmapTR3 itself is used for size alignment. More...
 
#define UDMA_TR1_OFFSET   (32U)
 Offset for TR1 type TR from TRPD start address. More...
 
#define UDMA_TR3_OFFSET   (32U)
 Offset for TR3 type TR from TRPD start address. More...
 

UDMA TR type

Various UDMA TR type supported

#define UDMA_TR_TYPE_0   (CSL_UDMAP_TR_FLAGS_TYPE_1D_DATA_MOVE)
 
#define UDMA_TR_TYPE_1   (CSL_UDMAP_TR_FLAGS_TYPE_2D_DATA_MOVE)
 
#define UDMA_TR_TYPE_2   (CSL_UDMAP_TR_FLAGS_TYPE_3D_DATA_MOVE)
 
#define UDMA_TR_TYPE_3   (CSL_UDMAP_TR_FLAGS_TYPE_4D_DATA_MOVE)
 
#define UDMA_TR_TYPE_4   (CSL_UDMAP_TR_FLAGS_TYPE_4D_DATA_MOVE_FORMATTING)
 
#define UDMA_TR_TYPE_5   (CSL_UDMAP_TR_FLAGS_TYPE_4D_CACHE_WARM)
 
#define UDMA_TR_TYPE_8   (CSL_UDMAP_TR_FLAGS_TYPE_4D_BLOCK_MOVE)
 
#define UDMA_TR_TYPE_9   (CSL_UDMAP_TR_FLAGS_TYPE_4D_BLOCK_MOVE_REPACKING)
 
#define UDMA_TR_TYPE_10   (CSL_UDMAP_TR_FLAGS_TYPE_2D_BLOCK_MOVE)
 
#define UDMA_TR_TYPE_11   (CSL_UDMAP_TR_FLAGS_TYPE_2D_BLOCK_MOVE_REPACKING)
 
#define UDMA_TR_TYPE_15   (CSL_UDMAP_TR_FLAGS_TYPE_4D_BLOCK_MOVE_REPACKING_INDIRECTION)
 

Macro Definition Documentation

◆ UDMA_TR_TYPE_0

#define UDMA_TR_TYPE_0   (CSL_UDMAP_TR_FLAGS_TYPE_1D_DATA_MOVE)

◆ UDMA_TR_TYPE_1

#define UDMA_TR_TYPE_1   (CSL_UDMAP_TR_FLAGS_TYPE_2D_DATA_MOVE)

◆ UDMA_TR_TYPE_2

#define UDMA_TR_TYPE_2   (CSL_UDMAP_TR_FLAGS_TYPE_3D_DATA_MOVE)

◆ UDMA_TR_TYPE_3

#define UDMA_TR_TYPE_3   (CSL_UDMAP_TR_FLAGS_TYPE_4D_DATA_MOVE)

◆ UDMA_TR_TYPE_4

#define UDMA_TR_TYPE_4   (CSL_UDMAP_TR_FLAGS_TYPE_4D_DATA_MOVE_FORMATTING)

◆ UDMA_TR_TYPE_5

#define UDMA_TR_TYPE_5   (CSL_UDMAP_TR_FLAGS_TYPE_4D_CACHE_WARM)

◆ UDMA_TR_TYPE_8

#define UDMA_TR_TYPE_8   (CSL_UDMAP_TR_FLAGS_TYPE_4D_BLOCK_MOVE)

◆ UDMA_TR_TYPE_9

#define UDMA_TR_TYPE_9   (CSL_UDMAP_TR_FLAGS_TYPE_4D_BLOCK_MOVE_REPACKING)

◆ UDMA_TR_TYPE_10

#define UDMA_TR_TYPE_10   (CSL_UDMAP_TR_FLAGS_TYPE_2D_BLOCK_MOVE)

◆ UDMA_TR_TYPE_11

#define UDMA_TR_TYPE_11   (CSL_UDMAP_TR_FLAGS_TYPE_2D_BLOCK_MOVE_REPACKING)

◆ UDMA_TR_TYPE_15

◆ UDMA_GET_TRPD_TR15_SIZE

#define UDMA_GET_TRPD_TR15_SIZE (   n)    (UDMA_ALIGN_SIZE(sizeof(CSL_UdmapTR15) + ((n) * (sizeof(CSL_UdmapTR15) + 4U))))

UDMA TR15 packet descriptor memory size in bytes. This contains the CSL_UdmapCppi5TRPD + Padding to sizeof(CSL_UdmapTR15) + N* Type_15 TR (CSL_UdmapTR15) + N* TR response of 4 bytes. Since CSL_UdmapCppi5TRPD header is less than CSL_UdmapTR15, CSL_UdmapTR15 itself is used for size alignment.

n - Number of TR's present in the TRPD

◆ UDMA_GET_TRPD_TR3_SIZE

#define UDMA_GET_TRPD_TR3_SIZE (   n)    (UDMA_ALIGN_SIZE(sizeof(CSL_UdmapTR3) + ((n) * (sizeof(CSL_UdmapTR3) + 4U))))

UDMA TR3 packet descriptor memory size in bytes. This contains the CSL_UdmapCppi5TRPD + Padding to sizeof(CSL_UdmapTR3) + N* Type_3 TR (CSL_UdmapTR3) + N* TR response of 4 bytes. Since CSL_UdmapCppi5TRPD header is less than CSL_UdmapTR3, CSL_UdmapTR3 itself is used for size alignment.

n - Number of TR's present in the TRPD

◆ UDMA_TR1_OFFSET

#define UDMA_TR1_OFFSET   (32U)

Offset for TR1 type TR from TRPD start address.

◆ UDMA_TR3_OFFSET

#define UDMA_TR3_OFFSET   (32U)

Offset for TR3 type TR from TRPD start address.

Function Documentation

◆ UdmaUtils_getRingMemSize()

uint32_t UdmaUtils_getRingMemSize ( uint8_t  mode,
uint32_t  elemCnt,
uint8_t  elemSize 
)

UDMA get ring size utility API.

Parameters
mode[IN] Ring mode. Refer tisci_msg_rm_ring_cfg_req::mode
elemCnt[IN] Ring element count.
elemSize[IN] Ring element size. Refer Udma_RingElemSize
Returns
Size of the ring memory required in bytes

◆ UdmaUtils_makeTrpdTr15()

void UdmaUtils_makeTrpdTr15 ( uint8_t *  trpdMem,
uint32_t  trCnt,
uint32_t  cqRingNum 
)

UDMA utility API to make TRPD with TR15 TR type. Other TRPD make APIs should be called only after this API.

Note: This sets the most commonly used value for all the fields. User can override the fields after calling this API if required.

Parameters
trpdMem[IN] Pointer to TRPD memory
trCnt[IN] Number of TR entries present in the TRPD
cqRingNum[IN] Completion ring number where the TRPD is returned after processing

◆ UdmaUtils_makeTrpd()

void UdmaUtils_makeTrpd ( uint8_t *  trpdMem,
uint32_t  trType,
uint32_t  trCnt,
uint32_t  cqRingNum 
)

UDMA utility API to make TRPD. Other TRPD make APIs should be called only after this API.

Note: This sets the most commonly used value for all the fields. User can override the fields after calling this API if required.

Parameters
trpdMem[IN] Pointer to TRPD memory
trType[IN] TR type. Refer Udma_TrType
trCnt[IN] Number of TR entries present in the TRPD
cqRingNum[IN] Completion ring number where the TRPD is returned after processing

◆ UdmaUtils_getTrSizeEncoded()

uint32_t UdmaUtils_getTrSizeEncoded ( uint32_t  trType)

Returns the size of TR (encoded) based on the type.

Parameters
trType[IN] TR type. Refer Udma_TrType
Returns
Size of the TR record in encoded value to be programmed in TRPD.

◆ UdmaUtils_getTrSizeBytes()

uint32_t UdmaUtils_getTrSizeBytes ( uint32_t  trType)

Returns the size of TR in bytes based on the type.

Parameters
trType[IN] TR type. Refer Udma_TrType
Returns
Size of the TR record in bytes.

◆ UdmaUtils_mapLocaltoGlobalEvent()

int32_t UdmaUtils_mapLocaltoGlobalEvent ( Udma_DrvHandle  drvHandle,
Udma_ChHandle  chHandle,
uint32_t  localeventID,
uint32_t  eventMode 
)

Map L2G event for BCDMA trigger.

Parameters
drvHandle[IN] UDMA driver handle - static memory needs to allocated by caller. This is used by the driver to maintain the driver states. This cannot be NULL.
chHandle[IN] UDMA channel handle. This parameter can't be NULL.
localeventID[IN] Local event ID for the corresponding IP.
eventMode[IN] Edge triggering signal or pulsed signal.
Returns
SYSTEMP_SUCESS OR SYSTEMP_FAILURE.

◆ UdmaUtils_setTrpdReload()

int32_t UdmaUtils_setTrpdReload ( uint8_t *  trpdMem,
uint32_t  reloadEnable,
uint32_t  reloadIdx 
)

Sets the reload count and index for the TRPD.

Parameters
trpdMem[IN] Address to TRPD memory
reloadEnable[IN] Reload enable flag
reloadIdx[IN] Reload index

◆ UdmaUtils_getTrpdTr15Response()

static uint32_t UdmaUtils_getTrpdTr15Response ( const uint8_t *  trpdMem,
uint32_t  trCnt,
uint32_t  trIndex 
)
inlinestatic

Returns the TR response in the TRPD memory based on the index.

Parameters
trpdMem[IN] TRPD memory pointer
trCnt[IN] Number of TR entries present in the TRPD
trIndex[IN] Index to the TR to get the response from
Returns
TR response Refer CSL_UdmapTrResponseStatus

◆ UdmaUtils_getTrpdTr15Pointer()

static CSL_UdmapTR15 * UdmaUtils_getTrpdTr15Pointer ( uint8_t *  trpdMem,
uint32_t  trIndex 
)
inlinestatic

Returns the TR15 pointer in the TRPD memory based on the index.

Parameters
trpdMem[IN] TRPD memory pointer
trIndex[IN] Index to the TR to get the TR15 pointer address
Returns
TR15 pointer address

◆ UdmaUtils_getTrpdTr1Pointer()

static CSL_UdmapTR1 * UdmaUtils_getTrpdTr1Pointer ( uint8_t *  trpdMem,
uint32_t  trIndex 
)
inlinestatic

Returns the TR1 pointer in the TRPD memory based on the index.

Parameters
trpdMem[IN] TRPD memory pointer
trIndex[IN] Index to the TR to get the TR1 pointer address
Returns
TR1 pointer address

◆ UdmaUtils_getTrpdTr3Pointer()

static CSL_UdmapTR3* UdmaUtils_getTrpdTr3Pointer ( uint8_t *  trpdMem,
uint32_t  trIndex 
)
inlinestatic