PDK API Guide for AM64x
csl_pktdma.h File Reference

Introduction

This CSL-FL header file contains various enumerations, structure definitions and function declarations for the Packet DMA (PKTDMA) IP.

This CSL-FL was designed to be orthogonal with the implementation of the udmap CSL-FL. Enumerations, structure definitions, and API functions are similarly named. The include file "csl_pktdma_alias_udmap_api.h" is available which maps pktdma CSL-FL content to their udmap equivalents for ease in porting existing udmap code to the pktdma.

There is CSL-FL content that is applicable for udmap but not for pktdma. Those items are denoted with the tag [udmap_only] in the comments below and are handled as follows:

  • Enumerations: The enumeration is defined, but is not used functionally
  • Structure definitions: The structure is defined, but is not used functionally
  • Structure elements: The element is defined in the structure, but is not used functionally
  • API functions: The function is implemented, but does no operations

The following is the required calling sequence in order to insure proper operation of this CSL-FL:

  1. Allocate a PKTDMA configuration structure (CSL_PktdmaCfg)
  2. (Optional) Call CSL_pktdmaInitCfg to initialize the PKTDMA configuration structure to all zeros
  3. Initialize the register structure pointer elements of the PKTDMA configuration structure
  4. Call CSL_pktdmaGetCfg to populate the PKTDMA configuration structure with configuration and capability information for the PKTDMA module
  5. Call the other PKTDMA API functions as required

Go to the source code of this file.

PKTDMA channel direction

This enumerator defines the possible channel directions


#define CSL_PKTDMA_CHAN_DIR_TX   ((uint32_t) 0U)
 
#define CSL_PKTDMA_CHAN_DIR_RX   ((uint32_t) 1U)
 
typedef uint32_t CSL_PktdmaChanDir
 

PKTDMA channel burst size

This enumerator defines the nominal burst size and alignment for data transfers on a TX or RX channel


#define CSL_PKTDMA_CHAN_BURST_SIZE_32_BYTES   ((uint32_t) 0U)
 
#define CSL_PKTDMA_CHAN_BURST_SIZE_64_BYTES   ((uint32_t) 1U)
 
#define CSL_PKTDMA_CHAN_BURST_SIZE_128_BYTES   ((uint32_t) 2U)
 
#define CSL_PKTDMA_CHAN_BURST_SIZE_256_BYTES   ((uint32_t) 3U)
 
typedef uint32_t CSL_PktdmaChanBurstSize
 

PKTDMA descriptor type

This enumerator defines the possible descriptor types


#define CSL_PKTDMA_DESC_TYPE_HOST   ((uint32_t) 0U)
 
#define CSL_PKTDMA_DESC_TYPE_HOST_SB   ((uint32_t) 1U)
 
#define CSL_PKTDMA_DESC_TYPE_MONOLITHIC   ((uint32_t) 2U)
 
#define CSL_PKTDMA_DESC_TYPE_RESERVED   ((uint32_t) 3U)
 
typedef uint32_t CSL_PktdmaDescType
 

PKTDMA protocol-specific data location

This enumerator defines the ps location for the descriptor


#define CSL_PKTDMA_PS_LOC_DESC   ((uint32_t) 0U)
 
#define CSL_PKTDMA_PS_LOC_PACKET   ((uint32_t) 1U)
 
typedef uint32_t CSL_PktdmaPsLoc
 

PKTDMA address type

This enumerator defines the possible address types


#define CSL_PKTDMA_ADDR_TYPE_PHYS   ((uint32_t) 0U)
 
#define CSL_PKTDMA_ADDR_TYPE_INTER   ((uint32_t) 1U)
 
#define CSL_PKTDMA_ADDR_TYPE_VIRT   ((uint32_t) 2U)
 
typedef uint32_t CSL_PktdmaAddrType
 

PKTDMA channel type

This enumerator defines the possible channel types


#define CSL_PKTDMA_CHAN_TYPE_NORMAL   ((uint32_t) 2U)
 
#define CSL_PKTDMA_CHAN_TYPE_SBMODE   ((uint32_t) 3U)
 
#define CSL_PKTDMA_CHAN_TYPE_REF_PKT_RING   ((uint32_t) 2U)
 
#define CSL_PKTDMA_CHAN_TYPE_REF_PKTSB_QUEUE   ((uint32_t) 3U)
 
typedef uint32_t CSL_PktdmaChanType
 

PKTDMA tag select

This enumerator defines how tag values are determined


#define CSL_PKTDMA_TAG_SELECT_NO_OVERWRITE   ((uint32_t) 0U)
 
#define CSL_PKTDMA_TAG_SELECT_OVERWRITE_WITH_VAL   ((uint32_t) 1U)
 
#define CSL_PKTDMA_TAG_SELECT_OVERWRITE_WITH_FLOWID_7_0   ((uint32_t) 2U)
 
#define CSL_PKTDMA_TAG_SELECT_OVERWRITE_WITH_FLOWID_15_8   ((uint32_t) 3U)
 
#define CSL_PKTDMA_TAG_SELECT_OVERWRITE_WITH_TAG_7_0   ((uint32_t) 4U)
 
#define CSL_PKTDMA_TAG_SELECT_OVERWRITE_WITH_TAG_15_8   ((uint32_t) 5U)
 
#define CSL_PKTDMA_TAG_SELECT_INVALID   ((uint32_t) 6U)
 
typedef uint32_t CSL_PktdmaTagSelect
 

PKTDMA channel schedling priority

This enumerator selects which scheduling bin the channel will be placed in for bandwidth allocation of the DMA units


#define CSL_PKTDMA_CHAN_SCHED_PRI_HIGH   ((uint32_t) 0U)
 
#define CSL_PKTDMA_CHAN_SCHED_PRI_MED_HIGH   ((uint32_t) 1U)
 
#define CSL_PKTDMA_CHAN_SCHED_PRI_MED_LOW   ((uint32_t) 2U)
 
#define CSL_PKTDMA_CHAN_SCHED_PRI_LOW   ((uint32_t) 3U)
 
typedef uint32_t CSL_PktdmaChanSchedPri
 

Data Structures

struct  CSL_PktdmaRouteTag
 Routing tag information. More...
 
struct  CSL_PktdmaRevision
 Module revision information. More...
 
struct  CSL_PktdmaRxFlowCfg
 Receive flow configuration information. More...
 
struct  CSL_PktdmaTxChanCfg
 Transmit channel configuration information. More...
 
struct  CSL_PktdmaRxChanCfg
 Receive channel configuration information. More...
 
struct  CSL_PktdmaRT
 Channel runtime configuration information. More...
 
struct  CSL_PktdmaCfg
 PKTDMA configuration structure. More...
 
struct  CSL_PktdmaRxFlowIdFirewallStatus
 [udmap_only] PKTDMA receive flow id firewall status More...
 
struct  CSL_PktdmaChanStats
 Transmit / receive channel statistics. More...
 

Macros

#define CSL_PKTDMA_NO_EVENT   ((uint32_t) 0xFFFFU)
 

Functions

uint32_t CSL_pktdmaGetRevision (const CSL_PktdmaCfg *pCfg)
 Return revision of the PKTDMA module. More...
 
int32_t CSL_pktdmaGetRevisionInfo (const CSL_PktdmaCfg *pCfg, CSL_PktdmaRevision *pRev)
 Return revision information of the PKTDMA module. More...
 
void CSL_pktdmaInitCfg (CSL_PktdmaCfg *pCfg)
 Initialize contents of a PKTDMA configuration structure. More...
 
void CSL_pktdmaGetCfg (CSL_PktdmaCfg *pCfg)
 Return PKTDMA configuration information. More...
 
void CSL_pktdmaInitTxChanCfg (CSL_PktdmaTxChanCfg *pTxChanCfg)
 Initialize a CSL_PktdmaTxChanCfg structure. More...
 
void CSL_pktdmaInitRxChanCfg (CSL_PktdmaRxChanCfg *pRxChanCfg)
 Initialize a CSL_PktdmaRxChanCfg structure. More...
 
void CSL_pktdmaInitRxFlowCfg (CSL_PktdmaRxFlowCfg *pFlow)
 Initialize a CSL_PktdmaRxFlowCfg structure. More...
 
void CSL_pktdmaSetPerfCtrl (CSL_PktdmaCfg *pCfg, uint32_t rxRetryTimeoutCnt)
 Set performance control parmeters. More...
 
void CSL_pktdmaSetUtcCtrl (CSL_PktdmaCfg *pCfg, uint32_t startingThreadNum)
 [udmap_only] Set UTC control parmeters More...
 
int32_t CSL_pktdmaRxFlowCfg (CSL_PktdmaCfg *pCfg, uint32_t flow, const CSL_PktdmaRxFlowCfg *pFlow)
 Configure an RX flow. More...
 
int32_t CSL_pktdmaRxChanCfg (CSL_PktdmaCfg *pCfg, uint32_t chanIdx, const CSL_PktdmaRxChanCfg *pRxChanCfg)
 Configure an RX channel. More...
 
int32_t CSL_pktdmaTxChanCfg (CSL_PktdmaCfg *pCfg, uint32_t chanIdx, const CSL_PktdmaTxChanCfg *pTxChanCfg)
 Configure a TX channel. More...
 
int32_t CSL_pktdmaRxChanSetTrEvent (CSL_PktdmaCfg *pCfg, uint32_t chanIdx, uint32_t trEventNum)
 [udmap_only] Configure an RX channel TR event More...
 
int32_t CSL_pktdmaTxChanSetTrEvent (CSL_PktdmaCfg *pCfg, uint32_t chanIdx, uint32_t trEventNum)
 [udmap_only]Configure an TX channel TR event More...
 
int32_t CSL_pktdmaRxChanSetBurstSize (CSL_PktdmaCfg *pCfg, uint32_t chanIdx, CSL_PktdmaChanBurstSize burstSize)
 Configure RX channel burst size. More...
 
int32_t CSL_pktdmaTxChanSetBurstSize (CSL_PktdmaCfg *pCfg, uint32_t chanIdx, CSL_PktdmaChanBurstSize burstSize)
 Configure TX channel burst size. More...
 
int32_t CSL_pktdmaGetRxRT (const CSL_PktdmaCfg *pCfg, uint32_t chanIdx, CSL_PktdmaRT *pRT)
 Get an RX channel's real-time register values. More...
 
int32_t CSL_pktdmaGetTxRT (const CSL_PktdmaCfg *pCfg, uint32_t chanIdx, CSL_PktdmaRT *pRT)
 Get a TX channel's real-time register values. More...
 
int32_t CSL_pktdmaSetRxRT (CSL_PktdmaCfg *pCfg, uint32_t chanIdx, const CSL_PktdmaRT *pRT)
 Set an RX channel's real-time register values. More...
 
int32_t CSL_pktdmaSetTxRT (CSL_PktdmaCfg *pCfg, uint32_t chanIdx, const CSL_PktdmaRT *pRT)
 Set a TX channel's real-time register values. More...
 
int32_t CSL_pktdmaEnableTxChan (CSL_PktdmaCfg *pCfg, uint32_t chanIdx)
 Enable a transmit channel. More...
 
int32_t CSL_pktdmaDisableTxChan (CSL_PktdmaCfg *pCfg, uint32_t chanIdx)
 Disable a transmit channel. More...
 
int32_t CSL_pktdmaTeardownTxChan (CSL_PktdmaCfg *pCfg, uint32_t chanIdx, bool bForce, bool bWait)
 Teardown a transmit channel. More...
 
int32_t CSL_pktdmaPauseTxChan (CSL_PktdmaCfg *pCfg, uint32_t chanIdx)
 Pause a transmit channel. More...
 
int32_t CSL_pktdmaUnpauseTxChan (CSL_PktdmaCfg *pCfg, uint32_t chanIdx)
 Un-pause a transmit channel. More...
 
int32_t CSL_pktdmaTriggerTxChan (CSL_PktdmaCfg *pCfg, uint32_t chanIdx)
 [udmap_only] Send a trigger event to a TX channel More...
 
void CSL_pktdmaClearTxChanError (CSL_PktdmaCfg *pCfg, uint32_t chanIdx)
 Clear error indication in a transmit channel. More...
 
int32_t CSL_pktdmaEnableRxChan (CSL_PktdmaCfg *pCfg, uint32_t chanIdx)
 Enable a receive channel. More...
 
int32_t CSL_pktdmaDisableRxChan (CSL_PktdmaCfg *pCfg, uint32_t chanIdx)
 Disable a receive channel. More...
 
int32_t CSL_pktdmaTeardownRxChan (CSL_PktdmaCfg *pCfg, uint32_t chanIdx, bool bForce, bool bWait)
 Teardown a receive channel. More...
 
int32_t CSL_pktdmaPauseRxChan (CSL_PktdmaCfg *pCfg, uint32_t chanIdx)
 Pause a receive channel. More...
 
int32_t CSL_pktdmaUnpauseRxChan (CSL_PktdmaCfg *pCfg, uint32_t chanIdx)
 Un-pause a receive channel. More...
 
int32_t CSL_pktdmaTriggerRxChan (CSL_PktdmaCfg *pCfg, uint32_t chanIdx)
 [udmap_only] Send a trigger event to an RX channel More...
 
void CSL_pktdmaClearRxChanError (CSL_PktdmaCfg *pCfg, uint32_t chanIdx)
 Clear error indication in a receive channel. More...
 
void CSL_pktdmaCfgRxFlowIdFirewall (CSL_PktdmaCfg *pCfg, uint32_t outEvtNum)
 Configure the receive flow ID range firewall. More...
 
bool CSL_pktdmaGetRxFlowIdFirewallStatus (CSL_PktdmaCfg *pCfg, CSL_PktdmaRxFlowIdFirewallStatus *pRxFlowIdFwStatus)
 Get receive flow ID range firewall status information. More...
 
void CSL_pktdmaGetChanStats (const CSL_PktdmaCfg *pCfg, uint32_t chanIdx, CSL_PktdmaChanDir chanDir, CSL_PktdmaChanStats *pChanStats)
 Get channel statistics. More...
 
void CSL_pktdmaDecChanStats (CSL_PktdmaCfg *pCfg, uint32_t chanIdx, CSL_PktdmaChanDir chanDir, const CSL_PktdmaChanStats *pChanStats)
 Decrement channel statistics. More...
 
int32_t CSL_pktdmaGetChanPeerReg (const CSL_PktdmaCfg *pCfg, uint32_t chanIdx, CSL_PktdmaChanDir chanDir, uint32_t regIdx, uint32_t *pVal)
 Read a channel peer register. More...
 
int32_t CSL_pktdmaSetChanPeerReg (const CSL_PktdmaCfg *pCfg, uint32_t chanIdx, CSL_PktdmaChanDir chanDir, uint32_t regIdx, uint32_t *pVal)
 Write a channel peer register. More...
 
int32_t CSL_pktdmaEnableLink (CSL_PktdmaCfg *pCfg, uint32_t chanIdx, CSL_PktdmaChanDir chanDir)
 Enable a directional data flow for a paired link. More...