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

Data Structures

struct  XAxiVdma_Config
 Holds hardware configuration for a VDMA device. More...
 
struct  XAxiVdma_DmaSetup
 Holds settings to start a frame read or write transfer. More...
 
struct  XAxiVdma_FrameCounter
 Holds frame counter interrupt threshold settings. More...
 
struct  XAxiVdma_ChannelCallBack
 Holds channel callback function pointers. More...
 
struct  XAxiVdma
 Holds driver instance data for a VDMA engine. More...
 

Macros

#define INITIALIZATION_POLLING   100000
 Maximum poll loops when waiting for hardware start after reset. More...
 
#define XAXIVDMA_WRITE   1
 VDMA data transfer direction. More...
 
#define XAXIVDMA_READ   2
 DMA transfer from memory. More...
 
#define XAXIVDMA_CHAN_FSYNC   0
 Frame Sync Source Selection. More...
 
#define XAXIVDMA_CHAN_OTHER_FSYNC   1
 Other channel frame sync. More...
 
#define XAXIVDMA_S2MM_TUSER_FSYNC   2
 S2MM TUSER frame sync. More...
 
#define XAXIVDMA_EXTERNAL_GENLOCK   0
 GenLock Source Selection. More...
 
#define XAXIVDMA_INTERNAL_GENLOCK   1
 Internal genlock source. More...
 
#define XAXIVDMA_GENLOCK_MASTER   0
 GenLock Mode Constants. More...
 
#define XAXIVDMA_GENLOCK_SLAVE   1
 Genlock slave mode. More...
 
#define XAXIVDMA_DYN_GENLOCK_MASTER   2
 Dynamic genlock master mode. More...
 
#define XAXIVDMA_DYN_GENLOCK_SLAVE   3
 Dynamic genlock slave mode. More...
 
#define XAXIVDMA_HANDLER_GENERAL   1
 Interrupt type for setting up callback. More...
 
#define XAXIVDMA_HANDLER_ERROR   2
 Error Interrupt Type. More...
 
#define XAXIVDMA_DEVICE_READY   0x11111111
 Flag to signal that device is ready to be used. More...
 
#define XAXIVDMA_ENABLE_DBG_THRESHOLD_REG   0x01
 Debug Configuration Parameter Constants (C_ENABLE_DEBUG_INFO_*) More...
 
#define XAXIVDMA_ENABLE_DBG_FRMSTORE_REG   0x02
 Enable debug frame store register. More...
 
#define XAXIVDMA_ENABLE_DBG_FRM_CNTR   0x04
 Enable debug frame counter. More...
 
#define XAXIVDMA_ENABLE_DBG_DLY_CNTR   0x08
 Enable debug delay counter. More...
 
#define XAXIVDMA_ENABLE_DBG_ALL_FEATURES   0x0F
 Enable all debug features. More...
 
#define XST_VDMA_MISMATCH_ERROR   1430
 Frame or line mismatch error status code for backward compatibility. More...
 
#define XAXIVDMA_RESET_POLLING   1000
 Maximum poll loops when waiting for channel reset completion. More...
 
#define XAXIVDMA_VIRT_TO_PHYS(VirtAddr)   (VirtAddr)
 Translates a virtual address to a physical address. More...
 
#define XAxiVdma_ChannelHiFrmAddrEnable(Channel)
 Sets the channel to enable access to higher Frame Buffer Addresses (SG=0). More...
 
#define XAxiVdma_ChannelHiFrmAddrDisable(Channel)
 Sets the channel to disable access higher Frame Buffer Addresses (SG=0). More...
 
#define XAXIVDMA_MISMATCH_ERROR   0x80000010
 Frame/Line Mismatch Error This is a typical DMA Internal Error, which on detection does not require a reset (as opposed to other errors). More...
 
#define XAXIVDMA_RESET_TIMEOUT   500
 Maximum iterations to wait for reset completion. More...
 
#define XPAR_XAXIVDMA_NUM_INSTANCES   0
 Number of AXI VDMA instances when not defined in xparameters.h. More...
 
#define MEMORY_BASE   0x01000000
 DDR memory base address. More...
 
#define DEBUG_MODE   0
 Enables buffer fill and compare checks. More...
 
#define FRAME_HORIZONTAL_LEN   0x1E00
 Horizontal frame length in bytes (1920 pixels, 4 bytes each). More...
 
#define FRAME_VERTICAL_LEN   0x438
 Vertical frame length in lines (1080 pixels). More...
 
#define FRAME_SIZE   (FRAME_HORIZONTAL_LEN * FRAME_VERTICAL_LEN)
 Frame size in bytes. More...
 
#define MAX_FRAME_STORE   XAXIVDMA_MAX_FRAMESTORE
 Maximum frame store count. More...
 
#define READ_BUFFER_SIZE   (MAX_FRAME_STORE * FRAME_SIZE)
 Read buffer size in bytes. More...
 
#define WRITE_BUFFER_SIZE   (MAX_FRAME_STORE * FRAME_SIZE)
 Write buffer size in bytes. More...
 
#define SUBFRAME_START_OFFSET   (FRAME_HORIZONTAL_LEN * 5 + 64)
 Byte offset of the subframe within a frame. More...
 
#define SUBFRAME_HORIZONTAL_SIZE   0x100
 Horizontal subframe size in bytes. More...
 
#define SUBFRAME_VERTICAL_SIZE   0x100
 Vertical subframe size in lines. More...
 
#define NUM_TEST_FRAME_SETS   10
 Number of frame sets to transfer for the test. More...
 
#define TEST_START_VALUE   0xC
 Starting value used to fill and verify frame data. More...
 
#define DELAY_TIMER_COUNTER   10
 Delay timer counter programmed into the VDMA. More...
 
#define XAXIVDMA_RESET_TIMEOUT_USEC   500
 Maximum microseconds to wait for VDMA reset. More...
 
#define POLL_TIMEOUT_COUNTER   1100000U
 Maximum poll iterations before a transfer times out. More...
 
#define NUMBER_OF_EVENTS   1
 Number of interrupt events expected to complete the test. More...
 

Typedefs

typedef void(* XAxiVdma_CallBack )(void *CallBackRef, u32 InterruptTypes)
 Callback type for general interrupts. More...
 
typedef void(* XAxiVdma_ErrorCallBack )(void *CallBackRef, u32 ErrorMask)
 Callback type for error interrupts. More...
 
typedef struct vdma_handle vdma_handle
 Holds VDMA instance context for the high-level API. More...
 

Functions

XAxiVdma_Channel * XAxiVdma_GetChannel (XAxiVdma *InstancePtr, u16 Direction)
 Gets a channel. More...
 
int XAxiVdma_CfgInitialize (XAxiVdma *InstancePtr, XAxiVdma_Config *CfgPtr, UINTPTR EffectiveAddr)
 Initializes the driver with hardware configuration. More...
 
void XAxiVdma_Reset (XAxiVdma *InstancePtr, u16 Direction)
 Provides function resets one DMA channel. More...
 
int XAxiVdma_ResetNotDone (XAxiVdma *InstancePtr, u16 Direction)
 Provides function checks one DMA channel for reset completion. More...
 
int XAxiVdma_IsBusy (XAxiVdma *InstancePtr, u16 Direction)
 Checks whether a DMA channel is busy. More...
 
u32 XAxiVdma_CurrFrameStore (XAxiVdma *InstancePtr, u16 Direction)
 Gets the current frame that hardware is working on. More...
 
u32 XAxiVdma_GetVersion (XAxiVdma *InstancePtr)
 Gets the version of the hardware. More...
 
u32 XAxiVdma_GetStatus (XAxiVdma *InstancePtr, u16 Direction)
 Gets the status of a channel. More...
 
int XAxiVdma_SetLineBufThreshold (XAxiVdma *InstancePtr, int LineBufThreshold, u16 Direction)
 Configures Line Buffer Threshold. More...
 
int XAxiVdma_FsyncSrcSelect (XAxiVdma *InstancePtr, u32 Source, u16 Direction)
 Configures Frame Sync Source and valid only when C_USE_FSYNC is enabled. More...
 
int XAxiVdma_GenLockSourceSelect (XAxiVdma *InstancePtr, u32 Source, u16 Direction)
 Configures Gen Lock Source. More...
 
int XAxiVdma_StartParking (XAxiVdma *InstancePtr, int FrameIndex, u16 Direction)
 Starts parking mode on a certain frame. More...
 
void XAxiVdma_StopParking (XAxiVdma *InstancePtr, u16 Direction)
 Exits parking mode, the channel will return to circular buffer mode. More...
 
void XAxiVdma_StartFrmCntEnable (XAxiVdma *InstancePtr, u16 Direction)
 Starts frame count enable on one channel. More...
 
int XAxiVdma_SetBdAddrs (XAxiVdma *InstancePtr, u32 BdAddrPhys, u32 BdAddrVirt, int NumBds, u16 Direction)
 Sets BD addresses to be different. More...
 
int XAxiVdma_StartWriteFrame (XAxiVdma *InstancePtr, XAxiVdma_DmaSetup *DmaConfigPtr)
 Starts a write operation. More...
 
int XAxiVdma_StartReadFrame (XAxiVdma *InstancePtr, XAxiVdma_DmaSetup *DmaConfigPtr)
 Starts a read operation. More...
 
int XAxiVdma_DmaConfig (XAxiVdma *InstancePtr, u16 Direction, XAxiVdma_DmaSetup *DmaConfigPtr)
 Configures one DMA channel using the configuration structure. More...
 
int XAxiVdma_DmaSetBufferAddr (XAxiVdma *InstancePtr, u16 Direction, UINTPTR *BufferAddrSet)
 Configures buffer addresses for one DMA channel. More...
 
int XAxiVdma_DmaStart (XAxiVdma *InstancePtr, u16 Direction)
 Starts one DMA channel. More...
 
void XAxiVdma_DmaStop (XAxiVdma *InstancePtr, u16 Direction)
 Stops one DMA channel. More...
 
void XAxiVdma_DmaRegisterDump (XAxiVdma *InstancePtr, u16 Direction)
 Dumps registers of one DMA channel. More...
 
int XAxiVdma_SetFrameCounter (XAxiVdma *InstancePtr, XAxiVdma_FrameCounter *CfgPtr)
 Sets the frame counter and delay counter for both channels. More...
 
void XAxiVdma_GetFrameCounter (XAxiVdma *InstancePtr, XAxiVdma_FrameCounter *CfgPtr)
 Gets the frame counter and delay counter for both channels. More...
 
int XAxiVdma_SetFrmStore (XAxiVdma *InstancePtr, u8 FrmStoreNum, u16 Direction)
 Sets the number of frame store buffers to use. More...
 
void XAxiVdma_GetFrmStore (XAxiVdma *InstancePtr, u8 *FrmStoreNum, u16 Direction)
 Gets the number of frame store buffers to use. More...
 
int XAxiVdma_GetDmaChannelErrors (XAxiVdma *InstancePtr, u16 Direction)
 Checks for DMA Channel Errors. More...
 
int XAxiVdma_ClearDmaChannelErrors (XAxiVdma *InstancePtr, u16 Direction, u32 ErrorMask)
 Clears DMA Channel Errors. More...
 
XAxiVdma_Config * XAxiVdma_LookupConfig (UINTPTR BaseAddress)
 Looks up the device configuration based on the unique device ID/BaseAddress. More...
 
void XAxiVdma_IntrEnable (XAxiVdma *InstancePtr, u32 IntrType, u16 Direction)
 Enables specific interrupts for a channel. More...
 
void XAxiVdma_IntrDisable (XAxiVdma *InstancePtr, u32 IntrType, u16 Direction)
 Disables specific interrupts for a channel. More...
 
u32 XAxiVdma_IntrGetPending (XAxiVdma *InstancePtr, u16 Direction)
 Gets the pending interrupts of a channel. More...
 
void XAxiVdma_IntrClear (XAxiVdma *InstancePtr, u32 IntrType, u16 Direction)
 Clears the pending interrupts specified by the bit mask. More...
 
int XAxiVdma_MaskS2MMErrIntr (XAxiVdma *InstancePtr, u32 ErrorMask, u16 Direction)
 Masks the S2MM error interrupt for the provided error mask value. More...
 
void XAxiVdma_ReadIntrHandler (void *InstancePtr)
 Interrupts handler for the read channel. More...
 
void XAxiVdma_WriteIntrHandler (void *InstancePtr)
 Interrupts handler for the write channel. More...
 
int XAxiVdma_SetCallBack (XAxiVdma *InstancePtr, u32 HandlerType, void *CallBackFunc, void *CallBackRef, u16 Direction)
 Sets call back function and call back reference pointer for one channel. More...
 
int XAxiVdma_Selftest (XAxiVdma *InstancePtr)
 Runs a self-test on the driver/device. More...
 
void XAxiVdma_ChannelInit (XAxiVdma_Channel *Channel)
 Initializes a channel of a DMA engine. More...
 
int XAxiVdma_ChannelResetNotDone (XAxiVdma_Channel *Channel)
 Provides function checks whether reset operation is done. More...
 
void XAxiVdma_ChannelReset (XAxiVdma_Channel *Channel)
 Provides function resets one DMA channel. More...
 
int XAxiVdma_ChannelIsRunning (XAxiVdma_Channel *Channel)
 Checks whether a DMA channel is running. More...
 
int XAxiVdma_ChannelIsBusy (XAxiVdma_Channel *Channel)
 Checks whether a DMA channel is busy. More...
 
u32 XAxiVdma_ChannelErrors (XAxiVdma_Channel *Channel)
 Returns the error bits for a DMA channel. More...
 
void XAxiVdma_ClearChannelErrors (XAxiVdma_Channel *Channel, u32 ErrorMask)
 Clears selected error bits for a DMA channel. More...
 
u32 XAxiVdma_ChannelGetStatus (XAxiVdma_Channel *Channel)
 Gets the current status of a channel. More...
 
int XAxiVdma_ChannelStartParking (XAxiVdma_Channel *Channel)
 Sets the channel to run in parking mode. More...
 
void XAxiVdma_ChannelStopParking (XAxiVdma_Channel *Channel)
 Sets the channel to run in circular mode, exiting parking mode. More...
 
void XAxiVdma_ChannelStartFrmCntEnable (XAxiVdma_Channel *Channel)
 Sets the channel to run in frame count enable mode. More...
 
int XAxiVdma_ChannelSetBdAddrs (XAxiVdma_Channel *Channel, UINTPTR BdAddrPhys, UINTPTR BdAddrVirt)
 Sets BD addresses to a different memory region. More...
 
int XAxiVdma_ChannelStartTransfer (XAxiVdma_Channel *Channel, XAxiVdma_ChannelSetup *ChannelCfgPtr)
 Starts a transfer. More...
 
int XAxiVdma_ChannelConfig (XAxiVdma_Channel *Channel, XAxiVdma_ChannelSetup *ChannelCfgPtr)
 Configures one DMA channel using the configuration structure. More...
 
int XAxiVdma_ChannelSetBufferAddr (XAxiVdma_Channel *Channel, UINTPTR *BufferAddrSet, int NumFrames)
 Configures buffer addresses for one DMA channel. More...
 
int XAxiVdma_ChannelStart (XAxiVdma_Channel *Channel)
 Starts one DMA channel. More...
 
void XAxiVdma_ChannelStop (XAxiVdma_Channel *Channel)
 Stops one DMA channel. More...
 
void XAxiVdma_ChannelRegisterDump (XAxiVdma_Channel *Channel)
 Dumps registers from one DMA channel. More...
 
int XAxiVdma_ChannelSetFrmCnt (XAxiVdma_Channel *Channel, u8 FrmCnt, u8 DlyCnt)
 Sets the frame counter and delay counter for one channel. More...
 
void XAxiVdma_ChannelGetFrmCnt (XAxiVdma_Channel *Channel, u8 *FrmCnt, u8 *DlyCnt)
 Gets the frame counter and delay counter for both channels. More...
 
void XAxiVdma_ChannelEnableIntr (XAxiVdma_Channel *Channel, u32 IntrType)
 Enables interrupts for a channel. More...
 
void XAxiVdma_ChannelDisableIntr (XAxiVdma_Channel *Channel, u32 IntrType)
 Disables interrupts for a channel. More...
 
u32 XAxiVdma_ChannelGetPendingIntr (XAxiVdma_Channel *Channel)
 Gets pending interrupts of a channel. More...
 
void XAxiVdma_ChannelIntrClear (XAxiVdma_Channel *Channel, u32 IntrType)
 Clears interrupts of a channel. More...
 
u32 XAxiVdma_ChannelGetEnabledIntr (XAxiVdma_Channel *Channel)
 Gets the enabled interrupts of a channel. More...
 
int run_triple_frame_buffer (XAxiVdma *InstancePtr, int DeviceId, int hsize, int vsize, int buf_base_addr, int number_frame_count, int enable_frm_cnt_intr)
 Runs the triple frame buffer API. More...
 
int main ()
 Runs the VDMA triple-frame-buffer example entry point. More...
 
int AxiVDMASelfTestExample (UINTPTR BaseAddress)
 Resets the VDMA device and checks that reset completes. More...
 

Variables

XAxiVdma AxiVdma
 Driver instance for the AXI VDMA under test. More...
 

Buffer Descriptor Alignment

#define XAXIVDMA_BD_MINIMUM_ALIGNMENT   0x20
 Minimum byte alignment requirement for descriptors. More...
 
#define XAXIVDMA_BD_MINIMUM_ALIGNMENT_WD   0x8
 Minimum word alignment requirement for descriptors. More...
 
#define XAXIVDMA_MAX_FRAMESTORE   32
 Maximum number of the frame store. More...
 
#define XAXIVDMA_MAX_FRAMESTORE_64   16
 Maximum # of the frame store for 64-bit. More...
 

Maximum transfer length

This is determined by hardware.

#define XAXIVDMA_MAX_VSIZE   0x1FFF
 Maximum vertical size (8K). More...
 
#define XAXIVDMA_MAX_HSIZE   0xFFFF
 Maximum horizontal size (64K). More...
 
#define XAXIVDMA_MAX_STRIDE   0xFFFF
 Maximum stride size (64K). More...
 
#define XAXIVDMA_FRMDLY_MAX   0xF
 Maximum frame delay. More...
 

Device registers

Register sets on TX (Read) and RX (Write) channels are identical.

The version register is shared by both channels

#define XAXIVDMA_TX_OFFSET   0x00000000
 TX channel registers base. More...
 
#define XAXIVDMA_RX_OFFSET   0x00000030
 RX channel registers base. More...
 
#define XAXIVDMA_PARKPTR_OFFSET   0x00000028
 Park Pointer Register. More...
 
#define XAXIVDMA_VERSION_OFFSET   0x0000002C
 Version register. More...
 
#define XAXIVDMA_CR_OFFSET   0x00000000
 Channel control. More...
 
#define XAXIVDMA_SR_OFFSET   0x00000004
 Status. More...
 
#define XAXIVDMA_CDESC_OFFSET   0x00000008
 Current descriptor pointer. More...
 
#define XAXIVDMA_TDESC_OFFSET   0x00000010
 Tail descriptor pointer. More...
 
#define XAXIVDMA_HI_FRMBUF_OFFSET   0x00000014
 32 FrameBuf Sel More...
 
#define XAXIVDMA_FRMSTORE_OFFSET   0x00000018
 Frame Store. More...
 
#define XAXIVDMA_BUFTHRES_OFFSET   0x0000001C
 Line Buffer Thres. More...
 
#define XAXIVDMA_MM2S_ADDR_OFFSET   0x00000050
 MM2S channel Addr. More...
 
#define XAXIVDMA_S2MM_ADDR_OFFSET   0x000000A0
 S2MM channel Addr. More...
 
#define XAXIVDMA_VFLIP_OFFSET   0x000000EC
 Enable Vertical Flip Register. More...
 
#define XAXIVDMA_S2MM_DMA_IRQ_MASK_OFFSET   0x0000003C
 S2MM Err IRQ Mask. More...
 

Start Addresses Register Array for a Channel

Base offset is set in each channel This set of registers are write only, they can be read when C_ENABLE_VIDPRMTR_READS is 1.

#define XAXIVDMA_VSIZE_OFFSET   0x00000000
 Vertical size. More...
 
#define XAXIVDMA_HSIZE_OFFSET   0x00000004
 Horizontal size. More...
 
#define XAXIVDMA_STRD_FRMDLY_OFFSET   0x00000008
 Horizontal size. More...
 
#define XAXIVDMA_START_ADDR_OFFSET   0x0000000C
 Start of address. More...
 
#define XAXIVDMA_START_ADDR_LEN   0x00000004
 Each entry is 4 bytes. More...
 
#define XAXIVDMA_START_ADDR_MSB_OFFSET   0x00000010
 Start of address. More...
 

Bitmasks of the XAXIVDMA_CR_OFFSET register

#define XAXIVDMA_CR_RUNSTOP_MASK   0x00000001
 Start/stop DMA channel. More...
 
#define XAXIVDMA_CR_TAIL_EN_MASK   0x00000002
 Tail ptr enable or Park. More...
 
#define XAXIVDMA_CR_RESET_MASK   0x00000004
 Reset channel. More...
 
#define XAXIVDMA_CR_SYNC_EN_MASK   0x00000008
 Gen-lock enable. More...
 
#define XAXIVDMA_CR_FRMCNT_EN_MASK   0x00000010
 Frame count enable. More...
 
#define XAXIVDMA_CR_FSYNC_SRC_MASK   0x00000060
 Fsync Source Select. More...
 
#define XAXIVDMA_CR_GENLCK_SRC_MASK   0x00000080
 Genlock Source Select. More...
 
#define XAXIVDMA_CR_RD_PTR_MASK   0x00000F00
 Read pointer number. More...
 
#define XAXIVDMA_CR_GENLCK_RPT_MASK   0x00008000
 GenLock Repeat. More...
 
#define XAXIVDMA_VFLIP_EN_MASK   0x00000001
 Vertical flip enable. More...
 
#define XAXIVDMA_CR_RD_PTR_SHIFT   8
 Shift for read pointer number. More...
 

Bitmasks of the XAXIVDMA_SR_OFFSET register

This register reports status of a DMA channel, including run/stop/idle state, errors, and interrupts

#define XAXIVDMA_SR_HALTED_MASK   0x00000001
 DMA channel halted. More...
 
#define XAXIVDMA_SR_IDLE_MASK   0x00000002
 DMA channel idle. More...
 
#define XAXIVDMA_SR_ERR_INTERNAL_MASK   0x00000010
 Datamover internal err. More...
 
#define XAXIVDMA_SR_ERR_SLAVE_MASK   0x00000020
 Datamover slave err. More...
 
#define XAXIVDMA_SR_ERR_DECODE_MASK   0x00000040
 Datamover decode err. More...
 
#define XAXIVDMA_SR_ERR_FSZ_LESS_MASK   0x00000080
 FSize Less Mismatch err. More...
 
#define XAXIVDMA_SR_ERR_LSZ_LESS_MASK   0x00000100
 LSize Less Mismatch err. More...
 
#define XAXIVDMA_SR_ERR_SG_SLV_MASK   0x00000200
 SG slave err. More...
 
#define XAXIVDMA_SR_ERR_SG_DEC_MASK   0x00000400
 SG decode err. More...
 
#define XAXIVDMA_SR_ERR_FSZ_MORE_MASK   0x00000800
 FSize More Mismatch err. More...
 
#define XAXIVDMA_SR_ERR_ALL_MASK   0x00000FF0
 All errors. More...
 

Bitmask for interrupts

These masks are shared by the XAXIVDMA_CR_OFFSET register and the XAXIVDMA_SR_OFFSET register

#define XAXIVDMA_IXR_FRMCNT_MASK   0x00001000
 Frame count intr. More...
 
#define XAXIVDMA_IXR_DELAYCNT_MASK   0x00002000
 Delay interrupt. More...
 
#define XAXIVDMA_IXR_ERROR_MASK   0x00004000
 Error interrupt. More...
 
#define XAXIVDMA_IXR_COMPLETION_MASK   0x00003000
 Completion interrupts. More...
 
#define XAXIVDMA_IXR_ALL_MASK   0x00007000
 All interrupts. More...
 

Bitmask and shift for delay and coalesce

These masks are shared by the XAXIVDMA_CR_OFFSET register and the XAXIVDMA_SR_OFFSET register

#define XAXIVDMA_DELAY_MASK   0xFF000000
 Delay timeout counter. More...
 
#define XAXIVDMA_FRMCNT_MASK   0x00FF0000
 Frame counter. More...
 
#define XAXIVDMA_REGINDEX_MASK   0x00000001
 Register Index. More...
 
#define XAXIVDMA_DELAY_SHIFT   24
 Bit shift for delay timeout counter. More...
 
#define XAXIVDMA_FRMCNT_SHIFT   16
 Bit shift for frame counter. More...
 

Bitmask for the XAXIVDMA_CDESC_OFFSET register

#define XAXIVDMA_CDESC_CURBD_MASK   0xFFFFFFE0
 BD now working on. More...
 

Bitmask for XAXIVDMA_TDESC_OFFSET register

#define XAXIVDMA_TDESC_CURBD_MASK   0xFFFFFFE0
 BD to stop on. More...
 

Bitmask for XAXIVDMA_FRMSTORE_OFFSET register

#define XAXIVDMA_FRMSTORE_MASK   0x0000003F
 Frame store count mask. More...
 

Bitmask for XAXIVDMA_PARKPTR_OFFSET register

#define XAXIVDMA_PARKPTR_READREF_MASK   0x0000001F
 Read frame to park on. More...
 
#define XAXIVDMA_PARKPTR_WRTREF_MASK   0x00001F00
 Write frame to park on. More...
 
#define XAXIVDMA_PARKPTR_READSTR_MASK   0x001F0000
 Current read frame. More...
 
#define XAXIVDMA_PARKPTR_WRTSTR_MASK   0x1F000000
 Current write frame. More...
 
#define XAXIVDMA_READREF_SHIFT   0
 Bit shift for read park frame. More...
 
#define XAXIVDMA_WRTREF_SHIFT   8
 Bit shift for write park frame. More...
 
#define XAXIVDMA_READSTR_SHIFT   16
 Bit shift for current read frame. More...
 
#define XAXIVDMA_WRTSTR_SHIFT   24
 Bit shift for current write frame. More...
 
#define XAXIVDMA_FRM_MAX   0xF
 At most 16 frames. More...
 

Bitmask for XAXIVDMA_VERSION_OFFSET register

#define XAXIVDMA_VERSION_MAJOR_MASK   0xF0000000
 Major version. More...
 
#define XAXIVDMA_VERSION_MINOR_MASK   0x0FF00000
 Minor version. More...
 
#define XAXIVDMA_VERSION_REV_MASK   0x000F0000
 Revision letter. More...
 
#define XAXIVDMA_VERSION_MAJOR_SHIFT   28
 Bit shift for major version. More...
 
#define XAXIVDMA_VERSION_MINOR_SHIFT   20
 Bit shift for minor version. More...
 

Bitmask for XAXIVDMA_S2MM_IRQ_MASK_OFFSET register

#define XAXIVDMA_S2MM_IRQ_FSZLESS_SOF_ERLY_MASK   0x00000001
 Masks S2MM IRQ FSize Less/SOF Early Error. More...
 
#define XAXIVDMA_S2MM_IRQ_LSZLESS_EOL_ERLY_MASK   0x00000002
 Masks S2MM IRQ LSize Less/EOL Early Error. More...
 
#define XAXIVDMA_S2MM_IRQ_FSZMORE_SOF_LATE_MASK   0x00000004
 Masks S2MM IRQ FSize More/SOF Late Error. More...
 
#define XAXIVDMA_S2MM_IRQ_LSZMORE_EOL_LATE_MASK   0x00000008
 Masks S2MM IRQ LSize More/EOL Late Error. More...
 
#define XAXIVDMA_S2MM_IRQ_ERR_ALL_MASK   0x0000000F
 Masks all S2MM IRQ Errors. More...
 

Frame Delay shared by start address registers and BDs

#define XAXIVDMA_VSIZE_MASK   0x00001FFF
 Vertical size. More...
 
#define XAXIVDMA_HSIZE_MASK   0x0000FFFF
 Horizontal size. More...
 
#define XAXIVDMA_STRIDE_MASK   0x0000FFFF
 Stride size. More...
 
#define XAXIVDMA_FRMDLY_MASK   0x0F000000
 Frame delay. More...
 
#define XAXIVDMA_FRMDLY_SHIFT   24
 Shift for frame delay. More...
 

Buffer Descriptor offsets

#define XAXIVDMA_BD_NDESC_OFFSET   0x00
 Next descriptor pointer. More...
 
#define XAXIVDMA_BD_START_ADDR_OFFSET   0x08
 Start address. More...
 
#define XAXIVDMA_BD_VSIZE_OFFSET   0x10
 Vertical size. More...
 
#define XAXIVDMA_BD_HSIZE_OFFSET   0x14
 Horizontal size. More...
 
#define XAXIVDMA_BD_STRIDE_OFFSET   0x18
 Stride size. More...
 
#define XAXIVDMA_BD_NUM_WORDS   7
 Total number of words for one BD. More...
 
#define XAXIVDMA_BD_HW_NUM_BYTES   28
 Number of bytes hw used. More...
 
#define XAXIVDMA_BD_BYTES_TO_CLEAR   20
 Skip next ptr when clearing. More...
 

Macro Definition Documentation

#define DEBUG_MODE   0

Enables buffer fill and compare checks.

#define DELAY_TIMER_COUNTER   10

Delay timer counter programmed into the VDMA.

#define FRAME_HORIZONTAL_LEN   0x1E00

Horizontal frame length in bytes (1920 pixels, 4 bytes each).

#define FRAME_SIZE   (FRAME_HORIZONTAL_LEN * FRAME_VERTICAL_LEN)

Frame size in bytes.

#define FRAME_VERTICAL_LEN   0x438

Vertical frame length in lines (1080 pixels).

#define INITIALIZATION_POLLING   100000

Maximum poll loops when waiting for hardware start after reset.

Referenced by XAxiVdma_CfgInitialize().

#define MAX_FRAME_STORE   XAXIVDMA_MAX_FRAMESTORE

Maximum frame store count.

#define MEMORY_BASE   0x01000000

DDR memory base address.

#define NUM_TEST_FRAME_SETS   10

Number of frame sets to transfer for the test.

#define NUMBER_OF_EVENTS   1

Number of interrupt events expected to complete the test.

#define POLL_TIMEOUT_COUNTER   1100000U

Maximum poll iterations before a transfer times out.

#define READ_BUFFER_SIZE   (MAX_FRAME_STORE * FRAME_SIZE)

Read buffer size in bytes.

#define SUBFRAME_HORIZONTAL_SIZE   0x100

Horizontal subframe size in bytes.

#define SUBFRAME_START_OFFSET   (FRAME_HORIZONTAL_LEN * 5 + 64)

Byte offset of the subframe within a frame.

#define SUBFRAME_VERTICAL_SIZE   0x100

Vertical subframe size in lines.

#define TEST_START_VALUE   0xC

Starting value used to fill and verify frame data.

#define WRITE_BUFFER_SIZE   (MAX_FRAME_STORE * FRAME_SIZE)

Write buffer size in bytes.

#define XAXIVDMA_BD_BYTES_TO_CLEAR   20

Skip next ptr when clearing.

#define XAXIVDMA_BD_HSIZE_OFFSET   0x14

Horizontal size.

#define XAXIVDMA_BD_HW_NUM_BYTES   28

Number of bytes hw used.

#define XAXIVDMA_BD_MINIMUM_ALIGNMENT   0x20

Minimum byte alignment requirement for descriptors.

Referenced by XAxiVdma_SetBdAddrs().

#define XAXIVDMA_BD_MINIMUM_ALIGNMENT_WD   0x8

Minimum word alignment requirement for descriptors.

#define XAXIVDMA_BD_NDESC_OFFSET   0x00

Next descriptor pointer.

#define XAXIVDMA_BD_NUM_WORDS   7

Total number of words for one BD.

#define XAXIVDMA_BD_START_ADDR_OFFSET   0x08

Start address.

#define XAXIVDMA_BD_STRIDE_OFFSET   0x18

Stride size.

#define XAXIVDMA_BD_VSIZE_OFFSET   0x10

Vertical size.

#define XAXIVDMA_BUFTHRES_OFFSET   0x0000001C

Line Buffer Thres.

Referenced by XAxiVdma_CfgInitialize(), and XAxiVdma_SetLineBufThreshold().

#define XAXIVDMA_CDESC_CURBD_MASK   0xFFFFFFE0

BD now working on.

#define XAXIVDMA_CDESC_OFFSET   0x00000008

Current descriptor pointer.

Referenced by XAxiVdma_ChannelRegisterDump(), and XAxiVdma_ChannelStart().

#define XAXIVDMA_CHAN_FSYNC   0

Frame Sync Source Selection.

Channel frame sync.

Referenced by XAxiVdma_FsyncSrcSelect().

#define XAXIVDMA_CHAN_OTHER_FSYNC   1

Other channel frame sync.

Referenced by XAxiVdma_FsyncSrcSelect().

#define XAxiVdma_ChannelHiFrmAddrDisable (   Channel)
Value:
{ \
XAxiVdma_WriteReg(Channel->ChanBase, \
}
#define XAXIVDMA_REGINDEX_MASK
Register Index.
Definition: xaxivdma_hw.h:200
#define XAXIVDMA_HI_FRMBUF_OFFSET
32 FrameBuf Sel
Definition: xaxivdma_hw.h:123

Sets the channel to disable access higher Frame Buffer Addresses (SG=0).

Parameters
[in]Channelis the pointer to the channel to work on

Referenced by XAxiVdma_ChannelSetBufferAddr().

#define XAxiVdma_ChannelHiFrmAddrEnable (   Channel)
Value:
{ \
XAxiVdma_WriteReg(Channel->ChanBase, \
}
#define XAXIVDMA_REGINDEX_MASK
Register Index.
Definition: xaxivdma_hw.h:200
#define XAXIVDMA_HI_FRMBUF_OFFSET
32 FrameBuf Sel
Definition: xaxivdma_hw.h:123

Sets the channel to enable access to higher Frame Buffer Addresses (SG=0).

Parameters
[in]Channelis the pointer to the channel to work on

Referenced by XAxiVdma_ChannelSetBufferAddr().

#define XAXIVDMA_CR_FRMCNT_EN_MASK   0x00000010

Frame count enable.

Referenced by XAxiVdma_ChannelConfig(), and XAxiVdma_ChannelStartFrmCntEnable().

#define XAXIVDMA_CR_FSYNC_SRC_MASK   0x00000060

Fsync Source Select.

Referenced by XAxiVdma_FsyncSrcSelect().

#define XAXIVDMA_CR_GENLCK_RPT_MASK   0x00008000

GenLock Repeat.

Referenced by XAxiVdma_ChannelConfig().

#define XAXIVDMA_CR_GENLCK_SRC_MASK   0x00000080

Genlock Source Select.

Referenced by XAxiVdma_GenLockSourceSelect().

#define XAXIVDMA_CR_RD_PTR_MASK   0x00000F00

Read pointer number.

Referenced by XAxiVdma_ChannelConfig().

#define XAXIVDMA_CR_RD_PTR_SHIFT   8

Shift for read pointer number.

Referenced by XAxiVdma_ChannelConfig().

#define XAXIVDMA_CR_RESET_MASK   0x00000004

Reset channel.

Referenced by XAxiVdma_ChannelReset(), and XAxiVdma_ChannelResetNotDone().

#define XAXIVDMA_CR_RUNSTOP_MASK   0x00000001

Start/stop DMA channel.

Referenced by XAxiVdma_ChannelIsRunning(), XAxiVdma_ChannelStart(), and XAxiVdma_ChannelStop().

#define XAXIVDMA_CR_SYNC_EN_MASK   0x00000008

Gen-lock enable.

Referenced by XAxiVdma_ChannelConfig().

#define XAXIVDMA_CR_TAIL_EN_MASK   0x00000002
#define XAXIVDMA_DELAY_MASK   0xFF000000

Delay timeout counter.

Referenced by XAxiVdma_ChannelGetFrmCnt(), and XAxiVdma_ChannelSetFrmCnt().

#define XAXIVDMA_DELAY_SHIFT   24

Bit shift for delay timeout counter.

Referenced by XAxiVdma_ChannelGetFrmCnt(), and XAxiVdma_ChannelSetFrmCnt().

#define XAXIVDMA_DEVICE_READY   0x11111111

Flag to signal that device is ready to be used.

Referenced by XAxiVdma_CfgInitialize(), XAxiVdma_GetFrameCounter(), XAxiVdma_SetCallBack(), and XAxiVdma_SetFrameCounter().

#define XAXIVDMA_DYN_GENLOCK_MASTER   2

Dynamic genlock master mode.

Referenced by XAxiVdma_ChannelConfig(), and XAxiVdma_GenLockSourceSelect().

#define XAXIVDMA_DYN_GENLOCK_SLAVE   3

Dynamic genlock slave mode.

Referenced by XAxiVdma_GenLockSourceSelect().

#define XAXIVDMA_ENABLE_DBG_ALL_FEATURES   0x0F

Enable all debug features.

Referenced by XAxiVdma_CfgInitialize().

#define XAXIVDMA_ENABLE_DBG_DLY_CNTR   0x08

Enable debug delay counter.

Referenced by XAxiVdma_CfgInitialize(), XAxiVdma_ChannelGetFrmCnt(), and XAxiVdma_ChannelSetFrmCnt().

#define XAXIVDMA_ENABLE_DBG_FRM_CNTR   0x04

Enable debug frame counter.

Referenced by XAxiVdma_CfgInitialize(), XAxiVdma_ChannelGetFrmCnt(), and XAxiVdma_ChannelSetFrmCnt().

#define XAXIVDMA_ENABLE_DBG_FRMSTORE_REG   0x02

Enable debug frame store register.

Referenced by XAxiVdma_CfgInitialize(), XAxiVdma_GetFrmStore(), and XAxiVdma_SetFrmStore().

#define XAXIVDMA_ENABLE_DBG_THRESHOLD_REG   0x01

Debug Configuration Parameter Constants (C_ENABLE_DEBUG_INFO_*)

Enable debug threshold register.

Referenced by XAxiVdma_CfgInitialize(), and XAxiVdma_SetLineBufThreshold().

#define XAXIVDMA_EXTERNAL_GENLOCK   0

GenLock Source Selection.

External genlock source.

Referenced by XAxiVdma_GenLockSourceSelect().

#define XAXIVDMA_FRM_MAX   0xF

At most 16 frames.

Referenced by XAxiVdma_ChannelConfig(), and XAxiVdma_StartParking().

#define XAXIVDMA_FRMCNT_MASK   0x00FF0000

Frame counter.

Referenced by XAxiVdma_ChannelGetFrmCnt(), and XAxiVdma_ChannelSetFrmCnt().

#define XAXIVDMA_FRMCNT_SHIFT   16

Bit shift for frame counter.

Referenced by XAxiVdma_ChannelGetFrmCnt(), and XAxiVdma_ChannelSetFrmCnt().

#define XAXIVDMA_FRMDLY_MASK   0x0F000000

Frame delay.

#define XAXIVDMA_FRMDLY_MAX   0xF

Maximum frame delay.

Referenced by XAxiVdma_ChannelConfig().

#define XAXIVDMA_FRMDLY_SHIFT   24

Shift for frame delay.

Referenced by XAxiVdma_ChannelConfig().

#define XAXIVDMA_FRMSTORE_MASK   0x0000003F

Frame store count mask.

Referenced by XAxiVdma_GetFrmStore(), and XAxiVdma_SetFrmStore().

#define XAXIVDMA_FRMSTORE_OFFSET   0x00000018

Frame Store.

Referenced by XAxiVdma_GetFrmStore(), and XAxiVdma_SetFrmStore().

#define XAXIVDMA_GENLOCK_MASTER   0

GenLock Mode Constants.

Genlock master mode.

Referenced by XAxiVdma_ChannelConfig(), and XAxiVdma_GenLockSourceSelect().

#define XAXIVDMA_GENLOCK_SLAVE   1

Genlock slave mode.

Referenced by XAxiVdma_GenLockSourceSelect().

#define XAXIVDMA_HANDLER_ERROR   2

Error Interrupt Type.

Referenced by XAxiVdma_SetCallBack().

#define XAXIVDMA_HANDLER_GENERAL   1

Interrupt type for setting up callback.

Non-Error Interrupt Type

Referenced by XAxiVdma_SetCallBack().

#define XAXIVDMA_HI_FRMBUF_OFFSET   0x00000014

32 FrameBuf Sel

#define XAXIVDMA_HSIZE_MASK   0x0000FFFF

Horizontal size.

#define XAXIVDMA_HSIZE_OFFSET   0x00000004

Horizontal size.

Referenced by XAxiVdma_ChannelConfig().

#define XAXIVDMA_INTERNAL_GENLOCK   1

Internal genlock source.

Referenced by XAxiVdma_GenLockSourceSelect().

#define XAXIVDMA_IXR_COMPLETION_MASK   0x00003000

Completion interrupts.

Referenced by XAxiVdma_ReadIntrHandler(), and XAxiVdma_WriteIntrHandler().

#define XAXIVDMA_IXR_DELAYCNT_MASK   0x00002000

Delay interrupt.

#define XAXIVDMA_IXR_ERROR_MASK   0x00004000
#define XAXIVDMA_IXR_FRMCNT_MASK   0x00001000

Frame count intr.

Referenced by run_triple_frame_buffer().

#define XAXIVDMA_MAX_FRAMESTORE   32

Maximum number of the frame store.

Maximum # of the frame store

Referenced by XAxiVdma_ChannelSetBufferAddr().

#define XAXIVDMA_MAX_FRAMESTORE_64   16

Maximum # of the frame store for 64-bit.

Referenced by XAxiVdma_ChannelSetBufferAddr().

#define XAXIVDMA_MAX_HSIZE   0xFFFF

Maximum horizontal size (64K).

Referenced by XAxiVdma_ChannelConfig().

#define XAXIVDMA_MAX_STRIDE   0xFFFF

Maximum stride size (64K).

Referenced by XAxiVdma_ChannelConfig().

#define XAXIVDMA_MAX_VSIZE   0x1FFF

Maximum vertical size (8K).

Referenced by XAxiVdma_ChannelConfig().

#define XAXIVDMA_MISMATCH_ERROR   0x80000010

Frame/Line Mismatch Error This is a typical DMA Internal Error, which on detection does not require a reset (as opposed to other errors).

So a MSB bit is set to identify it, from other DMA Internal Errors.

#define XAXIVDMA_MM2S_ADDR_OFFSET   0x00000050

MM2S channel Addr.

Referenced by XAxiVdma_CfgInitialize().

#define XAXIVDMA_PARKPTR_OFFSET   0x00000028

Park Pointer Register.

Referenced by XAxiVdma_ChannelConfig(), XAxiVdma_CurrFrameStore(), and XAxiVdma_StartParking().

#define XAXIVDMA_PARKPTR_READREF_MASK   0x0000001F

Read frame to park on.

Referenced by XAxiVdma_ChannelConfig(), and XAxiVdma_StartParking().

#define XAXIVDMA_PARKPTR_READSTR_MASK   0x001F0000

Current read frame.

Referenced by XAxiVdma_CurrFrameStore().

#define XAXIVDMA_PARKPTR_WRTREF_MASK   0x00001F00

Write frame to park on.

Referenced by XAxiVdma_ChannelConfig(), and XAxiVdma_StartParking().

#define XAXIVDMA_PARKPTR_WRTSTR_MASK   0x1F000000

Current write frame.

Referenced by XAxiVdma_CurrFrameStore().

#define XAXIVDMA_READREF_SHIFT   0

Bit shift for read park frame.

#define XAXIVDMA_READSTR_SHIFT   16

Bit shift for current read frame.

Referenced by XAxiVdma_CurrFrameStore().

#define XAXIVDMA_REGINDEX_MASK   0x00000001

Register Index.

#define XAXIVDMA_RESET_POLLING   1000

Maximum poll loops when waiting for channel reset completion.

#define XAXIVDMA_RESET_TIMEOUT   500

Maximum iterations to wait for reset completion.

Referenced by XAxiVdma_Selftest().

#define XAXIVDMA_RESET_TIMEOUT_USEC   500

Maximum microseconds to wait for VDMA reset.

#define XAXIVDMA_RX_OFFSET   0x00000030

RX channel registers base.

Referenced by XAxiVdma_CfgInitialize(), and XAxiVdma_Selftest().

#define XAXIVDMA_S2MM_ADDR_OFFSET   0x000000A0

S2MM channel Addr.

Referenced by XAxiVdma_CfgInitialize().

#define XAXIVDMA_S2MM_DMA_IRQ_MASK_OFFSET   0x0000003C

S2MM Err IRQ Mask.

Referenced by XAxiVdma_MaskS2MMErrIntr().

#define XAXIVDMA_S2MM_IRQ_ERR_ALL_MASK   0x0000000F

Masks all S2MM IRQ Errors.

Referenced by XAxiVdma_MaskS2MMErrIntr().

#define XAXIVDMA_S2MM_IRQ_FSZLESS_SOF_ERLY_MASK   0x00000001

Masks S2MM IRQ FSize Less/SOF Early Error.

#define XAXIVDMA_S2MM_IRQ_FSZMORE_SOF_LATE_MASK   0x00000004

Masks S2MM IRQ FSize More/SOF Late Error.

#define XAXIVDMA_S2MM_IRQ_LSZLESS_EOL_ERLY_MASK   0x00000002

Masks S2MM IRQ LSize Less/EOL Early Error.

#define XAXIVDMA_S2MM_IRQ_LSZMORE_EOL_LATE_MASK   0x00000008

Masks S2MM IRQ LSize More/EOL Late Error.

#define XAXIVDMA_S2MM_TUSER_FSYNC   2

S2MM TUSER frame sync.

Referenced by XAxiVdma_FsyncSrcSelect().

#define XAXIVDMA_SR_ERR_ALL_MASK   0x00000FF0

All errors.

Referenced by XAxiVdma_ChannelErrors().

#define XAXIVDMA_SR_ERR_DECODE_MASK   0x00000040

Datamover decode err.

#define XAXIVDMA_SR_ERR_FSZ_LESS_MASK   0x00000080

FSize Less Mismatch err.

#define XAXIVDMA_SR_ERR_FSZ_MORE_MASK   0x00000800

FSize More Mismatch err.

#define XAXIVDMA_SR_ERR_INTERNAL_MASK   0x00000010

Datamover internal err.

#define XAXIVDMA_SR_ERR_LSZ_LESS_MASK   0x00000100

LSize Less Mismatch err.

#define XAXIVDMA_SR_ERR_SG_DEC_MASK   0x00000400

SG decode err.

#define XAXIVDMA_SR_ERR_SG_SLV_MASK   0x00000200

SG slave err.

#define XAXIVDMA_SR_ERR_SLAVE_MASK   0x00000020

Datamover slave err.

#define XAXIVDMA_SR_HALTED_MASK   0x00000001

DMA channel halted.

Referenced by XAxiVdma_ChannelIsBusy(), and XAxiVdma_ChannelIsRunning().

#define XAXIVDMA_SR_IDLE_MASK   0x00000002

DMA channel idle.

Referenced by XAxiVdma_ChannelIsBusy().

#define XAXIVDMA_START_ADDR_LEN   0x00000004

Each entry is 4 bytes.

Referenced by XAxiVdma_ChannelSetBufferAddr().

#define XAXIVDMA_START_ADDR_MSB_OFFSET   0x00000010

Start of address.

Referenced by XAxiVdma_ChannelSetBufferAddr().

#define XAXIVDMA_START_ADDR_OFFSET   0x0000000C

Start of address.

Referenced by XAxiVdma_ChannelSetBufferAddr().

#define XAXIVDMA_STRD_FRMDLY_OFFSET   0x00000008

Horizontal size.

Referenced by XAxiVdma_ChannelConfig().

#define XAXIVDMA_STRIDE_MASK   0x0000FFFF

Stride size.

#define XAXIVDMA_TDESC_CURBD_MASK   0xFFFFFFE0

BD to stop on.

#define XAXIVDMA_TDESC_OFFSET   0x00000010

Tail descriptor pointer.

Referenced by XAxiVdma_ChannelRegisterDump(), and XAxiVdma_ChannelStart().

#define XAXIVDMA_TX_OFFSET   0x00000000

TX channel registers base.

Referenced by XAxiVdma_CfgInitialize(), and XAxiVdma_Selftest().

#define XAXIVDMA_VERSION_MAJOR_MASK   0xF0000000

Major version.

#define XAXIVDMA_VERSION_MAJOR_SHIFT   28

Bit shift for major version.

#define XAXIVDMA_VERSION_MINOR_MASK   0x0FF00000

Minor version.

#define XAXIVDMA_VERSION_MINOR_SHIFT   20

Bit shift for minor version.

#define XAXIVDMA_VERSION_OFFSET   0x0000002C

Version register.

Referenced by XAxiVdma_GetVersion().

#define XAXIVDMA_VERSION_REV_MASK   0x000F0000

Revision letter.

#define XAXIVDMA_VFLIP_EN_MASK   0x00000001

Vertical flip enable.

Referenced by XAxiVdma_ChannelConfig().

#define XAXIVDMA_VFLIP_OFFSET   0x000000EC

Enable Vertical Flip Register.

Referenced by XAxiVdma_ChannelConfig().

#define XAXIVDMA_VIRT_TO_PHYS (   VirtAddr)    (VirtAddr)

Translates a virtual address to a physical address.

When porting this driver to another RTOS, change this definition to match the target system address translation.

Parameters
[in]VirtAddris the virtual address to translate.
Returns
Returns the physical address for the virtual address.
Note
The virtual address and the physical address are the same here.

Referenced by XAxiVdma_ChannelInit().

#define XAXIVDMA_VSIZE_MASK   0x00001FFF

Vertical size.

#define XAXIVDMA_VSIZE_OFFSET   0x00000000

Vertical size.

Referenced by XAxiVdma_ChannelStart().

#define XAXIVDMA_WRTREF_SHIFT   8

Bit shift for write park frame.

Referenced by XAxiVdma_ChannelConfig(), and XAxiVdma_StartParking().

#define XAXIVDMA_WRTSTR_SHIFT   24

Bit shift for current write frame.

Referenced by XAxiVdma_CurrFrameStore().

#define XPAR_XAXIVDMA_NUM_INSTANCES   0

Number of AXI VDMA instances when not defined in xparameters.h.

Referenced by run_triple_frame_buffer().

#define XST_VDMA_MISMATCH_ERROR   1430

Frame or line mismatch error status code for backward compatibility.

This is a typical DMA internal error that does not require a reset. Reinitialize the channels when this error is observed.VDMA mismatch error status code.

Referenced by run_triple_frame_buffer().

Typedef Documentation

typedef struct vdma_handle vdma_handle

Holds VDMA instance context for the high-level API.

typedef void(* XAxiVdma_CallBack)(void *CallBackRef, u32 InterruptTypes)

Callback type for general interrupts.

Parameters
[in]CallBackRefCallback reference passed in by the upper layer.
[in]InterruptTypesDetailed interrupt type bitmask.
typedef void(* XAxiVdma_ErrorCallBack)(void *CallBackRef, u32 ErrorMask)

Callback type for error interrupts.

Parameters
[in]CallBackRefCallback reference passed in by the upper layer.
[in]ErrorMaskBit mask indicating the error cause.

Function Documentation

int AxiVDMASelfTestExample ( UINTPTR  BaseAddress)

Resets the VDMA device and checks that reset completes.

Parameters
[in]BaseAddresscontains the base address of the device.
Returns
  • XST_SUCCESS if channel reset is successful.
  • XST_FAILURE if channel reset fails.

References XAxiVdma_Config::BaseAddress, XAxiVdma_CfgInitialize(), XAxiVdma_LookupConfig(), and XAxiVdma_Selftest().

int main ( void  )

Runs the VDMA triple-frame-buffer example entry point.

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

Runs the AXI VDMA interrupt loopback example entry point.

Demonstrates configuration and start of two VDMA instances.

Sets up the DMA engine, starts frame transfers, and checks for errors.

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

References run_triple_frame_buffer().

int run_triple_frame_buffer ( XAxiVdma *  InstancePtr,
int  DeviceId,
int  hsize,
int  vsize,
int  buf_base_addr,
int  number_frame_count,
int  enable_frm_cnt_intr 
)

Runs the triple frame buffer API.

This API is the interface between application and other API. When application will call this API with right argument, This API will call rest of the API to configure the read and write path of VDMA,based on ID. After that it will start both the read and write path of VDMA

Parameters
[in]InstancePtris the handle to XAxiVdma data structure.
[in]DeviceIdis the device ID of current VDMA.
[in]hsizeis the horizontal size of the frame in pixels. The actual size of frame is calculated by multiplying this with tdata width.
[in]vsizeis the vertical size of the frame.
[in]buf_base_addris the buffer address where frames are written and read by VDMA.
[in]number_frame_countspecifies after how many frames the interrupt should come.
[in]enable_frm_cnt_intrenables frame count interrupt when set to 1.
Returns
  • XST_SUCCESS if example finishes successfully.
  • XST_FAILURE if example fails.

References XAxiVdma_Config::BaseAddress, XAxiVdma_Config::Mm2SStreamWidth, XAxiVdma_FrameCounter::ReadDelayTimerCount, XAxiVdma_FrameCounter::ReadFrameCount, XAxiVdma_FrameCounter::WriteDelayTimerCount, XAxiVdma_FrameCounter::WriteFrameCount, XAxiVdma_CfgInitialize(), XAxiVdma_IntrEnable(), XAXIVDMA_IXR_ERROR_MASK, XAXIVDMA_IXR_FRMCNT_MASK, XAxiVdma_LookupConfig(), XAXIVDMA_READ, XAxiVdma_SetFrameCounter(), XAXIVDMA_WRITE, XPAR_XAXIVDMA_NUM_INSTANCES, and XST_VDMA_MISMATCH_ERROR.

Referenced by main().

int XAxiVdma_CfgInitialize ( XAxiVdma *  InstancePtr,
XAxiVdma_Config *  CfgPtr,
UINTPTR  EffectiveAddr 
)

Initializes the driver with hardware configuration.

Parameters
[in]InstancePtris the pointer to the DMA engine to work on
[in]CfgPtris the pointer to the hardware configuration structure
[in]EffectiveAddris the virtual address map for the device
Returns
Returns XST_SUCCESS on success, XST_FAILURE if channel reset fails.
Note
If channel fails reset, then it will be set as invalid

References XAxiVdma_Config::AddrWidth, XAxiVdma::AddrWidth, XAxiVdma::BaseAddr, XAxiVdma_ChannelCallBack::CompletionCallBack, XAxiVdma_Config::EnableAllDbgFeatures, XAxiVdma_ChannelCallBack::ErrCallBack, XAxiVdma_Config::FlushonFsync, XAxiVdma_Config::HasMm2S, XAxiVdma::HasMm2S, XAxiVdma_Config::HasMm2SDRE, XAxiVdma_Config::HasS2Mm, XAxiVdma::HasS2Mm, XAxiVdma_Config::HasS2MmDRE, XAxiVdma_Config::HasSG, XAxiVdma::HasSG, XAxiVdma_Config::HasVFlip, INITIALIZATION_POLLING, XAxiVdma_Config::InternalGenLock, XAxiVdma::InternalGenLock, XAxiVdma::IsReady, XAxiVdma_Config::MaxFrameStoreNum, XAxiVdma::MaxNumFrames, XAxiVdma_Config::Mm2SBufDepth, XAxiVdma_Config::Mm2SDlyCntrEn, XAxiVdma_Config::Mm2SFrmCntrEn, XAxiVdma_Config::Mm2SFrmStoreRegEn, XAxiVdma_Config::Mm2SGenLock, XAxiVdma_Config::Mm2SStreamWidth, XAxiVdma_Config::Mm2SThresRegEn, XAxiVdma_Config::Mm2SWordLen, XAxiVdma::ReadCallBack, XAxiVdma_Config::S2MmBufDepth, XAxiVdma_Config::S2MmDlyCntrEn, XAxiVdma_Config::S2MmFrmCntrEn, XAxiVdma_Config::S2MmFrmStoreRegEn, XAxiVdma_Config::S2MmGenLock, XAxiVdma_Config::S2MmSOF, XAxiVdma_Config::S2MmStreamWidth, XAxiVdma_Config::S2MmThresRegEn, XAxiVdma_Config::S2MmWordLen, XAxiVdma_Config::UseFsync, XAxiVdma::UseFsync, XAxiVdma::WriteCallBack, XAXIVDMA_BUFTHRES_OFFSET, XAxiVdma_ChannelGetStatus(), XAxiVdma_ChannelInit(), XAxiVdma_ChannelReset(), XAxiVdma_ChannelResetNotDone(), XAXIVDMA_DEVICE_READY, XAXIVDMA_ENABLE_DBG_ALL_FEATURES, XAXIVDMA_ENABLE_DBG_DLY_CNTR, XAXIVDMA_ENABLE_DBG_FRM_CNTR, XAXIVDMA_ENABLE_DBG_FRMSTORE_REG, XAXIVDMA_ENABLE_DBG_THRESHOLD_REG, XAxiVdma_GetChannel(), XAXIVDMA_MM2S_ADDR_OFFSET, XAXIVDMA_READ, XAXIVDMA_RX_OFFSET, XAXIVDMA_S2MM_ADDR_OFFSET, XAXIVDMA_TX_OFFSET, and XAXIVDMA_WRITE.

Referenced by AxiVDMASelfTestExample(), and run_triple_frame_buffer().

int XAxiVdma_ChannelConfig ( XAxiVdma_Channel *  Channel,
XAxiVdma_ChannelSetup *  ChannelCfgPtr 
)

Configures one DMA channel using the configuration structure.

Setup the control register and BDs, however, BD addresses are not set.

Parameters
[in]Channelis the pointer to the channel to work on
[in]ChannelCfgPtris the pointer to the setup structure
Returns
Returns XST_SUCCESS on success, XST_FAILURE if not initialized, XST_DEVICE_BUSY if busy, XST_INVALID_PARAM on invalid configuration.

References XAxiVdma_ChannelIsBusy(), XAxiVdma_ChannelIsRunning(), XAXIVDMA_CR_FRMCNT_EN_MASK, XAXIVDMA_CR_GENLCK_RPT_MASK, XAXIVDMA_CR_OFFSET, XAXIVDMA_CR_RD_PTR_MASK, XAXIVDMA_CR_RD_PTR_SHIFT, XAXIVDMA_CR_SYNC_EN_MASK, XAXIVDMA_CR_TAIL_EN_MASK, XAXIVDMA_DYN_GENLOCK_MASTER, XAXIVDMA_FRM_MAX, XAXIVDMA_FRMDLY_MAX, XAXIVDMA_FRMDLY_SHIFT, XAXIVDMA_GENLOCK_MASTER, XAXIVDMA_HSIZE_OFFSET, XAXIVDMA_MAX_HSIZE, XAXIVDMA_MAX_STRIDE, XAXIVDMA_MAX_VSIZE, XAXIVDMA_PARKPTR_OFFSET, XAXIVDMA_PARKPTR_READREF_MASK, XAXIVDMA_PARKPTR_WRTREF_MASK, XAXIVDMA_STRD_FRMDLY_OFFSET, XAXIVDMA_VFLIP_EN_MASK, XAXIVDMA_VFLIP_OFFSET, XAXIVDMA_WRITE, and XAXIVDMA_WRTREF_SHIFT.

Referenced by XAxiVdma_ChannelStartTransfer(), and XAxiVdma_DmaConfig().

void XAxiVdma_ChannelDisableIntr ( XAxiVdma_Channel *  Channel,
u32  IntrType 
)

Disables interrupts for a channel.

Interrupts that are not specified by the. interrupt mask are not affected.

Parameters
[in]Channelis the pointer to the channel to work on
[in]IntrTypeis the interrupt mask for interrupts to be disabled

References XAXIVDMA_CR_OFFSET, and XAXIVDMA_IXR_ALL_MASK.

Referenced by XAxiVdma_IntrDisable().

void XAxiVdma_ChannelEnableIntr ( XAxiVdma_Channel *  Channel,
u32  IntrType 
)

Enables interrupts for a channel.

Interrupts that are not specified by the. interrupt mask are not affected.

Parameters
[in]Channelis the pointer to the channel to work on
[in]IntrTypeis the interrupt mask for interrupts to be enabled

References XAXIVDMA_CR_OFFSET, and XAXIVDMA_IXR_ALL_MASK.

Referenced by XAxiVdma_IntrEnable().

u32 XAxiVdma_ChannelErrors ( XAxiVdma_Channel *  Channel)

Returns the error bits for a DMA channel.

Parameters
[in]Channelis the pointer to the channel to work on.
Returns
Returns channel error bits, or 0 if there are no errors.

References XAXIVDMA_SR_ERR_ALL_MASK, and XAXIVDMA_SR_OFFSET.

Referenced by XAxiVdma_GetDmaChannelErrors().

u32 XAxiVdma_ChannelGetEnabledIntr ( XAxiVdma_Channel *  Channel)

Gets the enabled interrupts of a channel.

Parameters
[in]Channelis the pointer to the channel to work on
Returns
Returns the mask of enabled interrupts.

References XAXIVDMA_CR_OFFSET, and XAXIVDMA_IXR_ALL_MASK.

Referenced by XAxiVdma_ReadIntrHandler(), and XAxiVdma_WriteIntrHandler().

void XAxiVdma_ChannelGetFrmCnt ( XAxiVdma_Channel *  Channel,
u8 *  FrmCnt,
u8 *  DlyCnt 
)

Gets the frame counter and delay counter for both channels.

Parameters
[in]Channelis the pointer to the channel to work on
[in]FrmCntis the pointer for the returning frame counter value
[in]DlyCntis the pointer for the returning delay counter value
Note
If FrmCnt return as 0, then the channel is not initialized

References XAXIVDMA_CR_OFFSET, XAXIVDMA_DELAY_MASK, XAXIVDMA_DELAY_SHIFT, XAXIVDMA_ENABLE_DBG_DLY_CNTR, XAXIVDMA_ENABLE_DBG_FRM_CNTR, XAXIVDMA_FRMCNT_MASK, and XAXIVDMA_FRMCNT_SHIFT.

Referenced by XAxiVdma_GetFrameCounter().

u32 XAxiVdma_ChannelGetPendingIntr ( XAxiVdma_Channel *  Channel)

Gets pending interrupts of a channel.

Parameters
[in]Channelis the pointer to the channel to work on
Returns
Returns the mask of pending interrupts.

References XAXIVDMA_IXR_ALL_MASK, and XAXIVDMA_SR_OFFSET.

Referenced by XAxiVdma_IntrGetPending(), XAxiVdma_ReadIntrHandler(), and XAxiVdma_WriteIntrHandler().

u32 XAxiVdma_ChannelGetStatus ( XAxiVdma_Channel *  Channel)

Gets the current status of a channel.

Parameters
[in]Channelis the pointer to the channel to work on
Returns
Returns the channel status register value.

References XAXIVDMA_SR_OFFSET.

Referenced by XAxiVdma_CfgInitialize(), and XAxiVdma_GetStatus().

void XAxiVdma_ChannelInit ( XAxiVdma_Channel *  Channel)

Initializes a channel of a DMA engine.

This function initializes the BD ring for this channel

Parameters
[in]Channelis the pointer to the DMA channel to work on

References XAXIVDMA_VIRT_TO_PHYS.

Referenced by XAxiVdma_CfgInitialize(), and XAxiVdma_SetFrmStore().

void XAxiVdma_ChannelIntrClear ( XAxiVdma_Channel *  Channel,
u32  IntrType 
)

Clears interrupts of a channel.

Interrupts that are not specified by the. interrupt mask are not affected.

Parameters
[in]Channelis the pointer to the channel to work on
[in]IntrTypeis the interrupt mask for interrupts to be cleared

References XAXIVDMA_IXR_ALL_MASK, and XAXIVDMA_SR_OFFSET.

Referenced by XAxiVdma_IntrClear(), XAxiVdma_ReadIntrHandler(), and XAxiVdma_WriteIntrHandler().

int XAxiVdma_ChannelIsBusy ( XAxiVdma_Channel *  Channel)

Checks whether a DMA channel is busy.

Parameters
[in]Channelis the pointer to the channel to work on
Returns
Returns non-zero if the channel is busy, 0 if idle.

References XAXIVDMA_SR_HALTED_MASK, XAXIVDMA_SR_IDLE_MASK, and XAXIVDMA_SR_OFFSET.

Referenced by XAxiVdma_ChannelConfig(), XAxiVdma_ChannelSetBdAddrs(), XAxiVdma_ChannelStart(), XAxiVdma_ChannelStartTransfer(), and XAxiVdma_IsBusy().

int XAxiVdma_ChannelIsRunning ( XAxiVdma_Channel *  Channel)

Checks whether a DMA channel is running.

Parameters
[in]Channelis the pointer to the channel to work on.
Returns
Returns non-zero if the channel is running, or 0 if idle.

References XAXIVDMA_CR_OFFSET, XAXIVDMA_CR_RUNSTOP_MASK, XAXIVDMA_SR_HALTED_MASK, and XAXIVDMA_SR_OFFSET.

Referenced by XAxiVdma_ChannelConfig(), XAxiVdma_ChannelStart(), XAxiVdma_ChannelStartParking(), XAxiVdma_ChannelStop(), and XAxiVdma_SetFrmStore().

void XAxiVdma_ChannelRegisterDump ( XAxiVdma_Channel *  Channel)

Dumps registers from one DMA channel.

Parameters
[in]Channelis the pointer to the channel to work on

References XAXIVDMA_CDESC_OFFSET, XAXIVDMA_CR_OFFSET, XAXIVDMA_SR_OFFSET, and XAXIVDMA_TDESC_OFFSET.

Referenced by XAxiVdma_DmaRegisterDump().

void XAxiVdma_ChannelReset ( XAxiVdma_Channel *  Channel)

Provides function resets one DMA channel.

The registers will be default values after the reset

Parameters
[in]Channelis the pointer to the DMA channel to work on

References XAXIVDMA_CR_OFFSET, and XAXIVDMA_CR_RESET_MASK.

Referenced by XAxiVdma_CfgInitialize(), XAxiVdma_Reset(), and XAxiVdma_Selftest().

int XAxiVdma_ChannelResetNotDone ( XAxiVdma_Channel *  Channel)

Provides function checks whether reset operation is done.

Parameters
[in]Channelis the pointer to the DMA channel to work on
Returns
Returns non-zero if reset is ongoing, 0 if reset is done.

References XAXIVDMA_CR_OFFSET, and XAXIVDMA_CR_RESET_MASK.

Referenced by XAxiVdma_CfgInitialize(), XAxiVdma_ResetNotDone(), and XAxiVdma_Selftest().

int XAxiVdma_ChannelSetBdAddrs ( XAxiVdma_Channel *  Channel,
UINTPTR  BdAddrPhys,
UINTPTR  BdAddrVirt 
)

Sets BD addresses to a different memory region.

In some systems, it is convenient to put BDs into a certain region of the memory. This function enables that.

Parameters
[in]Channelis the pointer to the channel to work on
[in]BdAddrPhysis the physical starting address for BDs
[in]BdAddrVirtis the Virtual starting address for BDs. For systems that do not use MMU, then virtual address is the same as physical address
Returns
Returns XST_SUCCESS on success, XST_DEVICE_BUSY if channel is busy.
Note
We assume that the memory region starting from BdAddrPhys is large enough to hold all the BDs.

References XAxiVdma_ChannelIsBusy().

Referenced by XAxiVdma_SetBdAddrs().

int XAxiVdma_ChannelSetBufferAddr ( XAxiVdma_Channel *  Channel,
UINTPTR *  BufferAddrSet,
int  NumFrames 
)

Configures buffer addresses for one DMA channel.

The buffer addresses are physical addresses. Access to 32 Frame Buffer Addresses in direct mode is done through XAxiVdma_ChannelHiFrmAddrEnable/Disable Functions. 0 - Access Bank0 Registers (0x5C - 0x98) 1 - Access Bank1 Registers (0x5C - 0x98)

Parameters
[in]Channelis the pointer to the channel to work on
[in]BufferAddrSetis the set of addresses for the transfers
[in]NumFramesis the number of frames to set the address
Returns
Returns XST_SUCCESS on success, XST_FAILURE if not initialized, XST_INVALID_PARAM on invalid buffer address.

References XAxiVdma_ChannelHiFrmAddrDisable, XAxiVdma_ChannelHiFrmAddrEnable, XAXIVDMA_MAX_FRAMESTORE, XAXIVDMA_MAX_FRAMESTORE_64, XAXIVDMA_START_ADDR_LEN, XAXIVDMA_START_ADDR_MSB_OFFSET, and XAXIVDMA_START_ADDR_OFFSET.

Referenced by XAxiVdma_ChannelStartTransfer(), and XAxiVdma_DmaSetBufferAddr().

int XAxiVdma_ChannelSetFrmCnt ( XAxiVdma_Channel *  Channel,
u8  FrmCnt,
u8  DlyCnt 
)

Sets the frame counter and delay counter for one channel.

Parameters
[in]Channelis the pointer to the channel to work on
[in]FrmCntis the frame counter value to be set
[in]DlyCntis the delay counter value to be set
Returns
Returns XST_SUCCESS on success, XST_FAILURE if not initialized, XST_INVALID_PARAM on invalid value, XST_NO_FEATURE if counter is disabled.

References XAXIVDMA_CR_OFFSET, XAXIVDMA_DELAY_MASK, XAXIVDMA_DELAY_SHIFT, XAXIVDMA_ENABLE_DBG_DLY_CNTR, XAXIVDMA_ENABLE_DBG_FRM_CNTR, XAXIVDMA_FRMCNT_MASK, and XAXIVDMA_FRMCNT_SHIFT.

Referenced by XAxiVdma_SetFrameCounter().

int XAxiVdma_ChannelStart ( XAxiVdma_Channel *  Channel)

Starts one DMA channel.

Parameters
[in]Channelis the pointer to the channel to work on
Returns
Returns XST_SUCCESS on success, XST_FAILURE if not initialized, XST_DEVICE_BUSY if busy, XST_DMA_ERROR on start failure.

References XAXIVDMA_CDESC_OFFSET, XAxiVdma_ChannelIsBusy(), XAxiVdma_ChannelIsRunning(), XAXIVDMA_CR_OFFSET, XAXIVDMA_CR_RUNSTOP_MASK, XAXIVDMA_TDESC_OFFSET, and XAXIVDMA_VSIZE_OFFSET.

Referenced by XAxiVdma_ChannelStartTransfer(), and XAxiVdma_DmaStart().

void XAxiVdma_ChannelStartFrmCntEnable ( XAxiVdma_Channel *  Channel)

Sets the channel to run in frame count enable mode.

Parameters
[in]Channelis the pointer to the channel to work on

References XAXIVDMA_CR_FRMCNT_EN_MASK, and XAXIVDMA_CR_OFFSET.

Referenced by XAxiVdma_StartFrmCntEnable().

int XAxiVdma_ChannelStartParking ( XAxiVdma_Channel *  Channel)

Sets the channel to run in parking mode.

Parameters
[in]Channelis the pointer to the channel to work on
Returns
Returns XST_SUCCESS on success, XST_FAILURE if channel is not running.

References XAxiVdma_ChannelIsRunning(), XAXIVDMA_CR_OFFSET, and XAXIVDMA_CR_TAIL_EN_MASK.

Referenced by XAxiVdma_StartParking().

int XAxiVdma_ChannelStartTransfer ( XAxiVdma_Channel *  Channel,
XAxiVdma_ChannelSetup *  ChannelCfgPtr 
)

Starts a transfer.

This function setup the DMA engine and start the engine to do the transfer.

Parameters
[in]Channelis the pointer to the channel to work on
[in]ChannelCfgPtris the pointer to the setup structure
Returns
Returns XST_SUCCESS on success, XST_FAILURE if not initialized, XST_DEVICE_BUSY if busy, or channel error code.

References XAxiVdma_ChannelConfig(), XAxiVdma_ChannelIsBusy(), XAxiVdma_ChannelSetBufferAddr(), and XAxiVdma_ChannelStart().

Referenced by XAxiVdma_StartReadFrame(), and XAxiVdma_StartWriteFrame().

void XAxiVdma_ChannelStop ( XAxiVdma_Channel *  Channel)

Stops one DMA channel.

Parameters
[in]Channelis the pointer to the channel to work on

References XAxiVdma_ChannelIsRunning(), XAXIVDMA_CR_OFFSET, and XAXIVDMA_CR_RUNSTOP_MASK.

Referenced by XAxiVdma_DmaStop().

void XAxiVdma_ChannelStopParking ( XAxiVdma_Channel *  Channel)

Sets the channel to run in circular mode, exiting parking mode.

Parameters
[in]Channelis the pointer to the channel to work on

References XAXIVDMA_CR_OFFSET, and XAXIVDMA_CR_TAIL_EN_MASK.

Referenced by XAxiVdma_StopParking().

void XAxiVdma_ClearChannelErrors ( XAxiVdma_Channel *  Channel,
u32  ErrorMask 
)

Clears selected error bits for a DMA channel.

Parameters
[in]Channelis the pointer to the channel to work on.
[in]ErrorMaskis the mask of error bits to clear.

References XAXIVDMA_SR_OFFSET.

Referenced by XAxiVdma_ClearDmaChannelErrors().

int XAxiVdma_ClearDmaChannelErrors ( XAxiVdma *  InstancePtr,
u16  Direction,
u32  ErrorMask 
)

Clears DMA Channel Errors.

Parameters
[in]InstancePtris the XAxiVdma instance to operate on
[in]Directionis the channel to work on, use XAXIVDMA_READ/WRITE
[in]ErrorMaskis the mask of error bits to clear
Returns
- XST_SUCCESS, when error bits are cleared.
  • XST_INVALID_PARAM, when channel pointer is invalid.
  • XST_DEVICE_NOT_FOUND, when the channel is not valid.

References XAxiVdma_ClearChannelErrors(), and XAxiVdma_GetChannel().

u32 XAxiVdma_CurrFrameStore ( XAxiVdma *  InstancePtr,
u16  Direction 
)

Gets the current frame that hardware is working on.

Parameters
[in]InstancePtris the pointer to the DMA engine to work on
[in]Directionis the channel to work on, use XAXIVDMA_READ/WRITE
Returns
Returns the current frame index, or 0xFFFFFFFF if Direction is invalid.
Note
If returned frame number is out of range, then the channel is invalid

References XAxiVdma::BaseAddr, XAXIVDMA_PARKPTR_OFFSET, XAXIVDMA_PARKPTR_READSTR_MASK, XAXIVDMA_PARKPTR_WRTSTR_MASK, XAXIVDMA_READ, XAXIVDMA_READSTR_SHIFT, XAXIVDMA_WRITE, and XAXIVDMA_WRTSTR_SHIFT.

int XAxiVdma_DmaConfig ( XAxiVdma *  InstancePtr,
u16  Direction,
XAxiVdma_DmaSetup *  DmaConfigPtr 
)

Configures one DMA channel using the configuration structure.

Parameters
[in]InstancePtris the pointer to the DMA engine to work on
[in]Directionis the DMA channel to work on
[in]DmaConfigPtris the pointer to the setup structure
Returns
Returns XST_SUCCESS on success, XST_INVALID_PARAM on invalid Direction, XST_DEVICE_NOT_FOUND if channel is invalid, or channel error code.

References XAxiVdma_ChannelConfig(), and XAxiVdma_GetChannel().

void XAxiVdma_DmaRegisterDump ( XAxiVdma *  InstancePtr,
u16  Direction 
)

Dumps registers of one DMA channel.

Parameters
[in]InstancePtris the pointer to the DMA engine to work on
[in]Directionis the DMA channel to work on
Note
If channel is invalid, then do nothing on that channel

References XAxiVdma_ChannelRegisterDump(), and XAxiVdma_GetChannel().

int XAxiVdma_DmaSetBufferAddr ( XAxiVdma *  InstancePtr,
u16  Direction,
UINTPTR *  BufferAddrSet 
)

Configures buffer addresses for one DMA channel.

Parameters
[in]InstancePtris the pointer to the DMA engine to work on
[in]Directionis the DMA channel to work on
[in]BufferAddrSetis the set of addresses for the transfers
Returns
Returns XST_SUCCESS on success, XST_INVALID_PARAM on invalid Direction, XST_DEVICE_NOT_FOUND if channel is invalid, or channel error code.

References XAxiVdma_ChannelSetBufferAddr(), and XAxiVdma_GetChannel().

int XAxiVdma_DmaStart ( XAxiVdma *  InstancePtr,
u16  Direction 
)

Starts one DMA channel.

Parameters
[in]InstancePtris the pointer to the DMA engine to work on
[in]Directionis the DMA channel to work on
Returns
Returns XST_SUCCESS on success, XST_INVALID_PARAM on invalid Direction, XST_DEVICE_NOT_FOUND if channel is invalid, or channel error code.

References XAxiVdma_ChannelStart(), and XAxiVdma_GetChannel().

void XAxiVdma_DmaStop ( XAxiVdma *  InstancePtr,
u16  Direction 
)

Stops one DMA channel.

Parameters
[in]InstancePtris the pointer to the DMA engine to work on
[in]Directionis the DMA channel to work on
Note
If channel is invalid, then do nothing on that channel

References XAxiVdma_ChannelStop(), and XAxiVdma_GetChannel().

int XAxiVdma_FsyncSrcSelect ( XAxiVdma *  InstancePtr,
u32  Source,
u16  Direction 
)

Configures Frame Sync Source and valid only when C_USE_FSYNC is enabled.

Parameters
[in]InstancePtris the pointer to the DMA engine to work on
[in]Sourceis the value to set the source of Frame Sync
[in]Directionis the DMA channel to work on
Returns
Returns XST_SUCCESS on success, XST_FAILURE if frame sync is disabled or source is invalid.

References XAxiVdma::UseFsync, XAXIVDMA_CHAN_FSYNC, XAXIVDMA_CHAN_OTHER_FSYNC, XAXIVDMA_CR_FSYNC_SRC_MASK, XAXIVDMA_CR_OFFSET, XAxiVdma_GetChannel(), XAXIVDMA_S2MM_TUSER_FSYNC, and XAXIVDMA_WRITE.

int XAxiVdma_GenLockSourceSelect ( XAxiVdma *  InstancePtr,
u32  Source,
u16  Direction 
)

Configures Gen Lock Source.

Parameters
[in]InstancePtris the pointer to the DMA engine to work on
[in]Sourceis the value to set the source of Gen Lock
[in]Directionis the DMA channel to work on
Returns
Returns XST_SUCCESS on success, XST_FAILURE if genlock configuration is invalid.

References XAxiVdma::HasMm2S, XAxiVdma::HasS2Mm, XAxiVdma::InternalGenLock, XAXIVDMA_CR_GENLCK_SRC_MASK, XAXIVDMA_CR_OFFSET, XAXIVDMA_DYN_GENLOCK_MASTER, XAXIVDMA_DYN_GENLOCK_SLAVE, XAXIVDMA_EXTERNAL_GENLOCK, XAXIVDMA_GENLOCK_MASTER, XAXIVDMA_GENLOCK_SLAVE, XAxiVdma_GetChannel(), XAXIVDMA_INTERNAL_GENLOCK, XAXIVDMA_READ, and XAXIVDMA_WRITE.

int XAxiVdma_GetDmaChannelErrors ( XAxiVdma *  InstancePtr,
u16  Direction 
)

Checks for DMA Channel Errors.

Parameters
[in]InstancePtris the XAxiVdma instance to operate on
[in]Directionis the channel to work on, use XAXIVDMA_READ/WRITE
Returns
- Errors seen on the channel
  • XST_INVALID_PARAM, when channel pointer is invalid.
  • XST_DEVICE_NOT_FOUND, when the channel is not valid.

References XAxiVdma_ChannelErrors(), and XAxiVdma_GetChannel().

void XAxiVdma_GetFrameCounter ( XAxiVdma *  InstancePtr,
XAxiVdma_FrameCounter *  CfgPtr 
)

Gets the frame counter and delay counter for both channels.

Parameters
[in]InstancePtris the pointer to the DMA engine to work on
[in]CfgPtris the configuration structure to contain return values
Note
If returned frame counter value is 0, then the channel is not valid

References XAxiVdma::IsReady, XAxiVdma_FrameCounter::ReadDelayTimerCount, XAxiVdma_FrameCounter::ReadFrameCount, XAxiVdma_FrameCounter::WriteDelayTimerCount, XAxiVdma_FrameCounter::WriteFrameCount, XAxiVdma_ChannelGetFrmCnt(), XAXIVDMA_DEVICE_READY, XAxiVdma_GetChannel(), XAXIVDMA_READ, and XAXIVDMA_WRITE.

void XAxiVdma_GetFrmStore ( XAxiVdma *  InstancePtr,
u8 *  FrmStoreNum,
u16  Direction 
)

Gets the number of frame store buffers to use.

Parameters
[in]InstancePtris the XAxiVdma instance to operate on
[out]FrmStoreNumis the number of frame store buffers to use.
[in]Directionis the channel to work on, use XAXIVDMA_READ/WRITE

References XAXIVDMA_ENABLE_DBG_FRMSTORE_REG, XAXIVDMA_FRMSTORE_MASK, XAXIVDMA_FRMSTORE_OFFSET, and XAxiVdma_GetChannel().

u32 XAxiVdma_GetStatus ( XAxiVdma *  InstancePtr,
u16  Direction 
)

Gets the status of a channel.

Parameters
[in]InstancePtris the pointer to the DMA engine to work on
[in]Directionis the channel to work on, use XAXIVDMA_READ/WRITE
Returns
Returns the channel status register value, or 0xFFFFFFFF if invalid.
Note
An invalid return value indicates that channel is invalid

References XAxiVdma_ChannelGetStatus(), and XAxiVdma_GetChannel().

u32 XAxiVdma_GetVersion ( XAxiVdma *  InstancePtr)

Gets the version of the hardware.

Parameters
[in]InstancePtris the pointer to the DMA engine to work on
Returns
Returns the hardware version register value.

References XAxiVdma::BaseAddr, and XAXIVDMA_VERSION_OFFSET.

void XAxiVdma_IntrClear ( XAxiVdma *  InstancePtr,
u32  IntrType,
u16  Direction 
)

Clears the pending interrupts specified by the bit mask.

Interrupts not specified by the mask will not be affected

Parameters
[in]InstancePtris the pointer to the DMA engine to work on
[in]Directionis the DMA channel, use XAXIVDMA_READ or XAXIVDMA_WRITE
[in]IntrTypeis the bit mask for the interrupts to be cleared
Note
If channel is invalid, then nothing is done

References XAxiVdma_ChannelIntrClear(), and XAxiVdma_GetChannel().

void XAxiVdma_IntrDisable ( XAxiVdma *  InstancePtr,
u32  IntrType,
u16  Direction 
)

Disables specific interrupts for a channel.

Interrupts not specified by the mask will not be affected

Parameters
[in]InstancePtris the pointer to the DMA engine to work on
[in]IntrTypeis the bit mask for the interrupts to be disabled
[in]Directionis the DMA channel, use XAXIVDMA_READ or XAXIVDMA_WRITE
Note
If channel is invalid, then nothing is done

References XAxiVdma_ChannelDisableIntr(), and XAxiVdma_GetChannel().

void XAxiVdma_IntrEnable ( XAxiVdma *  InstancePtr,
u32  IntrType,
u16  Direction 
)

Enables specific interrupts for a channel.

Interrupts not specified by the mask will not be affected

Parameters
[in]InstancePtris the pointer to the DMA engine to work on
[in]Directionis the DMA channel, use XAXIVDMA_READ or XAXIVDMA_WRITE
[in]IntrTypeis the bit mask for the interrupts to be enabled
Note
If channel is invalid, then nothing is done

References XAxiVdma_ChannelEnableIntr(), and XAxiVdma_GetChannel().

Referenced by run_triple_frame_buffer().

u32 XAxiVdma_IntrGetPending ( XAxiVdma *  InstancePtr,
u16  Direction 
)

Gets the pending interrupts of a channel.

Parameters
[in]InstancePtris the pointer to the DMA engine to work on
[in]Directionis the DMA channel, use XAXIVDMA_READ or XAXIVDMA_WRITE
Returns
Returns the bit mask of pending interrupts, or 0 if direction or channel is invalid.
Note
If Direction is invalid, return 0

References XAxiVdma_ChannelGetPendingIntr(), and XAxiVdma_GetChannel().

int XAxiVdma_IsBusy ( XAxiVdma *  InstancePtr,
u16  Direction 
)

Checks whether a DMA channel is busy.

Parameters
[in]InstancePtris the pointer to the DMA engine to work on
[in]Directionis the channel to work on, use XAXIVDMA_READ/WRITE
Returns
Returns non-zero if the channel is busy, 0 if idle or invalid.

References XAxiVdma_ChannelIsBusy(), and XAxiVdma_GetChannel().

XAxiVdma_Config * XAxiVdma_LookupConfig ( UINTPTR  BaseAddress)

Looks up the device configuration based on the unique device ID/BaseAddress.

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 XAxiVdma_Config::Name.

Referenced by AxiVDMASelfTestExample(), and run_triple_frame_buffer().

int XAxiVdma_MaskS2MMErrIntr ( XAxiVdma *  InstancePtr,
u32  ErrorMask,
u16  Direction 
)

Masks the S2MM error interrupt for the provided error mask value.

Parameters
[in]InstancePtris the XAxiVdma instance to operate on
[in]ErrorMaskis the mask of error bits for which S2MM error interrupt can be disabled.
[in]Directionis the channel to work on, use XAXIVDMA_READ/WRITE
Returns
- XST_SUCCESS, when error bits are cleared.
  • XST_INVALID_PARAM, when channel pointer is invalid.
  • XST_DEVICE_NOT_FOUND, when the channel is not valid.
Note
The register S2MM_DMA_IRQ_MASK is only applicable from IPv6.01a which is added at offset XAXIVDMA_S2MM_DMA_IRQ_MASK_OFFSET. For older versions, this offset location is reserved and so the API does not have any effect.

References XAxiVdma_GetChannel(), XAXIVDMA_S2MM_DMA_IRQ_MASK_OFFSET, XAXIVDMA_S2MM_IRQ_ERR_ALL_MASK, and XAXIVDMA_WRITE.

void XAxiVdma_ReadIntrHandler ( void *  InstancePtr)
void XAxiVdma_Reset ( XAxiVdma *  InstancePtr,
u16  Direction 
)

Provides function resets one DMA channel.

The registers will be default values after the reset

Parameters
[in]InstancePtris the pointer to the DMA engine to work on
[in]Directionis the channel to work on, use XAXIVDMA_READ/WRITE
Note
Due to undeterminism of system delays, check the reset status through XAxiVdma_ResetNotDone(). If direction is invalid, do nothing.

References XAxiVdma_ChannelReset(), and XAxiVdma_GetChannel().

int XAxiVdma_ResetNotDone ( XAxiVdma *  InstancePtr,
u16  Direction 
)

Provides function checks one DMA channel for reset completion.

Parameters
[in]InstancePtris the pointer to the DMA engine to work on
[in]Directionis the channel to work on, use XAXIVDMA_READ/WRITE
Returns
Returns 0 if reset is done, 1 if reset is ongoing or Direction is invalid.
Note
We do not check for channel validity, because channel is marked as invalid before reset is done

References XAxiVdma_ChannelResetNotDone(), and XAxiVdma_GetChannel().

int XAxiVdma_Selftest ( XAxiVdma *  InstancePtr)

Runs a self-test on the driver/device.

This test perform a. reset of the VDMA device and checks the device is coming out of reset or not

Parameters
[in]InstancePtris a pointer to the XAxiVdma instance.
Returns
  • XST_SUCCESS if self-test was successful
  • XST_FAILURE if the device is not coming out of reset.

References XAxiVdma::BaseAddr, XAxiVdma::HasMm2S, XAxiVdma::HasS2Mm, XAxiVdma_ChannelReset(), XAxiVdma_ChannelResetNotDone(), XAxiVdma_GetChannel(), XAXIVDMA_READ, XAXIVDMA_RESET_TIMEOUT, XAXIVDMA_RX_OFFSET, XAXIVDMA_TX_OFFSET, and XAXIVDMA_WRITE.

Referenced by AxiVDMASelfTestExample().

int XAxiVdma_SetBdAddrs ( XAxiVdma *  InstancePtr,
u32  BdAddrPhys,
u32  BdAddrVirt,
int  NumBds,
u16  Direction 
)

Sets BD addresses to be different.

In some systems, it is convenient to put BDs into a certain region of the memory. This function enables that.

Parameters
[in]InstancePtris the pointer to the DMA engine to work on
[in]BdAddrPhysis the physical starting address for BDs
[in]BdAddrVirtis the Virtual starting address for BDs. For systems that do not use MMU, then virtual address is the same as physical address
[in]NumBdsis the number of BDs to setup with. This is required to be the same as the number of frame stores for that channel
[in]Directionis the channel direction
Returns
Returns XST_SUCCESS on success, XST_INVALID_PARAM on invalid parameters, XST_DEVICE_NOT_FOUND if channel is invalid, or channel error code.
Note
We assume that the memory region starting from BdAddrPhys and BdAddrVirt are large enough to hold all the BDs.

References XAXIVDMA_BD_MINIMUM_ALIGNMENT, XAxiVdma_ChannelSetBdAddrs(), and XAxiVdma_GetChannel().

int XAxiVdma_SetCallBack ( XAxiVdma *  InstancePtr,
u32  HandlerType,
void *  CallBackFunc,
void *  CallBackRef,
u16  Direction 
)

Sets call back function and call back reference pointer for one channel.

Parameters
[in]InstancePtris the pointer to the DMA engine to work on
[in]HandlerTypeis the interrupt type that this callback handles
[in]CallBackFuncis the call back function pointer
[in]CallBackRefis the call back reference pointer
[in]Directionis the DMA channel, use XAXIVDMA_READ or XAXIVDMA_WRITE
Returns
Returns XST_SUCCESS on success, XST_INVALID_PARAM on invalid handler type or direction.
Note
This function overwrites the existing interrupt handler and its reference pointer. The function sets the handlers even if the channels are invalid.

References XAxiVdma_ChannelCallBack::CompletionCallBack, XAxiVdma_ChannelCallBack::CompletionRef, XAxiVdma_ChannelCallBack::ErrCallBack, XAxiVdma_ChannelCallBack::ErrRef, XAxiVdma::IsReady, XAxiVdma::ReadCallBack, XAxiVdma::WriteCallBack, XAXIVDMA_DEVICE_READY, XAXIVDMA_HANDLER_ERROR, XAXIVDMA_HANDLER_GENERAL, and XAXIVDMA_READ.

int XAxiVdma_SetFrameCounter ( XAxiVdma *  InstancePtr,
XAxiVdma_FrameCounter *  CfgPtr 
)

Sets the frame counter and delay counter for both channels.

Parameters
[in]InstancePtris the pointer to the DMA engine to work on
[in]CfgPtris the pointer to the configuration structure
Returns
Returns XST_SUCCESS on success, XST_INVALID_PARAM on invalid configuration, or channel error code.
Note
If channel is invalid, then do nothing on that channel

References XAxiVdma::IsReady, XAxiVdma_FrameCounter::ReadDelayTimerCount, XAxiVdma_FrameCounter::ReadFrameCount, XAxiVdma_FrameCounter::WriteDelayTimerCount, XAxiVdma_FrameCounter::WriteFrameCount, XAxiVdma_ChannelSetFrmCnt(), XAXIVDMA_DEVICE_READY, XAxiVdma_GetChannel(), XAXIVDMA_READ, and XAXIVDMA_WRITE.

Referenced by run_triple_frame_buffer().

int XAxiVdma_SetFrmStore ( XAxiVdma *  InstancePtr,
u8  FrmStoreNum,
u16  Direction 
)

Sets the number of frame store buffers to use.

Parameters
[in]InstancePtris the XAxiVdma instance to operate on
[in]FrmStoreNumis the number of frame store buffers to use.
[in]Directionis the channel to work on, use XAXIVDMA_READ/WRITE
Returns
- XST_SUCCESS if operation is successful
  • XST_FAILURE if operation fails.
  • XST_NO_FEATURE if access to FrameStore register is disabled

References XAxiVdma::MaxNumFrames, XAxiVdma_ChannelInit(), XAxiVdma_ChannelIsRunning(), XAXIVDMA_ENABLE_DBG_FRMSTORE_REG, XAXIVDMA_FRMSTORE_MASK, XAXIVDMA_FRMSTORE_OFFSET, and XAxiVdma_GetChannel().

int XAxiVdma_SetLineBufThreshold ( XAxiVdma *  InstancePtr,
int  LineBufThreshold,
u16  Direction 
)

Configures Line Buffer Threshold.

Parameters
[in]InstancePtris the pointer to the DMA engine to work on
[in]LineBufThresholdis the value to set threshold
[in]Directionis the DMA channel to work on
Returns
Returns XST_SUCCESS on success, XST_FAILURE on invalid threshold, XST_NO_FEATURE if threshold register is disabled.

References XAXIVDMA_BUFTHRES_OFFSET, XAXIVDMA_ENABLE_DBG_THRESHOLD_REG, and XAxiVdma_GetChannel().

void XAxiVdma_StartFrmCntEnable ( XAxiVdma *  InstancePtr,
u16  Direction 
)

Starts frame count enable on one channel.

This is needed to start limiting the number of frames to transfer so that software can check the data etc after hardware stops transfer.

Parameters
[in]InstancePtris the pointer to the DMA engine to work on
[in]Directionis the channel to work on, use XAXIVDMA_READ/WRITE

References XAxiVdma_ChannelStartFrmCntEnable(), and XAxiVdma_GetChannel().

int XAxiVdma_StartParking ( XAxiVdma *  InstancePtr,
int  FrameIndex,
u16  Direction 
)

Starts parking mode on a certain frame.

Parameters
[in]InstancePtris the pointer to the DMA engine to work on
[in]FrameIndexis the frame to park on
[in]Directionis the channel to work on, use XAXIVDMA_READ/WRITE
Returns
Returns XST_SUCCESS on success, XST_INVALID_PARAM on invalid parameter, XST_FAILURE if parking start fails.

References XAxiVdma::BaseAddr, XAxiVdma_ChannelStartParking(), XAXIVDMA_FRM_MAX, XAxiVdma_GetChannel(), XAXIVDMA_PARKPTR_OFFSET, XAXIVDMA_PARKPTR_READREF_MASK, XAXIVDMA_PARKPTR_WRTREF_MASK, XAXIVDMA_READ, XAXIVDMA_WRITE, and XAXIVDMA_WRTREF_SHIFT.

int XAxiVdma_StartReadFrame ( XAxiVdma *  InstancePtr,
XAxiVdma_DmaSetup *  DmaConfigPtr 
)

Starts a read operation.

Read corresponds to send data from memory to device

Parameters
[in]InstancePtris the pointer to the DMA engine to work on
[in]DmaConfigPtris the pointer to the setup structure
Returns
Returns XST_SUCCESS on success, XST_DEVICE_NOT_FOUND if channel is invalid, or channel error code.

References XAxiVdma_ChannelStartTransfer(), XAxiVdma_GetChannel(), and XAXIVDMA_READ.

int XAxiVdma_StartWriteFrame ( XAxiVdma *  InstancePtr,
XAxiVdma_DmaSetup *  DmaConfigPtr 
)

Starts a write operation.

Write corresponds to send data from device to memory

Parameters
[in]InstancePtris the pointer to the DMA engine to work on
[in]DmaConfigPtris the pointer to the setup structure
Returns
Returns XST_SUCCESS on success, XST_DEVICE_NOT_FOUND if channel is invalid, or channel error code.

References XAxiVdma_ChannelStartTransfer(), XAxiVdma_GetChannel(), and XAXIVDMA_WRITE.

void XAxiVdma_StopParking ( XAxiVdma *  InstancePtr,
u16  Direction 
)

Exits parking mode, the channel will return to circular buffer mode.

Parameters
[in]InstancePtris the pointer to the DMA engine to work on
[in]Directionis the channel to work on, use XAXIVDMA_READ/WRITE
Note
If channel is invalid, then do nothing

References XAxiVdma_ChannelStopParking(), and XAxiVdma_GetChannel().

void XAxiVdma_WriteIntrHandler ( void *  InstancePtr)

Variable Documentation

XAxiVdma AxiVdma

Driver instance for the AXI VDMA under test.