![]() |
axicdma
Vitis Drivers API Documentation
|
Macros | |
#define | XAxiCdma_ReadReg(BaseAddress, RegOffset) XAxiCdma_In32((BaseAddress) + (u32)(RegOffset)) |
Read a given register. More... | |
#define | XAxiCdma_WriteReg(BaseAddress, RegOffset, Data) XAxiCdma_Out32((BaseAddress) + (u32)(RegOffset), (u32)(Data)) |
Write to a given register. More... | |
Typedefs | |
typedef UINTPTR | XAxiCdma_Bd [XAXICDMA_BD_NUM_WORDS] |
XAxiCdma_Bd. More... | |
Functions | |
u32 | XAxiCdma_GetError (XAxiCdma *InstancePtr) |
This function gets the status on error bits. More... | |
void | XAxiCdma_Reset (XAxiCdma *InstancePtr) |
This function conducts hardware reset. More... | |
int | XAxiCdma_ResetIsDone (XAxiCdma *InstancePtr) |
This function checks whether the hardware reset is done. More... | |
u32 | XAxiCdma_CfgInitialize (XAxiCdma *InstancePtr, XAxiCdma_Config *CfgPtr, UINTPTR EffectiveAddr) |
This function initializes the driver. More... | |
int | XAxiCdma_IsBusy (XAxiCdma *InstancePtr) |
This function checks whether the hardware is doing transfer. More... | |
int | XAxiCdma_SelectKeyHole (XAxiCdma *InstancePtr, u32 Direction, u32 Select) |
This function configures KeyHole Write/Read Feature. More... | |
u32 | XAxiCdma_SimpleTransfer (XAxiCdma *InstancePtr, UINTPTR SrcAddr, UINTPTR DstAddr, int Length, XAxiCdma_CallBackFn SimpleCallBack, void *CallBackRef) |
This function does one simple transfer submission. More... | |
int | XAxiCdma_SetCoalesce (XAxiCdma *InstancePtr, u32 Counter, u32 Delay) |
This function tries to set the interrupt coalescing threshold counter and the delay counter. More... | |
void | XAxiCdma_GetCoalesce (XAxiCdma *InstancePtr, u32 *CounterPtr, u32 *DelayPtr) |
This function gets the current setting of the interrupt coalescing threshold counter and the delay counter. More... | |
void | XAxiCdma_DumpRegisters (XAxiCdma *InstancePtr) |
This function dumps the registers of this DMA instance. More... | |
XAxiCdma_Config * | XAxiCdma_LookupConfig (u32 DeviceId) |
Look up the hardware configuration for a device instance. More... | |
void | XAxiCdma_IntrEnable (XAxiCdma *InstancePtr, u32 Mask) |
This function enables interrupts specified by the Mask. More... | |
u32 | XAxiCdma_IntrGetEnabled (XAxiCdma *InstancePtr) |
This function gets the mask for the interrupts that are currently enabled. More... | |
void | XAxiCdma_IntrDisable (XAxiCdma *InstancePtr, u32 Mask) |
This function disables interrupts specified by the Mask. More... | |
void | XAxiCdma_IntrHandler (void *HandlerRef) |
This function is the interrupt handler for the driver, it handles all the interrupts. More... | |
u32 | XAxiCdma_BdRingCntCalc (u32 Alignment, u32 Bytes, UINTPTR BdBuffAddr) |
This function calculates how many BDs can be built using given number of bytes of memory, according to alignment provided. More... | |
u32 | XAxiCdma_BdRingMemCalc (u32 Alignment, int NumBd) |
This function calculates how much memory is needed to build requested number of BDs. More... | |
u32 | XAxiCdma_BdRingGetCnt (XAxiCdma *InstancePtr) |
This function gets the total number of BDs in the BD ring. More... | |
u32 | XAxiCdma_BdRingGetFreeCnt (XAxiCdma *InstancePtr) |
This function gets the number of free BDs. More... | |
void | XAxiCdma_BdRingSnapShotCurrBd (XAxiCdma *InstancePtr) |
This function grabs a copy of the current BD pointer from the hardware. More... | |
XAxiCdma_Bd * | XAxiCdma_BdRingGetCurrBd (XAxiCdma *InstancePtr) |
This function grabs a copy of the current BD pointer from the hardware. More... | |
XAxiCdma_Bd * | XAxiCdma_BdRingNext (XAxiCdma *InstancePtr, XAxiCdma_Bd *BdPtr) |
This function gets the next BD of the current BD on the BD ring. More... | |
XAxiCdma_Bd * | XAxiCdma_BdRingPrev (XAxiCdma *InstancePtr, XAxiCdma_Bd *BdPtr) |
This function gets the previous BD of the current BD on the BD ring. More... | |
LONG | XAxiCdma_BdRingCreate (XAxiCdma *InstancePtr, UINTPTR PhysAddr, UINTPTR VirtAddr, u32 Alignment, int BdCount) |
This function creates the BD ring for the driver instance. More... | |
LONG | XAxiCdma_BdRingClone (XAxiCdma *InstancePtr, XAxiCdma_Bd *TemplateBdPtr) |
This function clones all BDs in the BD ring to be the same as the given BD. More... | |
LONG | XAxiCdma_BdRingAlloc (XAxiCdma *InstancePtr, int NumBd, XAxiCdma_Bd **BdSetPtr) |
This function requests number of BDs from the BD ring. More... | |
LONG | XAxiCdma_BdRingUnAlloc (XAxiCdma *InstancePtr, int NumBd, XAxiCdma_Bd *BdSetPtr) |
This function tries to free the number of BDs back to the ring. More... | |
LONG | XAxiCdma_BdRingToHw (XAxiCdma *InstancePtr, int NumBd, XAxiCdma_Bd *BdSetPtr, XAxiCdma_CallBackFn CallBackFn, void *CallBackRef) |
This function tries to enqueue the number of BDs to the hardware. More... | |
u32 | XAxiCdma_BdRingFromHw (XAxiCdma *InstancePtr, int BdLimit, XAxiCdma_Bd **BdSetPtr) |
This function tries to retrieve completed BDs from the hardware. More... | |
u32 | XAxiCdma_BdRingFree (XAxiCdma *InstancePtr, int NumBd, XAxiCdma_Bd *BdSetPtr) |
This function returns the BDs back to the free pool of the BD ring. More... | |
void | XAxiCdma_BdSetCurBdPtr (XAxiCdma *InstancePtr, UINTPTR CurBdPtr) |
This function set the Current BD ptr of a BD. More... | |
void | XAxiCdma_BdSetTailBdPtr (XAxiCdma *InstancePtr, UINTPTR TailBdPtr) |
This function set the Tail BD ptr of a BD. More... | |
void | XAxiCdma_BdClear (XAxiCdma_Bd *BdPtr) |
This function clears the content of the BD. More... | |
void | XAxiCdma_BdClone (XAxiCdma_Bd *BdPtr, XAxiCdma_Bd *TmpBd) |
This function clones the content from the template BD. More... | |
LONG | XAxiCdma_BdGetNextPtr (XAxiCdma_Bd *BdPtr) |
This function gets the next BD pointer of the BD. More... | |
void | XAxiCdma_BdSetNextPtr (XAxiCdma_Bd *BdPtr, UINTPTR NextBdPtr) |
This function set the Next BD ptr of a BD. More... | |
u32 | XAxiCdma_BdGetSts (XAxiCdma_Bd *BdPtr) |
This function gets the completion status of the BD. More... | |
void | XAxiCdma_BdClearSts (XAxiCdma_Bd *BdPtr) |
This function clears the status bits of the BD. More... | |
u32 | XAxiCdma_BdSetSrcBufAddr (XAxiCdma_Bd *BdPtr, UINTPTR Addr) |
This function sets the source address of the BD. More... | |
LONG | XAxiCdma_BdGetSrcBufAddr (XAxiCdma_Bd *BdPtr) |
This function gets the source address of the BD. More... | |
u32 | XAxiCdma_BdSetDstBufAddr (XAxiCdma_Bd *BdPtr, UINTPTR Addr) |
This function sets the destination address of the BD. More... | |
LONG | XAxiCdma_BdGetDstBufAddr (XAxiCdma_Bd *BdPtr) |
This function gets the destination address of the BD. More... | |
u32 | XAxiCdma_BdSetLength (XAxiCdma_Bd *BdPtr, int LenBytes) |
This function sets the length of the BD. More... | |
u32 | XAxiCdma_BdGetLength (XAxiCdma_Bd *BdPtr) |
This function gets the length of the BD. More... | |
void | XAxiCdma_BdSetPhysAddr (XAxiCdma_Bd *BdPtr, UINTPTR PhysAddr) |
This function sets the Physical address of the BD. More... | |
void | XAxiCdma_BdSetIsLite (XAxiCdma_Bd *BdPtr, int IsLite) |
This function sets the is lite mode field of the BD. More... | |
void | XAxiCdma_BdSetHasDRE (XAxiCdma_Bd *BdPtr, int HasDRE) |
This function sets the has DRE field of the BD. More... | |
void | XAxiCdma_BdSetWordLen (XAxiCdma_Bd *BdPtr, int WordLen) |
This function sets the word length field of the BD. More... | |
void | XAxiCdma_BdSetMaxLen (XAxiCdma_Bd *BdPtr, int MaxLen) |
This function sets the maximum transfer length field of the BD. More... | |
LONG | XAxiCdma_BdGetPhysAddr (XAxiCdma_Bd *BdPtr) |
This function gets the Physical address of the BD. More... | |
void | XAxiCdma_DumpBd (XAxiCdma_Bd *BdPtr) |
This function dumps the BD, it is a debug utility. More... | |
Buffer Descriptor Alignment | |
#define | XAXICDMA_BD_MINIMUM_ALIGNMENT 0x40 |
Minimum byte alignment requirement for descriptors to satisfy both hardware/software needs. More... | |
Register offset definitions | |
#define | XAXICDMA_CR_OFFSET 0x00000000 |
Control register. More... | |
#define | XAXICDMA_SR_OFFSET 0x00000004 |
Status register. More... | |
#define | XAXICDMA_CDESC_OFFSET 0x00000008 |
Current descriptor pointer. More... | |
#define | XAXICDMA_CDESC_MSB_OFFSET 0x0000000C |
Current descriptor pointer. More... | |
#define | XAXICDMA_TDESC_OFFSET 0x00000010 |
Tail descriptor pointer. More... | |
#define | XAXICDMA_TDESC_MSB_OFFSET 0x00000014 |
Tail descriptor pointer. More... | |
#define | XAXICDMA_SRCADDR_OFFSET 0x00000018 |
Source address register. More... | |
#define | XAXICDMA_SRCADDR_MSB_OFFSET 0x0000001C |
Source address register. More... | |
#define | XAXICDMA_DSTADDR_OFFSET 0x00000020 |
Destination address register. More... | |
#define | XAXICDMA_DSTADDR_MSB_OFFSET 0x00000024 |
Destination address register. More... | |
Bitmasks of XAXICDMA_CR_OFFSET register | |
#define | XAXICDMA_CR_RESET_MASK 0x00000004 |
Reset DMA engine. More... | |
#define | XAXICDMA_CR_RESET_MASK 0x00000004 |
Reset DMA engine. More... | |
#define | XAXICDMA_CR_SGMODE_MASK 0x00000008 |
Scatter gather mode. More... | |
#define | XAXICDMA_CR_SGMODE_MASK 0x00000008 |
Scatter gather mode. More... | |
#define | XAXICDMA_CR_KHOLE_RD_MASK 0x00000010 |
Keyhole Read. More... | |
#define | XAXICDMA_CR_KHOLE_RD_MASK 0x00000010 |
Keyhole Read. More... | |
#define | XAXICDMA_CR_KHOLE_WR_MASK 0x00000020 |
Keyhole Write. More... | |
#define | XAXICDMA_CR_KHOLE_WR_MASK 0x00000020 |
Keyhole Write. More... | |
Bitmasks of XAXICDMA_SR_OFFSET register | |
This register reports status of a DMA channel, including idle state, errors, and interrupts | |
#define | XAXICDMA_BTT_OFFSET 0x00000028 |
Bytes to transfer. More... | |
#define | XAXICDMA_BTT_OFFSET 0x00000028 |
Bytes to transfer. More... | |
#define | XAXICDMA_SR_IDLE_MASK 0x00000002 |
DMA channel idle. More... | |
#define | XAXICDMA_SR_IDLE_MASK 0x00000002 |
DMA channel idle. More... | |
#define | XAXICDMA_SR_SGINCLD_MASK 0x00000008 |
Hybrid build. More... | |
#define | XAXICDMA_SR_SGINCLD_MASK 0x00000008 |
Hybrid build. More... | |
#define | XAXICDMA_SR_ERR_INTERNAL_MASK 0x00000010 |
Datamover internal err. More... | |
#define | XAXICDMA_SR_ERR_INTERNAL_MASK 0x00000010 |
Datamover internal err. More... | |
#define | XAXICDMA_SR_ERR_SLAVE_MASK 0x00000020 |
Datamover slave err. More... | |
#define | XAXICDMA_SR_ERR_DECODE_MASK 0x00000040 |
Datamover decode err. More... | |
#define | XAXICDMA_SR_ERR_SG_INT_MASK 0x00000100 |
SG internal err. More... | |
#define | XAXICDMA_SR_ERR_SG_SLV_MASK 0x00000200 |
SG slave err. More... | |
#define | XAXICDMA_SR_ERR_SG_DEC_MASK 0x00000400 |
SG decode err. More... | |
#define | XAXICDMA_SR_ERR_ALL_MASK 0x00000770 |
All errors. More... | |
Bitmask for descriptor | |
#define | XAXICDMA_DESC_LSB_MASK (0xFFFFFFC0U) |
LSB Address mask. More... | |
Bitmask for interrupts | |
These masks are shared by XAXICDMA_CR_OFFSET register and XAXICDMA_SR_OFFSET register | |
#define | XAXICDMA_XR_IRQ_IOC_MASK 0x00001000 |
Completion interrupt. More... | |
#define | XAXICDMA_XR_IRQ_DELAY_MASK 0x00002000 |
Delay interrupt. More... | |
#define | XAXICDMA_XR_IRQ_ERROR_MASK 0x00004000 |
Error interrupt. More... | |
#define | XAXICDMA_XR_IRQ_ALL_MASK 0x00007000 |
All interrupts. More... | |
#define | XAXICDMA_XR_IRQ_SIMPLE_ALL_MASK 0x00005000 |
All interrupts for simple only mode. More... | |
Bitmask and shift for delay counter and coalescing counter | |
These masks are shared by XAXICDMA_CR_OFFSET register and XAXICDMA_SR_OFFSET register | |
#define | XAXICDMA_XR_DELAY_MASK 0xFF000000 |
Delay timeout counter. More... | |
#define | XAXICDMA_XR_COALESCE_MASK 0x00FF0000 |
Coalesce counter. More... | |
#define | XAXICDMA_DELAY_SHIFT 24 |
#define | XAXICDMA_COALESCE_SHIFT 16 |
#define | XAXICDMA_DELAY_MAX 0xFF |
Maximum delay counter value. More... | |
#define | XAXICDMA_COALESCE_MAX 0xFF |
Maximum coalescing counter value. More... | |
Buffer Descriptor offsets | |
The first 8 words are used by hardware. Cache operations are required for words used by hardware to enforce data consistency. All words after the 8th word are for software use only. | |
#define | XAXICDMA_BD_NDESC_OFFSET 0x00 |
Next descriptor pointer. More... | |
#define | XAXICDMA_BD_NDESC_MSB_OFFSET 0x04 |
Next descriptor pointer. More... | |
#define | XAXICDMA_BD_BUFSRC_OFFSET 0x08 |
Buffer source address. More... | |
#define | XAXICDMA_BD_BUFSRC_MSB_OFFSET 0x0C |
Buffer source address. More... | |
#define | XAXICDMA_BD_BUFDST_OFFSET 0x10 |
Buffer destination address. More... | |
#define | XAXICDMA_BD_BUFDST_MSB_OFFSET 0x14 |
Buffer destination address. More... | |
#define | XAXICDMA_BD_CTRL_LEN_OFFSET 0x18 |
Control/buffer length. More... | |
#define | XAXICDMA_BD_STS_OFFSET 0x1C |
Status. More... | |
#define | XAXICDMA_BD_PHYS_ADDR_OFFSET 0x20 |
Physical address of the BD. More... | |
#define | XAXICDMA_BD_PHYS_ADDR_MSB_OFFSET 0x24 |
Physical address of the BD. More... | |
#define | XAXICDMA_BD_ISLITE_OFFSET 0x28 |
Lite mode hardware build? More... | |
#define | XAXICDMA_BD_HASDRE_OFFSET 0x2C |
Support unaligned transfers? More... | |
#define | XAXICDMA_BD_WORDLEN_OFFSET 0x30 |
Word length in bytes. More... | |
#define | XAXICDMA_BD_MAX_LEN_OFFSET 0x34 |
Word length in bytes. More... | |
#define | XAXICDMA_BD_ADDRLEN_OFFSET 0x38 |
Word length in bytes. More... | |
#define | XAXICDMA_BD_START_CLEAR 8 |
Offset to start clear. More... | |
#define | XAXICDMA_BD_TO_CLEAR 24 |
BD specific bytes to be cleared. More... | |
#define | XAXICDMA_BD_NUM_WORDS 16U |
Total number of words for one BD. More... | |
#define | XAXICDMA_BD_HW_NUM_BYTES 32 |
Number of bytes hw used. More... | |
Bitmasks of XAXICDMA_BD_CTRL_OFFSET register | |
#define | XAXICDMA_BD_CTRL_LENGTH_MASK 0x007FFFFF |
Requested len. More... | |
Bitmasks of XAXICDMA_BD_STS_OFFSET register | |
#define | XAXICDMA_BD_STS_COMPLETE_MASK 0x80000000 |
Completed. More... | |
#define | XAXICDMA_BD_STS_DEC_ERR_MASK 0x40000000 |
Decode error. More... | |
#define | XAXICDMA_BD_STS_SLV_ERR_MASK 0x20000000 |
Slave error. More... | |
#define | XAXICDMA_BD_STS_INT_ERR_MASK 0x10000000 |
Internal err. More... | |
#define | XAXICDMA_BD_STS_ALL_ERR_MASK 0x70000000 |
All errors. More... | |
#define | XAXICDMA_BD_STS_ALL_MASK 0xF0000000 |
All status bits. More... | |
#define XAXICDMA_BD_ADDRLEN_OFFSET 0x38 |
Word length in bytes.
#define XAXICDMA_BD_BUFDST_MSB_OFFSET 0x14 |
Buffer destination address.
Referenced by XAxiCdma_BdGetDstBufAddr(), and XAxiCdma_BdSetDstBufAddr().
#define XAXICDMA_BD_BUFDST_OFFSET 0x10 |
Buffer destination address.
Referenced by XAxiCdma_BdGetDstBufAddr(), and XAxiCdma_BdSetDstBufAddr().
#define XAXICDMA_BD_BUFSRC_MSB_OFFSET 0x0C |
Buffer source address.
Referenced by XAxiCdma_BdGetSrcBufAddr(), and XAxiCdma_BdSetSrcBufAddr().
#define XAXICDMA_BD_BUFSRC_OFFSET 0x08 |
Buffer source address.
Referenced by XAxiCdma_BdGetSrcBufAddr(), and XAxiCdma_BdSetSrcBufAddr().
#define XAXICDMA_BD_CTRL_LEN_OFFSET 0x18 |
Control/buffer length.
Referenced by XAxiCdma_BdGetLength(), and XAxiCdma_BdSetLength().
#define XAXICDMA_BD_CTRL_LENGTH_MASK 0x007FFFFF |
Requested len.
#define XAXICDMA_BD_HASDRE_OFFSET 0x2C |
Support unaligned transfers?
Referenced by XAxiCdma_BdSetDstBufAddr(), XAxiCdma_BdSetHasDRE(), XAxiCdma_BdSetSrcBufAddr(), and XAxiCdma_DumpBd().
#define XAXICDMA_BD_HW_NUM_BYTES 32 |
Number of bytes hw used.
#define XAXICDMA_BD_ISLITE_OFFSET 0x28 |
Lite mode hardware build?
Referenced by XAxiCdma_BdSetIsLite(), and XAxiCdma_DumpBd().
#define XAXICDMA_BD_MAX_LEN_OFFSET 0x34 |
Word length in bytes.
Referenced by XAxiCdma_BdSetLength(), XAxiCdma_BdSetMaxLen(), and XAxiCdma_DumpBd().
#define XAXICDMA_BD_MINIMUM_ALIGNMENT 0x40 |
Minimum byte alignment requirement for descriptors to satisfy both hardware/software needs.
Referenced by XAxiCdma_BdRingCreate(), XAxiCdma_BdRingNext(), and XAxiCdma_BdRingPrev().
#define XAXICDMA_BD_NDESC_MSB_OFFSET 0x04 |
Next descriptor pointer.
Referenced by XAxiCdma_BdGetNextPtr(), and XAxiCdma_BdSetNextPtr().
#define XAXICDMA_BD_NDESC_OFFSET 0x00 |
Next descriptor pointer.
Referenced by XAxiCdma_BdGetNextPtr(), and XAxiCdma_BdSetNextPtr().
#define XAXICDMA_BD_NUM_WORDS 16U |
Total number of words for one BD.
#define XAXICDMA_BD_PHYS_ADDR_MSB_OFFSET 0x24 |
Physical address of the BD.
Referenced by XAxiCdma_BdGetPhysAddr(), and XAxiCdma_BdSetPhysAddr().
#define XAXICDMA_BD_PHYS_ADDR_OFFSET 0x20 |
Physical address of the BD.
Referenced by XAxiCdma_BdGetPhysAddr(), and XAxiCdma_BdSetPhysAddr().
#define XAXICDMA_BD_START_CLEAR 8 |
Offset to start clear.
Referenced by XAxiCdma_BdClear(), and XAxiCdma_BdClone().
#define XAXICDMA_BD_STS_ALL_ERR_MASK 0x70000000 |
All errors.
#define XAXICDMA_BD_STS_ALL_MASK 0xF0000000 |
All status bits.
Referenced by XAxiCdma_BdGetSts().
#define XAXICDMA_BD_STS_COMPLETE_MASK 0x80000000 |
Completed.
Referenced by XAxiCdma_BdRingFromHw().
#define XAXICDMA_BD_STS_DEC_ERR_MASK 0x40000000 |
Decode error.
#define XAXICDMA_BD_STS_INT_ERR_MASK 0x10000000 |
Internal err.
#define XAXICDMA_BD_STS_OFFSET 0x1C |
Status.
Referenced by XAxiCdma_BdClearSts(), and XAxiCdma_BdGetSts().
#define XAXICDMA_BD_STS_SLV_ERR_MASK 0x20000000 |
Slave error.
#define XAXICDMA_BD_TO_CLEAR 24 |
BD specific bytes to be cleared.
Referenced by XAxiCdma_BdClear(), and XAxiCdma_BdClone().
#define XAXICDMA_BD_WORDLEN_OFFSET 0x30 |
Word length in bytes.
Referenced by XAxiCdma_BdSetDstBufAddr(), XAxiCdma_BdSetSrcBufAddr(), XAxiCdma_BdSetWordLen(), and XAxiCdma_DumpBd().
#define XAXICDMA_BTT_OFFSET 0x00000028 |
Bytes to transfer.
Referenced by XAxiCdma_DumpRegisters(), and XAxiCdma_SimpleTransfer().
#define XAXICDMA_BTT_OFFSET 0x00000028 |
Bytes to transfer.
#define XAXICDMA_CDESC_MSB_OFFSET 0x0000000C |
Current descriptor pointer.
Referenced by XAxiCdma_BdRingGetCurrBd(), XAxiCdma_BdSetCurBdPtr(), and XAxiCdma_DumpRegisters().
#define XAXICDMA_CDESC_OFFSET 0x00000008 |
Current descriptor pointer.
Referenced by XAxiCdma_BdRingGetCurrBd(), XAxiCdma_BdSetCurBdPtr(), and XAxiCdma_DumpRegisters().
#define XAXICDMA_COALESCE_MAX 0xFF |
Maximum coalescing counter value.
Referenced by XAxiCdma_SetCoalesce().
#define XAXICDMA_CR_KHOLE_RD_MASK 0x00000010 |
Keyhole Read.
Referenced by XAxiCdma_SelectKeyHole().
#define XAXICDMA_CR_KHOLE_RD_MASK 0x00000010 |
Keyhole Read.
#define XAXICDMA_CR_KHOLE_WR_MASK 0x00000020 |
Keyhole Write.
Referenced by XAxiCdma_SelectKeyHole().
#define XAXICDMA_CR_KHOLE_WR_MASK 0x00000020 |
Keyhole Write.
#define XAXICDMA_CR_OFFSET 0x00000000 |
Control register.
Referenced by XAxiCdma_DumpRegisters(), XAxiCdma_GetCoalesce(), XAxiCdma_IntrDisable(), XAxiCdma_IntrEnable(), XAxiCdma_IntrGetEnabled(), XAxiCdma_Reset(), XAxiCdma_ResetIsDone(), XAxiCdma_SelectKeyHole(), and XAxiCdma_SetCoalesce().
#define XAXICDMA_CR_RESET_MASK 0x00000004 |
Reset DMA engine.
Referenced by XAxiCdma_Reset(), and XAxiCdma_ResetIsDone().
#define XAXICDMA_CR_RESET_MASK 0x00000004 |
Reset DMA engine.
#define XAXICDMA_CR_SGMODE_MASK 0x00000008 |
Scatter gather mode.
Referenced by XAxiCdma_SelectKeyHole().
#define XAXICDMA_CR_SGMODE_MASK 0x00000008 |
Scatter gather mode.
#define XAXICDMA_DELAY_MAX 0xFF |
Maximum delay counter value.
Referenced by XAxiCdma_SetCoalesce().
#define XAXICDMA_DESC_LSB_MASK (0xFFFFFFC0U) |
LSB Address mask.
Referenced by XAxiCdma_BdSetCurBdPtr(), XAxiCdma_BdSetNextPtr(), and XAxiCdma_BdSetTailBdPtr().
#define XAXICDMA_DSTADDR_MSB_OFFSET 0x00000024 |
Destination address register.
Referenced by XAxiCdma_DumpRegisters(), and XAxiCdma_SimpleTransfer().
#define XAXICDMA_DSTADDR_OFFSET 0x00000020 |
Destination address register.
Referenced by XAxiCdma_DumpRegisters(), and XAxiCdma_SimpleTransfer().
#define XAxiCdma_ReadReg | ( | BaseAddress, | |
RegOffset | |||
) | XAxiCdma_In32((BaseAddress) + (u32)(RegOffset)) |
Read a given register.
BaseAddress | is the base virtual address of the device |
RegOffset | is the register offset to be read |
Referenced by XAxiCdma_CfgInitialize(), XAxiCdma_DumpRegisters(), XAxiCdma_GetCoalesce(), XAxiCdma_GetError(), XAxiCdma_IntrDisable(), XAxiCdma_IntrEnable(), XAxiCdma_IntrGetEnabled(), XAxiCdma_IntrHandler(), XAxiCdma_IsBusy(), XAxiCdma_ResetIsDone(), XAxiCdma_SelectKeyHole(), and XAxiCdma_SetCoalesce().
#define XAXICDMA_SR_ERR_ALL_MASK 0x00000770 |
All errors.
Referenced by XAxiCdma_GetError(), and XAxiCdma_IntrHandler().
#define XAXICDMA_SR_ERR_DECODE_MASK 0x00000040 |
Datamover decode err.
#define XAXICDMA_SR_ERR_INTERNAL_MASK 0x00000010 |
Datamover internal err.
#define XAXICDMA_SR_ERR_INTERNAL_MASK 0x00000010 |
Datamover internal err.
#define XAXICDMA_SR_ERR_SG_DEC_MASK 0x00000400 |
SG decode err.
#define XAXICDMA_SR_ERR_SG_INT_MASK 0x00000100 |
SG internal err.
#define XAXICDMA_SR_ERR_SG_SLV_MASK 0x00000200 |
SG slave err.
#define XAXICDMA_SR_ERR_SLAVE_MASK 0x00000020 |
Datamover slave err.
#define XAXICDMA_SR_IDLE_MASK 0x00000002 |
DMA channel idle.
Referenced by XAxiCdma_IsBusy().
#define XAXICDMA_SR_IDLE_MASK 0x00000002 |
DMA channel idle.
#define XAXICDMA_SR_OFFSET 0x00000004 |
Status register.
Referenced by XAxiCdma_CfgInitialize(), XAxiCdma_DumpRegisters(), XAxiCdma_GetError(), XAxiCdma_IntrHandler(), and XAxiCdma_IsBusy().
#define XAXICDMA_SR_SGINCLD_MASK 0x00000008 |
Hybrid build.
Referenced by XAxiCdma_CfgInitialize().
#define XAXICDMA_SR_SGINCLD_MASK 0x00000008 |
Hybrid build.
#define XAXICDMA_SRCADDR_MSB_OFFSET 0x0000001C |
Source address register.
Referenced by XAxiCdma_DumpRegisters(), and XAxiCdma_SimpleTransfer().
#define XAXICDMA_SRCADDR_OFFSET 0x00000018 |
Source address register.
Referenced by XAxiCdma_DumpRegisters(), and XAxiCdma_SimpleTransfer().
#define XAXICDMA_TDESC_MSB_OFFSET 0x00000014 |
Tail descriptor pointer.
Referenced by XAxiCdma_BdSetTailBdPtr(), and XAxiCdma_DumpRegisters().
#define XAXICDMA_TDESC_OFFSET 0x00000010 |
Tail descriptor pointer.
Referenced by XAxiCdma_BdSetTailBdPtr(), and XAxiCdma_DumpRegisters().
#define XAxiCdma_WriteReg | ( | BaseAddress, | |
RegOffset, | |||
Data | |||
) | XAxiCdma_Out32((BaseAddress) + (u32)(RegOffset), (u32)(Data)) |
Write to a given register.
BaseAddress | is the base virtual address of the device |
RegOffset | is the register offset to be written |
Data | is the 32-bit value to write to the register |
Referenced by XAxiCdma_BdSetCurBdPtr(), XAxiCdma_BdSetTailBdPtr(), XAxiCdma_IntrDisable(), XAxiCdma_IntrEnable(), XAxiCdma_IntrHandler(), XAxiCdma_Reset(), XAxiCdma_SelectKeyHole(), XAxiCdma_SetCoalesce(), and XAxiCdma_SimpleTransfer().
#define XAXICDMA_XR_COALESCE_MASK 0x00FF0000 |
Coalesce counter.
Referenced by XAxiCdma_GetCoalesce(), and XAxiCdma_SetCoalesce().
#define XAXICDMA_XR_DELAY_MASK 0xFF000000 |
Delay timeout counter.
Referenced by XAxiCdma_GetCoalesce(), and XAxiCdma_SetCoalesce().
#define XAXICDMA_XR_IRQ_ALL_MASK 0x00007000 |
#define XAXICDMA_XR_IRQ_DELAY_MASK 0x00002000 |
Delay interrupt.
#define XAXICDMA_XR_IRQ_ERROR_MASK 0x00004000 |
Error interrupt.
Referenced by XAxiCdma_IntrHandler().
#define XAXICDMA_XR_IRQ_IOC_MASK 0x00001000 |
Completion interrupt.
#define XAXICDMA_XR_IRQ_SIMPLE_ALL_MASK 0x00005000 |
All interrupts for simple only mode.
Referenced by XAxiCdma_SimpleTransfer().
typedef UINTPTR XAxiCdma_Bd[XAXICDMA_BD_NUM_WORDS] |
XAxiCdma_Bd.
Buffer descriptor, shared by hardware and software The structure of the BD is as the following, however, the user never directly accesses the fields in the BD. The following shows the fields inside a BD:
u32 NextBdPtr; u32 NextBdPtrMsb; u32 SrcAddr; u32 SrcAddrMsb; u32 DstAddr; u32 DstAddrMsb; int Length; u32 Status; u32 PhysAddr; u32 IsLite; u32 HasDRE; u32 WordLen; u32 Addrlen;
void XAxiCdma_BdClear | ( | XAxiCdma_Bd * | BdPtr | ) |
This function clears the content of the BD.
BdPtr | is the pointer to the BD to be cleared |
References XAXICDMA_BD_START_CLEAR, and XAXICDMA_BD_TO_CLEAR.
void XAxiCdma_BdClearSts | ( | XAxiCdma_Bd * | BdPtr | ) |
This function clears the status bits of the BD.
The status bits include the completion bit as well as the error bits.
This is the only function that needs to be called to clear a completed BD. All other fields (except reserved words) need to be re-assigned before re-submission.
BdPtr | is the pointer to the BD to clear the status |
References XAXICDMA_BD_STS_OFFSET.
Referenced by XAxiCdma_BdRingClone(), and XAxiCdma_BdRingToHw().
void XAxiCdma_BdClone | ( | XAxiCdma_Bd * | BdPtr, |
XAxiCdma_Bd * | TmpBd | ||
) |
This function clones the content from the template BD.
BdPtr | is the pointer to the BD to be cloned to |
TmpBd | is the pointer to the BD to be cloned from |
References XAXICDMA_BD_START_CLEAR, and XAXICDMA_BD_TO_CLEAR.
Referenced by XAxiCdma_BdRingClone().
LONG XAxiCdma_BdGetDstBufAddr | ( | XAxiCdma_Bd * | BdPtr | ) |
This function gets the destination address of the BD.
BdPtr | is the pointer to the BD to get the destination address |
References XAXICDMA_BD_BUFDST_MSB_OFFSET, and XAXICDMA_BD_BUFDST_OFFSET.
Referenced by XAxiCdma_DumpBd().
u32 XAxiCdma_BdGetLength | ( | XAxiCdma_Bd * | BdPtr | ) |
This function gets the length of the BD.
BdPtr | is the pointer to the BD to get the length |
References XAXICDMA_BD_CTRL_LEN_OFFSET.
Referenced by XAxiCdma_BdRingToHw(), and XAxiCdma_DumpBd().
LONG XAxiCdma_BdGetNextPtr | ( | XAxiCdma_Bd * | BdPtr | ) |
This function gets the next BD pointer of the BD.
BdPtr | is the pointer to the BD to get the next BD ptr |
References XAXICDMA_BD_NDESC_MSB_OFFSET, and XAXICDMA_BD_NDESC_OFFSET.
Referenced by XAxiCdma_DumpBd().
LONG XAxiCdma_BdGetPhysAddr | ( | XAxiCdma_Bd * | BdPtr | ) |
This function gets the Physical address of the BD.
BdPtr | is the pointer to the BD to get the physical address |
References XAXICDMA_BD_PHYS_ADDR_MSB_OFFSET, and XAXICDMA_BD_PHYS_ADDR_OFFSET.
Referenced by XAxiCdma_BdRingToHw(), and XAxiCdma_DumpBd().
LONG XAxiCdma_BdGetSrcBufAddr | ( | XAxiCdma_Bd * | BdPtr | ) |
This function gets the source address of the BD.
BdPtr | is the pointer to the BD to get the source address |
References XAXICDMA_BD_BUFSRC_MSB_OFFSET, and XAXICDMA_BD_BUFSRC_OFFSET.
Referenced by XAxiCdma_DumpBd().
u32 XAxiCdma_BdGetSts | ( | XAxiCdma_Bd * | BdPtr | ) |
This function gets the completion status of the BD.
BdPtr | is the pointer to the BD to get the status |
References XAXICDMA_BD_STS_ALL_MASK, and XAXICDMA_BD_STS_OFFSET.
Referenced by XAxiCdma_BdRingFromHw(), and XAxiCdma_DumpBd().
LONG XAxiCdma_BdRingAlloc | ( | XAxiCdma * | InstancePtr, |
int | NumBd, | ||
XAxiCdma_Bd ** | BdSetPtr | ||
) |
This function requests number of BDs from the BD ring.
InstancePtr | is the driver instance we are working on |
NumBd | is the number of BDs to request |
BdSetPtr | is the pointer to the set of BDs returned |
LONG XAxiCdma_BdRingClone | ( | XAxiCdma * | InstancePtr, |
XAxiCdma_Bd * | TemplateBdPtr | ||
) |
This function clones all BDs in the BD ring to be the same as the given BD.
InstancePtr | is the driver instance we are working on |
TemplateBdPtr | is the BD to be copied from |
References XAxiCdma_BdClearSts(), XAxiCdma_BdClone(), and XAxiCdma_IsBusy().
u32 XAxiCdma_BdRingCntCalc | ( | u32 | Alignment, |
u32 | Bytes, | ||
UINTPTR | BdBuffAddr | ||
) |
This function calculates how many BDs can be built using given number of bytes of memory, according to alignment provided.
Alignment | is the preferred alignment for the BDs |
Bytes | is the number of bytes of memory to build BDs with |
BdBuffAddr | is the buffer address allocated for the BDs. This is to check the alignment of the buffer to make sure the the buffer is aligned to the BD alignment. An invalid buffer address results in 0. |
LONG XAxiCdma_BdRingCreate | ( | XAxiCdma * | InstancePtr, |
UINTPTR | PhysAddr, | ||
UINTPTR | VirtAddr, | ||
u32 | Alignment, | ||
int | BdCount | ||
) |
This function creates the BD ring for the driver instance.
If a BD ring pre-exist of this ring, the previous ring is lost.
InstancePtr | is the driver instance we are working on |
PhysAddr | is the physical address of the memory for the BD ring |
VirtAddr | is the virtual address of the memory for the BD ring |
Alignment | is the alignment for the BDs |
BdCount | is the number of BDs to create in the ring |
References XAXICDMA_BD_MINIMUM_ALIGNMENT, XAxiCdma_BdSetHasDRE(), XAxiCdma_BdSetIsLite(), XAxiCdma_BdSetMaxLen(), XAxiCdma_BdSetNextPtr(), XAxiCdma_BdSetPhysAddr(), and XAxiCdma_BdSetWordLen().
u32 XAxiCdma_BdRingFree | ( | XAxiCdma * | InstancePtr, |
int | NumBd, | ||
XAxiCdma_Bd * | BdSetPtr | ||
) |
This function returns the BDs back to the free pool of the BD ring.
InstancePtr | is the driver instance we are working on |
NumBd | is the number of BDs to free |
BdSetPtr | is the set of BDs to be freed |
u32 XAxiCdma_BdRingFromHw | ( | XAxiCdma * | InstancePtr, |
int | BdLimit, | ||
XAxiCdma_Bd ** | BdSetPtr | ||
) |
This function tries to retrieve completed BDs from the hardware.
InstancePtr | is the driver instance we are working on |
BdLimit | is the maximum number of completed BDs to retrieve |
BdSetPtr | is the set of completed BDs |
References XAXICDMA_BD_STS_COMPLETE_MASK, XAxiCdma_BdGetSts(), and XAxiCdma_BdRingNext().
u32 XAxiCdma_BdRingGetCnt | ( | XAxiCdma * | InstancePtr | ) |
This function gets the total number of BDs in the BD ring.
InstancePtr | is the driver instance we are working on |
XAxiCdma_Bd * XAxiCdma_BdRingGetCurrBd | ( | XAxiCdma * | InstancePtr | ) |
This function grabs a copy of the current BD pointer from the hardware.
InstancePtr | is the driver instance we are working on |
References XAXICDMA_CDESC_MSB_OFFSET, and XAXICDMA_CDESC_OFFSET.
Referenced by XAxiCdma_BdRingSnapShotCurrBd(), and XAxiCdma_SelectKeyHole().
u32 XAxiCdma_BdRingGetFreeCnt | ( | XAxiCdma * | InstancePtr | ) |
This function gets the number of free BDs.
InstancePtr | is the driver instance we are working on |
u32 XAxiCdma_BdRingMemCalc | ( | u32 | Alignment, |
int | NumBd | ||
) |
This function calculates how much memory is needed to build requested number of BDs.
Alignment | is the preferred alignment for the BDs |
NumBd | is the number of BDs to be built |
XAxiCdma_Bd * XAxiCdma_BdRingNext | ( | XAxiCdma * | InstancePtr, |
XAxiCdma_Bd * | BdPtr | ||
) |
This function gets the next BD of the current BD on the BD ring.
InstancePtr | is the driver instance we are working on |
BdPtr | is the current BD |
References XAXICDMA_BD_MINIMUM_ALIGNMENT.
Referenced by XAxiCdma_BdRingFromHw(), XAxiCdma_BdRingSnapShotCurrBd(), XAxiCdma_BdRingToHw(), and XAxiCdma_SelectKeyHole().
XAxiCdma_Bd * XAxiCdma_BdRingPrev | ( | XAxiCdma * | InstancePtr, |
XAxiCdma_Bd * | BdPtr | ||
) |
This function gets the previous BD of the current BD on the BD ring.
InstancePtr | is the driver instance we are working on |
BdPtr | is the current BD |
References XAXICDMA_BD_MINIMUM_ALIGNMENT.
Referenced by XAxiCdma_BdRingToHw().
void XAxiCdma_BdRingSnapShotCurrBd | ( | XAxiCdma * | InstancePtr | ) |
This function grabs a copy of the current BD pointer from the hardware.
It is normally used to prepare for the hardware reset. The snapshot of the current BD pointer should be reloaded once the reset is done.
InstancePtr | is the driver instance we are working on |
References XAxiCdma_BdRingGetCurrBd(), and XAxiCdma_BdRingNext().
LONG XAxiCdma_BdRingToHw | ( | XAxiCdma * | InstancePtr, |
int | NumBd, | ||
XAxiCdma_Bd * | BdSetPtr, | ||
XAxiCdma_CallBackFn | CallBackFn, | ||
void * | CallBackRef | ||
) |
This function tries to enqueue the number of BDs to the hardware.
InstancePtr | is the driver instance we are working on |
NumBd | is the number of BDs to enqueue |
BdSetPtr | is the set of BDs to be enqueued |
CallBackFn | is the callback function for this transfer, NULL is fine |
CallBackRef | is the callback reference pointer |
References XAxiCdma_BdClearSts(), XAxiCdma_BdGetLength(), XAxiCdma_BdGetPhysAddr(), XAxiCdma_BdRingNext(), XAxiCdma_BdRingPrev(), and XAxiCdma_BdSetTailBdPtr().
LONG XAxiCdma_BdRingUnAlloc | ( | XAxiCdma * | InstancePtr, |
int | NumBd, | ||
XAxiCdma_Bd * | BdSetPtr | ||
) |
This function tries to free the number of BDs back to the ring.
InstancePtr | is the driver instance we are working on |
NumBd | is the number of BDs to return |
BdSetPtr | is the set of BDs to be returned |
void XAxiCdma_BdSetCurBdPtr | ( | XAxiCdma * | InstancePtr, |
UINTPTR | CurBdPtr | ||
) |
This function set the Current BD ptr of a BD.
BdPtr | is the pointer to the BD to set the Next BD ptr |
CurBdPtr | is the valud of Current BD ptr |
References XAXICDMA_CDESC_MSB_OFFSET, XAXICDMA_CDESC_OFFSET, XAXICDMA_DESC_LSB_MASK, and XAxiCdma_WriteReg.
Referenced by XAxiCdma_SelectKeyHole().
u32 XAxiCdma_BdSetDstBufAddr | ( | XAxiCdma_Bd * | BdPtr, |
UINTPTR | Addr | ||
) |
This function sets the destination address of the BD.
BdPtr | is the pointer to the BD to set the destination address |
Addr | is the destination address of the buffer |
References XAXICDMA_BD_BUFDST_MSB_OFFSET, XAXICDMA_BD_BUFDST_OFFSET, XAXICDMA_BD_HASDRE_OFFSET, and XAXICDMA_BD_WORDLEN_OFFSET.
void XAxiCdma_BdSetHasDRE | ( | XAxiCdma_Bd * | BdPtr, |
int | HasDRE | ||
) |
This function sets the has DRE field of the BD.
BdPtr | is the pointer to the BD to work on |
HasDRE | is the value for whether hardware has DRE built in |
References XAXICDMA_BD_HASDRE_OFFSET.
Referenced by XAxiCdma_BdRingCreate().
void XAxiCdma_BdSetIsLite | ( | XAxiCdma_Bd * | BdPtr, |
int | IsLite | ||
) |
This function sets the is lite mode field of the BD.
BdPtr | is the pointer to the BD to work on |
IsLite | is the value for whether hardware is in lite mode |
References XAXICDMA_BD_ISLITE_OFFSET.
Referenced by XAxiCdma_BdRingCreate().
u32 XAxiCdma_BdSetLength | ( | XAxiCdma_Bd * | BdPtr, |
int | LenBytes | ||
) |
This function sets the length of the BD.
BdPtr | is the pointer to the BD to set the length |
LenBytes | is the length of the buffer |
References XAXICDMA_BD_CTRL_LEN_OFFSET, and XAXICDMA_BD_MAX_LEN_OFFSET.
void XAxiCdma_BdSetMaxLen | ( | XAxiCdma_Bd * | BdPtr, |
int | MaxLen | ||
) |
This function sets the maximum transfer length field of the BD.
BdPtr | is the pointer to the BD to work on |
MaxLen | is the maximum transfer length in bytes |
References XAXICDMA_BD_MAX_LEN_OFFSET.
Referenced by XAxiCdma_BdRingCreate().
void XAxiCdma_BdSetNextPtr | ( | XAxiCdma_Bd * | BdPtr, |
UINTPTR | NextBdPtr | ||
) |
This function set the Next BD ptr of a BD.
BdPtr | is the pointer to the BD to set the Next BD ptr |
NextBdPtr | is the valud of Next BD ptr |
References XAXICDMA_BD_NDESC_MSB_OFFSET, XAXICDMA_BD_NDESC_OFFSET, and XAXICDMA_DESC_LSB_MASK.
Referenced by XAxiCdma_BdRingCreate().
void XAxiCdma_BdSetPhysAddr | ( | XAxiCdma_Bd * | BdPtr, |
UINTPTR | PhysAddr | ||
) |
This function sets the Physical address of the BD.
BdPtr | is the pointer to the BD to set the physical address |
PhysAddr | is the physical address of the BD |
References XAXICDMA_BD_PHYS_ADDR_MSB_OFFSET, and XAXICDMA_BD_PHYS_ADDR_OFFSET.
Referenced by XAxiCdma_BdRingCreate().
u32 XAxiCdma_BdSetSrcBufAddr | ( | XAxiCdma_Bd * | BdPtr, |
UINTPTR | Addr | ||
) |
This function sets the source address of the BD.
BdPtr | is the pointer to the BD to set the source address |
Addr | is the source address of the buffer |
References XAXICDMA_BD_BUFSRC_MSB_OFFSET, XAXICDMA_BD_BUFSRC_OFFSET, XAXICDMA_BD_HASDRE_OFFSET, and XAXICDMA_BD_WORDLEN_OFFSET.
void XAxiCdma_BdSetTailBdPtr | ( | XAxiCdma * | InstancePtr, |
UINTPTR | TailBdPtr | ||
) |
This function set the Tail BD ptr of a BD.
BdPtr | is the pointer to the BD to set the Next BD ptr |
Tail | Bd is the value of Tail BD ptr |
References XAXICDMA_DESC_LSB_MASK, XAXICDMA_TDESC_MSB_OFFSET, XAXICDMA_TDESC_OFFSET, and XAxiCdma_WriteReg.
Referenced by XAxiCdma_BdRingToHw().
void XAxiCdma_BdSetWordLen | ( | XAxiCdma_Bd * | BdPtr, |
int | WordLen | ||
) |
This function sets the word length field of the BD.
BdPtr | is the pointer to the BD to work on |
WordLen | is the length of word in bytes |
References XAXICDMA_BD_WORDLEN_OFFSET.
Referenced by XAxiCdma_BdRingCreate().
u32 XAxiCdma_CfgInitialize | ( | XAxiCdma * | InstancePtr, |
XAxiCdma_Config * | CfgPtr, | ||
UINTPTR | EffectiveAddr | ||
) |
This function initializes the driver.
It should be called before any other function calls to the driver.
It sets up the driver according to the hardware build. It resets the hardware at the end.
InstancePtr | is the driver instance that is working on |
CfgPtr | is the pointer to the hardware configuration structure |
EffectiveAddr | is the virtual address of the hardware instance. If address translation is not in use, please use the physical address |
References XAxiCdma_ReadReg, XAxiCdma_Reset(), XAxiCdma_ResetIsDone(), XAXICDMA_SR_OFFSET, and XAXICDMA_SR_SGINCLD_MASK.
Referenced by XAxiCdma_HybridIntrExample(), XAxiCdma_HybridPollExample(), XAxiCdma_SgIntrExample(), XAxiCdma_SgPollExample(), XAxiCdma_SimpleIntrExample(), and XAxiCdma_SimplePollExample().
void XAxiCdma_DumpBd | ( | XAxiCdma_Bd * | BdPtr | ) |
This function dumps the BD, it is a debug utility.
BdPtr | is the pointer to the BD to get the physical address |
References XAXICDMA_BD_HASDRE_OFFSET, XAXICDMA_BD_ISLITE_OFFSET, XAXICDMA_BD_MAX_LEN_OFFSET, XAXICDMA_BD_WORDLEN_OFFSET, XAxiCdma_BdGetDstBufAddr(), XAxiCdma_BdGetLength(), XAxiCdma_BdGetNextPtr(), XAxiCdma_BdGetPhysAddr(), XAxiCdma_BdGetSrcBufAddr(), and XAxiCdma_BdGetSts().
void XAxiCdma_DumpRegisters | ( | XAxiCdma * | InstancePtr | ) |
This function dumps the registers of this DMA instance.
InstancePtr | is the driver instance we are working on |
References XAXICDMA_BTT_OFFSET, XAXICDMA_CDESC_MSB_OFFSET, XAXICDMA_CDESC_OFFSET, XAXICDMA_CR_OFFSET, XAXICDMA_DSTADDR_MSB_OFFSET, XAXICDMA_DSTADDR_OFFSET, XAxiCdma_ReadReg, XAXICDMA_SR_OFFSET, XAXICDMA_SRCADDR_MSB_OFFSET, XAXICDMA_SRCADDR_OFFSET, XAXICDMA_TDESC_MSB_OFFSET, and XAXICDMA_TDESC_OFFSET.
void XAxiCdma_GetCoalesce | ( | XAxiCdma * | InstancePtr, |
u32 * | CounterPtr, | ||
u32 * | DelayPtr | ||
) |
This function gets the current setting of the interrupt coalescing threshold counter and the delay counter.
InstancePtr | is the driver instance we are working on |
CounterPtr | is the return value for the coalescing counter setting |
DelayPtr | is the return value for the delay counter setting |
References XAXICDMA_CR_OFFSET, XAxiCdma_ReadReg, XAXICDMA_XR_COALESCE_MASK, and XAXICDMA_XR_DELAY_MASK.
u32 XAxiCdma_GetError | ( | XAxiCdma * | InstancePtr | ) |
This function gets the status on error bits.
InstancePtr | is the driver instance we are working on |
References XAxiCdma_ReadReg, XAXICDMA_SR_ERR_ALL_MASK, and XAXICDMA_SR_OFFSET.
Referenced by XAxiCdma_SgIntrExample().
void XAxiCdma_IntrDisable | ( | XAxiCdma * | InstancePtr, |
u32 | Mask | ||
) |
This function disables interrupts specified by the Mask.
Interrupts that are not in the mask are not affected.
InstancePtr | is the driver instance we are working on |
Mask | is the mask for the interrupts to be disabled |
References XAXICDMA_CR_OFFSET, XAxiCdma_ReadReg, XAxiCdma_WriteReg, and XAXICDMA_XR_IRQ_ALL_MASK.
Referenced by XAxiCdma_HybridPollExample(), and XAxiCdma_SimplePollExample().
void XAxiCdma_IntrEnable | ( | XAxiCdma * | InstancePtr, |
u32 | Mask | ||
) |
This function enables interrupts specified by the Mask.
Interrupts that are not in the mask are not affected.
InstancePtr | is the driver instance we are working on |
Mask | is the mask for the interrupts to be enabled |
References XAXICDMA_CR_OFFSET, XAxiCdma_ReadReg, XAxiCdma_WriteReg, and XAXICDMA_XR_IRQ_ALL_MASK.
Referenced by XAxiCdma_HybridIntrExample(), XAxiCdma_SgIntrExample(), and XAxiCdma_SimpleIntrExample().
u32 XAxiCdma_IntrGetEnabled | ( | XAxiCdma * | InstancePtr | ) |
This function gets the mask for the interrupts that are currently enabled.
InstancePtr | is the driver instance we are working on |
References XAXICDMA_CR_OFFSET, XAxiCdma_ReadReg, and XAXICDMA_XR_IRQ_ALL_MASK.
Referenced by XAxiCdma_SimpleTransfer().
void XAxiCdma_IntrHandler | ( | void * | HandlerRef | ) |
This function is the interrupt handler for the driver, it handles all the interrupts.
For the completion of a transfer that has a callback function, the callback function is called.
HandlerRef | is a reference pointer passed to the interrupt registration function. It will be a pointer to the driver instance we are working on |
References XAxiCdma_ReadReg, XAxiCdma_Reset(), XAxiCdma_ResetIsDone(), XAXICDMA_SR_ERR_ALL_MASK, XAXICDMA_SR_OFFSET, XAxiCdma_WriteReg, XAXICDMA_XR_IRQ_ALL_MASK, and XAXICDMA_XR_IRQ_ERROR_MASK.
Referenced by XAxiCdma_SimpleIntrExample().
int XAxiCdma_IsBusy | ( | XAxiCdma * | InstancePtr | ) |
This function checks whether the hardware is doing transfer.
InstancePtr | is the driver instance we are working on |
References XAxiCdma_ReadReg, XAXICDMA_SR_IDLE_MASK, and XAXICDMA_SR_OFFSET.
Referenced by XAxiCdma_BdRingClone(), XAxiCdma_SelectKeyHole(), and XAxiCdma_SimpleTransfer().
XAxiCdma_Config * XAxiCdma_LookupConfig | ( | u32 | DeviceId | ) |
Look up the hardware configuration for a device instance.
DeviceId | is the unique device ID of the device to lookup for |
Referenced by XAxiCdma_HybridIntrExample(), XAxiCdma_HybridPollExample(), XAxiCdma_SgIntrExample(), XAxiCdma_SgPollExample(), XAxiCdma_SimpleIntrExample(), and XAxiCdma_SimplePollExample().
void XAxiCdma_Reset | ( | XAxiCdma * | InstancePtr | ) |
This function conducts hardware reset.
Current transfer will finish gracefully. However, all queued SG transfers that have not started will be flushed from the hardware.
InstancePtr | is the driver instance we are working on |
References XAXICDMA_CR_OFFSET, XAXICDMA_CR_RESET_MASK, and XAxiCdma_WriteReg.
Referenced by XAxiCdma_CfgInitialize(), XAxiCdma_IntrHandler(), and XAxiCdma_SgPollExample().
int XAxiCdma_ResetIsDone | ( | XAxiCdma * | InstancePtr | ) |
This function checks whether the hardware reset is done.
InstancePtr | is the driver instance we are working on |
References XAXICDMA_CR_OFFSET, XAXICDMA_CR_RESET_MASK, and XAxiCdma_ReadReg.
Referenced by XAxiCdma_CfgInitialize(), XAxiCdma_IntrHandler(), and XAxiCdma_SgPollExample().
int XAxiCdma_SelectKeyHole | ( | XAxiCdma * | InstancePtr, |
u32 | Direction, | ||
u32 | Select | ||
) |
This function configures KeyHole Write/Read Feature.
InstancePtr | is the driver instance we are working on |
Direction | is WRITE/READ Select is the option to enable (TRUE) or disable (FALSE). |
References XAxiCdma_BdRingGetCurrBd(), XAxiCdma_BdRingNext(), XAxiCdma_BdSetCurBdPtr(), XAXICDMA_CR_KHOLE_RD_MASK, XAXICDMA_CR_KHOLE_WR_MASK, XAXICDMA_CR_OFFSET, XAXICDMA_CR_SGMODE_MASK, XAxiCdma_IsBusy(), XAxiCdma_ReadReg, and XAxiCdma_WriteReg.
int XAxiCdma_SetCoalesce | ( | XAxiCdma * | InstancePtr, |
u32 | Counter, | ||
u32 | Delay | ||
) |
This function tries to set the interrupt coalescing threshold counter and the delay counter.
If to set only one of the counters, set the value of the other counter to be XAXICDMA_COALESCE_NO_CHANGE.
InstancePtr | is the driver instance we are working on |
Counter | is the coalescing threshold to set to, the valid range is 1 to XAXICDMA_COALESCE_MAX. |
Delay | is the delay timeout counter to set to, the valid range is 0 to XAXICDMA_DELAY_MAX. Setting a value of 0 disables the delay interrupt. |
References XAXICDMA_COALESCE_MAX, XAXICDMA_CR_OFFSET, XAXICDMA_DELAY_MAX, XAxiCdma_ReadReg, XAxiCdma_WriteReg, XAXICDMA_XR_COALESCE_MASK, and XAXICDMA_XR_DELAY_MASK.
u32 XAxiCdma_SimpleTransfer | ( | XAxiCdma * | InstancePtr, |
UINTPTR | SrcAddr, | ||
UINTPTR | DstAddr, | ||
int | Length, | ||
XAxiCdma_CallBackFn | SimpleCallBack, | ||
void * | CallBackRef | ||
) |
This function does one simple transfer submission.
It checks in the following sequence:
InstancePtr | is the pointer to the driver instance |
SrcAddr | is the address of the source buffer |
DstAddr | is the address of the destination buffer |
Length | is the length of the transfer |
SimpleCallBack | is the callback function for the simple transfer |
CallBackRef | is the callback reference pointer |
References XAXICDMA_BTT_OFFSET, XAXICDMA_DSTADDR_MSB_OFFSET, XAXICDMA_DSTADDR_OFFSET, XAxiCdma_IntrGetEnabled(), XAxiCdma_IsBusy(), XAXICDMA_SRCADDR_MSB_OFFSET, XAXICDMA_SRCADDR_OFFSET, XAxiCdma_WriteReg, and XAXICDMA_XR_IRQ_SIMPLE_ALL_MASK.