PSDK QNX API Guide
UDMA Driver Flow 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_FlowHandle
 UDMA flow object. 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...
 

Functions

int32_t Udma_flowAlloc (Udma_DrvHandle drvHandle, Udma_FlowHandle flowHandle, uint32_t flowCnt)
 UDMA flow allocation API. More...
 
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...
 
int32_t UdmaFlowPrms_init (Udma_FlowPrms *flowPrms, uint32_t chType)
 Udma_FlowPrms structure init function. More...
 

Variables

Udma_ChHandle Udma_FlowPrms::rxChHandle
 
uint8_t Udma_FlowPrms::einfoPresent
 
uint8_t Udma_FlowPrms::psInfoPresent
 
uint8_t Udma_FlowPrms::errorHandling
 
uint8_t Udma_FlowPrms::descType
 
uint8_t Udma_FlowPrms::psLocation
 
uint16_t Udma_FlowPrms::sopOffset
 
uint16_t Udma_FlowPrms::defaultRxCQ
 
uint8_t Udma_FlowPrms::srcTagHi
 
uint8_t Udma_FlowPrms::srcTagLo
 
uint8_t Udma_FlowPrms::srcTagHiSel
 
uint8_t Udma_FlowPrms::srcTagLoSel
 
uint8_t Udma_FlowPrms::destTagHi
 
uint8_t Udma_FlowPrms::destTagLo
 
uint8_t Udma_FlowPrms::destTagHiSel
 
uint8_t Udma_FlowPrms::destTagLoSel
 
uint8_t Udma_FlowPrms::sizeThreshEn
 
uint16_t Udma_FlowPrms::fdq0Sz0Qnum
 
uint16_t Udma_FlowPrms::fdq1Qnum
 
uint16_t Udma_FlowPrms::fdq2Qnum
 
uint16_t Udma_FlowPrms::fdq3Qnum
 
uint16_t Udma_FlowPrms::sizeThresh0
 
uint16_t Udma_FlowPrms::sizeThresh1
 
uint16_t Udma_FlowPrms::sizeThresh2
 
uint16_t Udma_FlowPrms::fdq0Sz1Qnum
 
uint16_t Udma_FlowPrms::fdq0Sz2Qnum
 
uint16_t Udma_FlowPrms::fdq0Sz3Qnum
 
uint32_t Udma_FlowAllocMappedPrms::mappedFlowGrp
 
uint32_t Udma_FlowAllocMappedPrms::mappedChNum
 
Udma_DrvHandle Udma_FlowHandle::drvHandle
 
uint32_t Udma_FlowHandle::flowStart
 
uint32_t Udma_FlowHandle::flowCnt
 
uint32_t Udma_FlowHandle::flowInitDone
 
uint32_t Udma_FlowHandle::mappedFlowGrp
 
uint32_t Udma_FlowHandle::mappedChNum
 

Detailed Description

This is UDMA driver RX flow related configuration parameters and API

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_flowAlloc()

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

◆ 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.

Requirement: TODO

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 similar to how Udma_flowAlloc and Udma_flowConfig API are implemented.
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.

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

◆ 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()

int32_t 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.
Returns
UDMA_SOK on success or UDMA_EINVALID_PARAMS on error

Variable Documentation

◆ rxChHandle

Udma_ChHandle Udma_FlowPrms::rxChHandle

[IN] Deprecated member. Not used any more.

◆ einfoPresent

uint8_t Udma_FlowPrms::einfoPresent

[IN] Set to 1 if extended packet info is present in the descriptor

◆ psInfoPresent

uint8_t Udma_FlowPrms::psInfoPresent

[IN] Set to 1 if protocol-specific info is present in the descriptor

◆ errorHandling

uint8_t Udma_FlowPrms::errorHandling

[IN] Determines how starvation errors are handled. 0=drop packet, 1=retry

◆ descType

uint8_t Udma_FlowPrms::descType

[IN] Descriptor type - see tisci_msg_rm_udmap_flow_cfg_req::rx_desc_type

◆ psLocation

uint8_t Udma_FlowPrms::psLocation

[IN] Protocol-specific info location. TISCI_MSG_VALUE_RM_UDMAP_RX_FLOW_PS_END_PD TISCI_MSG_VALUE_RM_UDMAP_RX_FLOW_PS_BEGIN_DB

◆ sopOffset

uint16_t Udma_FlowPrms::sopOffset

[IN] Start of rx packet data (byte offset from the start of the SOP buffer)

◆ defaultRxCQ

uint16_t Udma_FlowPrms::defaultRxCQ

[IN] Rx destination queue

◆ srcTagHi

uint8_t Udma_FlowPrms::srcTagHi

[IN] UDMAP receive flow source tag high byte constant configuration to be programmed into the rx_src_tag_hi field of the flow's RFLOW_RFB register.

◆ srcTagLo

uint8_t Udma_FlowPrms::srcTagLo

[IN] UDMAP receive flow source tag low byte constant configuration to be programmed into the rx_src_tag_lo field of the flow's RFLOW_RFB register.

◆ srcTagHiSel

uint8_t Udma_FlowPrms::srcTagHiSel

[IN] UDMAP receive flow source tag high byte selector configuration to be programmed into the rx_src_tag_hi_sel field of the RFLOW_RFC register. Refer tisci_msg_rm_udmap_flow_cfg_req::rx_dest_tag_hi_sel.

◆ srcTagLoSel

uint8_t Udma_FlowPrms::srcTagLoSel

[IN] UDMAP receive flow source tag low byte selector configuration to be programmed into the rx_src_tag_low_sel field of the RFLOW_RFC register. Refer tisci_msg_rm_udmap_flow_cfg_req::rx_dest_tag_lo_sel.

◆ destTagHi

uint8_t Udma_FlowPrms::destTagHi

[IN] UDMAP receive flow destination tag high byte constant configuration to be programmed into the rx_dest_tag_hi field of the flow's RFLOW_RFB register.

◆ destTagLo

uint8_t Udma_FlowPrms::destTagLo

[IN] UDMAP receive flow destination tag low byte constant configuration to be programmed into the rx_dest_tag_lo field of the flow's RFLOW_RFB register.

◆ destTagHiSel

uint8_t Udma_FlowPrms::destTagHiSel

[IN] UDMAP receive flow destination tag high byte selector configuration to be programmed into the rx_dest_tag_hi_sel field of the RFLOW_RFC register. Refer tisci_msg_rm_udmap_flow_cfg_req::rx_dest_tag_hi_sel.

◆ destTagLoSel

uint8_t Udma_FlowPrms::destTagLoSel

[IN] UDMAP receive flow destination tag low byte selector configuration to be programmed into the rx_dest_tag_low_sel field of the RFLOW_RFC register. Refer tisci_msg_rm_udmap_flow_cfg_req::rx_dest_tag_lo_sel.

◆ sizeThreshEn

uint8_t Udma_FlowPrms::sizeThreshEn

[IN] UDMAP receive flow packet size based free buffer queue enable configuration to be programmed into the rx_size_thresh_en field of the RFLOW_RFC register. See the UDMAP section of the TRM for more information on this setting. Configuration of the optional size thresholds when this configuration is enabled is done by sending the tisci_msg_rm_udmap_flow_size_thresh_cfg_req message to System Firmware for the receive flow allocated by this request. This parameter can be no greater than TISCI_MSG_VALUE_RM_UDMAP_RX_FLOW_SIZE_THRESH_MAX

◆ fdq0Sz0Qnum

uint16_t Udma_FlowPrms::fdq0Sz0Qnum

[IN] UDMAP receive flow free descriptor queue 0 configuration to be programmed into the rx_fdq0_sz0_qnum field of the flow's RFLOW_RFD register. See the UDMAP section of the TRM for more information on this setting. The specified free queue must be valid within the Navigator Subsystem and must be owned by the host, or a subordinate of the host, requesting allocation and configuration of the receive flow.

◆ fdq1Qnum

uint16_t Udma_FlowPrms::fdq1Qnum

[IN] UDMAP receive flow free descriptor queue 1 configuration to be programmed into the rx_fdq1_qnum field of the flow's RFLOW_RFD register. See the UDMAP section of the TRM for more information on this setting. The specified free queue must be valid within the Navigator Subsystem and must be owned by the host, or a subordinate of the host, requesting allocation and configuration of the receive flow.

◆ fdq2Qnum

uint16_t Udma_FlowPrms::fdq2Qnum

[IN] UDMAP receive flow free descriptor queue 2 configuration to be programmed into the rx_fdq2_qnum field of the flow's RFLOW_RFE register. See the UDMAP section of the TRM for more information on this setting. The specified free queue must be valid within the Navigator Subsystem and must be owned by the host, or a subordinate of the host, requesting allocation and configuration of the receive flow.

◆ fdq3Qnum

uint16_t Udma_FlowPrms::fdq3Qnum

[IN] UDMAP receive flow free descriptor queue 3 configuration to be programmed into the rx_fdq3_qnum field of the flow's RFLOW_RFE register. See the UDMAP section of the TRM for more information on this setting. The specified free queue must be valid within the Navigator Subsystem and must be owned by the host, or a subordinate of the host, requesting allocation and configuration of the receive flow.

◆ sizeThresh0

uint16_t Udma_FlowPrms::sizeThresh0

[IN] UDMAP receive flow packet size threshold 0 configuration to be programmed into the rx_size_thresh0 field of the flow's RFLOW_RFF register. See the UDMAP section of the TRM for more information on this setting.

◆ sizeThresh1

uint16_t Udma_FlowPrms::sizeThresh1

[IN] UDMAP receive flow packet size threshold 1 configuration to be programmed into the rx_size_thresh1 field of the flow's RFLOW_RFF register. See the UDMAP section of the TRM for more information on this setting.

◆ sizeThresh2

uint16_t Udma_FlowPrms::sizeThresh2

[IN] UDMAP receive flow packet size threshold 2 configuration to be programmed into the rx_size_thresh2 field of the flow's RFLOW_RFG register. See the UDMAP section of the TRM for more information on this setting.

◆ fdq0Sz1Qnum

uint16_t Udma_FlowPrms::fdq0Sz1Qnum

[IN] UDMAP receive flow free descriptor queue for size threshold 1 configuration to be programmed into the rx_fdq0_sz1_qnum field of the flow's RFLOW_RFG register. See the UDMAP section of the TRM for more information on this setting. The specified free queue must be valid within the Navigator Subsystem and must be owned by the host, or a subordinate of the host, who owns the receive flow index and who is making the optional configuration request.

◆ fdq0Sz2Qnum

uint16_t Udma_FlowPrms::fdq0Sz2Qnum

[IN] UDMAP receive flow free descriptor queue for size threshold 2 configuration to be programmed into the rx_fdq0_sz2_qnum field of the flow's RFLOW_RFH register. See the UDMAP section of the TRM for more information on this setting. The specified free queue must be valid within the Navigator Subsystem and must be owned by the host, or a subordinate of the host, who owns the receive flow index and who is making the optional configuration request.

◆ fdq0Sz3Qnum

uint16_t Udma_FlowPrms::fdq0Sz3Qnum

[IN] UDMAP receive flow free descriptor queue for size threshold 3 configuration to be programmed into the rx_fdq0_sz3_qnum field of the flow's RFLOW_RFH register. See the UDMAP section of the TRM for more information on this setting. The specified free queue must be valid within the Navigator Subsystem and must be owned by the host, or a subordinate of the host, who owns the receive flow index and who is making the optional configuration request.

◆ mappedFlowGrp [1/2]

uint32_t Udma_FlowAllocMappedPrms::mappedFlowGrp

The Mapped flow group to use when channel type is UDMA_CH_TYPE_RX_MAPPED.

The driver will allocate mapped flows from this group. Refer Udma_MappedRxGrpSoc macro for details about mapped RX flow groups.

◆ mappedChNum [1/2]

uint32_t Udma_FlowAllocMappedPrms::mappedChNum

The assigned mapped channel number when channel type is UDMA_CH_TYPE_RX_MAPPED.

This is used to allocate the corresponding mapped flow for the particular channel. The driver will allocate from the mapped flows which are dedicated for this particular channel.

◆ drvHandle

Udma_DrvHandle Udma_FlowHandle::drvHandle

Pointer to global driver handle.

◆ flowStart

uint32_t Udma_FlowHandle::flowStart

Flow ID start number.

Note: In case of mapped flow(in devices like AM64x), this indicates the mapped flow idx managed by this flow handle.

◆ flowCnt

uint32_t Udma_FlowHandle::flowCnt

Number of flow IDs allocated - Contiguos flows are allocated

Note: In case of mapped flow(in devices like AM64x), this will be 1 since only one mapped flow is managed by a flow handle.

◆ flowInitDone

uint32_t Udma_FlowHandle::flowInitDone

Flag to set the flow object is init.

◆ mappedFlowGrp [2/2]

uint32_t Udma_FlowHandle::mappedFlowGrp

The allocated mapped flow group when channel type is UDMA_CH_TYPE_RX_MAPPED.

This is needed to free the mapped flow.

Refer Udma_MappedRxGrpSoc macro for details about mapped RX flow groups.

For unmapped case, this will be UDMA_MAPPED_GROUP_INVALID

◆ mappedChNum [2/2]

uint32_t Udma_FlowHandle::mappedChNum

The assigned mapped channel number when channel type is UDMA_CH_TYPE_RX_MAPPED.

This is needed to free the mapped flow.

For unmapped case, this will be UDMA_DMA_CH_INVALID.