axicdma
Vitis Drivers API Documentation
 All Data Structures Files Functions Variables Typedefs Groups Pages
Overview

Data Structures

struct  XAxiCdma_IntrHandlerList
 Interrupt handler list entry for scatter gather transfers. More...
 
struct  XAxiCdma_Config
 Hardware configuration structure for the CDMA engine. More...
 
struct  XAxiCdma
 Driver instance data for one CDMA engine. More...
 

Macros

#define XAXICDMA_MAXIMUM_MAX_HANDLER   20
 Maximum active SG interrupt handlers this driver manages. More...
 
#define XAxiCdma_BdRead(BdPtr, Offset)   (*(u32 *)((UINTPTR)((void *)(BdPtr)) + (u32)(Offset)))
 Reads a word from a buffer descriptor. More...
 
#define XAxiCdma_BdWrite(BdPtr, Offset, Value)   (*(u32 *)((UINTPTR)(void *)(BdPtr) + (u32)(Offset))) = (u32)(Value)
 Writes a word to a buffer descriptor. More...
 
#define XAxiCdma_BdSetAddrLen(BdPtr, AddrLen)   XAxiCdma_BdWrite(BdPtr, XAXICDMA_BD_ADDRLEN_OFFSET, AddrLen);
 Sets the address length field of a BD. More...
 
#define XAxiCdma_BdGetAddrLength(BdPtr)   XAxiCdma_BdRead(BdPtr, XAXICDMA_BD_ADDRLEN_OFFSET);
 Reads the address length field of a BD. More...
 
#define XAXICDMA_RING_SEEKAHEAD(InstancePtr, BdPtr, NumBd)
 Moves the BD pointer ahead by an arbitrary number of BDs. More...
 
#define XAXICDMA_RING_SEEKBACK(InstancePtr, BdPtr, NumBd)
 Moves the BD pointer backwards by an arbitrary number of BDs. More...
 
#define XAxiCdma_In32   Xil_In32
 Reads a 32-bit value from a memory-mapped register. More...
 
#define XAxiCdma_Out32   Xil_Out32
 Writes a 32-bit value to a memory-mapped register. More...
 
#define XAxiCdma_ReadReg(BaseAddress, RegOffset)   XAxiCdma_In32((BaseAddress) + (u32)(RegOffset))
 Reads a device register. More...
 
#define XAxiCdma_WriteReg(BaseAddress, RegOffset, Data)   XAxiCdma_Out32((BaseAddress) + (u32)(RegOffset), (u32)(Data))
 Writes a device register. More...
 
#define XAXICDMA_RESET_LOOP_LIMIT   5
 Maximum number of reset completion polls. More...
 
#define AXICDMA_BASE_ADDR   XPAR_XAXICDMA_0_BASEADDR
 Base address of the AXI CDMA device under test. More...
 
#define BUFFER_BYTESIZE   128
 Length in bytes of the source and destination DMA buffers. More...
 
#define MAX_PKT_LEN   1024
 Maximum packet length in bytes for each buffer descriptor. More...
 
#define MARK_UNCACHEABLE   0x701
 Memory attribute used to mark buffers as uncacheable on AArch64. More...
 
#define NUMBER_OF_BDS_TO_TRANSFER   30
 Number of buffer descriptors to transfer in this test. More...
 
#define COALESCING_COUNT   5
 Interrupt coalescing count programmed into the DMA engine. More...
 
#define DELAY_COUNT   5
 Interrupt delay counter programmed into the DMA engine. More...
 
#define POLL_TIMEOUT_COUNTER   1000000U
 Maximum poll iterations before a transfer times out. More...
 
#define NUMBER_OF_EVENTS   1
 Number of interrupt events expected to complete the test. More...
 
#define BD_SPACE_SIZE   (64 * sizeof(XAxiCdma_Bd))
 Source and Destination buffer for DMA transfer. More...
 
#define SG_BUFFER_SIZE   (MAX_PKT_LEN * NUMBER_OF_BDS_TO_TRANSFER)
 SG buffer size. More...
 
#define AXICDMA_BASE_ADDR   XPAR_XAXICDMA_0_BASEADDR
 Base address of the AXI CDMA device under test. More...
 
#define BUFFER_BYTESIZE   128
 Length in bytes of the source and destination DMA buffers. More...
 
#define MAX_PKT_LEN   1024
 Maximum packet length in bytes for each buffer descriptor. More...
 
#define MARK_UNCACHEABLE   0x701
 Memory attribute used to mark buffers as uncacheable on AArch64. More...
 
#define NUMBER_OF_BDS_TO_TRANSFER   30
 Number of buffer descriptors to transfer in this test. More...
 
#define RESET_LOOP_COUNT   10
 Number of times to poll for reset completion. More...
 
#define POLL_TIMEOUT_COUNTER   1000000U
 Maximum poll iterations before a transfer times out. More...
 
#define BD_SPACE_SIZE   (64 * sizeof(XAxiCdma_Bd))
 BD space size. More...
 
#define SG_BUFFER_SIZE   (MAX_PKT_LEN * NUMBER_OF_BDS_TO_TRANSFER)
 SG buffer size. More...
 
#define AXICDMA_BASE_ADDR   XPAR_XAXICDMA_0_BASEADDR
 Base address of the AXI CDMA device under test. More...
 
#define MAX_PKT_LEN   1024
 Maximum packet length in bytes for each buffer descriptor. More...
 
#define MARK_UNCACHEABLE   0x701
 Memory attribute used to mark buffers as uncacheable on AArch64. More...
 
#define NUMBER_OF_BDS_TO_TRANSFER   30
 Number of buffer descriptors to transfer in this test. More...
 
#define COALESCING_COUNT   5
 Interrupt coalescing count programmed into the DMA engine. More...
 
#define DELAY_COUNT   5
 Interrupt delay counter programmed into the DMA engine. More...
 
#define POLL_TIMEOUT_COUNTER   1000000U
 Maximum poll iterations before a transfer times out. More...
 
#define NUMBER_OF_EVENTS   1
 Number of interrupt events expected to complete the test. More...
 
#define BD_SPACE_SIZE   (64 * sizeof(XAxiCdma_Bd))
 BD space size. More...
 
#define SG_BUFFER_SIZE   (MAX_PKT_LEN * NUMBER_OF_BDS_TO_TRANSFER)
 SG buffer size. More...
 
#define AXICDMA_BASE_ADDR   XPAR_XAXICDMA_0_BASEADDR
 Base address of the AXI CDMA device under test. More...
 
#define MAX_PKT_LEN   128
 Maximum packet length in bytes for each buffer descriptor. More...
 
#define MARK_UNCACHEABLE   0x701
 Memory attribute used to mark buffers as uncacheable on AArch64. More...
 
#define NUMBER_OF_BDS_TO_TRANSFER   1
 Number of buffer descriptors to transfer in this test. More...
 
#define RESET_LOOP_COUNT   10
 Number of times to poll for reset completion. More...
 
#define POLL_TIMEOUT_COUNTER   1000000U
 Maximum poll iterations before a transfer times out. More...
 
#define BD_SPACE_SIZE   (64 * sizeof(XAxiCdma_Bd))
 BD space size. More...
 
#define SG_BUFFER_SIZE   (MAX_PKT_LEN * NUMBER_OF_BDS_TO_TRANSFER)
 SG buffer size. More...
 
#define AXICDMA_BASE_ADDR   XPAR_XAXICDMA_0_BASEADDR
 Base address of the AXI CDMA device under test. More...
 
#define BUFFER_BYTESIZE   64
 Length in bytes of the source and destination DMA buffers. More...
 
#define NUMBER_OF_TRANSFERS   4
 Number of simple transfers to run in this test. More...
 
#define POLL_TIMEOUT_COUNTER   1000000U
 Maximum poll iterations before a transfer times out. More...
 
#define NUMBER_OF_EVENTS   1
 Number of interrupt events expected to complete the test. More...
 
#define AXICDMA_BASE_ADDR   XPAR_XAXICDMA_0_BASEADDR
 Base address of the AXI CDMA device under test. More...
 
#define BUFFER_BYTESIZE   64
 Length in bytes of the source and destination DMA buffers. More...
 
#define NUMBER_OF_TRANSFERS   4
 Number of simple transfers to run in this test. More...
 
#define RESET_LOOP_COUNT   10
 Number of times to poll for reset completion. More...
 
#define POLL_TIMEOUT_COUNTER   1000000U
 Maximum poll iterations before a transfer times out. More...
 

Typedefs

typedef void(* XAxiCdma_CallBackFn )(void *CallBackRef, u32 IrqMask, int *NumBdPtr)
 Defines the callback function type for transfer completion notification. More...
 
typedef UINTPTR XAxiCdma_Bd [XAXICDMA_BD_NUM_WORDS]
 Buffer descriptor shared by hardware and software. More...
 

Functions

u32 XAxiCdma_GetError (XAxiCdma *InstancePtr)
 Reads error status bits from the hardware. More...
 
void XAxiCdma_Reset (XAxiCdma *InstancePtr)
 Resets the hardware. More...
 
int XAxiCdma_ResetIsDone (XAxiCdma *InstancePtr)
 Checks whether hardware reset completed. More...
 
u32 XAxiCdma_CfgInitialize (XAxiCdma *InstancePtr, XAxiCdma_Config *CfgPtr, UINTPTR EffectiveAddr)
 Initializes the driver. More...
 
int XAxiCdma_IsBusy (XAxiCdma *InstancePtr)
 Checks whether the hardware is doing transfer. More...
 
int XAxiCdma_IsSimpleMode (XAxiCdma *InstancePtr)
 Checks whether the hardware is in simple mode. More...
 
int XAxiCdma_SelectKeyHole (XAxiCdma *InstancePtr, u32 Direction, u32 Select)
 Configures the KeyHole read or write feature. More...
 
int XAxiCdma_SwitchMode (XAxiCdma *InstancePtr, int Mode)
 Switches the hardware between simple and scatter gather mode. More...
 
u32 XAxiCdma_SimpleTransfer (XAxiCdma *InstancePtr, UINTPTR SrcAddr, UINTPTR DstAddr, int Length, XAxiCdma_CallBackFn SimpleCallBack, void *CallBackRef)
 Performs one simple transfer submission. More...
 
int XAxiCdma_SetCoalesce (XAxiCdma *InstancePtr, u32 Counter, u32 Delay)
 Sets the interrupt coalescing threshold and delay counters. More...
 
void XAxiCdma_GetCoalesce (XAxiCdma *InstancePtr, u32 *CounterPtr, u32 *DelayPtr)
 Reads the interrupt coalescing threshold and delay counter settings. More...
 
void XAxiCdma_DumpRegisters (XAxiCdma *InstancePtr)
 Dumps the registers of this DMA instance. More...
 
XAxiCdma_Config * XAxiCdma_LookupConfig (UINTPTR BaseAddress)
 Looks up device configuration by device ID or base address. More...
 
void XAxiCdma_IntrEnable (XAxiCdma *InstancePtr, u32 Mask)
 Enables interrupts specified by the Mask. More...
 
u32 XAxiCdma_IntrGetEnabled (XAxiCdma *InstancePtr)
 Reads the mask for currently enabled interrupts. More...
 
void XAxiCdma_IntrDisable (XAxiCdma *InstancePtr, u32 Mask)
 Disables interrupts specified by the Mask. More...
 
void XAxiCdma_IntrHandler (void *HandlerRef)
 Handles driver interrupts, it handles all the interrupts. More...
 
u32 XAxiCdma_BdRingCntCalc (u32 Alignment, u32 Bytes, UINTPTR BdBuffAddr)
 Calculates how many BDs fit in the given memory size and alignment. More...
 
u32 XAxiCdma_BdRingMemCalc (u32 Alignment, int NumBd)
 Calculates memory required for the requested number of BDs. More...
 
u32 XAxiCdma_BdRingGetCnt (XAxiCdma *InstancePtr)
 Reads the total number of BDs in the BD ring. More...
 
u32 XAxiCdma_BdRingGetFreeCnt (XAxiCdma *InstancePtr)
 Reads the number of free BDs. More...
 
void XAxiCdma_BdRingSnapShotCurrBd (XAxiCdma *InstancePtr)
 Reads and saves the current BD pointer from the hardware. More...
 
XAxiCdma_Bd * XAxiCdma_BdRingGetCurrBd (XAxiCdma *InstancePtr)
 Reads the current BD pointer from the hardware. More...
 
XAxiCdma_Bd * XAxiCdma_BdRingNext (XAxiCdma *InstancePtr, XAxiCdma_Bd *BdPtr)
 Reads the next BD on the BD ring. More...
 
XAxiCdma_Bd * XAxiCdma_BdRingPrev (XAxiCdma *InstancePtr, XAxiCdma_Bd *BdPtr)
 Reads the previous BD on the BD ring. More...
 
LONG XAxiCdma_BdRingCreate (XAxiCdma *InstancePtr, UINTPTR PhysAddr, UINTPTR VirtAddr, u32 Alignment, int BdCount)
 Creates the BD ring for the driver instance. More...
 
LONG XAxiCdma_BdRingClone (XAxiCdma *InstancePtr, XAxiCdma_Bd *TemplateBdPtr)
 Clones all BDs in the ring from a template BD. More...
 
LONG XAxiCdma_BdRingAlloc (XAxiCdma *InstancePtr, int NumBd, XAxiCdma_Bd **BdSetPtr)
 Allocates BDs from the BD ring. More...
 
LONG XAxiCdma_BdRingUnAlloc (XAxiCdma *InstancePtr, int NumBd, XAxiCdma_Bd *BdSetPtr)
 Returns BDs to the free pool in the ring. More...
 
LONG XAxiCdma_BdRingToHw (XAxiCdma *InstancePtr, int NumBd, XAxiCdma_Bd *BdSetPtr, XAxiCdma_CallBackFn CallBackFn, void *CallBackRef)
 Enqueues prepared BDs to the hardware. More...
 
u32 XAxiCdma_BdRingFromHw (XAxiCdma *InstancePtr, int BdLimit, XAxiCdma_Bd **BdSetPtr)
 Retrieves completed BDs from the hardware. More...
 
u32 XAxiCdma_BdRingFree (XAxiCdma *InstancePtr, int NumBd, XAxiCdma_Bd *BdSetPtr)
 Returns the BDs back to the free pool of the BD ring. More...
 
void XAxiCdma_BdSetCurBdPtr (XAxiCdma *InstancePtr, UINTPTR CurBdPtr)
 Sets the current BD pointer in the hardware. More...
 
void XAxiCdma_BdSetTailBdPtr (XAxiCdma *InstancePtr, UINTPTR TailBdPtr)
 Sets the tail BD pointer in the hardware. More...
 
void XAxiCdma_BdClear (XAxiCdma_Bd *BdPtr)
 Clears the content of the BD. More...
 
void XAxiCdma_BdClone (XAxiCdma_Bd *BdPtr, XAxiCdma_Bd *TmpBd)
 Clones the content from the template BD. More...
 
LONG XAxiCdma_BdGetNextPtr (XAxiCdma_Bd *BdPtr)
 Reads the next BD pointer from the BD. More...
 
void XAxiCdma_BdSetNextPtr (XAxiCdma_Bd *BdPtr, UINTPTR NextBdPtr)
 Sets the next BD pointer in the BD. More...
 
u32 XAxiCdma_BdGetSts (XAxiCdma_Bd *BdPtr)
 Reads the completion status of the BD. More...
 
void XAxiCdma_BdClearSts (XAxiCdma_Bd *BdPtr)
 Clears the status bits of the BD. More...
 
u32 XAxiCdma_BdSetSrcBufAddr (XAxiCdma_Bd *BdPtr, UINTPTR Addr)
 Sets the source address of the BD. More...
 
LONG XAxiCdma_BdGetSrcBufAddr (XAxiCdma_Bd *BdPtr)
 Reads the source address of the BD. More...
 
u32 XAxiCdma_BdSetDstBufAddr (XAxiCdma_Bd *BdPtr, UINTPTR Addr)
 Sets the destination address of the BD. More...
 
LONG XAxiCdma_BdGetDstBufAddr (XAxiCdma_Bd *BdPtr)
 Reads the destination address of the BD. More...
 
u32 XAxiCdma_BdSetLength (XAxiCdma_Bd *BdPtr, int LenBytes)
 Sets the length of the BD. More...
 
u32 XAxiCdma_BdGetLength (XAxiCdma_Bd *BdPtr)
 Reads the length of the BD. More...
 
void XAxiCdma_BdSetPhysAddr (XAxiCdma_Bd *BdPtr, UINTPTR PhysAddr)
 Sets the physical address of the BD. More...
 
void XAxiCdma_BdSetIsLite (XAxiCdma_Bd *BdPtr, int IsLite)
 Sets the lite mode field of the BD. More...
 
void XAxiCdma_BdSetHasDRE (XAxiCdma_Bd *BdPtr, int HasDRE)
 Sets the DRE field of the BD. More...
 
void XAxiCdma_BdSetWordLen (XAxiCdma_Bd *BdPtr, int WordLen)
 Sets the word length field of the BD. More...
 
void XAxiCdma_BdSetMaxLen (XAxiCdma_Bd *BdPtr, int MaxLen)
 Sets the maximum transfer length field of the BD. More...
 
LONG XAxiCdma_BdGetPhysAddr (XAxiCdma_Bd *BdPtr)
 Reads the physical address of the BD. More...
 
void XAxiCdma_DumpBd (XAxiCdma_Bd *BdPtr)
 Dumps the BD for debug purposes. More...
 
int XAxiCdma_BdRingStartTransfer (XAxiCdma *InstancePtr)
 Starts a queued SG transfer after a simple transfer completes. More...
 
void xil_printf (const char *format,...)
 Prints a formatted message when DEBUG is not defined. More...
 
int XAxiCdma_HybridIntrExample (XAxiCdma *InstancePtr, UINTPTR BaseAddress)
 Demonstrates hybrid interrupt transfers with the following transfers: a simple transfer a multiple BD scatter gather transfer another simple transfer. More...
 
int main (void)
 Runs the example entry point, sets up UART16550 if available, invokes the example function, and reports the execution status. More...
 
int XAxiCdma_HybridPollExample (UINTPTR BaseAddress)
 Demonstrates hybrid polled transfers with the following sequence: a simple polled transfer a scatter gather polled transfer with multiple BDs a simple polled transfer. More...
 
int XAxiCdma_SgIntrExample (XAxiCdma *InstancePtr, UINTPTR BaseAddress)
 Demonstrates scatter-gather transfer through interrupt. More...
 
int XAxiCdma_SgPollExample (XAxiCdma *InstancePtr, UINTPTR BaseAddress)
 Demonstrates scatter-gather transfer through polling. More...
 
int XAxiCdma_SimpleIntrExample (XAxiCdma *InstancePtr, UINTPTR BaseAddress)
 Demonstrates simple transfer through interrupt. More...
 
int XAxiCdma_SimplePollExample (XAxiCdma *InstancePtr, UINTPTR BaseAddress)
 Demonstrates simple transfer through polling. More...
 

Variables

XAxiCdma_Config XAxiCdma_ConfigTable []
 Configuration table for each CDMA instance in the system. More...
 
u32 * TransmitBufferPtr
 Pointer to transmit buffer. More...
 
u32 * ReceiveBufferPtr
 Pointer to receive buffer. More...
 

Coalesce and buffer descriptor constants

#define XAXICDMA_COALESCE_NO_CHANGE   0xFFFFFFFF
 Leaves coalesce unchanged. More...
 
#define XAXICDMA_ALL_BDS   0x7FFFFFFF
 Maximum BD count value. More...
 

Engine mode constants

#define XAXICDMA_SG_MODE   1
 Scatter gather mode. More...
 
#define XAXICDMA_SIMPLE_MODE   2
 Simple DMA mode. More...
 

KeyHole feature selection

#define XAXICDMA_KEYHOLE_READ   0
 KeyHole read direction. More...
 
#define XAXICDMA_KEYHOLE_WRITE   1
 KeyHole write direction. More...
 

Buffer descriptor cache maintenance macros

#define XAXICDMA_CACHE_FLUSH(BdPtr)   Xil_DCacheFlushRange((BdPtr), XAXICDMA_BD_HW_NUM_BYTES);
 Flushes the data cache for a buffer descriptor. More...
 
#define XAXICDMA_CACHE_INVALIDATE(BdPtr)   Xil_DCacheInvalidateRange((BdPtr), XAXICDMA_BD_HW_NUM_BYTES)
 Invalidates the data cache for a buffer descriptor. More...
 

Buffer Descriptor Alignment

#define XAXICDMA_BD_MINIMUM_ALIGNMENT   0x40
 Minimum byte alignment requirement for descriptors to satisfy both hardware/software needs. More...
 

Maximum transfer length

This is determined by hardware

#define XAXICDMA_MAX_TRANSFER_LEN   0x7FFFFF
 Max length hw supports. More...
 
#define XAXICDMA_4_1_MAX_TRANSFER_LEN   0x3FFFFFF
 Max length hw supports. More...
 

Register offset definitions

Register accesses are 32-bit.

#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...
 
#define XAXICDMA_BTT_OFFSET   0x00000028
 Bytes to transfer. More...
 

Bitmasks of XAXICDMA_CR_OFFSET register

#define XAXICDMA_CR_RESET_MASK   0x00000004
 Reset DMA engine. 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_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_SR_IDLE_MASK   0x00000002
 DMA channel idle. 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_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
 Shift for delay timeout counter. More...
 
#define XAXICDMA_COALESCE_SHIFT   16
 Shift for coalesce counter. More...
 
#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...
 

Macro Definition Documentation

#define AXICDMA_BASE_ADDR   XPAR_XAXICDMA_0_BASEADDR

Base address of the AXI CDMA device under test.

#define AXICDMA_BASE_ADDR   XPAR_XAXICDMA_0_BASEADDR

Base address of the AXI CDMA device under test.

#define AXICDMA_BASE_ADDR   XPAR_XAXICDMA_0_BASEADDR

Base address of the AXI CDMA device under test.

#define AXICDMA_BASE_ADDR   XPAR_XAXICDMA_0_BASEADDR

Base address of the AXI CDMA device under test.

#define AXICDMA_BASE_ADDR   XPAR_XAXICDMA_0_BASEADDR

Base address of the AXI CDMA device under test.

Referenced by main().

#define AXICDMA_BASE_ADDR   XPAR_XAXICDMA_0_BASEADDR

Base address of the AXI CDMA device under test.

#define BD_SPACE_SIZE   (64 * sizeof(XAxiCdma_Bd))

BD space size.

#define BD_SPACE_SIZE   (64 * sizeof(XAxiCdma_Bd))

BD space size.

#define BD_SPACE_SIZE   (64 * sizeof(XAxiCdma_Bd))

BD space size.

#define BD_SPACE_SIZE   (64 * sizeof(XAxiCdma_Bd))

Source and Destination buffer for DMA transfer.

BD space size

#define BUFFER_BYTESIZE   64

Length in bytes of the source and destination DMA buffers.

Referenced by XAxiCdma_SimplePollExample().

#define BUFFER_BYTESIZE   128

Length in bytes of the source and destination DMA buffers.

#define BUFFER_BYTESIZE   64

Length in bytes of the source and destination DMA buffers.

Referenced by XAxiCdma_SimpleIntrExample().

#define BUFFER_BYTESIZE   128

Length in bytes of the source and destination DMA buffers.

Referenced by XAxiCdma_HybridIntrExample().

#define COALESCING_COUNT   5

Interrupt coalescing count programmed into the DMA engine.

#define COALESCING_COUNT   5

Interrupt coalescing count programmed into the DMA engine.

#define DELAY_COUNT   5

Interrupt delay counter programmed into the DMA engine.

#define DELAY_COUNT   5

Interrupt delay counter programmed into the DMA engine.

#define MARK_UNCACHEABLE   0x701

Memory attribute used to mark buffers as uncacheable on AArch64.

Referenced by XAxiCdma_SgPollExample().

#define MARK_UNCACHEABLE   0x701

Memory attribute used to mark buffers as uncacheable on AArch64.

#define MARK_UNCACHEABLE   0x701

Memory attribute used to mark buffers as uncacheable on AArch64.

#define MARK_UNCACHEABLE   0x701

Memory attribute used to mark buffers as uncacheable on AArch64.

Referenced by XAxiCdma_SgIntrExample().

#define MAX_PKT_LEN   128

Maximum packet length in bytes for each buffer descriptor.

Referenced by XAxiCdma_SgPollExample().

#define MAX_PKT_LEN   1024

Maximum packet length in bytes for each buffer descriptor.

#define MAX_PKT_LEN   1024

Maximum packet length in bytes for each buffer descriptor.

#define MAX_PKT_LEN   1024

Maximum packet length in bytes for each buffer descriptor.

Referenced by XAxiCdma_SgIntrExample().

#define NUMBER_OF_BDS_TO_TRANSFER   1

Number of buffer descriptors to transfer in this test.

#define NUMBER_OF_BDS_TO_TRANSFER   30

Number of buffer descriptors to transfer in this test.

#define NUMBER_OF_BDS_TO_TRANSFER   30

Number of buffer descriptors to transfer in this test.

#define NUMBER_OF_BDS_TO_TRANSFER   30

Number of buffer descriptors to transfer in this test.

#define NUMBER_OF_EVENTS   1

Number of interrupt events expected to complete the test.

#define NUMBER_OF_EVENTS   1

Number of interrupt events expected to complete the test.

#define NUMBER_OF_EVENTS   1

Number of interrupt events expected to complete the test.

Referenced by XAxiCdma_SgIntrExample().

#define NUMBER_OF_TRANSFERS   4

Number of simple transfers to run in this test.

Referenced by XAxiCdma_SimplePollExample().

#define NUMBER_OF_TRANSFERS   4

Number of simple transfers to run in this test.

Referenced by XAxiCdma_SimpleIntrExample().

#define POLL_TIMEOUT_COUNTER   1000000U

Maximum poll iterations before a transfer times out.

#define POLL_TIMEOUT_COUNTER   1000000U

Maximum poll iterations before a transfer times out.

Referenced by XAxiCdma_SgPollExample().

#define POLL_TIMEOUT_COUNTER   1000000U

Maximum poll iterations before a transfer times out.

#define POLL_TIMEOUT_COUNTER   1000000U

Maximum poll iterations before a transfer times out.

#define POLL_TIMEOUT_COUNTER   1000000U

Maximum poll iterations before a transfer times out.

#define POLL_TIMEOUT_COUNTER   1000000U

Maximum poll iterations before a transfer times out.

Referenced by XAxiCdma_SgIntrExample().

#define RESET_LOOP_COUNT   10

Number of times to poll for reset completion.

#define RESET_LOOP_COUNT   10

Number of times to poll for reset completion.

Referenced by XAxiCdma_SgPollExample().

#define RESET_LOOP_COUNT   10

Number of times to poll for reset completion.

#define SG_BUFFER_SIZE   (MAX_PKT_LEN * NUMBER_OF_BDS_TO_TRANSFER)

SG buffer size.

#define SG_BUFFER_SIZE   (MAX_PKT_LEN * NUMBER_OF_BDS_TO_TRANSFER)

SG buffer size.

#define SG_BUFFER_SIZE   (MAX_PKT_LEN * NUMBER_OF_BDS_TO_TRANSFER)

SG buffer size.

#define SG_BUFFER_SIZE   (MAX_PKT_LEN * NUMBER_OF_BDS_TO_TRANSFER)

SG buffer size.

#define XAXICDMA_4_1_MAX_TRANSFER_LEN   0x3FFFFFF

Max length hw supports.

Referenced by XAxiCdma_CfgInitialize().

#define XAXICDMA_ALL_BDS   0x7FFFFFFF

Maximum BD count value.

#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
#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
#define XAxiCdma_BdGetAddrLength (   BdPtr)    XAxiCdma_BdRead(BdPtr, XAXICDMA_BD_ADDRLEN_OFFSET);

Reads the address length field of a BD.

Parameters
[in]BdPtrBD to operate on.
Returns
Address length stored in the BD.
Note
C-style signature: u32 XAxiCdma_BdGetAddrLength(XAxiCdma_Bd* BdPtr)

Referenced by XAxiCdma_BdGetDstBufAddr(), XAxiCdma_BdGetNextPtr(), XAxiCdma_BdGetPhysAddr(), XAxiCdma_BdGetSrcBufAddr(), XAxiCdma_BdSetDstBufAddr(), XAxiCdma_BdSetNextPtr(), XAxiCdma_BdSetPhysAddr(), and XAxiCdma_BdSetSrcBufAddr().

#define XAxiCdma_BdRead (   BdPtr,
  Offset 
)    (*(u32 *)((UINTPTR)((void *)(BdPtr)) + (u32)(Offset)))

Reads a word from a buffer descriptor.

Parameters
[in]BdPtrBD to operate on.
[in]OffsetByte offset of the word to read.
Returns
The 32-bit value at the specified offset.
Note
C-style signature: u32 XAxiCdma_BdRead(XAxiCdma_Bd* BdPtr, int Offset);

Referenced by XAxiCdma_BdGetDstBufAddr(), XAxiCdma_BdGetLength(), XAxiCdma_BdGetNextPtr(), XAxiCdma_BdGetPhysAddr(), XAxiCdma_BdGetSrcBufAddr(), XAxiCdma_BdGetSts(), XAxiCdma_BdRingGetCurrBd(), XAxiCdma_BdSetDstBufAddr(), XAxiCdma_BdSetLength(), XAxiCdma_BdSetSrcBufAddr(), and XAxiCdma_DumpBd().

#define XAxiCdma_BdSetAddrLen (   BdPtr,
  AddrLen 
)    XAxiCdma_BdWrite(BdPtr, XAXICDMA_BD_ADDRLEN_OFFSET, AddrLen);

Sets the address length field of a BD.

Parameters
[in]BdPtrBD to operate on.
[in]AddrLenAddress width of the CDMA.
Note
C-style signature: u32 XAxiCdma_BdSetAddrLen(XAxiCdma_Bd* BdPtr, int AddrLen)

Referenced by XAxiCdma_BdRingCreate().

#define XAxiCdma_BdWrite (   BdPtr,
  Offset,
  Value 
)    (*(u32 *)((UINTPTR)(void *)(BdPtr) + (u32)(Offset))) = (u32)(Value)

Writes a word to a buffer descriptor.

Parameters
[in]BdPtrBD to operate on.
[in]OffsetByte offset of the word to write.
[in]Value32-bit value to write.
Note
C-style signature: u32 XAxiCdma_BdWrite(XAxiCdma_Bd* BdPtr, int Offset, u32 Value )

Referenced by XAxiCdma_BdClearSts(), XAxiCdma_BdSetDstBufAddr(), XAxiCdma_BdSetHasDRE(), XAxiCdma_BdSetIsLite(), XAxiCdma_BdSetLength(), XAxiCdma_BdSetMaxLen(), XAxiCdma_BdSetNextPtr(), XAxiCdma_BdSetPhysAddr(), XAxiCdma_BdSetSrcBufAddr(), and XAxiCdma_BdSetWordLen().

#define XAXICDMA_BTT_OFFSET   0x00000028

Bytes to transfer.

Referenced by XAxiCdma_DumpRegisters(), and XAxiCdma_SimpleTransfer().

#define XAXICDMA_CACHE_FLUSH (   BdPtr)    Xil_DCacheFlushRange((BdPtr), XAXICDMA_BD_HW_NUM_BYTES);

Flushes the data cache for a buffer descriptor.

Parameters
[in]BdPtris the buffer descriptor address.

Referenced by XAxiCdma_BdRingCreate(), and XAxiCdma_BdRingToHw().

#define XAXICDMA_CACHE_INVALIDATE (   BdPtr)    Xil_DCacheInvalidateRange((BdPtr), XAXICDMA_BD_HW_NUM_BYTES)

Invalidates the data cache for a buffer descriptor.

Parameters
[in]BdPtris the buffer descriptor address.

Referenced by XAxiCdma_BdRingFromHw().

#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_COALESCE_NO_CHANGE   0xFFFFFFFF

Leaves coalesce unchanged.

Referenced by XAxiCdma_SetCoalesce().

#define XAXICDMA_COALESCE_SHIFT   16

Shift for coalesce counter.

Referenced by XAxiCdma_GetCoalesce(), and XAxiCdma_SetCoalesce().

#define XAXICDMA_CR_KHOLE_RD_MASK   0x00000010

Keyhole Read.

Referenced by XAxiCdma_SelectKeyHole().

#define XAXICDMA_CR_KHOLE_WR_MASK   0x00000020

Keyhole Write.

Referenced by XAxiCdma_SelectKeyHole().

#define XAXICDMA_CR_RESET_MASK   0x00000004

Reset DMA engine.

Referenced by XAxiCdma_Reset(), and XAxiCdma_ResetIsDone().

#define XAXICDMA_CR_SGMODE_MASK   0x00000008

Scatter gather mode.

Referenced by XAxiCdma_IsSimpleMode(), and XAxiCdma_SwitchMode().

#define XAXICDMA_DELAY_MAX   0xFF

Maximum delay counter value.

Referenced by XAxiCdma_SetCoalesce().

#define XAXICDMA_DELAY_SHIFT   24

Shift for delay timeout counter.

Referenced by XAxiCdma_GetCoalesce(), and XAxiCdma_SetCoalesce().

#define XAXICDMA_DESC_LSB_MASK   (0xFFFFFFC0U)
#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_In32   Xil_In32

Reads a 32-bit value from a memory-mapped register.

#define XAXICDMA_KEYHOLE_READ   0

KeyHole read direction.

#define XAXICDMA_KEYHOLE_WRITE   1

KeyHole write direction.

Referenced by XAxiCdma_SelectKeyHole().

#define XAXICDMA_MAX_TRANSFER_LEN   0x7FFFFF

Max length hw supports.

Referenced by XAxiCdma_CfgInitialize().

#define XAXICDMA_MAXIMUM_MAX_HANDLER   20

Maximum active SG interrupt handlers this driver manages.

Referenced by XAxiCdma_BdRingToHw(), and XAxiCdma_IntrHandler().

#define XAxiCdma_Out32   Xil_Out32

Writes a 32-bit value to a memory-mapped register.

#define XAxiCdma_ReadReg (   BaseAddress,
  RegOffset 
)    XAxiCdma_In32((BaseAddress) + (u32)(RegOffset))

Reads a device register.

Parameters
[in]BaseAddressis the base virtual address of the device
[in]RegOffsetis the register offset to be read
Returns
The 32-bit value of the register
Note
C-style signature: u32 XAxiCdma_ReadReg(u32 BaseAddress, u32 RegOffset)

Referenced by XAxiCdma_CfgInitialize(), XAxiCdma_DumpRegisters(), XAxiCdma_GetCoalesce(), XAxiCdma_GetError(), XAxiCdma_IntrDisable(), XAxiCdma_IntrEnable(), XAxiCdma_IntrGetEnabled(), XAxiCdma_IntrHandler(), XAxiCdma_IsBusy(), XAxiCdma_IsSimpleMode(), XAxiCdma_ResetIsDone(), XAxiCdma_SelectKeyHole(), XAxiCdma_SetCoalesce(), and XAxiCdma_SwitchMode().

#define XAXICDMA_RESET_LOOP_LIMIT   5

Maximum number of reset completion polls.

Referenced by XAxiCdma_CfgInitialize(), and XAxiCdma_IntrHandler().

#define XAXICDMA_RING_SEEKAHEAD (   InstancePtr,
  BdPtr,
  NumBd 
)
Value:
{ \
UINTPTR Addr = (UINTPTR)(void *)(BdPtr); \
\
Addr += ((InstancePtr)->BdSeparation * (NumBd)); \
if (Addr > (InstancePtr)->LastBdAddr) { \
Addr -= (InstancePtr)->BdRingTotalLen; \
} \
\
(BdPtr) = (XAxiCdma_Bd *)(void *)Addr; \
}
UINTPTR XAxiCdma_Bd[XAXICDMA_BD_NUM_WORDS]
Buffer descriptor shared by hardware and software.
Definition: xaxicdma_bd.h:49

Moves the BD pointer ahead by an arbitrary number of BDs.

Wraps around to the beginning of the ring when needed. A wraparound occurs when the new BD pointer is greater than the high address in the ring.

Parameters
[in]InstancePtris the driver instance that owns the ring.
[in,out]BdPtris the starting BD pointer on input and the final BD pointer on output.
[in]NumBdis the number of BD spaces to advance.
Note
Updates BdPtr when NumBd is not zero.

Referenced by XAxiCdma_BdRingAlloc(), XAxiCdma_BdRingFree(), XAxiCdma_BdRingFromHw(), XAxiCdma_BdRingToHw(), and XAxiCdma_BdRingUnAlloc().

#define XAXICDMA_RING_SEEKBACK (   InstancePtr,
  BdPtr,
  NumBd 
)
Value:
{ \
UINTPTR Addr = (UINTPTR)(void *)(BdPtr); \
\
Addr -= ((InstancePtr)->BdSeparation * (NumBd)); \
if (Addr < (InstancePtr)->FirstBdAddr) { \
Addr += (InstancePtr)->BdRingTotalLen; \
} \
\
(BdPtr) = (XAxiCdma_Bd*)(void *)Addr; \
}
UINTPTR XAxiCdma_Bd[XAXICDMA_BD_NUM_WORDS]
Buffer descriptor shared by hardware and software.
Definition: xaxicdma_bd.h:49

Moves the BD pointer backwards by an arbitrary number of BDs.

Wraps around to the end of the ring when needed. A wraparound occurs when the new BD pointer is less than the base address in the ring.

Parameters
[in]InstancePtris the driver instance that owns the ring.
[in,out]BdPtris the starting BD pointer on input and the final BD pointer on output.
[in]NumBdis the number of BD spaces to move backward.
Note
Updates BdPtr when NumBd is not zero.

Referenced by XAxiCdma_BdRingUnAlloc().

#define XAXICDMA_SG_MODE   1
#define XAXICDMA_SIMPLE_MODE   2

Simple DMA mode.

Referenced by XAxiCdma_SimpleTransfer(), and XAxiCdma_SwitchMode().

#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_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_OFFSET   0x00000004
#define XAXICDMA_SR_SGINCLD_MASK   0x00000008

Hybrid build.

Referenced by XAxiCdma_CfgInitialize().

#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))

Writes a device register.

Parameters
[in]BaseAddressis the base virtual address of the device
[in]RegOffsetis the register offset to be written
[in]Datais the 32-bit value to write to the register
Note
C-style signature: void XAxiCdma_WriteReg(u32 BaseAddress, u32 RegOffset, u32 Data)

Referenced by XAxiCdma_BdSetCurBdPtr(), XAxiCdma_BdSetTailBdPtr(), XAxiCdma_IntrDisable(), XAxiCdma_IntrEnable(), XAxiCdma_IntrHandler(), XAxiCdma_Reset(), XAxiCdma_SelectKeyHole(), XAxiCdma_SetCoalesce(), XAxiCdma_SimpleTransfer(), and XAxiCdma_SwitchMode().

#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_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 Documentation

typedef UINTPTR XAxiCdma_Bd[XAXICDMA_BD_NUM_WORDS]

Buffer descriptor shared by hardware and software.

The user never directly accesses BD fields. The layout contains next descriptor pointers, source and destination addresses, length, status, and configuration metadata.

typedef void(* XAxiCdma_CallBackFn)(void *CallBackRef, u32 IrqMask, int *NumBdPtr)

Defines the callback function type for transfer completion notification.

Register the callback through transfer submission when interrupts are enabled.

Parameters
[in]CallBackRefCallback reference passed in by the application.
[in]IrqMaskInterrupt mask for this completion.
[out]NumBdPtrPointer to the number of BDs this handler handles.

Function Documentation

int main ( void  )

Runs the example entry point, sets up UART16550 if available, invokes the example function, and reports the execution status.

Runs the example entry point, invokes the example function, and reports the execution status.

Returns
  • XST_SUCCESS if example finishes successfully
  • XST_FAILURE if example fails.

< Pointer to the transmit (source) buffer.

< Pointer to the receive (destination) buffer.

< Pointer to the transmit (source) buffer.

< Pointer to the receive (destination) buffer.

< Pointer to the transmit (source) buffer.

< Pointer to the receive (destination) buffer.

References AXICDMA_BASE_ADDR, XAxiCdma_HybridIntrExample(), and xil_printf().

void XAxiCdma_BdClear ( XAxiCdma_Bd *  BdPtr)

Clears the content of the BD.

Parameters
[in]BdPtris the pointer to the BD to be cleared

References XAXICDMA_BD_START_CLEAR, and XAXICDMA_BD_TO_CLEAR.

void XAxiCdma_BdClearSts ( XAxiCdma_Bd *  BdPtr)

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.

Parameters
[in]BdPtris the pointer to the BD to clear the status

References XAXICDMA_BD_STS_OFFSET, and XAxiCdma_BdWrite.

Referenced by XAxiCdma_BdRingClone(), and XAxiCdma_BdRingToHw().

void XAxiCdma_BdClone ( XAxiCdma_Bd *  BdPtr,
XAxiCdma_Bd *  TmpBd 
)

Clones the content from the template BD.

Parameters
[in]BdPtris the pointer to the BD to be cloned to
[in]TmpBdis 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)

Reads the destination address of the BD.

Parameters
[in]BdPtris the pointer to the BD to get the destination address
Returns
The destination address of the buffer that this BD describes

References XAXICDMA_BD_BUFDST_MSB_OFFSET, XAXICDMA_BD_BUFDST_OFFSET, XAxiCdma_BdGetAddrLength, and XAxiCdma_BdRead.

Referenced by XAxiCdma_DumpBd().

u32 XAxiCdma_BdGetLength ( XAxiCdma_Bd *  BdPtr)

Reads the length of the BD.

Parameters
[in]BdPtris the pointer to the BD to get the length
Returns
The length of the buffer that this BD describes

References XAXICDMA_BD_CTRL_LEN_OFFSET, and XAxiCdma_BdRead.

Referenced by XAxiCdma_BdRingToHw(), and XAxiCdma_DumpBd().

LONG XAxiCdma_BdGetNextPtr ( XAxiCdma_Bd *  BdPtr)

Reads the next BD pointer from the BD.

Parameters
[in]BdPtris the pointer to the BD to read the next BD pointer.
Returns
The next BD pointer of the BD.

References XAXICDMA_BD_NDESC_MSB_OFFSET, XAXICDMA_BD_NDESC_OFFSET, XAxiCdma_BdGetAddrLength, and XAxiCdma_BdRead.

Referenced by XAxiCdma_DumpBd().

LONG XAxiCdma_BdGetPhysAddr ( XAxiCdma_Bd *  BdPtr)

Reads the physical address of the BD.

Parameters
[in]BdPtris the pointer to the BD to get the physical address
Returns
The physical address of the BD

References XAXICDMA_BD_PHYS_ADDR_MSB_OFFSET, XAXICDMA_BD_PHYS_ADDR_OFFSET, XAxiCdma_BdGetAddrLength, and XAxiCdma_BdRead.

Referenced by XAxiCdma_BdRingSnapShotCurrBd(), XAxiCdma_BdRingStartTransfer(), XAxiCdma_BdRingToHw(), XAxiCdma_DumpBd(), and XAxiCdma_SwitchMode().

LONG XAxiCdma_BdGetSrcBufAddr ( XAxiCdma_Bd *  BdPtr)

Reads the source address of the BD.

Parameters
[in]BdPtris the pointer to the BD to get the source address
Returns
The source address of the buffer that this BD describes

References XAXICDMA_BD_BUFSRC_MSB_OFFSET, XAXICDMA_BD_BUFSRC_OFFSET, XAxiCdma_BdGetAddrLength, and XAxiCdma_BdRead.

Referenced by XAxiCdma_DumpBd().

u32 XAxiCdma_BdGetSts ( XAxiCdma_Bd *  BdPtr)

Reads the completion status of the BD.

Parameters
[in]BdPtris the pointer to the BD to get the status
Returns
The status bits of the BD.

References XAXICDMA_BD_STS_ALL_MASK, XAXICDMA_BD_STS_OFFSET, and XAxiCdma_BdRead.

Referenced by XAxiCdma_BdRingFromHw(), and XAxiCdma_DumpBd().

LONG XAxiCdma_BdRingAlloc ( XAxiCdma *  InstancePtr,
int  NumBd,
XAxiCdma_Bd **  BdSetPtr 
)

Allocates BDs from the BD ring.

Parameters
[in]InstancePtris the driver instance we are working on
[in]NumBdis the number of BDs to request
[out]BdSetPtris the pointer to the set of BDs returned
Returns
  • XST_SUCCESS for success
  • XST_INVALID_PARAM if requests non-positive number of BDs
  • XST_FAILURE if not enough free BDs available

References XAxiCdma::FreeBdCnt, XAxiCdma::FreeBdHead, XAxiCdma::PreBdCnt, and XAXICDMA_RING_SEEKAHEAD.

LONG XAxiCdma_BdRingClone ( XAxiCdma *  InstancePtr,
XAxiCdma_Bd *  TemplateBdPtr 
)

Clones all BDs in the ring from a template BD.

BD.

Parameters
[in]InstancePtris the driver instance we are working on
[in]TemplateBdPtris the BD to be copied from
Returns
  • XST_SUCCESS for success
  • XST_DMA_SG_NO_LIST if there is no BD ring
  • XST_DEVICE_IS_STARTED if the hardware is running
  • XST_DMA_SG_LIST_ERROR is the BD ring is still in use

References XAxiCdma::AllBdCnt, XAxiCdma::BdSeparation, XAxiCdma::FirstBdAddr, XAxiCdma::FreeBdCnt, XAxiCdma_BdClearSts(), XAxiCdma_BdClone(), and XAxiCdma_IsBusy().

u32 XAxiCdma_BdRingCntCalc ( u32  Alignment,
u32  Bytes,
UINTPTR  BdBuffAddr 
)

Calculates how many BDs fit in the given memory size and alignment.

Parameters
[in]Alignmentis the preferred alignment for the BDs
[in]Bytesis the number of bytes of memory to build BDs with
[in]BdBuffAddris the buffer address allocated for the BDs. This is to check the alignment of the buffer to make sure the buffer is aligned to the BD alignment. An invalid buffer address results in 0.
Returns
The number of BDs can be built. 0 means buffer address is not valid.
Note
The application is responsible to align the buffer before pass it to this function.
LONG XAxiCdma_BdRingCreate ( XAxiCdma *  InstancePtr,
UINTPTR  PhysAddr,
UINTPTR  VirtAddr,
u32  Alignment,
int  BdCount 
)

Creates the BD ring for the driver instance.

pre-exist of this ring, the previous ring is lost.

Parameters
[in]InstancePtris the driver instance we are working on
[in]PhysAddris the physical address of the memory for the BD ring
[in]VirtAddris the virtual address of the memory for the BD ring
[in]Alignmentis the alignment for the BDs
[in]BdCountis the number of BDs to create in the ring
Returns
  • XST_SUCCESS for success
  • XST_INVALID_PARAM for invalid parameter
  • XST_DMA_SG_LIST_ERROR for invalid memory region
  • XST_FAILURE if the hardware build is simple mode only
Note
For a system that has flat memory layout, then the PhysAddr and the VirtAddr are the same.

References XAxiCdma::AddrWidth, XAxiCdma::AllBdCnt, XAxiCdma::BdaRestart, XAxiCdma::BdRingTotalLen, XAxiCdma::BdSeparation, XAxiCdma::FirstBdAddr, XAxiCdma::FirstBdPhysAddr, XAxiCdma::FreeBdCnt, XAxiCdma::FreeBdHead, XAxiCdma::HasDRE, XAxiCdma::HwBdCnt, XAxiCdma::HwBdHead, XAxiCdma::HwBdTail, XAxiCdma::IsLite, XAxiCdma::LastBdAddr, XAxiCdma::MaxTransLen, XAxiCdma::PostBdCnt, XAxiCdma::PostBdHead, XAxiCdma::PreBdCnt, XAxiCdma::PreBdHead, XAxiCdma::SimpleOnlyBuild, XAxiCdma::WordLength, XAXICDMA_BD_MINIMUM_ALIGNMENT, XAxiCdma_BdSetAddrLen, XAxiCdma_BdSetHasDRE(), XAxiCdma_BdSetIsLite(), XAxiCdma_BdSetMaxLen(), XAxiCdma_BdSetNextPtr(), XAxiCdma_BdSetPhysAddr(), XAxiCdma_BdSetWordLen(), and XAXICDMA_CACHE_FLUSH.

u32 XAxiCdma_BdRingFree ( XAxiCdma *  InstancePtr,
int  NumBd,
XAxiCdma_Bd *  BdSetPtr 
)

Returns the BDs back to the free pool of the BD ring.

Parameters
[in]InstancePtris the driver instance we are working on
[in]NumBdis the number of BDs to free
[out]BdSetPtris the set of BDs to be freed
Returns
  • XST_SUCCESS for success
  • XST_INVALID_PARAM if number of BDs is negative
  • XST_DMA_SG_LIST_ERROR if the BD ring management has a problem

References XAxiCdma::FreeBdCnt, XAxiCdma::PostBdCnt, XAxiCdma::PostBdHead, and XAXICDMA_RING_SEEKAHEAD.

u32 XAxiCdma_BdRingFromHw ( XAxiCdma *  InstancePtr,
int  BdLimit,
XAxiCdma_Bd **  BdSetPtr 
)

Retrieves completed BDs from the hardware.

Parameters
[in]InstancePtris the driver instance we are working on
[out]BdLimitis the maximum number of completed BDs to retrieve
[out]BdSetPtris the set of completed BDs
Returns
The number of completed BDs.

References XAxiCdma::HwBdCnt, XAxiCdma::HwBdHead, XAxiCdma::HwBdTail, XAxiCdma::PostBdCnt, XAXICDMA_BD_STS_COMPLETE_MASK, XAxiCdma_BdGetSts(), XAxiCdma_BdRingNext(), XAXICDMA_CACHE_INVALIDATE, and XAXICDMA_RING_SEEKAHEAD.

u32 XAxiCdma_BdRingGetCnt ( XAxiCdma *  InstancePtr)

Reads the total number of BDs in the BD ring.

Parameters
[in]InstancePtris the driver instance we are working on
Returns
The total number of BDs for this instance

References XAxiCdma::AllBdCnt.

XAxiCdma_Bd * XAxiCdma_BdRingGetCurrBd ( XAxiCdma *  InstancePtr)

Reads the current BD pointer from the hardware.

The hardware CDESC register contains a physical address. This routine translates that address to the virtual address used by BD ring APIs.

Parameters
[in]InstancePtris the driver instance we are working on
Returns
The virtual address of the BD pointed to by CDESC

References XAxiCdma::AddrWidth, XAxiCdma::BaseAddr, XAxiCdma_BdRead, XAXICDMA_CDESC_MSB_OFFSET, and XAXICDMA_CDESC_OFFSET.

Referenced by XAxiCdma_BdRingSnapShotCurrBd(), and XAxiCdma_SwitchMode().

u32 XAxiCdma_BdRingGetFreeCnt ( XAxiCdma *  InstancePtr)

Reads the number of free BDs.

Parameters
[in]InstancePtris the driver instance we are working on
Returns
The total number of free BDs for this instance

References XAxiCdma::FreeBdCnt.

u32 XAxiCdma_BdRingMemCalc ( u32  Alignment,
int  NumBd 
)

Calculates memory required for the requested number of BDs.

Parameters
[in]Alignmentis the preferred alignment for the BDs
[in]NumBdis the number of BDs to be built
Returns
The number of bytes of memory needed to build the BDs
XAxiCdma_Bd * XAxiCdma_BdRingNext ( XAxiCdma *  InstancePtr,
XAxiCdma_Bd *  BdPtr 
)

Reads the next BD on the BD ring.

Parameters
[in]InstancePtris the driver instance we are working on
[in]BdPtris the current BD
Returns
The next BD on the ring from the current BD, NULL if passed in BdPtr not valid.

References XAxiCdma::BdSeparation, XAxiCdma::FirstBdAddr, XAxiCdma::LastBdAddr, and XAXICDMA_BD_MINIMUM_ALIGNMENT.

Referenced by XAxiCdma_BdRingFromHw(), XAxiCdma_BdRingSnapShotCurrBd(), XAxiCdma_BdRingToHw(), and XAxiCdma_SwitchMode().

XAxiCdma_Bd * XAxiCdma_BdRingPrev ( XAxiCdma *  InstancePtr,
XAxiCdma_Bd *  BdPtr 
)

Reads the previous BD on the BD ring.

Parameters
[in]InstancePtris the driver instance we are working on
[in]BdPtris the current BD
Returns
The previous BD on the ring from the current BD

References XAxiCdma::BdSeparation, XAxiCdma::FirstBdAddr, XAxiCdma::LastBdAddr, and XAXICDMA_BD_MINIMUM_ALIGNMENT.

Referenced by XAxiCdma_BdRingToHw().

void XAxiCdma_BdRingSnapShotCurrBd ( XAxiCdma *  InstancePtr)

Reads and saves 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. The restart pointer is saved as a physical address for programming CDESC.

Parameters
[in]InstancePtris the driver instance we are working on

References XAxiCdma::BdaRestart, XAxiCdma_BdGetPhysAddr(), XAxiCdma_BdRingGetCurrBd(), and XAxiCdma_BdRingNext().

int XAxiCdma_BdRingStartTransfer ( XAxiCdma *  InstancePtr)

Starts a queued SG transfer after a simple transfer completes.

Parameters
[in]InstancePtris the driver instance we are working on
Returns
  • XST_SUCCESS if BD ring has been successfully started, SGWaiting will be 0
  • XST_FAILURE if BD ring cannot be be started, either because the hardware is simple only build or cannot switch to SG mode.

References XAxiCdma::HwBdCnt, XAxiCdma::HwBdTail, XAxiCdma::SGWaiting, XAxiCdma::SimpleNotDone, XAxiCdma::SimpleOnlyBuild, XAxiCdma_BdGetPhysAddr(), XAxiCdma_BdSetTailBdPtr(), XAxiCdma_IsSimpleMode(), XAXICDMA_SG_MODE, and XAxiCdma_SwitchMode().

Referenced by XAxiCdma_IntrHandler().

LONG XAxiCdma_BdRingToHw ( XAxiCdma *  InstancePtr,
int  NumBd,
XAxiCdma_Bd *  BdSetPtr,
XAxiCdma_CallBackFn  CallBackFn,
void *  CallBackRef 
)

Enqueues prepared BDs to the hardware.

Parameters
[in]InstancePtris the driver instance we are working on
[in]NumBdis the number of BDs to enqueue
[out]BdSetPtris the set of BDs to be enqueued
[in]CallBackFnis the callback function for this transfer, NULL is fine
[in]CallBackRefis the callback reference pointer
Returns
  • XST_SUCCESS for success
  • XST_INVALID_PARAM if enqueues negative number of BDs or zero transfer len
  • XST_DMA_SG_LIST_ERROR if BD ring management has a problem
  • XST_FIFO_NO_ROOM if the interrupt handler array is full
  • XST_FAILURE for: Hardware is in invalid state, for example, reset failed Or, the hardware build is simple mode only

References XAxiCdma_IntrHandlerList::CallBackFn, XAxiCdma_IntrHandlerList::CallBackRef, XAxiCdma::Handlers, XAxiCdma::HwBdCnt, XAxiCdma::HwBdTail, XAxiCdma::Initialized, XAxiCdma_IntrHandlerList::NumBds, XAxiCdma::PreBdCnt, XAxiCdma::PreBdHead, XAxiCdma::SgHandlerHead, XAxiCdma::SgHandlerTail, XAxiCdma::SGWaiting, XAxiCdma::SimpleNotDone, XAxiCdma::SimpleOnlyBuild, XAxiCdma_BdClearSts(), XAxiCdma_BdGetLength(), XAxiCdma_BdGetPhysAddr(), XAxiCdma_BdRingNext(), XAxiCdma_BdRingPrev(), XAxiCdma_BdSetTailBdPtr(), XAXICDMA_CACHE_FLUSH, XAxiCdma_IsSimpleMode(), XAXICDMA_MAXIMUM_MAX_HANDLER, XAXICDMA_RING_SEEKAHEAD, XAXICDMA_SG_MODE, and XAxiCdma_SwitchMode().

LONG XAxiCdma_BdRingUnAlloc ( XAxiCdma *  InstancePtr,
int  NumBd,
XAxiCdma_Bd *  BdSetPtr 
)

Returns BDs to the free pool in the ring.

Parameters
[in]InstancePtris the driver instance we are working on
[in]NumBdis the number of BDs to return
[out]BdSetPtris the set of BDs to be returned
Returns
  • XST_SUCCESS for success
  • XST_INVALID_PARAM if to free non-positive number of BDs
  • XST_FAILURE if BD ring management shows an error

References XAxiCdma::FreeBdCnt, XAxiCdma::FreeBdHead, XAxiCdma::PreBdCnt, XAXICDMA_RING_SEEKAHEAD, and XAXICDMA_RING_SEEKBACK.

void XAxiCdma_BdSetCurBdPtr ( XAxiCdma *  InstancePtr,
UINTPTR  CurBdPtr 
)

Sets the current BD pointer in the hardware.

Parameters
[in]InstancePtris a pointer to the driver instance.
[in]CurBdPtris the current BD pointer value.

References XAxiCdma::AddrWidth, XAxiCdma::BaseAddr, XAXICDMA_CDESC_MSB_OFFSET, XAXICDMA_CDESC_OFFSET, XAXICDMA_DESC_LSB_MASK, and XAxiCdma_WriteReg.

Referenced by XAxiCdma_SwitchMode().

u32 XAxiCdma_BdSetDstBufAddr ( XAxiCdma_Bd *  BdPtr,
UINTPTR  Addr 
)

Sets the destination address of the BD.

Parameters
[in]BdPtris the pointer to the BD to set the destination address
[in]Addris the destination address of the buffer
Returns
  • XST_SUCCESS if buffer address set successfully
  • XST_INVALID_PARAM if buffer address is not aligned and hardware build has no DRE or in lite mode

References XAXICDMA_BD_BUFDST_MSB_OFFSET, XAXICDMA_BD_BUFDST_OFFSET, XAXICDMA_BD_HASDRE_OFFSET, XAXICDMA_BD_WORDLEN_OFFSET, XAxiCdma_BdGetAddrLength, XAxiCdma_BdRead, and XAxiCdma_BdWrite.

void XAxiCdma_BdSetHasDRE ( XAxiCdma_Bd *  BdPtr,
int  HasDRE 
)

Sets the DRE field of the BD.

Parameters
[in]BdPtris the pointer to the BD to work on
[in]HasDREis the value for whether hardware has DRE built in

References XAXICDMA_BD_HASDRE_OFFSET, and XAxiCdma_BdWrite.

Referenced by XAxiCdma_BdRingCreate().

void XAxiCdma_BdSetIsLite ( XAxiCdma_Bd *  BdPtr,
int  IsLite 
)

Sets the lite mode field of the BD.

Parameters
[in]BdPtris the pointer to the BD to work on
[in]IsLiteis the value for whether hardware is in lite mode

References XAXICDMA_BD_ISLITE_OFFSET, and XAxiCdma_BdWrite.

Referenced by XAxiCdma_BdRingCreate().

u32 XAxiCdma_BdSetLength ( XAxiCdma_Bd *  BdPtr,
int  LenBytes 
)

Sets the length of the BD.

Parameters
[in]BdPtris the pointer to the BD to set the length
[in]LenBytesis the length of the buffer
Returns
  • XST_SUCCESS for success
  • XST_INVALID_PARAM if invalid length: Length value out of valid range
Note
One case that will cause hardware failure is not covered here: If the start address is not at page offset 0, and the length plus the offset crosses the page boundary, this will cause slave error if the hardware is built in lite mode.

References XAXICDMA_BD_CTRL_LEN_OFFSET, XAXICDMA_BD_MAX_LEN_OFFSET, XAxiCdma_BdRead, and XAxiCdma_BdWrite.

void XAxiCdma_BdSetMaxLen ( XAxiCdma_Bd *  BdPtr,
int  MaxLen 
)

Sets the maximum transfer length field of the BD.

Parameters
[in]BdPtris the pointer to the BD to work on
[in]MaxLenis the maximum transfer length in bytes

References XAXICDMA_BD_MAX_LEN_OFFSET, and XAxiCdma_BdWrite.

Referenced by XAxiCdma_BdRingCreate().

void XAxiCdma_BdSetNextPtr ( XAxiCdma_Bd *  BdPtr,
UINTPTR  NextBdPtr 
)

Sets the next BD pointer in the BD.

Parameters
[in]BdPtris the pointer to the BD to set the next BD pointer.
[in]NextBdPtris the next BD pointer value.

References XAXICDMA_BD_NDESC_MSB_OFFSET, XAXICDMA_BD_NDESC_OFFSET, XAxiCdma_BdGetAddrLength, XAxiCdma_BdWrite, and XAXICDMA_DESC_LSB_MASK.

Referenced by XAxiCdma_BdRingCreate().

void XAxiCdma_BdSetPhysAddr ( XAxiCdma_Bd *  BdPtr,
UINTPTR  PhysAddr 
)

Sets the physical address of the BD.

Parameters
[in]BdPtris the pointer to the BD to set the physical address
[in]PhysAddris the physical address of the BD

References XAXICDMA_BD_PHYS_ADDR_MSB_OFFSET, XAXICDMA_BD_PHYS_ADDR_OFFSET, XAxiCdma_BdGetAddrLength, and XAxiCdma_BdWrite.

Referenced by XAxiCdma_BdRingCreate().

u32 XAxiCdma_BdSetSrcBufAddr ( XAxiCdma_Bd *  BdPtr,
UINTPTR  Addr 
)

Sets the source address of the BD.

Parameters
[in]BdPtris the pointer to the BD to set the source address
[in]Addris the source address of the buffer
Returns
  • XST_SUCCESS if buffer address set successfully
  • XST_INVALID_PARAM if buffer address is not aligned and hardware build has no DRE or in lite mode

References XAXICDMA_BD_BUFSRC_MSB_OFFSET, XAXICDMA_BD_BUFSRC_OFFSET, XAXICDMA_BD_HASDRE_OFFSET, XAXICDMA_BD_WORDLEN_OFFSET, XAxiCdma_BdGetAddrLength, XAxiCdma_BdRead, and XAxiCdma_BdWrite.

void XAxiCdma_BdSetTailBdPtr ( XAxiCdma *  InstancePtr,
UINTPTR  TailBdPtr 
)

Sets the tail BD pointer in the hardware.

Parameters
[in]InstancePtris a pointer to the driver instance.
[in]TailBdPtris the tail BD pointer value.

References XAxiCdma::AddrWidth, XAxiCdma::BaseAddr, XAXICDMA_DESC_LSB_MASK, XAXICDMA_TDESC_MSB_OFFSET, XAXICDMA_TDESC_OFFSET, and XAxiCdma_WriteReg.

Referenced by XAxiCdma_BdRingStartTransfer(), and XAxiCdma_BdRingToHw().

void XAxiCdma_BdSetWordLen ( XAxiCdma_Bd *  BdPtr,
int  WordLen 
)

Sets the word length field of the BD.

Parameters
[in]BdPtris the pointer to the BD to work on
[in]WordLenis the length of word in bytes

References XAXICDMA_BD_WORDLEN_OFFSET, and XAxiCdma_BdWrite.

Referenced by XAxiCdma_BdRingCreate().

u32 XAxiCdma_CfgInitialize ( XAxiCdma *  InstancePtr,
XAxiCdma_Config *  CfgPtr,
UINTPTR  EffectiveAddr 
)

Initializes the driver.

Call this function before any other driver function calls. It sets up the driver according to the hardware build and resets the hardware at the end.

Parameters
[in]InstancePtris the driver instance that is working on
[in]CfgPtris the pointer to the hardware configuration structure
[in]EffectiveAddris the virtual address of the hardware instance. If address translation is not in use, please use the physical address
Returns
  • XST_SUCCESS for success
  • XST_INVALID_PARAM if word length is less than 4
  • XST_FAILURE for reset failure

References XAxiCdma_Config::AddrWidth, XAxiCdma::AddrWidth, XAxiCdma::AllBdCnt, XAxiCdma::BaseAddr, XAxiCdma_Config::BurstLen, XAxiCdma::BurstLen, XAxiCdma_Config::DataWidth, XAxiCdma::FreeBdCnt, XAxiCdma_Config::HasDRE, XAxiCdma::HasDRE, XAxiCdma::HwBdCnt, XAxiCdma::Initialized, XAxiCdma_Config::IsLite, XAxiCdma::IsLite, XAxiCdma::MaxTransLen, XAxiCdma_Config::Name, XAxiCdma::PostBdCnt, XAxiCdma::PreBdCnt, XAxiCdma::SimpleOnlyBuild, XAxiCdma::WordLength, XAXICDMA_4_1_MAX_TRANSFER_LEN, XAXICDMA_MAX_TRANSFER_LEN, XAxiCdma_ReadReg, XAxiCdma_Reset(), XAXICDMA_RESET_LOOP_LIMIT, 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_DumpRegisters ( XAxiCdma *  InstancePtr)
void XAxiCdma_GetCoalesce ( XAxiCdma *  InstancePtr,
u32 *  CounterPtr,
u32 *  DelayPtr 
)

Reads the interrupt coalescing threshold and delay counter settings.

Parameters
[in]InstancePtris the driver instance we are working on
[out]CounterPtris the return value for the coalescing counter setting
[out]DelayPtris the return value for the delay counter setting
Note
A zero coalescing threshold indicates invalid results

References XAxiCdma::BaseAddr, XAxiCdma::Initialized, XAXICDMA_COALESCE_SHIFT, XAXICDMA_CR_OFFSET, XAXICDMA_DELAY_SHIFT, XAxiCdma_ReadReg, XAXICDMA_XR_COALESCE_MASK, and XAXICDMA_XR_DELAY_MASK.

u32 XAxiCdma_GetError ( XAxiCdma *  InstancePtr)

Reads error status bits from the hardware.

Parameters
[in]InstancePtris the driver instance we are working on
Returns
The error bits in the status register. Zero indicates no errors.

References XAxiCdma::BaseAddr, XAxiCdma_ReadReg, XAXICDMA_SR_ERR_ALL_MASK, and XAXICDMA_SR_OFFSET.

Referenced by XAxiCdma_SgIntrExample().

int XAxiCdma_HybridIntrExample ( XAxiCdma *  InstancePtr,
UINTPTR  BaseAddress 
)

Demonstrates hybrid interrupt transfers with the following transfers: a simple transfer a multiple BD scatter gather transfer another simple transfer.

Parameters
[in]InstancePtris a pointer to the XAxiCdma instance
[in]BaseAddresscontains the base address of the device
Returns
  • XST_SUCCESS if example finishes successfully
  • XST_FAILURE if error occurs
Note
If the hardware build has problems with interrupt, then this function hangs

References XAxiCdma_Config::BaseAddress, BUFFER_BYTESIZE, XAxiCdma_Config::IntrId, XAxiCdma_Config::IntrParent, XAxiCdma_CfgInitialize(), XAxiCdma_IntrEnable(), XAxiCdma_LookupConfig(), XAXICDMA_XR_IRQ_ALL_MASK, and xil_printf().

Referenced by main().

int XAxiCdma_HybridPollExample ( UINTPTR  BaseAddress)

Demonstrates hybrid polled transfers with the following sequence: a simple polled transfer a scatter gather polled transfer with multiple BDs a simple polled transfer.

Parameters
[in]BaseAddresscontains the base address of the device
Returns
  • XST_SUCCESS if example finishes successfully
  • XST_FAILURE if error occurs
Note
If the hardware build has problems with interrupt, then this function hangs

References XAxiCdma_Config::BaseAddress, XAxiCdma_CfgInitialize(), XAxiCdma_IntrDisable(), XAxiCdma_LookupConfig(), XAXICDMA_XR_IRQ_ALL_MASK, and xil_printf().

void XAxiCdma_IntrDisable ( XAxiCdma *  InstancePtr,
u32  Mask 
)

Disables interrupts specified by the Mask.

Interrupts that are not in the mask are not affected.

Parameters
[in]InstancePtris the driver instance we are working on
[in]Maskis the mask for the interrupts to be disabled

References XAxiCdma::BaseAddr, 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 
)

Enables interrupts specified by the Mask.

Interrupts that are not in the mask are not affected.

Parameters
[in]InstancePtris the driver instance we are working on
[in]Maskis the mask for the interrupts to be enabled

References XAxiCdma::BaseAddr, 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)

Reads the mask for currently enabled interrupts.

Parameters
[in]InstancePtris the driver instance we are working on
Returns
The bit mask for the interrupts that are currently enabled

References XAxiCdma::BaseAddr, XAXICDMA_CR_OFFSET, XAxiCdma_ReadReg, and XAXICDMA_XR_IRQ_ALL_MASK.

Referenced by XAxiCdma_SimpleTransfer().

void XAxiCdma_IntrHandler ( void *  HandlerRef)

Handles driver interrupts, it handles all the interrupts.

For the completion of a transfer that has a callback function, the callback function is called.

Parameters
[in]HandlerRefis a reference pointer passed to the interrupt registration function. It will be a pointer to the driver instance we are working on
Note
If one transfer does not have all its submitted BDs completed successfully,then a reset is needed to clean up the mess left by that transfer.Otherwise, the wrong interrupt callback maybe called for the following transfers. However, if you always use the same interrupt callback for all the transfers, and you are the only user of the DMA engine, then you do not have to worry about this.

References XAxiCdma::BaseAddr, XAxiCdma_IntrHandlerList::CallBackFn, XAxiCdma_IntrHandlerList::CallBackRef, XAxiCdma::Handlers, XAxiCdma::Initialized, XAxiCdma_IntrHandlerList::NumBds, XAxiCdma::SgHandlerHead, XAxiCdma::SgHandlerTail, XAxiCdma::SGWaiting, XAxiCdma::SimpleCallBackFn, XAxiCdma::SimpleCallBackRef, XAxiCdma::SimpleNotDone, XAxiCdma_BdRingStartTransfer(), XAXICDMA_MAXIMUM_MAX_HANDLER, XAxiCdma_ReadReg, XAxiCdma_Reset(), XAXICDMA_RESET_LOOP_LIMIT, 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)

Checks whether the hardware is doing transfer.

Parameters
[in]InstancePtris the driver instance we are working on
Returns
  • 1 if the hardware is doing a transfer
  • 0 if the hardware is idle

References XAxiCdma::BaseAddr, XAxiCdma_ReadReg, XAXICDMA_SR_IDLE_MASK, and XAXICDMA_SR_OFFSET.

Referenced by XAxiCdma_BdRingClone(), XAxiCdma_SelectKeyHole(), XAxiCdma_SimpleTransfer(), and XAxiCdma_SwitchMode().

int XAxiCdma_IsSimpleMode ( XAxiCdma *  InstancePtr)

Checks whether the hardware is in simple mode.

Parameters
[in]InstancePtris the driver instance we are working on
Returns
  • 1 if the hardware is in simple mode
  • 0 if the hardware is in SG mode

References XAxiCdma::BaseAddr, XAXICDMA_CR_OFFSET, XAXICDMA_CR_SGMODE_MASK, and XAxiCdma_ReadReg.

Referenced by XAxiCdma_BdRingStartTransfer(), XAxiCdma_BdRingToHw(), XAxiCdma_SimpleTransfer(), and XAxiCdma_SwitchMode().

XAxiCdma_Config * XAxiCdma_LookupConfig ( UINTPTR  BaseAddress)

Looks up device configuration by device ID or base address.

A table contains the configuration info for each device in the system.

Parameters
[in]BaseAddresscontains the base address of the device
Returns
A pointer to the configuration table entry corresponding to the given device ID/BaseAddress, or NULL if no match is found.
Note
In XSCT/classic flow, DeviceId is used to look up the device configuration.

References XAxiCdma_Config::Name.

Referenced by XAxiCdma_HybridIntrExample(), XAxiCdma_HybridPollExample(), XAxiCdma_SgIntrExample(), XAxiCdma_SgPollExample(), XAxiCdma_SimpleIntrExample(), and XAxiCdma_SimplePollExample().

void XAxiCdma_Reset ( XAxiCdma *  InstancePtr)

Resets the hardware.

Current transfer will finish gracefully. However, all queued SG transfers that have not started will be flushed from the hardware.

Parameters
[in]InstancePtris the driver instance we are working on

References XAxiCdma::BaseAddr, XAxiCdma::SgHandlerHead, XAxiCdma::SgHandlerTail, XAxiCdma::SGWaiting, XAxiCdma::SimpleCallBackFn, XAxiCdma::SimpleCallBackRef, XAxiCdma::SimpleNotDone, XAXICDMA_CR_OFFSET, XAXICDMA_CR_RESET_MASK, and XAxiCdma_WriteReg.

Referenced by XAxiCdma_CfgInitialize(), XAxiCdma_IntrHandler(), and XAxiCdma_SgPollExample().

int XAxiCdma_ResetIsDone ( XAxiCdma *  InstancePtr)

Checks whether hardware reset completed.

Parameters
[in]InstancePtris the driver instance we are working on
Returns
  • 1 if the reset has finished successfully
  • 0 if the reset is not done

References XAxiCdma::BaseAddr, 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 
)

Configures the KeyHole read or write feature.

Parameters
[in]InstancePtris the driver instance we are working on
[in]Directionis WRITE/READ
[in]Selectis the option to enable (TRUE) or disable (FALSE).
Returns
- XST_SUCCESS for success
  • XST_DEVICE_BUSY when transfer is in progress
  • XST_NO_FEATURE when not configured with feature

References XAxiCdma::BaseAddr, XAxiCdma::BurstLen, XAXICDMA_CR_KHOLE_RD_MASK, XAXICDMA_CR_KHOLE_WR_MASK, XAXICDMA_CR_OFFSET, XAxiCdma_IsBusy(), XAXICDMA_KEYHOLE_WRITE, XAxiCdma_ReadReg, and XAxiCdma_WriteReg.

int XAxiCdma_SetCoalesce ( XAxiCdma *  InstancePtr,
u32  Counter,
u32  Delay 
)

Sets the interrupt coalescing threshold and delay counters.

To set only one counter, set the other to XAXICDMA_COALESCE_NO_CHANGE.

Parameters
[in]InstancePtris the driver instance we are working on
[in]Counteris the coalescing threshold to set to, the valid range is 1 to XAXICDMA_COALESCE_MAX.
[in]Delayis 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.
Returns
  • XST_SUCCESS for success
  • XST_FAILURE if hardware is in invalid state, for example, reset failed
  • XST_INVALID_PARAM if one of the counters is not in the valid range

References XAxiCdma::BaseAddr, XAxiCdma::Initialized, XAXICDMA_COALESCE_MAX, XAXICDMA_COALESCE_NO_CHANGE, XAXICDMA_COALESCE_SHIFT, XAXICDMA_CR_OFFSET, XAXICDMA_DELAY_MAX, XAXICDMA_DELAY_SHIFT, XAxiCdma_ReadReg, XAxiCdma_WriteReg, XAXICDMA_XR_COALESCE_MASK, and XAXICDMA_XR_DELAY_MASK.

int XAxiCdma_SgIntrExample ( XAxiCdma *  InstancePtr,
UINTPTR  BaseAddress 
)

Demonstrates scatter-gather transfer through interrupt.

Parameters
[in]InstancePtris a pointer to the XAxiCdma instance
[in]BaseAddresscontains the base address of the device
Returns
  • XST_SUCCESS if example finishes successfully
  • XST_FAILURE if error occurs during transfer setup or transfer has errors
Note
If the hardware build has problems with interrupt, then this function hangs

< Pointer to the transmit (source) buffer.

< Pointer to the receive (destination) buffer.

References XAxiCdma_Config::BaseAddress, XAxiCdma_Config::IntrId, XAxiCdma_Config::IntrParent, MARK_UNCACHEABLE, MAX_PKT_LEN, NUMBER_OF_EVENTS, POLL_TIMEOUT_COUNTER, XAxiCdma_CfgInitialize(), XAxiCdma_GetError(), XAxiCdma_IntrEnable(), XAxiCdma_LookupConfig(), and XAXICDMA_XR_IRQ_ALL_MASK.

int XAxiCdma_SgPollExample ( XAxiCdma *  InstancePtr,
UINTPTR  BaseAddress 
)

Demonstrates scatter-gather transfer through polling.

Parameters
[in]InstancePtris a pointer to the XAxiCdma instance
[in]BaseAddresscontains the base address of the device
Returns
  • XST_SUCCESS if example finishes successfully
  • XST_FAILURE if error occurs

< Pointer to the transmit (source) buffer.

< Pointer to the receive (destination) buffer.

References XAxiCdma_Config::BaseAddress, MARK_UNCACHEABLE, MAX_PKT_LEN, POLL_TIMEOUT_COUNTER, RESET_LOOP_COUNT, XAxiCdma_CfgInitialize(), XAxiCdma_LookupConfig(), XAxiCdma_Reset(), and XAxiCdma_ResetIsDone().

int XAxiCdma_SimpleIntrExample ( XAxiCdma *  InstancePtr,
UINTPTR  BaseAddress 
)

Demonstrates simple transfer through interrupt.

Parameters
[in]InstancePtris a pointer to the XAxiCdma instance
[in]BaseAddresscontains the base address of the device
Returns
  • XST_SUCCESS if example finishes successfully
  • XST_FAILURE if error occurs
Note
If the hardware build has problems with interrupt, then this function hangs

References XAxiCdma_Config::BaseAddress, BUFFER_BYTESIZE, XAxiCdma_Config::IntrId, XAxiCdma_Config::IntrParent, NUMBER_OF_TRANSFERS, XAxiCdma_CfgInitialize(), XAxiCdma_IntrEnable(), XAxiCdma_IntrHandler(), XAxiCdma_LookupConfig(), and XAXICDMA_XR_IRQ_ALL_MASK.

int XAxiCdma_SimplePollExample ( XAxiCdma *  InstancePtr,
UINTPTR  BaseAddress 
)

Demonstrates simple transfer through polling.

The constant NUMBER_OF_TRANSFERS defines how many times a simple transfer is repeated.

Parameters
[in]InstancePtris a pointer to the XAxiCdma instance
[in]BaseAddresscontains the base address of the device
Returns
  • XST_SUCCESS if example finishes successfully
  • XST_FAILURE if error occurs
Note
If the hardware build has problems with interrupt, then this function hangs

References XAxiCdma_Config::BaseAddress, BUFFER_BYTESIZE, NUMBER_OF_TRANSFERS, XAxiCdma_CfgInitialize(), XAxiCdma_IntrDisable(), XAxiCdma_LookupConfig(), and XAXICDMA_XR_IRQ_ALL_MASK.

u32 XAxiCdma_SimpleTransfer ( XAxiCdma *  InstancePtr,
UINTPTR  SrcAddr,
UINTPTR  DstAddr,
int  Length,
XAxiCdma_CallBackFn  SimpleCallBack,
void *  CallBackRef 
)

Performs one simple transfer submission.

It checks in the following sequence:

  • if engine is busy, cannot submit
  • if software is still handling the completion of the previous simple transfer, cannot submit
  • if engine is in SG mode and cannot switch to simple mode, cannot submit
Parameters
[in]InstancePtris the pointer to the driver instance
[in]SrcAddris the address of the source buffer
[in]DstAddris the address of the destination buffer
[in]Lengthis the length of the transfer
[in]SimpleCallBackis the callback function for the simple transfer
[in]CallBackRefis the callback reference pointer
Returns
  • XST_SUCCESS for success of submission
  • XST_FAILURE for submission failure, maybe caused by: Another simple transfer is still going . Another SG transfer is still going
  • XST_INVALID_PARAM if: Length out of valid range [1: InstancePtr->MaxTransLen] Or, address not aligned when DRE is not built in
Note
Only set the callback function if using interrupt to signal the completion.If used in polling mode, please set the callback function to be NULL.

References XAxiCdma::AddrWidth, XAxiCdma::BaseAddr, XAxiCdma::HasDRE, XAxiCdma::MaxTransLen, XAxiCdma::SimpleCallBackFn, XAxiCdma::SimpleCallBackRef, XAxiCdma::SimpleNotDone, XAxiCdma::WordLength, XAXICDMA_BTT_OFFSET, XAXICDMA_DSTADDR_MSB_OFFSET, XAXICDMA_DSTADDR_OFFSET, XAxiCdma_IntrGetEnabled(), XAxiCdma_IsBusy(), XAxiCdma_IsSimpleMode(), XAXICDMA_SIMPLE_MODE, XAXICDMA_SRCADDR_MSB_OFFSET, XAXICDMA_SRCADDR_OFFSET, XAxiCdma_SwitchMode(), XAxiCdma_WriteReg, and XAXICDMA_XR_IRQ_SIMPLE_ALL_MASK.

int XAxiCdma_SwitchMode ( XAxiCdma *  InstancePtr,
int  Mode 
)

Switches the hardware between simple and scatter gather mode.

If switching to SG mode, sets up the current BD pointer register when needed.

Parameters
[in]InstancePtris the driver instance we are working on
[in]Modeis the mode to switch to.
Returns
  • XST_SUCCESS if mode switch is successful
  • XST_DEVICE_BUSY if the engine is busy, so cannot switch mode
  • XST_INVALID_PARAM if pass in invalid mode value
  • XST_FAILURE if:Hardware is simple mode only build Mode switch failed

References XAxiCdma::BaseAddr, XAxiCdma::BdaRestart, XAxiCdma::SimpleOnlyBuild, XAxiCdma_BdGetPhysAddr(), XAxiCdma_BdRingGetCurrBd(), XAxiCdma_BdRingNext(), XAxiCdma_BdSetCurBdPtr(), XAXICDMA_CR_OFFSET, XAXICDMA_CR_SGMODE_MASK, XAxiCdma_IsBusy(), XAxiCdma_IsSimpleMode(), XAxiCdma_ReadReg, XAXICDMA_SG_MODE, XAXICDMA_SIMPLE_MODE, and XAxiCdma_WriteReg.

Referenced by XAxiCdma_BdRingStartTransfer(), XAxiCdma_BdRingToHw(), and XAxiCdma_SimpleTransfer().

void xil_printf ( const char *  format,
  ... 
)

Prints a formatted message when DEBUG is not defined.

Parameters
[in]formatis the printf-style format string.

Referenced by main(), XAxiCdma_DumpBd(), XAxiCdma_DumpRegisters(), XAxiCdma_HybridIntrExample(), and XAxiCdma_HybridPollExample().

Variable Documentation

u32* ReceiveBufferPtr

Pointer to receive buffer.

u32* TransmitBufferPtr

Pointer to transmit buffer.

XAxiCdma_Config XAxiCdma_ConfigTable[]
Initial value:
= {
{
XPAR_AXICDMA_0_DEVICE_ID,
XPAR_AXICDMA_0_BASEADDR,
XPAR_AXICDMA_0_INCLUDE_DRE,
XPAR_AXICDMA_0_USE_DATAMOVER_LITE,
XPAR_AXICDMA_0_M_AXI_DATA_WIDTH,
XPAR_AXICDMA_0_M_AXI_MAX_BURST_LEN,
XPAR_AXICDMA_0_ADDR_WIDTH
}
}

Configuration table for each CDMA instance in the system.