PDK API Guide for J721E
|
This is DMA Utils related configuration parameters and API
Files | |
file | dmautils_autoincrement_3d.h |
This file contains the data types and util function prototype for configuring DMA Utility autoincrement 3D usecase. | |
Data Structures | |
struct | DmaUtilsAutoInc3d_TransferDim |
This structure specifies the properties of the transfer for auto increment usecase. More... | |
struct | DmaUtilsAutoInc3d_TransferCirc |
This structure specifies the circular properties for each level of the transfer count. User can specify 2 different sizes for each level. More... | |
struct | DmaUtilsAutoInc3d_IOPointers |
This structure specifies the input and output pointers for the transfer. More... | |
struct | DmaUtilsAutoInc3d_TransferProp |
This structure specifies the properties of the transfer for auto increment usecase. More... | |
struct | DmaUtilsAutoInc3d_ChannelInitParam |
This structure specifies the parameter to initialize auto increment related properties. More... | |
struct | DmaUtilsAutoInc3d_InitParam |
struct | DmaUtilsAutoInc3d_TrPrepareParam |
Functions | |
int32_t | DmaUtilsAutoInc3d_getContextSize (int32_t numChannels) |
Returns the size of dmautils context. More... | |
int32_t | DmaUtilsAutoInc3d_init (void *autoIncrementContext, DmaUtilsAutoInc3d_InitParam *initParams, DmaUtilsAutoInc3d_ChannelInitParam chInitParams[]) |
This function initializes the DMA UTILS context for autoincrement usecase. More... | |
int32_t | DmaUtilsAutoInc3d_getTrMemReq (int32_t numTRs) |
This function returns the size of the TR descriptor required for the transfer configuration given by the user. More... | |
int32_t | DmaUtilsAutoInc3d_prepareTr (DmaUtilsAutoInc3d_TrPrepareParam *trPrepParam, DmaUtilsAutoInc3d_TransferProp transferProp[]) |
This function will prepare a TR/ TR descriptor depending on the number of Tr's to be submitted on a particular channel. Note this function will use the addresses as given by the user without any conversion. If user wants to convert addresses from virtual to physical address they should use DmaUtilsAutoInc3d_convertTrVirtToPhyAddr API. Other way to do the same is to call DmaUtilsAutoInc3d_convertToPhysicalAddr to explicitly convert the address in TR to physical address. More... | |
int32_t | DmaUtilsAutoInc3d_prepareTrWithPhysicalAddress (void *autoIncrementContext, DmaUtilsAutoInc3d_TrPrepareParam *trPrepParam, DmaUtilsAutoInc3d_TransferProp transferProp[]) |
This function will prepare a TR/ TR descriptor depending on the number of Tr's to be submitted on a particular channel. The only difference between this function and DmaUtilsAutoInc3d_prepareTr function is that this function will call UDMA driver's Udma_VirtToPhyFxn function if its not NULL to convert virtual address to physical address. Note that this function will convert the virtual addresses given to physical addresses if UDMA driver Udma_VirtToPhyFxn function is not NULL using the same function. If user is preparing TR without using this API then it is user's responsibity to provide the physical addresses or call DmaUtilsAutoInc3d_convertToPhysicalAddr API to covert the addresses given in TR to physical addresses. More... | |
int32_t | DmaUtilsAutoInc3d_convertTrVirtToPhyAddr (void *autoIncrementContext, DmaUtilsAutoInc3d_TrPrepareParam *trPrepParam, uint32_t convertMask) |
This function should be called whenever provides TR with virtual addresses of src and dst pointer. This function will convert the virtual addresses given to physical addresses using UDMA driver initialized function Udma_VirtToPhyFxn. If UDMA driver Udma_VirtToPhyFxn function is NULL then this API results into no change. More... | |
int32_t | DmaUtilsAutoInc3d_configure (void *autoIncrementContext, int32_t channelId, uint8_t *trMem, int32_t numTr) |
This function configures autoincrement for a particular channel. More... | |
int32_t | DmaUtilsAutoInc3d_trigger (void *autoIncrementContext, int32_t channelId) |
This function triggers transfer on a particular channel. More... | |
void | DmaUtilsAutoInc3d_wait (void *autoIncrementContext, int32_t channelId) |
This function waits for completion transfer on a particular channel. More... | |
int32_t | DmaUtilsAutoInc3d_deconfigure (void *autoIncrementContext, int32_t channelId, uint8_t *trMem, int32_t numTr) |
This function deconfigures autoincrement for a particular channel. More... | |
int32_t | DmaUtilsAutoInc3d_deinit (void *autoIncrementContext) |
This function deinit autoincrement by releasing all the resorces allocated. More... | |
Enumerations | |
enum | DmaUtilsAutoInc3d_SyncType { DMAUTILSAUTOINC3D_SYNC_1D = 0, DMAUTILSAUTOINC3D_SYNC_2D = 1, DMAUTILSAUTOINC3D_SYNC_3D = 2, DMAUTILSAUTOINC3D_SYNC_4D = 3 } |
Describes the boundary at which the DMA is suppose to get synced. More... | |
enum | DmaUtilsAutoInc3d_AddrType { DMAUTILSAUTOINC3D_ADDR_LINEAR = 0, DMAUTILSAUTOINC3D_ADDR_CIRC1 = 1, DMAUTILSAUTOINC3D_ADDR_CIRC2 = 2 } |
Describes the boundary at which the DMA is suppose to get synced. More... | |
enum | DmaUtilsAutoInc3d_CircDirType { DMAUTILSAUTOINC3D_CIRCDIR_SRC = 0, DMAUTILSAUTOINC3D_CIRCDIR_DST = 1 } |
Describes the direction in which circular addressing is applied. More... | |
enum | DmaUtilsAutoInc3d_druOwner { DMAUTILSAUTOINC3D_DRUOWNER_DIRECT_TR = 0, DMAUTILSAUTOINC3D_DRUOWNER_UDMA = 1 } |
enum | DmaUtilsAutoInc3d_addrConvertMask { DMAUTILSAUTOINC3D_ADDRCONVERTMASK_SRCADDR = (uint32_t)1U << 0, DMAUTILSAUTOINC3D_ADDRCONVERTMASK_DSTADDR = (uint32_t)1U << 1 } |
Describes the addresses that needs to be converted while using DmaUtilsAutoInc3d_convertToPhysicalAddr update API.User can create a mask with more than one fields of this enumby "OR"ing these fields to update more than one parameters. e.g. if user wants to convert both src and destination addresses then they can create this mask as follows : mask = DMAUTILSAUTOINC3D_ADDRCONVERTMASK_SRCADDR | DMAUTILSAUTOINC3D_ADDRCONVERTMASK_DSTADDR. More... | |
Macros | |
#define | DMAUTILS_MAX_NUM_TR_DIRECT_TR_MODE (1U) |
Number of TR's that can be submitted back to back channel. More... | |
#define DMAUTILS_MAX_NUM_TR_DIRECT_TR_MODE (1U) |
Number of TR's that can be submitted back to back channel.
Describes the boundary at which the DMA is suppose to get synced.
Describes the boundary at which the DMA is suppose to get synced.
Describes the addresses that needs to be converted while using DmaUtilsAutoInc3d_convertToPhysicalAddr update API.User can create a mask with more than one fields of this enumby "OR"ing these fields to update more than one parameters. e.g. if user wants to convert both src and destination addresses then they can create this mask as follows : mask = DMAUTILSAUTOINC3D_ADDRCONVERTMASK_SRCADDR | DMAUTILSAUTOINC3D_ADDRCONVERTMASK_DSTADDR.
Enumerator | |
---|---|
DMAUTILSAUTOINC3D_ADDRCONVERTMASK_SRCADDR | Convert Source Address Pointer |
DMAUTILSAUTOINC3D_ADDRCONVERTMASK_DSTADDR | Convert Destination Address Pointer |
int32_t DmaUtilsAutoInc3d_getContextSize | ( | int32_t | numChannels | ) |
Returns the size of dmautils context.
This function returns the size of the DMA UTILS autoincrement 3D handle. User is then expected to allocate this memory and provide it to DMA UTILS autoincrement 3D function as an input.
numChannels | [IN] Number of channels required for a usecase |
int32_t DmaUtilsAutoInc3d_init | ( | void * | autoIncrementContext, |
DmaUtilsAutoInc3d_InitParam * | initParams, | ||
DmaUtilsAutoInc3d_ChannelInitParam | chInitParams[] | ||
) |
This function initializes the DMA UTILS context for autoincrement usecase.
This function initializes the DMA UTILS context for autoincrement usecase. Internally it allocates numChannels DRU channels for the use case
autoIncrementContext | [IN] Memory allocated by the user as per DmaUtilsAutoInc3d_getContextSize API. Try to allocate this memory in the fastest available memory for optimal performance |
initParams | [IN] Init params for the dmautils |
chInitParams | [IN] Init parameter for each channel. This is an array and number of enteries should be same as numChannels |
int32_t DmaUtilsAutoInc3d_getTrMemReq | ( | int32_t | numTRs | ) |
This function returns the size of the TR descriptor required for the transfer configuration given by the user.
numTRs | [IN] Number of Transfer Records (TR's) that will be submitted to a particular channel |
int32_t DmaUtilsAutoInc3d_prepareTr | ( | DmaUtilsAutoInc3d_TrPrepareParam * | trPrepParam, |
DmaUtilsAutoInc3d_TransferProp | transferProp[] | ||
) |
This function will prepare a TR/ TR descriptor depending on the number of Tr's to be submitted on a particular channel. Note this function will use the addresses as given by the user without any conversion. If user wants to convert addresses from virtual to physical address they should use DmaUtilsAutoInc3d_convertTrVirtToPhyAddr API. Other way to do the same is to call DmaUtilsAutoInc3d_convertToPhysicalAddr to explicitly convert the address in TR to physical address.
trPrepParam | [IN] Parameters required for preparing TR |
transferProp | [IN] Transfer properties of all the TR'sr which needs to be submitted to a single channel |
int32_t DmaUtilsAutoInc3d_prepareTrWithPhysicalAddress | ( | void * | autoIncrementContext, |
DmaUtilsAutoInc3d_TrPrepareParam * | trPrepParam, | ||
DmaUtilsAutoInc3d_TransferProp | transferProp[] | ||
) |
This function will prepare a TR/ TR descriptor depending on the number of Tr's to be submitted on a particular channel. The only difference between this function and DmaUtilsAutoInc3d_prepareTr function is that this function will call UDMA driver's Udma_VirtToPhyFxn function if its not NULL to convert virtual address to physical address. Note that this function will convert the virtual addresses given to physical addresses if UDMA driver Udma_VirtToPhyFxn function is not NULL using the same function. If user is preparing TR without using this API then it is user's responsibity to provide the physical addresses or call DmaUtilsAutoInc3d_convertToPhysicalAddr API to covert the addresses given in TR to physical addresses.
autoIncrementContext | [IN] Context allocated for dmautils usecase |
trPrepParam | [IN] Parameters required for preparing TR |
transferProp | [IN] Transfer properties of all the TR'sr which needs to be submitted to a single channel |
int32_t DmaUtilsAutoInc3d_convertTrVirtToPhyAddr | ( | void * | autoIncrementContext, |
DmaUtilsAutoInc3d_TrPrepareParam * | trPrepParam, | ||
uint32_t | convertMask | ||
) |
This function should be called whenever provides TR with virtual addresses of src and dst pointer. This function will convert the virtual addresses given to physical addresses using UDMA driver initialized function Udma_VirtToPhyFxn. If UDMA driver Udma_VirtToPhyFxn function is NULL then this API results into no change.
autoIncrementContext | [IN] Context allocated for dmautils usecase |
trPrepParam | [IN] Parameters required for preparing TR |
convertMask | [IN] Mask to inform which fields address to be converted. Refer DmaUtilsAutoInc3d_addrConvertMask for its usage. |
int32_t DmaUtilsAutoInc3d_configure | ( | void * | autoIncrementContext, |
int32_t | channelId, | ||
uint8_t * | trMem, | ||
int32_t | numTr | ||
) |
This function configures autoincrement for a particular channel.
autoIncrementContext | [IN] Context allocated for dmautils usecase |
channelId | [IN] Channel Id which needs to be configured. It is important to note that this id is a virtual id for channel and is not related to the actual channel used internally to do the transfer |
trMem | [IN] Populated TrMem after calling DmaUtilsAutoInc3d_prepareTr function. This API expects all addresses to be physical memory addresses. This is automatically taken care if user prepares TR using DmaUtilsAutoInc3d_prepareTr or user can call DmaUtilsAutoInc3d_convertToPhysicalAddr to convert addresses to physical addresses. |
numTr | [IN] Number of Transfer Records (TR's) that will be submitted to a particular channel |
int32_t DmaUtilsAutoInc3d_trigger | ( | void * | autoIncrementContext, |
int32_t | channelId | ||
) |
This function triggers transfer on a particular channel.
autoIncrementContext | [IN] Context allocated for dmautils usecase |
channelId | [IN] Channel Id which needs to be triggered. It is important to note that this id is a virtual id for channel and is not related to the actual channel used internally to do the transfer |
void DmaUtilsAutoInc3d_wait | ( | void * | autoIncrementContext, |
int32_t | channelId | ||
) |
This function waits for completion transfer on a particular channel.
autoIncrementContext | [IN] Context allocated for dmautils usecase |
channelId | [IN] Channel Id for which we need to wait for transfer completion. It is important to note that this id is a virtual id for channel and is not related to the actual channel used internally to do the transfer |
int32_t DmaUtilsAutoInc3d_deconfigure | ( | void * | autoIncrementContext, |
int32_t | channelId, | ||
uint8_t * | trMem, | ||
int32_t | numTr | ||
) |
This function deconfigures autoincrement for a particular channel.
autoIncrementContext | [IN] Context allocated for dmautils usecase |
channelId | [IN] Channel Id which needs to be de-configured. It is important to note that this id is a virtual id for channel and is not related to the actual channel used internally to do the transfer |
trMem | [IN] Populated TrMem after calling DmaUtilsAutoInc3d_prepareTr function |
numTr | [IN] Number of Transfer Records (TR's) that will be submitted to a particular channel |
int32_t DmaUtilsAutoInc3d_deinit | ( | void * | autoIncrementContext | ) |
This function deinit autoincrement by releasing all the resorces allocated.
autoIncrementContext | [IN] Context allocated for dmautils usecase |