AM62Px MCU+ SDK  11.01.00
UDMA Configuration

Introduction

This group contains structure and type definitions needed to properly construct the Enet UDMA configuration structure which is part of the top-level Enet UDMA configuration structure.

Data Structures

struct  EnetUdma_RingMonCfg
 UDMA ring monitor config parameters. More...
 
struct  EnetUdma_UdmaRingPrms
 Enet UDMA channel ring parameters. More...
 
struct  EnetUdma_UdmaChPrms
 Enet UDMA RX flow/TX channel ring configuration parameters. More...
 
struct  EnetUdma_UdmaFlowPrms
 UDMA RX channel flow parameters. More...
 
struct  EnetUdma_UdmaChTxPrms
 Enet UDMA TX channel parameters. More...
 
struct  EnetUdma_AutoReclaimPrms
 Enet UDMA channel/flow auto-reclaim config struct. More...
 
struct  EnetUdma_OpenRxFlowPrms
 Param struct for the get default flowId open parameters. More...
 
struct  EnetUdma_OpenTxChPrms
 Param struct for the TX channel open function. More...
 
struct  EnetUdma_RxChInitPrms
 Param struct for the RX channel open. More...
 
struct  EnetDma_Cfg
 Config structure for Enet UDMA. More...
 
struct  EnetDma_initCfg
 Config structure for Enet UDMA Data Path initialization. More...
 

Functions

void EnetUdma_initDataPathParams (EnetDma_initCfg *pDmaConfig)
 
void EnetUdma_initRxFlowParams (EnetUdma_OpenRxFlowPrms *pRxFlowPrms)
 Initialize RX channel open parameters. More...
 
EnetDma_RxChHandle EnetUdma_openRxFlow (EnetDma_Handle hDma, const EnetUdma_OpenRxFlowPrms *pRxFlowPrms)
 Enet DMA open RX channel. More...
 
int32_t EnetUdma_closeRxFlow (EnetDma_RxChHandle hRxCh, EnetDma_PktQ *fq, EnetDma_PktQ *cq)
 Enet DMA close RX channel. More...
 
void EnetUdma_initTxChParams (EnetUdma_OpenTxChPrms *pTxChPrms)
 Initialize TX channel open parameters. More...
 
EnetDma_TxChHandle EnetUdma_openTxCh (EnetDma_Handle hDma, const EnetUdma_OpenTxChPrms *pTxChPrms)
 Enet DMA open TX channel. More...
 
int32_t EnetUdma_closeTxCh (EnetDma_TxChHandle hTxCh, EnetDma_PktQ *fq, EnetDma_PktQ *cq)
 Enet DMA close TX channel. More...
 
EnetDma_Handle EnetUdma_initDataPath (Enet_Type enetType, uint32_t instId, const EnetDma_initCfg *pDmaInitCfg)
 
int32_t EnetUdma_deInitDataPath (EnetDma_Handle hEnetUdma)
 
int32_t EnetUdma_checkRxFlowSanity (EnetDma_RxChHandle hRxFlow, uint32_t margin)
 Check if any packet loss in RX flow FQ and CQ rings. More...
 
int32_t EnetUdma_checkTxChSanity (EnetDma_TxChHandle hTxCh, uint32_t margin)
 Check if any packet loss in TX Channel FQ and CQ rings. More...
 
Udma_RingHandle EnetUdma_getTxChFqHandle (EnetDma_TxChHandle hTxCh)
 Get TX channel FQ handle. More...
 
EnetUdma_DmaDescQHandle EnetUdma_getTxChDescPoolHandle (EnetDma_TxChHandle hTxCh)
 Get handle to DMA descriptor free pool for TX channel. More...
 
Udma_RingHandle EnetUdma_getRxFlowFqHandle (EnetDma_RxChHandle hRxFlow)
 Get RX flow FQ handle. More...
 
EnetUdma_DmaDescQHandle EnetUdma_getRxFlowDescPoolHandle (EnetDma_RxChHandle hRxFlow)
 Get handle to DMA descriptor free pool for RX flow. More...
 

Typedefs

typedef EnetUdma_OpenRxFlowPrms EnetDma_OpenRxChPrms
 Param struct for the RX channel open function. We include this typedef as top level DMA APIs use EnetDma_OpenRxChPrms struct. More...
 

Typedef Documentation

◆ EnetDma_OpenRxChPrms

Param struct for the RX channel open function. We include this typedef as top level DMA APIs use EnetDma_OpenRxChPrms struct.

Function Documentation

◆ EnetUdma_initDataPathParams()

void EnetUdma_initDataPathParams ( EnetDma_initCfg pDmaConfig)

◆ EnetUdma_initRxFlowParams()

void EnetUdma_initRxFlowParams ( EnetUdma_OpenRxFlowPrms pRxFlowPrms)

Initialize RX channel open parameters.

Initializes RX channel parameters with default values. Refer to SOC DMA specific RX channel config structure for specific config details.

Parameters
pRxFlowPrmsRX channel configuration parameters.

◆ EnetUdma_openRxFlow()

EnetDma_RxChHandle EnetUdma_openRxFlow ( EnetDma_Handle  hDma,
const EnetUdma_OpenRxFlowPrms pRxFlowPrms 
)

Enet DMA open RX channel.

Opens the Enet DMA RX channel based on the channel parameters. This function configures the DMA channel. This also configures event if notifyCb is not null. Refer to SOC DMA specific RX channel config structure for specific config details.

Enet DMA is peripheral-aware as peripherals in a given SoC may need different handling, i.e. DMA descriptor's extra fields having different meaning for two peripherals using same DMA engine. This peripheral-awareness is given to the RX channel/flow via EnetDma_Handle passed at open time.

Parameters
hDmaEnet DMA handle
pRxFlowPrmsRX channel configuration parameters. This parameter can't be NULL.
Returns
RX channel opaque handle if opened. Otherwise, NULL.

◆ EnetUdma_closeRxFlow()

int32_t EnetUdma_closeRxFlow ( EnetDma_RxChHandle  hRxCh,
EnetDma_PktQ fq,
EnetDma_PktQ cq 
)

Enet DMA close RX channel.

Closes the Enet DMA RX channel and frees all associated resources. During close operation, we flush FQ taking all DMA descriptors with packet submitted in advance for reception and return to app. Also we retrieve all packets from the CQ (packets received between last EnetDma_retrieveRxPktQ() function call) and return those to app. App doesn't need to call function EnetDma_retrieveRxPktQ() explicitly to retrieve these packets.

Parameters
hRxCh[IN] Enet DMA channel handle. This parameter can't be NULL.
fq[OUT] Pointer to EnetDma_PktQ structure where packets from FQ (submitted for reception) are retrieved and returned to application. This parameter can't be NULL.
cq[OUT] Pointer to EnetDma_PktQ structure where packets from CQ (received packets) are retrieved and returned to application. This parameter can't be NULL.
Returns
Enet_ErrorCodes

◆ EnetUdma_initTxChParams()

void EnetUdma_initTxChParams ( EnetUdma_OpenTxChPrms pTxChPrms)

Initialize TX channel open parameters.

Initializes TX channel open parameters with default values. Refer to SOC DMA specific RX channel config structure for specific config details.

Parameters
pTxChPrmsTX channel configuration parameters.

◆ EnetUdma_openTxCh()

EnetDma_TxChHandle EnetUdma_openTxCh ( EnetDma_Handle  hDma,
const EnetUdma_OpenTxChPrms pTxChPrms 
)

Enet DMA open TX channel.

Opens the DMA TX DMA channel based on the channel parameters. This function open TX channel using chNum provided in EnetDma_OpenTxChPrms() and configures TX channel. This also configures event if notifyCb is not null. Refer to SOC DMA specific RX channel config structure for specific config details.

Enet DMA is peripheral-aware as peripherals in a given SoC may need different handling, i.e. DMA descriptor's extra fields having different meaning for two peripherals using same DMA engine. This peripheral-awareness is given to the TX channel via EnetDma_Handle passed at open time.

Parameters
hDmaEnet DMA handle
pTxChPrmsTX channel configuration parameters. This parameter can't be NULL.
Returns
TX channel opaque handle if opened. Otherwise, NULL.

◆ EnetUdma_closeTxCh()

int32_t EnetUdma_closeTxCh ( EnetDma_TxChHandle  hTxCh,
EnetDma_PktQ fq,
EnetDma_PktQ cq 
)

Enet DMA close TX channel.

Closes the Enet DMA TX channel and frees all associated resources. During close operation, we flush FQ taking all DMA descriptors with packet submitted but not yet transmitted and return to app. Also we retrieve all packets from the CQ (transmission completed packets) and return those to app. App doesn't need to call EnetDma_retrieveTxPktQ() explicitly to retrieve these packets.

Parameters
hTxCh[IN] Enet DMA TX Channel handle. This parameter can't be NULL.
fq[OUT] Pointer to EnetDma_PktQ structure where packets from FQ (TX ready - submitted for transmission) are retrieved and returned to application. This parameter can't be NULL.
cq[OUT] Pointer to EnetDma_PktQ structure where packets from CQ (TX free - transmitted packets) are retrieved and returned to application. This parameter can't be NULL.
Returns
Enet_ErrorCodes

◆ EnetUdma_initDataPath()

EnetDma_Handle EnetUdma_initDataPath ( Enet_Type  enetType,
uint32_t  instId,
const EnetDma_initCfg pDmaInitCfg 
)

◆ EnetUdma_deInitDataPath()

int32_t EnetUdma_deInitDataPath ( EnetDma_Handle  hEnetUdma)

◆ EnetUdma_checkRxFlowSanity()

int32_t EnetUdma_checkRxFlowSanity ( EnetDma_RxChHandle  hRxFlow,
uint32_t  margin 
)

Check if any packet loss in RX flow FQ and CQ rings.

This development time error checks API checks DMA descriptor loss due to any timing issues. We check amount of descriptors with DMA and free matches the number of allocated with some "margin" for packets in flight.

Note: Margin can vary drastically based on Core (A72 vs R5), type of Udma channel (NORMAL/HC etc.) and size of packet. This makes these API dependent on application configuration.

Parameters
hRxFlow[IN] flow handle for the flow we wish to check sanity
margin[IN] Amount of packets which can be in flight in DMA
Return values
UDMA_SOKNumber of free descriptors and with DMA matches (total allocated packets - margin) = (packets in CQ + Packets in FQ)
UDMA_EFAILNumber offree descriptors and with DMA don't match

◆ EnetUdma_checkTxChSanity()

int32_t EnetUdma_checkTxChSanity ( EnetDma_TxChHandle  hTxCh,
uint32_t  margin 
)

Check if any packet loss in TX Channel FQ and CQ rings.

This development time error checks API checks dma desc loss due to any timing issues. We check amount of descriptors with DMA and free matches the number of allocated with some "margin" for packets in flight.

Note: Margin can vary drastically based on Core (A72 vs R5), type of Udma channel (NORMAL/HC etc.) and size of packet. This makes these API dependent on application configuration.

Parameters
hTxCh[IN] TX Channel handle for the TX channel we wish to check sanity
margin[IN] Amount of packets which can be in flight in DMA
Return values
UDMA_SOKNumber of free descriptors and with DMA matches (total allocated packets - margin) = (packets in CQ + Packets in FQ)
UDMA_EFAILNumber of free descriptors and with DMA don't match

◆ EnetUdma_getTxChFqHandle()

Udma_RingHandle EnetUdma_getTxChFqHandle ( EnetDma_TxChHandle  hTxCh)

Get TX channel FQ handle.

Returns FQ handle for TX Channel. This function can be used when auto-recycling of buffers is used.

Parameters
hTxCh[IN] TX Channel handle
Returns
Udma_RingHandle - Handle to FQ ring

◆ EnetUdma_getTxChDescPoolHandle()

EnetUdma_DmaDescQHandle EnetUdma_getTxChDescPoolHandle ( EnetDma_TxChHandle  hTxCh)

Get handle to DMA descriptor free pool for TX channel.

Returns DMA descriptor free pool for TX channel. This function can be used when auto-recycling of buffers is used.

Parameters
hTxCh[IN] TX channel handle
Returns
EnetUdma_DmaDescQHandle - Handle to DMA descriptor free pool

◆ EnetUdma_getRxFlowFqHandle()

Udma_RingHandle EnetUdma_getRxFlowFqHandle ( EnetDma_RxChHandle  hRxFlow)

Get RX flow FQ handle.

Returns FQ handle for RX flow. This function can be used when auto-recycling of buffers is used.

Parameters
hRxFlow[IN] RX flow handle
Returns
Udma_RingHandle - Handle to FQ ring

◆ EnetUdma_getRxFlowDescPoolHandle()

EnetUdma_DmaDescQHandle EnetUdma_getRxFlowDescPoolHandle ( EnetDma_RxChHandle  hRxFlow)

Get handle to DMA descriptor free pool for RX flow.

Returns DMA descriptor free pool for RX flow. This function can be used when auto-recycling of buffers is used.

Parameters
hRxFlow[IN] RX flow handle
Returns
EnetUdma_DmaDescQHandle - Handle to DMA descriptor free pool