AM64x MCU+ SDK  08.02.00

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_FlowAllocMappedPrms
 UDMA RX channel mapped flow alloc parameters. More...
 
struct  Udma_FlowObject
 Opaque UDMA flow object. More...
 

Functions

int32_t Udma_flowAllocMapped (Udma_DrvHandle drvHandle, Udma_FlowHandle flowHandle, const Udma_FlowAllocMappedPrms *flowAllocMappedPrms)
 UDMA mapped flow allocation API. In devices like AM64x, flows are tied to channels. This API is used to allocate a single flow from the mapped free flows which are dedicated for a particular channel. 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_flowAttachMapped (Udma_DrvHandle drvHandle, Udma_FlowHandle flowHandle, uint32_t mappepdFlowNum, const Udma_FlowAllocMappedPrms *flowAllocMappedPrms)
 UDMA mapped flow attach API. This API is used to attach to an already allocated mapped flow. This API differs from mapped 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

◆ UDMA_DEFAULT_FLOW_ID

#define UDMA_DEFAULT_FLOW_ID   (0x3FFFU)

Default flow ID.

◆ UDMA_FLOW_INVALID

#define UDMA_FLOW_INVALID   ((uint32_t) 0xFFFF0000U)

Macro used to specify that flow ID is invalid.

Function Documentation

◆ Udma_flowAllocMapped()

int32_t Udma_flowAllocMapped ( Udma_DrvHandle  drvHandle,
Udma_FlowHandle  flowHandle,
const Udma_FlowAllocMappedPrms flowAllocMappedPrms 
)

UDMA mapped flow allocation API. In devices like AM64x, flows are tied to channels. This API is used to allocate a single flow from the mapped free flows which are dedicated for a particular channel.

Note: Allocation of mapped flows have to be done after Udma_chOpen, Since the mapped flow have to be allocated from the dedicated flows for the particular channel.

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.
flowAllocMappedPrms[IN] UDMA mapped flow alloc parameters. This parameter can't be NULL.
Returns
Udma_ErrorCodes

◆ Udma_flowFree()

int32_t Udma_flowFree ( Udma_FlowHandle  flowHandle)

UDMA free flows.

Freeup the flow resources.

Note: This API can be used to free mapped flow also, which are allocated using Udma_flowAllocMapped.

Parameters
flowHandle[IN] UDMA flow handle. This parameter can't be NULL.
Returns
Udma_ErrorCodes

◆ Udma_flowAttach()

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 doesn't 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
Returns
Udma_ErrorCodes

◆ Udma_flowAttachMapped()

int32_t Udma_flowAttachMapped ( Udma_DrvHandle  drvHandle,
Udma_FlowHandle  flowHandle,
uint32_t  mappepdFlowNum,
const Udma_FlowAllocMappedPrms flowAllocMappedPrms 
)

UDMA mapped flow attach API. This API is used to attach to an already allocated mapped flow. This API differs from mapped 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.
mappepdFlowNum[IN] Mapped flow index to attach to. This paramter should be a valid mapped flow number allowed to be used by a core and by the mapped channel. The driver doesn't check the validity of this field at the time of attach. But the flow config API may fail if wrong mapped flow index is used or when the core doesn't own the mapped flow as per DMSC board config or if the mapped flow dosen't belong to the deicated flows for the particular channel.
flowAllocMappedPrms[IN] UDMA mapped flow alloc parameters. This parameter can't be NULL.
Returns
Udma_ErrorCodes

◆ Udma_flowDetach()

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.

Note: This API can be used to detach mapped flow also, which are attached using Udma_flowAttachMapped.

Requirement: DOX_REQ_TAG(PDK-3418)

Parameters
flowHandle[IN] UDMA flow handle. This parameter can't be NULL.
Returns
Udma_ErrorCodes

◆ Udma_flowConfig()

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. If the index goes beyond what is allocated, then the function returns error. Note: In case of configuring the default flow and mapped flow(in devices like AM64x), this should be set to "zero".
flowPrms[IN] Pointer to flow configuration.
Returns
Udma_ErrorCodes

◆ Udma_flowGetNum()

uint32_t Udma_flowGetNum ( Udma_FlowHandle  flowHandle)

Returns the start flow number managed by this flow handle.

Note: In case off mapped flow(in devices like AM64x), this returns the mapped flow number.

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

◆ Udma_flowGetCount()

uint32_t Udma_flowGetCount ( Udma_FlowHandle  flowHandle)

Returns the number of flows managed by this flow handle.

Note: In case of mapped flow(in devices like AM64x), this always returns 1, since only one mapped flow is managed by a 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

◆ UdmaFlowPrms_init()

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.