mcdma
Vitis Drivers API Documentation
|
Macros | |
#define | XMcdma_DisableCh(Chan, ChanId) |
Disable Particular Channel in the MCDMA Core. More... | |
#define | XMcdma_GetChan(Chan) XMcdma_ReadReg(Chan->ChanBase, XMCDMA_CHSER_OFFSET) |
Get Channel number that last Serviced. More... | |
#define | XMcdma_isidle(Chan) |
This function checks whether DMA is Idle or not. More... | |
#define | XMcdma_IntrEnable(Chan, Mask) |
This function enables interrupts specified by the Mask in specified direction, Interrupts that are not in the mask are not affected. More... | |
#define | XMcdma_IntrDisable(Chan, Mask) |
This function disables interrupts specified by the Mask. More... | |
#define | XMcdma_GetPktDrp_cnt(Chan) XMcdma_ReadReg(Chan->ChanBase, XMCDMA_CPKTDROP_OFFSET) |
Gets global Packet drop Count. More... | |
#define | XMcdma_GetMcdmaTxChan(InstancePtr, ChanId) (&((InstancePtr)->Tx_Chan[ChanId])) |
Gets the TX Channel Pointer. More... | |
#define | XMcdma_GetMcdmaRxChan(InstancePtr, ChanId) (&((InstancePtr)->Rx_Chan[ChanId])) |
Gets the RX Channel Pointer. More... | |
#define | XMcdma_GetChanCurBd(Chan) ((Chan)->BdRestart) |
Gets the Channel BD Chain Current BD. More... | |
#define | XMcdma_GetChanBdDoneCnt(Chan) ((Chan)->BdDoneCnt) |
This functions gives the Buffer descriptor count processed by the h/w. More... | |
#define | XMcdma_ChanGetIrq(Chan) |
This function gets the interrupts that are asserted. More... | |
#define | XMcdma_ChanAckIrq(Chan, Mask) |
This function acknowledges the interrupts that are specified in Mask. More... | |
#define | XMcdma_GetChanPktDrp_Cnt(Chan, ChanId) |
Get Packet drop Count for the particular Channel. More... | |
#define | XMcdma_SetARCache(InstancePtr, Value) |
This function sets the ARCACHE field with the user specified value. More... | |
#define | XMcdma_SetAWCache(InstancePtr, Value) |
This function sets the AWCACHE field with the user specified value. More... | |
#define | XMcdma_GetEgressObserver(InstancePtr, ObsId) |
Get Egress Channel Observer contents. More... | |
#define | XMcdma_GetIngressObserver(InstancePtr, ObsId) |
Get Ingress Channel Observer contents. More... | |
#define | XMcdma_BdRead(BaseAddress, Offset) (*(u32 *)(((void *)(UINTPTR)(BaseAddress)) + (u32)(Offset))) |
Read the given Buffer Descriptor word. More... | |
#define | XMcdma_BdRead64(BaseAddress, Offset) (*(u64 *)(((void *)(UINTPTR)(BaseAddress)) + (u32)(Offset))) |
Read the given Buffer Descriptor word. More... | |
#define | XMcdma_BdWrite(BaseAddress, Offset, Data) (*(u32 *)((UINTPTR)(void *)(BaseAddress) + (u32)(Offset))) = (u32)(Data) |
Write the given Buffer Descriptor word. More... | |
#define | XMcdma_BdWrite64(BaseAddress, Offset, Data) (*(u64 *)((UINTPTR)(void *)(BaseAddress) + (u32)(Offset))) = (u64)(Data) |
Write the given Buffer Descriptor double word. More... | |
#define | XMcDma_BdGetSts(BdPtr) XMcdma_BdRead((BdPtr), XMCDMA_BD_STS_OFFSET) |
Retrieve the status of a Ingress(S2MM) BD. More... | |
#define | XMcdma_BdHwCompleted(BdPtr) |
Check whether a Ingress(S2MM) BD has completed in hardware. More... | |
#define | XMcDma_BdGetActualLength(BdPtr, LengthMask) |
Get the actual transfer length of a Ingress (S2MM)BD. More... | |
#define | XMcDma_TxBdGetSts(BdPtr) XMcdma_BdRead((BdPtr), XMCDMA_BD_SIDEBAND_STS_OFFSET) |
Retrieve the status of a Egress(MM2S) BD. More... | |
#define | XMcdma_TxBdHwCompleted(BdPtr) |
Check whether a Egress(MM2S) BD has completed in hardware. More... | |
#define | XMcDma_TxBdGetActualLength(BdPtr, LengthMask) |
Get the actual transfer length of a Egress(MM2S) BD. More... | |
#define | XMcDma_BdGetCtrl(BdPtr) |
Gets the control bits of a BD. More... | |
#define | XMcdma_BdChainNextBd(Chan, BdPtr) |
Return the next BD in the Chain. More... | |
#define | XMcdma_BdChainPrevBd(Chan, BdPtr) |
Return the previous BD in the Chain. More... | |
#define | XMcdma_HwIsStarted(Chan) |
Check whether a DMA is started, meaning the channel is not halted. More... | |
#define | XMcdma_ChanHwIsStarted(Chan, Chan_id) |
Check whether a DMA channel is started, meaning the channel is not halted. More... | |
#define | XMcDma_BdSetCtrlSideBand(BdPtr, Tid, Tuser) |
Set the Tid and Tuser fields of a BD with the user provided values. More... | |
#define | XMcDma_GetBdSbandStats(BdPtr) XMcdma_BdRead((BdPtr), XMCDMA_BD_SIDEBAND_STS_OFFSET) |
Retrieve the side band status of a BD. More... | |
#define | XMcdma_BdClear(BdPtr) |
Clears the BD Contents. More... | |
#define | XMcdma_BdSetSwId(BdPtr, Id) (XMcdma_BdWrite((BdPtr), XMCDMA_BD_SW_ID_OFFSET, (UINTPTR)(Id))) |
Set the Sw ID field of the given BD. More... | |
#define | XMcdma_BdGetSwId(BdPtr) (XMcdma_BdRead((BdPtr), XMCDMA_BD_SW_ID_OFFSET)) |
Retrieve the Sw ID field of the given BD previously set with XMcdma_BdSetSwId. More... | |
Functions | |
s32 | XMcDma_CfgInitialize (XMcdma *InstancePtr, XMcdma_Config *CfgPtr) |
This function initializes an MCDMA core. More... | |
s32 | XMcDma_Initialize (XMcdma *InstancePtr, XMcdma_Config *CfgPtr) |
This function initializes an MCDMA core. More... | |
void | XMcDma_Reset (XMcdma *InstancePtr) |
This function resets the MCDMA core. More... | |
void | XMcdma_SetSGAWCache (XMcdma *InstancePtr, u8 Value) |
This function sets the AWCACHE field of the SG interface With the user specified value. More... | |
void | XMcdma_SetSGARCache (XMcdma *InstancePtr, u8 Value) |
This function sets the ARCACHE field of the SG interface With the user specified value. More... | |
u32 | XMcdma_ResetIsDone (XMcdma *InstancePtr) |
Check whether reset is done. More... | |
u32 | XMcdma_Start (XMcdma_ChanCtrl *Chan) |
Start the DMA engine. More... | |
u32 | XMcdma_ChanHwStop (XMcdma_ChanCtrl *Chan) |
Stops the DMA engine. More... | |
void | XMcdma_EnableCh (XMcdma_ChanCtrl *Chan) |
Enables a particular channel. More... | |
u16 | XMcdma_GetChanServiced (XMcdma *InstancePtr) |
Gets the last serviced s2mm channel number. More... | |
u16 | XMcdma_GetTxChanServiced (XMcdma *InstancePtr) |
Gets the last serviced mm2s channel number. More... | |
void | XMcdma_DumpChanRegs (XMcdma_ChanCtrl *Chan) |
Dump the registers for a channel. More... | |
int | XMcdma_UpdateChanCDesc (XMcdma_ChanCtrl *Chan) |
Update Current Descriptor for the MCDMA Channel. More... | |
int | XMcdma_UpdateChanTDesc (XMcdma_ChanCtrl *Chan) |
Update Tail Desc for the Channel. More... | |
u32 | XMcDma_ChanBdCreate (XMcdma_ChanCtrl *Chan, UINTPTR Addr, u32 Count) |
Using a memory segment allocated by the caller, This function creates and setup the BD Chain for the MCDMA Channel. More... | |
u32 | XMcDma_ChanSubmit (XMcdma_ChanCtrl *Chan, UINTPTR BufAddr, u32 len) |
This function Populates the BD Chain with the required buffer address and length fields. More... | |
u32 | XMcDma_Chan_Sideband_Submit (XMcdma_ChanCtrl *ChanPtr, UINTPTR BufAddr, u32 Len, u32 *AppPtr, u16 Tuser, u16 Tid) |
This function populates the BD Chain with the required buffer address, length APP(user application), TUSER and TID fields. More... | |
u32 | XMcDma_ChanToHw (XMcdma_ChanCtrl *Chan) |
This function triggers/Starts the h/w by programming the Current and Tail Descriptors and enabling the particular channel. More... | |
int | XMcdma_BdChainFromHW (XMcdma_ChanCtrl *Chan, u32 BdLimit, XMcdma_Bd **BdSetPtr) |
Returns a set of BD(s) that have been processed by hardware. More... | |
int | XMcdma_BdChainFree (XMcdma_ChanCtrl *Chan, int BdCount, XMcdma_Bd *BdSetPtr) |
Frees a set of BDs that had been previously retrieved with XMcdma_BdChainFromHW(). More... | |
u32 | XMcdma_BdSetBufAddr (XMcdma_Bd *BdPtr, UINTPTR Addr) |
Set the Buffer descriptor buffer address field. More... | |
void | XMcDma_BdSetCtrl (XMcdma_Bd *BdPtr, u32 Data) |
Set the control bits for a BD. More... | |
int | XMcDma_BdSetAppWord (XMcdma_Bd *BdPtr, int Offset, u32 Word) |
Set the APP word at the specified APP word offset for a BD. More... | |
u32 | XMcDma_BdGetAppWord (XMcdma_Bd *BdPtr, int Offset, int *Valid) |
Get the APP word at the specified APP word offset for a BD. More... | |
u32 | XMcdma_SetChanCoalesceDelay (XMcdma_ChanCtrl *Chan, u32 IrqCoalesce, u32 IrqDelay) |
Set interrupt coalescing parameters for a particular channel. More... | |
void | XMcDma_DumpBd (XMcdma_Bd *BdPtr) |
Dump the fields of a BD. More... | |
void | XMcdma_ChanIntrHandler (void *Instance) |
This function is the Per Channel interrupt handler for the MCDMA core. More... | |
s32 | XMcdma_ChanSetCallBack (XMcdma_ChanCtrl *Chan, XMcdma_ChanHandler HandlerType, void *CallBackFunc, void *CallBackRef) |
This routine installs an asynchronous callback function for the given HandlerType. More... | |
void | XMcdma_IntrHandler (void *Instance) |
This function is the S2MM(RX) interrupt handler for the MCDMA core. More... | |
void | XMcdma_TxIntrHandler (void *Instance) |
This function is the MM2S interrupt handler for the MCDMA core. More... | |
s32 | XMcdma_SetCallBack (XMcdma *InstancePtr, XMcdma_Handler HandlerType, void *CallBackFunc, void *CallBackRef) |
This routine installs an asynchronous callback function for the given HandlerType. More... | |
s32 | XMcdma_SelfTest (XMcdma *InstancePtr) |
This file contains a diagnostic self-test function for the MCDMA driver. More... | |
XMcdma_Config * | XMcdma_LookupConfig (u16 DeviceId) |
XMcdma_LookupConfig returns a reference to an XMcdma_Config structure based on the unique device id, DeviceId. More... | |
XMcdma_Config * | XMcdma_LookupConfigBaseAddr (UINTPTR Baseaddr) |
XMcdma_LookupConfigBaseAddr returns a reference to an XMcdma_Config structure based on base address. More... | |
#define XMcdma_BdChainNextBd | ( | Chan, | |
BdPtr | |||
) |
Return the next BD in the Chain.
Chan | is the Channel BD Chain to operate on. |
BdPtr | is the current BD. |
Referenced by XMcdma_BdChainFree(), XMcdma_BdChainFromHW(), XMcDma_Chan_Sideband_Submit(), and XMcDma_ChanSubmit().
#define XMcdma_BdChainPrevBd | ( | Chan, | |
BdPtr | |||
) |
Return the previous BD in the Chain.
Chan | is the MCDMA channel to operate on. |
BdPtr | is the current BD. |
#define XMcdma_BdClear | ( | BdPtr | ) |
Clears the BD Contents.
BdPtr | is the BD to operate on |
Referenced by XMcdma_BdChainFree(), XMcDma_Chan_Sideband_Submit(), and XMcDma_ChanSubmit().
#define XMcDma_BdGetActualLength | ( | BdPtr, | |
LengthMask | |||
) |
Get the actual transfer length of a Ingress (S2MM)BD.
The BD has completed in hw.
This function may not work if the BD is in cached memory.
BdPtr | is the BD to check on |
LengthMask | is the Maximum Transfer Length. |
#define XMcDma_BdGetCtrl | ( | BdPtr | ) |
Gets the control bits of a BD.
BdPtr | is the BD to operate on |
#define XMcDma_BdGetSts | ( | BdPtr | ) | XMcdma_BdRead((BdPtr), XMCDMA_BD_STS_OFFSET) |
Retrieve the status of a Ingress(S2MM) BD.
BdPtr | is the BD to operate on |
#define XMcdma_BdGetSwId | ( | BdPtr | ) | (XMcdma_BdRead((BdPtr), XMCDMA_BD_SW_ID_OFFSET)) |
Retrieve the Sw ID field of the given BD previously set with XMcdma_BdSetSwId.
BdPtr | is the BD to operate on |
#define XMcdma_BdHwCompleted | ( | BdPtr | ) |
Check whether a Ingress(S2MM) BD has completed in hardware.
This BD has been submitted to hardware. The application can use this function To poll for the Completion of the BD.
This function may not work if the BD is in cached memory.
BdPtr | is the BD to check on |
#define XMcdma_BdRead | ( | BaseAddress, | |
Offset | |||
) | (*(u32 *)(((void *)(UINTPTR)(BaseAddress)) + (u32)(Offset))) |
Read the given Buffer Descriptor word.
BaseAddress | is the base address of the BD to read |
Offset | is the word offset to be read |
Referenced by XMcdma_BdChainFromHW(), XMcDma_BdGetAppWord(), XMcDma_BdSetAppWord(), XMcdma_BdSetBufAddr(), XMcDma_BdSetCtrl(), and XMcDma_DumpBd().
#define XMcdma_BdRead64 | ( | BaseAddress, | |
Offset | |||
) | (*(u64 *)(((void *)(UINTPTR)(BaseAddress)) + (u32)(Offset))) |
Read the given Buffer Descriptor word.
BaseAddress | is the base address of the BD to read |
Offset | is the word offset to be read |
#define XMcDma_BdSetCtrlSideBand | ( | BdPtr, | |
Tid, | |||
Tuser | |||
) |
Set the Tid and Tuser fields of a BD with the user provided values.
BdPtr | is the BD to operate on. |
Tid | is Tid value to be written in the Bd field. |
Tuser | is Tuser value to be written in the Bd field. |
Referenced by XMcDma_Chan_Sideband_Submit().
#define XMcdma_BdSetSwId | ( | BdPtr, | |
Id | |||
) | (XMcdma_BdWrite((BdPtr), XMCDMA_BD_SW_ID_OFFSET, (UINTPTR)(Id))) |
Set the Sw ID field of the given BD.
The ID is an arbitrary piece of data the application can associate with a specific BD.
BdPtr | is the BD to operate on |
Id | is a 32 bit quantity to set in the BD |
#define XMcdma_BdWrite | ( | BaseAddress, | |
Offset, | |||
Data | |||
) | (*(u32 *)((UINTPTR)(void *)(BaseAddress) + (u32)(Offset))) = (u32)(Data) |
Write the given Buffer Descriptor word.
BaseAddress | is the base address of the BD to write |
Offset | is the word offset to be written |
Data | is the 32-bit value to write to the field |
Referenced by XMcDma_BdSetAppWord(), XMcdma_BdSetBufAddr(), XMcDma_BdSetCtrl(), XMcDma_Chan_Sideband_Submit(), XMcDma_ChanBdCreate(), and XMcDma_ChanSubmit().
#define XMcdma_BdWrite64 | ( | BaseAddress, | |
Offset, | |||
Data | |||
) | (*(u64 *)((UINTPTR)(void *)(BaseAddress) + (u32)(Offset))) = (u64)(Data) |
Write the given Buffer Descriptor double word.
BaseAddress | is the base address of the BD to write |
Offset | is the word offset to be written |
Data | is the 64-bit value to write to the field |
Referenced by XMcdma_BdSetBufAddr().
#define XMcdma_ChanAckIrq | ( | Chan, | |
Mask | |||
) |
This function acknowledges the interrupts that are specified in Mask.
Chan | is the MCDMA Channel to Operate on. |
Mask | is the mask for the interrupts to be acknowledge |
Referenced by XMcdma_ChanIntrHandler(), XMcdma_IntrHandler(), and XMcdma_TxIntrHandler().
#define XMcdma_ChanGetIrq | ( | Chan | ) |
This function gets the interrupts that are asserted.
Chan | is the MCDMA Channel to Operate on. |
Referenced by XMcdma_ChanIntrHandler(), XMcdma_IntrHandler(), and XMcdma_TxIntrHandler().
#define XMcdma_ChanHwIsStarted | ( | Chan, | |
Chan_id | |||
) |
Check whether a DMA channel is started, meaning the channel is not halted.
Chan | is the channel instance to operate on. |
Chan_id | is the channel number to operate on. |
Referenced by XMcdma_UpdateChanTDesc().
#define XMcdma_DisableCh | ( | Chan, | |
ChanId | |||
) |
Disable Particular Channel in the MCDMA Core.
Chan | is the MCDMA Channel to be worked on. |
ChanId | is the channel to disable. |
#define XMcDma_GetBdSbandStats | ( | BdPtr | ) | XMcdma_BdRead((BdPtr), XMCDMA_BD_SIDEBAND_STS_OFFSET) |
Retrieve the side band status of a BD.
BdPtr | is the BD to operate on |
#define XMcdma_GetChan | ( | Chan | ) | XMcdma_ReadReg(Chan->ChanBase, XMCDMA_CHSER_OFFSET) |
Get Channel number that last Serviced.
Chan | is the MCDMA Channel to be worked on. |
#define XMcdma_GetChanBdDoneCnt | ( | Chan | ) | ((Chan)->BdDoneCnt) |
This functions gives the Buffer descriptor count processed by the h/w.
Chan | is the MCDMA Channel to Operate on. |
#define XMcdma_GetChanCurBd | ( | Chan | ) | ((Chan)->BdRestart) |
Gets the Channel BD Chain Current BD.
Chan | is the MCDMA Channel to Operate on. |
#define XMcdma_GetChanPktDrp_Cnt | ( | Chan, | |
ChanId | |||
) |
Get Packet drop Count for the particular Channel.
Chan | is the MCDMA Channel to be worked on. |
ChanId | is the Channel number to be worked on. |
#define XMcdma_GetEgressObserver | ( | InstancePtr, | |
ObsId | |||
) |
Get Egress Channel Observer contents.
InstancePtr | is the driver instance we are working on. |
ObsId | is the Egress Channel observer number to be worked on. |
#define XMcdma_GetIngressObserver | ( | InstancePtr, | |
ObsId | |||
) |
Get Ingress Channel Observer contents.
InstancePtr | is the driver instance we are working on. |
ObsId | is the Ingress Channel observer number to be worked on. |
#define XMcdma_GetMcdmaRxChan | ( | InstancePtr, | |
ChanId | |||
) | (&((InstancePtr)->Rx_Chan[ChanId])) |
Gets the RX Channel Pointer.
InstancePtr | is a pointer to the DMA engine instance to be worked on. |
ChanId | is the channel to operate on |
Referenced by XMcdma_IntrHandler(), and XMcdma_ResetIsDone().
#define XMcdma_GetMcdmaTxChan | ( | InstancePtr, | |
ChanId | |||
) | (&((InstancePtr)->Tx_Chan[ChanId])) |
Gets the TX Channel Pointer.
InstancePtr | is a pointer to the DMA engine instance to be worked on. |
ChanId | is the channel to operate on |
Referenced by XMcdma_ResetIsDone(), and XMcdma_TxIntrHandler().
#define XMcdma_GetPktDrp_cnt | ( | Chan | ) | XMcdma_ReadReg(Chan->ChanBase, XMCDMA_CPKTDROP_OFFSET) |
Gets global Packet drop Count.
Chan | is the MCDMA Channel to be worked on. |
#define XMcdma_HwIsStarted | ( | Chan | ) |
Check whether a DMA is started, meaning the channel is not halted.
Chan | is the channel instance to operate on. |
Referenced by XMcdma_UpdateChanTDesc().
#define XMcdma_IntrDisable | ( | Chan, | |
Mask | |||
) |
This function disables interrupts specified by the Mask.
Interrupts that are not in the mask are not affected.
Chan | is the MCDMA Channel to be worked on. |
Mask | is the mask for the interrupts to be disabled |
#define XMcdma_IntrEnable | ( | Chan, | |
Mask | |||
) |
This function enables interrupts specified by the Mask in specified direction, Interrupts that are not in the mask are not affected.
Chan | is the MCDMA Channel to be worked on. |
Mask | is the mask for the interrupts to be enabled |
#define XMcdma_isidle | ( | Chan | ) |
This function checks whether DMA is Idle or not.
Chan | is the MCDMA Channel to be worked on. |
#define XMcdma_SetARCache | ( | InstancePtr, | |
Value | |||
) |
This function sets the ARCACHE field with the user specified value.
InstancePtr | is the driver instance we are working on |
Value | is the ARCACHE value to be written. |
Referenced by XMcDma_CfgInitialize().
#define XMcdma_SetAWCache | ( | InstancePtr, | |
Value | |||
) |
This function sets the AWCACHE field with the user specified value.
InstancePtr | is the driver instance we are working on |
Value | is the AWCACHE value to be written. |
Referenced by XMcDma_CfgInitialize().
#define XMcDma_TxBdGetActualLength | ( | BdPtr, | |
LengthMask | |||
) |
Get the actual transfer length of a Egress(MM2S) BD.
The BD has completed in hw.
This function may not work if the BD is in cached memory.
BdPtr | is the BD to check on |
LengthMask | is the Maximum Transfer Length. |
#define XMcDma_TxBdGetSts | ( | BdPtr | ) | XMcdma_BdRead((BdPtr), XMCDMA_BD_SIDEBAND_STS_OFFSET) |
Retrieve the status of a Egress(MM2S) BD.
BdPtr | is the BD to operate on |
#define XMcdma_TxBdHwCompleted | ( | BdPtr | ) |
Check whether a Egress(MM2S) BD has completed in hardware.
This BD has been submitted to hardware. The application can use this function To poll for the Completion of the BD.
This function may not work if the BD is in cached memory.
BdPtr | is the BD to check on |
enum XMcdma_ChanHandler |
enum XMcdma_Handler |
int XMcdma_BdChainFree | ( | XMcdma_ChanCtrl * | Chan, |
int | BdCount, | ||
XMcdma_Bd * | BdSetPtr | ||
) |
Frees a set of BDs that had been previously retrieved with XMcdma_BdChainFromHW().
Chan | is the MCDMA Channel to be worked on.. |
BdCount | is the number of BDs to free. |
BdSetPtr | is the head of a list of BDs returned by XMcdma_BdChainFromHW(). |
References XMcdma_BdChainNextBd, and XMcdma_BdClear.
int XMcdma_BdChainFromHW | ( | XMcdma_ChanCtrl * | Chan, |
u32 | BdLimit, | ||
XMcdma_Bd ** | BdSetPtr | ||
) |
Returns a set of BD(s) that have been processed by hardware.
The returned BDs may be examined by the application to determine the outcome of the DMA transactions. Once the BDs have been examined, the application must call XMcdma_BdChainFree() in the same order which they were retrieved here.
If hardware has partially completed a packet spanning multiple BDs, then none of the BDs for that packet will be included in the results.
Chan | is the MCDMA Channel to be worked on.. |
BdLimit | is the maximum number of BDs to return in the set. |
BdSetPtr | is an output parameter, it points to the first BD available for examination. |
References XMcdma_BdChainNextBd, and XMcdma_BdRead.
u32 XMcDma_BdGetAppWord | ( | XMcdma_Bd * | BdPtr, |
int | Offset, | ||
int * | Valid | ||
) |
Get the APP word at the specified APP word offset for a BD.
BdPtr | is the BD to operate on. |
Offset | is the offset inside the APP word, it is valid from 0 to 4 |
Valid | is to tell the caller whether parameters are valid |
References XMcdma_BdRead.
int XMcDma_BdSetAppWord | ( | XMcdma_Bd * | BdPtr, |
int | Offset, | ||
u32 | Word | ||
) |
Set the APP word at the specified APP word offset for a BD.
BdPtr | is the BD to operate on |
Offset | is the offset inside the APP word, it is valid from 0 to 4 |
Word | is the value to set |
References XMcdma_BdRead, and XMcdma_BdWrite.
u32 XMcdma_BdSetBufAddr | ( | XMcdma_Bd * | BdPtr, |
UINTPTR | Addr | ||
) |
Set the Buffer descriptor buffer address field.
BdPtr | is the BD to operate on |
Addr | is the address to set |
References XMcdma_BdRead, XMcdma_BdWrite, and XMcdma_BdWrite64.
Referenced by XMcDma_Chan_Sideband_Submit(), and XMcDma_ChanSubmit().
void XMcDma_BdSetCtrl | ( | XMcdma_Bd * | BdPtr, |
u32 | Data | ||
) |
Set the control bits for a BD.
BdPtr | is the BD to operate on. |
Data | is the bit value to set |
References XMcdma_BdRead, and XMcdma_BdWrite.
s32 XMcDma_CfgInitialize | ( | XMcdma * | InstancePtr, |
XMcdma_Config * | CfgPtr | ||
) |
This function initializes an MCDMA core.
This function must be called prior to using an MCDMA core. Initialization of an MCDMA includes setting up the instance data and ensuring the hardware is in a quiescent state and resets all the hardware configurations.
InstancePtr | is a pointer to the XMcdma instance. |
CfgPtr | is a reference to a structure containing information about a specific XMcdma instance. |
References XMcDma_Initialize(), XMcDma_Reset(), XMcdma_ResetIsDone(), XMcdma_SetARCache, and XMcdma_SetAWCache.
Referenced by main().
u32 XMcDma_Chan_Sideband_Submit | ( | XMcdma_ChanCtrl * | ChanPtr, |
UINTPTR | BufAddr, | ||
u32 | Len, | ||
u32 * | AppPtr, | ||
u16 | Tuser, | ||
u16 | Tid | ||
) |
This function populates the BD Chain with the required buffer address, length APP(user application), TUSER and TID fields.
User can submit multiple buffers/buffer descriptors by calling this function multiple times
ChanPtr | is the MCDMA Channel to be worked on.. |
BufAddr | is the buffer address to which data should send/recv. |
Len | is the Amount of data user requested to send/recv. |
AppPtr | is the point to APP fields. |
Tuser | is the value presented on the beat that has TLAST. |
Tid | is the value value presented on the beat that has TLAST. |
References XMcdma_BdChainNextBd, XMcdma_BdClear, XMcdma_BdSetBufAddr(), XMcDma_BdSetCtrlSideBand, and XMcdma_BdWrite.
u32 XMcDma_ChanBdCreate | ( | XMcdma_ChanCtrl * | Chan, |
UINTPTR | Addr, | ||
u32 | Count | ||
) |
Using a memory segment allocated by the caller, This function creates and setup the BD Chain for the MCDMA Channel.
Chan | is the MCDMA Channel to be worked on.. |
Addr | is the address of the application memory region. |
Count | is the number of BDs to setup in the application memory region. |
References XMcdma_BdWrite.
u32 XMcdma_ChanHwStop | ( | XMcdma_ChanCtrl * | Chan | ) |
Stops the DMA engine.
Chan | is the Channel instance to be worked on |
void XMcdma_ChanIntrHandler | ( | void * | Instance | ) |
This function is the Per Channel interrupt handler for the MCDMA core.
This handler reads the pending interrupt from Status register, determines the source of the interrupts and calls the respective callbacks for the interrupts that are enabled in the per channel control register, and finally clears the interrupts.
The application is responsible for connecting this function to the interrupt system. Application beyond this driver is also responsible for providing callbacks to handle interrupts and installing the callbacks using XMcdma_ChanSetCallBack() during initialization phase.
Instance | is a pointer to the Channel instance to be worked on. |
References XMcdma_ChanAckIrq, and XMcdma_ChanGetIrq.
s32 XMcdma_ChanSetCallBack | ( | XMcdma_ChanCtrl * | Chan, |
XMcdma_ChanHandler | HandlerType, | ||
void * | CallBackFunc, | ||
void * | CallBackRef | ||
) |
This routine installs an asynchronous callback function for the given HandlerType.
HandlerType Callback Function Type ----------------------- -------------------------------------------------- XMCDMA_HANDLER_DONE Channel Done handler XMCDMA_HANDLER_ERROR Channel Error handler
Chan | is the Channel instance to be worked on |
HandlerType | specifies which callback is to be attached. |
CallBackFunc | is the address of the callback function. |
CallBackRef | is a user data item that will be passed to the callback function when it is invoked. |
References XMCDMA_CHAN_HANDLER_DONE, and XMCDMA_CHAN_HANDLER_ERROR.
u32 XMcDma_ChanSubmit | ( | XMcdma_ChanCtrl * | Chan, |
UINTPTR | BufAddr, | ||
u32 | len | ||
) |
This function Populates the BD Chain with the required buffer address and length fields.
User can submit multiple buffers/buffer descriptors by calling this function multiple times
Chan | is the MCDMA Channel to be worked on.. |
BufAddr | is the buffer address to which data should send/recv. |
len | is the Amount of data user requested to send/recv. |
References XMcdma_BdChainNextBd, XMcdma_BdClear, XMcdma_BdSetBufAddr(), and XMcdma_BdWrite.
u32 XMcDma_ChanToHw | ( | XMcdma_ChanCtrl * | Chan | ) |
This function triggers/Starts the h/w by programming the Current and Tail Descriptors and enabling the particular channel.
Chan | is the MCDMA Channel to be worked on.. |
References XMcdma_EnableCh(), XMcdma_UpdateChanCDesc(), and XMcdma_UpdateChanTDesc().
void XMcDma_DumpBd | ( | XMcdma_Bd * | BdPtr | ) |
Dump the fields of a BD.
BdPtr | is the BD to operate on. |
References XMcdma_BdRead.
void XMcdma_DumpChanRegs | ( | XMcdma_ChanCtrl * | Chan | ) |
Dump the registers for a channel.
Chan | is the MCDMA Channel to be worked on. |
void XMcdma_EnableCh | ( | XMcdma_ChanCtrl * | Chan | ) |
Enables a particular channel.
Chan | is the Channel instance to be worked on |
Referenced by XMcDma_ChanToHw().
u16 XMcdma_GetChanServiced | ( | XMcdma * | InstancePtr | ) |
Gets the last serviced s2mm channel number.
InstancePtr | is a pointer to the DMA engine instance to be worked on. |
u16 XMcdma_GetTxChanServiced | ( | XMcdma * | InstancePtr | ) |
Gets the last serviced mm2s channel number.
InstancePtr | is a pointer to the DMA engine instance to be worked on. |
s32 XMcDma_Initialize | ( | XMcdma * | InstancePtr, |
XMcdma_Config * | CfgPtr | ||
) |
This function initializes an MCDMA core.
This function must be called prior to using an MCDMA core. Initialization of an MCDMA includes setting up the instance data and updating the driver filed with a proper values.
InstancePtr | is a pointer to the XMcdma instance. |
CfgPtr | is a reference to a structure containing information about a specific XMcdma instance. |
Referenced by XMcDma_CfgInitialize().
void XMcdma_IntrHandler | ( | void * | Instance | ) |
This function is the S2MM(RX) interrupt handler for the MCDMA core.
This handler reads the pending interrupt from Status register, determines the source of the interrupts and calls the respective callbacks for the interrupts that are enabled in global control register, and finally clears the interrupts.
The application is responsible for connecting this function to the interrupt system. Application beyond this driver is also responsible for providing callbacks to handle interrupts and installing the callbacks using XMcdma_SetCallBack() during initialization phase.
Instance | is a pointer to the XMcdma instance to be worked on. |
References XMcdma_ChanAckIrq, XMcdma_ChanGetIrq, and XMcdma_GetMcdmaRxChan.
XMcdma_Config* XMcdma_LookupConfig | ( | u16 | DeviceId | ) |
XMcdma_LookupConfig returns a reference to an XMcdma_Config structure based on the unique device id, DeviceId.
The return value will refer to an entry in the device configuration table defined in the xmcdma_g.c file.
DeviceId | is the unique device ID of the device for the lookup operation. |
Referenced by main().
XMcdma_Config* XMcdma_LookupConfigBaseAddr | ( | UINTPTR | Baseaddr | ) |
XMcdma_LookupConfigBaseAddr returns a reference to an XMcdma_Config structure based on base address.
The return value will refer to an entry in the device configuration table defined in the xmcdma_g.c file.
Baseaddr | is the base address of the device to lookup for |
void XMcDma_Reset | ( | XMcdma * | InstancePtr | ) |
This function resets the MCDMA core.
InstancePtr | is a pointer to the XMcdma instance. |
Referenced by XMcDma_CfgInitialize(), and XMcdma_SelfTest().
u32 XMcdma_ResetIsDone | ( | XMcdma * | InstancePtr | ) |
Check whether reset is done.
InstancePtr | is a pointer to the DMA engine instance to be worked on. |
References XMcdma_GetMcdmaRxChan, and XMcdma_GetMcdmaTxChan.
Referenced by XMcDma_CfgInitialize(), and XMcdma_SelfTest().
s32 XMcdma_SelfTest | ( | XMcdma * | InstancePtr | ) |
This file contains a diagnostic self-test function for the MCDMA driver.
Refer to the header file xmcdma.h for more detailed information.
InstancePtr | is a pointer to XMcDma instance. |
References XMcDma_Reset(), and XMcdma_ResetIsDone().
s32 XMcdma_SetCallBack | ( | XMcdma * | InstancePtr, |
XMcdma_Handler | HandlerType, | ||
void * | CallBackFunc, | ||
void * | CallBackRef | ||
) |
This routine installs an asynchronous callback function for the given HandlerType.
HandlerType Callback Function Type ----------------------- -------------------------------------------------- XMCDMA_TX_HANDLER_DONE MM2S(TX) Done handler XMCDMA_TX_HANDLER_ERROR MM2S(TX) Error handler XMCDMA_HANDLER_DONE S2MM(RX) Done handler XMCDMA_HANDLER_ERROR S2MM(RX) Error handler XMCDMA_HANDLER_PKTDROP S2MM(RX) Packet drop handler
InstancePtr | is a pointer to the XMcdma instance to be worked on. |
HandlerType | specifies which callback is to be attached. |
CallBackFunc | is the address of the callback function. |
CallBackRef | is a user data item that will be passed to the callback function when it is invoked. |
References XMCDMA_HANDLER_DONE, XMCDMA_HANDLER_ERROR, XMCDMA_HANDLER_PKTDROP, XMCDMA_TX_HANDLER_DONE, and XMCDMA_TX_HANDLER_ERROR.
u32 XMcdma_SetChanCoalesceDelay | ( | XMcdma_ChanCtrl * | Chan, |
u32 | IrqCoalesce, | ||
u32 | IrqDelay | ||
) |
Set interrupt coalescing parameters for a particular channel.
Chan | is the MCDMA Channel to be worked on.. |
IrqCoalesce | is the Irq Threshold value valid ranges are 1 to 255 |
IrqDelay | is the Irq Delay value valid ranges are 1 to 255 |
void XMcdma_SetSGARCache | ( | XMcdma * | InstancePtr, |
u8 | Value | ||
) |
This function sets the ARCACHE field of the SG interface With the user specified value.
InstancePtr | is the driver instance we are working on |
Value | is the ARCACHE value to be written. |
void XMcdma_SetSGAWCache | ( | XMcdma * | InstancePtr, |
u8 | Value | ||
) |
This function sets the AWCACHE field of the SG interface With the user specified value.
InstancePtr | is the driver instance we are working on |
Value | is the AWCACHE value to be written. |
u32 XMcdma_Start | ( | XMcdma_ChanCtrl * | Chan | ) |
Start the DMA engine.
Chan | is the Channel instance to be worked on |
Referenced by XMcdma_UpdateChanTDesc().
void XMcdma_TxIntrHandler | ( | void * | Instance | ) |
This function is the MM2S interrupt handler for the MCDMA core.
This handler reads the pending interrupt from Status register, determines the source of the interrupts and calls the respective callbacks for the interrupts that are enabled in global control register, and finally clears the interrupts.
The application is responsible for connecting this function to the interrupt system. Application beyond this driver is also responsible for providing callbacks to handle interrupts and installing the callbacks using XMcdma_SetCallBack() during initialization phase.
Instance | is a pointer to the XMcdma instance to be worked on. |
References XMcdma_ChanAckIrq, XMcdma_ChanGetIrq, and XMcdma_GetMcdmaTxChan.
int XMcdma_UpdateChanCDesc | ( | XMcdma_ChanCtrl * | Chan | ) |
Update Current Descriptor for the MCDMA Channel.
Chan | is the Channel instance to be worked on |
Referenced by XMcDma_ChanToHw().
int XMcdma_UpdateChanTDesc | ( | XMcdma_ChanCtrl * | Chan | ) |
Update Tail Desc for the Channel.
Chan | is the MCDMA Channel to be worked on. |
References XMcdma_ChanHwIsStarted, XMcdma_HwIsStarted, and XMcdma_Start().
Referenced by XMcDma_ChanToHw().