PDK API Guide for J721E
UDMA Driver Flow API

Introduction

This is UDMA driver RX flow related configuration parameters and API

Files

file  udma_flow.h
 UDMA flow related parameters and API.
 

Data Structures

struct  Udma_FlowPrms
 UDMA RX channel flow parameters. More...
 
struct  Udma_FlowHandle
 UDMA flow object. More...
 

Functions

int32_t Udma_flowAlloc (Udma_DrvHandle drvHandle, Udma_FlowHandle flowHandle, uint32_t flowCnt)
 UDMA flow allocation API. More...
 
int32_t Udma_flowFree (Udma_FlowHandle flowHandle)
 UDMA free flows. More...
 
int32_t Udma_flowAttach (Udma_DrvHandle drvHandle, Udma_FlowHandle flowHandle, uint32_t flowStart, uint32_t flowCnt)
 UDMA flow attach API. This API is used to attach to an already allocated flow. This API differs from flow alloc API in this aspect - it doesn't allocate resource from RM. Once the flow is attached to, Udma_flowConfig API can be used to configure the flow through sciclient/DMSC API. More...
 
int32_t Udma_flowDetach (Udma_FlowHandle flowHandle)
 UDMA flow detach API. More...
 
int32_t Udma_flowConfig (Udma_FlowHandle flowHandle, uint32_t flowIdx, const Udma_FlowPrms *flowPrms)
 This API configures the flow configurations. More...
 
uint32_t Udma_flowGetNum (Udma_FlowHandle flowHandle)
 Returns the start flow number managed by this flow handle. More...
 
uint32_t Udma_flowGetCount (Udma_FlowHandle flowHandle)
 Returns the number of flows managed by this flow handle. More...
 
void UdmaFlowPrms_init (Udma_FlowPrms *flowPrms, uint32_t chType)
 Udma_FlowPrms structure init function. More...
 

Macros

#define UDMA_DEFAULT_FLOW_ID   (0x3FFFU)
 Default flow ID. More...
 
#define UDMA_FLOW_INVALID   ((uint32_t) 0xFFFF0000U)
 Macro used to specify that flow ID is invalid. More...
 

Macro Definition Documentation

#define UDMA_DEFAULT_FLOW_ID   (0x3FFFU)

Default flow ID.

#define UDMA_FLOW_INVALID   ((uint32_t) 0xFFFF0000U)

Macro used to specify that flow ID is invalid.

Function Documentation

int32_t Udma_flowAlloc ( Udma_DrvHandle  drvHandle,
Udma_FlowHandle  flowHandle,
uint32_t  flowCnt 
)

UDMA flow allocation API.

Parameters
drvHandle[IN] UDMA driver handle pointer passed during Udma_init
flowHandle[IN/OUT] UDMA flow handle. The caller need to allocate memory for this object and pass this pointer to all further APIs. The caller should not change any parameters as this is owned and maintained by the driver.
flowCnt[IN] Flow count. The driver will allocate this many flows contiguously.
Returns
Udma_ErrorCodes
int32_t Udma_flowFree ( Udma_FlowHandle  flowHandle)

UDMA free flows.

Freeup the flow resources.

Requirement: TODO

Parameters
flowHandle[IN] UDMA flow handle. This parameter can't be NULL.
Returns
Udma_ErrorCodes
int32_t Udma_flowAttach ( Udma_DrvHandle  drvHandle,
Udma_FlowHandle  flowHandle,
uint32_t  flowStart,
uint32_t  flowCnt 
)

UDMA flow attach API. This API is used to attach to an already allocated flow. This API differs from flow alloc API in this aspect - it doesn't allocate resource from RM. Once the flow is attached to, Udma_flowConfig API can be used to configure the flow through sciclient/DMSC API.

Requirement: DOX_REQ_TAG(PDK-3418)

Parameters
drvHandle[IN] UDMA driver handle pointer passed during Udma_init
flowHandle[IN/OUT] UDMA flow handle. The caller need to allocate memory for this object and pass this pointer to all further APIs. The caller should not change any parameters as this is owned and maintained by the driver.
flowStart[IN] Flow index to attach to. This paramter should be a valid flow number allowed to be used by a core. The driver doesn't check the validity of this field at the time of attach. But the flow config API may fail if wrong flow index is used or when the core does own the flow as per DMSC board config.
flowCnt[IN] Flow count - to attach to more than 1 flow which is contiguous from flow start. This is provided to allow a single handle to manage multiple contiguous flows similar to how Udma_flowAlloc and Udma_flowConfig API are implemented.
Returns
Udma_ErrorCodes
int32_t Udma_flowDetach ( Udma_FlowHandle  flowHandle)

UDMA flow detach API.

Since no allocation is done in attach, this API just clears up the flow handle.

Requirement: DOX_REQ_TAG(PDK-3418)

Parameters
flowHandle[IN] UDMA flow handle. This parameter can't be NULL.
Returns
Udma_ErrorCodes
int32_t Udma_flowConfig ( Udma_FlowHandle  flowHandle,
uint32_t  flowIdx,
const Udma_FlowPrms flowPrms 
)

This API configures the flow configurations.

Requirement: DOX_REQ_TAG(PDK-2599)

Parameters
flowHandle[IN] UDMA flow handle pointer
flowIdx[IN] Since multiple flows are allocated and also contiguously, all the flows needs to be configured one after the other. This is the relative index from the start of the flow allocated. In case of configuring the default flow, this should be set to zero. If the index goes beyond what is allocated, then the function returns error.
flowPrms[IN] Pointer to flow configuration.
Returns
Udma_ErrorCodes
uint32_t Udma_flowGetNum ( Udma_FlowHandle  flowHandle)

Returns the start flow number managed by this flow handle.

Requirement: TODO

Parameters
flowHandle[IN] UDMA flow handle. This parameter can't be NULL.
Returns
Start flow number on success or UDMA_FLOW_INVALID on error
uint32_t Udma_flowGetCount ( Udma_FlowHandle  flowHandle)

Returns the number of flows managed by this flow handle.

Requirement: DOX_REQ_TAG(PDK-3718)

Parameters
flowHandle[IN] UDMA flow handle. This parameter can't be NULL.
Returns
Flow count on success or UDMA_FLOW_INVALID on error
void UdmaFlowPrms_init ( Udma_FlowPrms flowPrms,
uint32_t  chType 
)

Udma_FlowPrms structure init function.

Parameters
flowPrms[IN] Pointer to Udma_FlowPrms structure.
chType[IN] UDMA channel type. Refer Udma_ChType.