![]() |
mcdma
Vitis Drivers API Documentation
|
Data Structures | |
| struct | XMcdma_ChanCtrl |
| Per-channel control and BD ring state for MCDMA. More... | |
| struct | XMcdma |
| Driver instance data for an MCDMA device. More... | |
Macros | |
| #define | XMCDMA_LOOP_COUNT 1000000 |
| Default poll loop iteration limit. More... | |
| #define | XMCDMA_NUM_APP_WORDS 5 |
| Number of application words in a buffer descriptor. More... | |
| #define | XMCDMA_MAX_CHAN_PER_DEVICE 32 |
| Maximum number of channels per MCDMA device. More... | |
| #define | XMCDMA_CHAN_IDLE 0 |
| Channel idle state value. More... | |
| #define | XMCDMA_CHAN_PAUSE 1 |
| Channel paused state value. More... | |
| #define | XMCDMA_CHAN_BUSY 2 |
| Channel busy state value. More... | |
| #define | XMCDMA_BD_MINIMUM_ALIGNMENT 0x40 |
| Minimum buffer descriptor alignment in bytes. More... | |
| #define | XMCDMA_AXCACHE 0xB |
| Default AXI cache attribute value. More... | |
| #define | XMCDMA_DEV_TO_MEM 0 |
| Transfer direction from device to memory. More... | |
| #define | XMCDMA_MEM_TO_DEV 1 |
| Transfer direction from memory to device. More... | |
| #define | XMcdma_DisableCh(Chan, ChanId) |
| Disable Particular Channel in the MCDMA Core. More... | |
| #define | XMcdma_GetChan(Chan) XMcdma_ReadReg(Chan->ChanBase, XMCDMA_CHSER_OFFSET) |
| Get Channel number that last Serviced. More... | |
| #define | XMcdma_isidle(Chan) |
| Checks whether the DMA channel is idle or not. More... | |
| #define | XMcdma_IntrEnable(Chan, Mask) |
| Enables interrupts specified by the Mask in specified direction, Interrupts that are not in the mask are not affected. More... | |
| #define | XMcdma_IntrDisable(Chan, Mask) |
| Disables interrupts specified by the Mask. More... | |
| #define | XMcdma_GetPktDrp_cnt(Chan) XMcdma_ReadReg(Chan->ChanBase, XMCDMA_CPKTDROP_OFFSET) |
| Gets global Packet drop Count. More... | |
| #define | XMcdma_GetMcdmaTxChan(InstancePtr, ChanId) (&((InstancePtr)->Tx_Chan[ChanId])) |
| Gets the TX Channel Pointer. More... | |
| #define | XMcdma_GetMcdmaRxChan(InstancePtr, ChanId) (&((InstancePtr)->Rx_Chan[ChanId])) |
| Gets the RX Channel Pointer. More... | |
| #define | XMcdma_GetChanCurBd(Chan) ((Chan)->BdRestart) |
| Gets the Channel BD Chain Current BD. More... | |
| #define | XMcdma_GetChanBdDoneCnt(Chan) ((Chan)->BdDoneCnt) |
| Returns the buffer descriptor count processed by the h/w. More... | |
| #define | XMcdma_ChanGetIrq(Chan) |
| Returns asserted channel interrupts. More... | |
| #define | XMcdma_ChanAckIrq(Chan, Mask) |
| Acknowledges the specified channel interrupts that are specified in Mask. More... | |
| #define | XMcdma_GetChanPktDrp_Cnt(Chan, ChanId) |
| Get Packet drop Count for the particular Channel. More... | |
| #define | XMcdma_SetARCache(InstancePtr, Value) |
| Sets the ARCACHE field with the user specified value. More... | |
| #define | XMcdma_SetAWCache(InstancePtr, Value) |
| Sets the AWCACHE field with the user specified value. More... | |
| #define | XMcdma_GetEgressObserver(InstancePtr, ObsId) |
| Get Egress Channel Observer contents. More... | |
| #define | XMcdma_GetIngressObserver(InstancePtr, ObsId) |
| Get Ingress Channel Observer contents. More... | |
| #define | MAX_TRANSFER_LEN(h) (((~0UL) << (0)) & (~0UL >> (32 - 1 - (h)))) |
| Computes a contiguous bit mask for the maximum transfer length field. More... | |
| #define | WRR_MASK(h, l) (((~0UL) << (l)) & (~0UL >> (32 - 1 - (h)))) |
| Computes a contiguous bit mask between high and low bit indices. More... | |
| #define | XMCDMA_CHAN_SEEKAHEAD(Chan, BdPtr, NumBd) |
| Advances a BD pointer by a number of descriptors with ring wrap. More... | |
| #define | XMCDMA_CACHE_FLUSH(BdPtr) Xil_DCacheFlushRange((UINTPTR)(BdPtr), XMCDMA_BD_HW_NUM_BYTES) |
| Declares cache flush and invalidate helpers for BDs in cached memory. More... | |
| #define | XMCDMA_CACHE_INVALIDATE(BdPtr) Xil_DCacheInvalidateRange((UINTPTR)(BdPtr), XMCDMA_BD_HW_NUM_BYTES) |
| Invalidates the data cache for a buffer descriptor. More... | |
| #define | XMcdma_BdRead(BaseAddress, Offset) (*(u32 *)(((UINTPTR)(void *)(BaseAddress)) + (u32)(Offset))) |
| Read the given Buffer Descriptor word. More... | |
| #define | XMcdma_BdRead64(BaseAddress, Offset) (*(u64 *)(((UINTPTR)(void *)(BaseAddress)) + (u32)(Offset))) |
| Read the given Buffer Descriptor word. More... | |
| #define | XMcdma_BdWrite(BaseAddress, Offset, Data) (*(u32 *)((UINTPTR)(void *)(BaseAddress) + (u32)(Offset))) = (u32)(Data) |
| Write the given Buffer Descriptor word. More... | |
| #define | XMcdma_BdWrite64(BaseAddress, Offset, Data) (*(u64 *)((UINTPTR)(void *)(BaseAddress) + (u32)(Offset))) = (u64)(Data) |
| Write the given Buffer Descriptor double word. More... | |
| #define | XMcDma_BdGetSts(BdPtr) XMcdma_BdRead((BdPtr), XMCDMA_BD_STS_OFFSET) |
| Retrieve the status of a Ingress(S2MM) BD. More... | |
| #define | XMcdma_BdHwCompleted(BdPtr) |
| Check whether a Ingress(S2MM) BD has completed in hardware. More... | |
| #define | XMcDma_BdGetActualLength(BdPtr, LengthMask) |
| Get the actual transfer length of a Ingress (S2MM)BD. More... | |
| #define | XMcDma_TxBdGetSts(BdPtr) XMcdma_BdRead((BdPtr), XMCDMA_BD_SIDEBAND_STS_OFFSET) |
| Retrieve the status of a Egress(MM2S) BD. More... | |
| #define | XMcdma_TxBdHwCompleted(BdPtr) |
| Check whether a Egress(MM2S) BD has completed in hardware. More... | |
| #define | XMcDma_TxBdGetActualLength(BdPtr, LengthMask) |
| Get the actual transfer length of a Egress(MM2S) BD. More... | |
| #define | XMcDma_BdGetCtrl(BdPtr) |
| Gets the control bits of a BD. More... | |
| #define | XMcdma_BdChainNextBd(Chan, BdPtr) |
| Return the next BD in the Chain. More... | |
| #define | XMcdma_BdChainPrevBd(Chan, BdPtr) |
| Return the previous BD in the Chain. More... | |
| #define | XMcdma_HwIsStarted(Chan) |
| Check whether a DMA is started, meaning the channel is not halted. More... | |
| #define | XMcdma_ChanHwIsStarted(Chan, Chan_id) |
| Check whether a DMA channel is started, meaning the channel is not halted. More... | |
| #define | XMcDma_BdSetCtrlSideBand(BdPtr, Tid, Tuser) |
| Set the Tid and Tuser fields of a BD with the user provided values. More... | |
| #define | XMcDma_GetBdSbandStats(BdPtr) XMcdma_BdRead((BdPtr), XMCDMA_BD_SIDEBAND_STS_OFFSET) |
| Retrieve the side band status of a BD. More... | |
| #define | XMcdma_BdClear(BdPtr) |
| Clears the BD Contents. More... | |
| #define | XMcdma_BdSetSwId(BdPtr, Id) (XMcdma_BdWrite((BdPtr), XMCDMA_BD_SW_ID_OFFSET, (UINTPTR)(Id))) |
| Set the Sw ID field of the given BD. More... | |
| #define | XMcdma_BdGetSwId(BdPtr) (XMcdma_BdRead((BdPtr), XMCDMA_BD_SW_ID_OFFSET)) |
| Retrieve the Sw ID field of the given BD previously set with XMcdma_BdSetSwId. More... | |
| #define | XMCDMA_BD_CTRL_SBAND_OFFSET 0x18 |
| Status. More... | |
| #define | XMCDMA_BD_CTRL_SOF_MASK 0x80000000 |
| Buffer descriptor start-of-frame control mask. More... | |
| #define | XMCDMA_BD_CTRL_EOF_MASK 0x40000000 |
| Buffer descriptor end-of-frame control mask. More... | |
| #define | XMCDMA_BD_CTRL_ALL_MASK 0xC0000000 |
| Buffer descriptor SOF and EOF control mask. More... | |
| #define | XMCDMA_BD_CTRL_SBAND_SHIFT 24 |
| Bit shift for BD sideband control fields. More... | |
| #define | XMCDMA_BD_STS_COMPLETE_MASK 0x80000000 |
| Completed. More... | |
| #define | XMCDMA_BD_STS_DEC_ERR_MASK 0x40000000 |
| Decode error. More... | |
| #define | XMCDMA_BD_STS_SLV_ERR_MASK 0x20000000 |
| Slave error. More... | |
| #define | XMCDMA_BD_STS_INT_ERR_MASK 0x10000000 |
| Internal err. More... | |
| #define | XMCDMA_BD_STS_ALL_ERR_MASK 0x70000000 |
| All errors. More... | |
| #define | XMCDMA_BD_STS_RXSOF_MASK 0x08000000 |
| First rx pkt. More... | |
| #define | XMCDMA_BD_STS_RXEOF_MASK 0x04000000 |
| Last rx pkt. More... | |
| #define | XMCDMA_BD_STS_ALL_MASK 0xFC000000 |
| All status bits. More... | |
| #define | XMCDMA_BD_SIDEBAND_STS_TID_MASK 0xFF000000 |
| BD sideband status TID field mask. More... | |
| #define | XMCDMA_BD_SIDEBAND_STS_TDEST_MASK 0x000F0000 |
| BD sideband status TDEST field mask. More... | |
| #define | XMCDMA_BD_SIDEBAND_STS_TUSER_MASK 0x0000FFFF |
| BD sideband status TUSER field mask. More... | |
| #define | XMCDMA_MAX_TRANSFER_LEN 0x03FFFFFF |
| Maximum buffer transfer length mask. More... | |
| #define | XMCDMA_BD_HW_NUM_BYTES 52 |
| Number of bytes hw used. More... | |
| #define | XMCDMA_BD_START_CLEAR 8 |
| Offset to start clear. More... | |
| #define | XMCDMA_BD_BYTES_TO_CLEAR 44 |
| BD-specific bytes to clear. More... | |
| #define | XMCDMA_BD_HAS_DRE_MASK 0xF00 |
| Whether has DRE mask. More... | |
| #define | XMCDMA_BD_WORDLEN_MASK 0xFF |
| Whether has DRE mask. More... | |
| #define | XMCDMA_BD_HAS_DRE_SHIFT 8 |
| Whether has DRE shift. More... | |
| #define | XMCDMA_BD_WORDLEN_SHIFT 0 |
| Whether has DRE shift. More... | |
| #define | XMCDMA_LAST_APPWORD 4 |
| Last application word index in the BD. More... | |
| #define | XMcdma_In32 Xil_In32 |
| Input operation. More... | |
| #define | XMcdma_Out32 Xil_Out32 |
| Output operation. More... | |
| #define | XMcdma_ReadReg(BaseAddress, RegOffset) XMcdma_In32((BaseAddress) + (u32)(RegOffset)) |
| Reads the given register. More... | |
| #define | XMcdma_WriteReg(BaseAddress, RegOffset, Data) XMcdma_Out32(((BaseAddress) + (RegOffset)), (Data)) |
| Writes the given register. More... | |
| #define | MCDMA_BASE_ADDR XPAR_XMCDMA_0_BASEADDR |
| Base address of the MCDMA device. More... | |
| #define | NUMBER_OF_BDS_PER_PKT 10 |
| Number of buffer descriptors per packet. More... | |
| #define | NUMBER_OF_PKTS_TO_TRANSFER 100 |
| Number of packets to transfer in the test. More... | |
| #define | NUMBER_OF_BDS_TO_TRANSFER |
| Total buffer descriptors to transfer. More... | |
| #define | PACKETS_PER_IRQ 50 |
| Number of packets processed per interrupt. More... | |
| #define | MAX_PKT_LEN 1024 |
| Maximum packet length in bytes. More... | |
| #define | BLOCK_SIZE_2MB 0x200000U |
| Two-megabyte block size for TLB attributes. More... | |
| #define | TEST_START_VALUE 0xC |
| Starting value used to fill and verify test data. 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 | MAX_CHANNELS 16 |
| Maximum number of MCDMA channels. More... | |
| #define | TX_BUFFER_SIZE (NUMBER_OF_BDS_TO_TRANSFER * MAX_PKT_LEN * MAX_CHANNELS ) |
| Transmit buffer size in bytes. More... | |
| #define | RX_BUFFER_SIZE (NUMBER_OF_BDS_TO_TRANSFER * MAX_PKT_LEN * MAX_CHANNELS ) |
| Receive buffer size in bytes. More... | |
| #define | TX_BD_SPACE_SIZE (NUMBER_OF_BDS_TO_TRANSFER * sizeof(XMcdma_Bd) * MAX_CHANNELS) |
| Transmit BD space size in bytes. More... | |
| #define | RX_BD_SPACE_SIZE (NUMBER_OF_BDS_TO_TRANSFER * sizeof(XMcdma_Bd) * MAX_CHANNELS) |
| Receive BD space size in bytes. More... | |
| #define | MCDMA_BASE_ADDR XPAR_XMCDMA_0_BASEADDR |
| Base address of the MCDMA device. More... | |
| #define | MEM_BASE_ADDR 0x01000000 |
| Base address for DMA buffers and BD space. More... | |
| #define | TX_BD_SPACE_BASE (MEM_BASE_ADDR) |
| Base address of the transmit BD space. More... | |
| #define | RX_BD_SPACE_BASE (MEM_BASE_ADDR + 0x10000000) |
| Base address of the receive BD space. More... | |
| #define | TX_BUFFER_BASE (MEM_BASE_ADDR + 0x20000000) |
| Base address of the transmit buffer. More... | |
| #define | RX_BUFFER_BASE (MEM_BASE_ADDR + 0x50000000) |
| Base address of the receive buffer. More... | |
| #define | NUMBER_OF_BDS_PER_PKT 10 |
| Number of buffer descriptors per packet. More... | |
| #define | NUMBER_OF_PKTS_TO_TRANSFER 100 |
| Number of packets to transfer in the test. More... | |
| #define | NUMBER_OF_BDS_TO_TRANSFER |
| Total buffer descriptors to transfer. More... | |
| #define | MAX_PKT_LEN 1024 |
| Maximum packet length in bytes. More... | |
| #define | BLOCK_SIZE_2MB 0x200000U |
| Two-megabyte block size for TLB attributes. More... | |
| #define | NUM_MAX_CHANNELS 16 |
| Maximum number of channels for pattern arrays. More... | |
| #define | TEST_START_VALUE 0xC |
| Starting value used to fill and verify test data. More... | |
| #define | POLL_TIMEOUT_COUNTER 1000000U |
| Maximum poll iterations before a transfer times out. More... | |
| #define | MAX_CHANNELS 16 |
| Maximum number of MCDMA channels. More... | |
| #define | TX_BUFFER_SIZE (NUMBER_OF_BDS_TO_TRANSFER * MAX_PKT_LEN * MAX_CHANNELS ) |
| Transmit buffer size in bytes. More... | |
| #define | RX_BUFFER_SIZE (NUMBER_OF_BDS_TO_TRANSFER * MAX_PKT_LEN * MAX_CHANNELS ) |
| Receive buffer size in bytes. More... | |
| #define | TX_BD_SPACE_SIZE (NUMBER_OF_BDS_TO_TRANSFER * sizeof(XMcdma_Bd) * MAX_CHANNELS ) |
| Transmit BD space size in bytes. More... | |
| #define | RX_BD_SPACE_SIZE (NUMBER_OF_BDS_TO_TRANSFER * sizeof(XMcdma_Bd) * MAX_CHANNELS ) |
| Receive BD space size in bytes. More... | |
Typedefs | |
| typedef u32 | XMcdma_Bd [16] |
| Buffer descriptor storage as an array of 32-bit words. More... | |
Enumerations | |
| enum | XMcdma_Handler { XMCDMA_TX_HANDLER_DONE, XMCDMA_TX_HANDLER_ERROR, XMCDMA_HANDLER_DONE, XMCDMA_HANDLER_ERROR, XMCDMA_HANDLER_PKTDROP } |
| MCDMA instance-level interrupt handler types. More... | |
| enum | XMcdma_ChanHandler { XMCDMA_CHAN_HANDLER_DONE, XMCDMA_CHAN_HANDLER_ERROR, XMCDMA_CHAN_HANDLER_PKTDROP } |
| MCDMA per-channel interrupt handler types. More... | |
| enum | XMcdma_QScheduler { XMCDMA_FIXED_PRIORITY, XMCDMA_WRR, XMCDMA_WRR_PRIORITY } |
| Queue scheduler types for MCDMA channels. More... | |
Functions | |
| s32 | XMcDma_CfgInitialize (XMcdma *InstancePtr, XMcdma_Config *CfgPtr) |
| Initializes an MCDMA core before any other driver function is called. More... | |
| s32 | XMcDma_Initialize (XMcdma *InstancePtr, XMcdma_Config *CfgPtr) |
| Initializes an MCDMA core before any other driver function is called. More... | |
| void | XMcDma_Reset (XMcdma *InstancePtr) |
| Resets the MCDMA core. More... | |
| void | XMcdma_SetSGAWCache (XMcdma *InstancePtr, u8 Value) |
| Sets the AWCACHE field of the SG interface With the user specified value. More... | |
| void | XMcdma_SetSGARCache (XMcdma *InstancePtr, u8 Value) |
| Sets the ARCACHE field of the SG interface With the user specified value. More... | |
| u32 | XMcdma_ResetIsDone (XMcdma *InstancePtr) |
| Check whether reset is done. More... | |
| u32 | XMcdma_Start (XMcdma_ChanCtrl *Chan) |
| Start the DMA engine. More... | |
| u32 | XMcdma_ChanHwStop (XMcdma_ChanCtrl *Chan) |
| Stops the DMA engine. More... | |
| void | XMcdma_EnableCh (XMcdma_ChanCtrl *Chan) |
| Enables a particular channel. More... | |
| u16 | XMcdma_GetChanServiced (XMcdma *InstancePtr) |
| Gets the last serviced s2mm channel number. More... | |
| u16 | XMcdma_GetTxChanServiced (XMcdma *InstancePtr) |
| Gets the last serviced mm2s channel number. More... | |
| u32 | XMCdma_GetChan_Weight (XMcdma_ChanCtrl *Chan) |
| Gets the weighted round-robin weight for a transmit channel. More... | |
| u32 | XMCdma_SetChan_Weight (XMcdma_ChanCtrl *Chan, u8 Weight) |
| Sets the weighted round-robin weight for a transmit channel. More... | |
| u32 | XMCdma_GetChan_PktDoneCnt (XMcdma_ChanCtrl *Chan) |
| Gets the packet-done count for an MCDMA channel. More... | |
| void | XMcdma_DumpChanRegs (XMcdma_ChanCtrl *Chan) |
| Dump the registers for a channel. More... | |
| XMcdma_Config * | XMcdma_LookupConfig (UINTPTR BaseAddress) |
| Looks up device configuration by base address. More... | |
| s32 | XMcdma_SelfTest (XMcdma *InstancePtr) |
| This file contains a diagnostic self-test function for the MCDMA driver. More... | |
| u32 | XMcdma_SetChanCoalesceDelay (XMcdma_ChanCtrl *Chan, u32 IrqCoalesce, u32 IrqDelay) |
| Set interrupt coalescing parameters for a particular channel. More... | |
| int | XMcdma_UpdateChanCDesc (XMcdma_ChanCtrl *Chan) |
| Update Current Descriptor for the MCDMA Channel. More... | |
| int | XMcdma_UpdateChanTDesc (XMcdma_ChanCtrl *Chan) |
| Update Tail Desc for the Channel. More... | |
| u32 | XMcDma_ChanBdCreate (XMcdma_ChanCtrl *Chan, UINTPTR Addr, u32 Count) |
| Using a memory segment allocated by the caller, creates and setup the BD Chain for the MCDMA Channel. More... | |
| u32 | XMcDma_ChanSubmit (XMcdma_ChanCtrl *Chan, UINTPTR BufAddr, u32 len) |
| Populates the BD chain with the required buffer address and length fields. More... | |
| u32 | XMcDma_Chan_Sideband_Submit (XMcdma_ChanCtrl *ChanPtr, UINTPTR BufAddr, u32 Len, u32 *AppPtr, u16 Tuser, u16 Tid) |
| Populates the BD chain with the required buffer address, length APP(user application), TUSER and TID fields. More... | |
| u32 | XMcDma_ChanToHw (XMcdma_ChanCtrl *Chan) |
| Starts hardware by programming current and tail descriptors by programming the Current and Tail Descriptors and enabling the particular channel. More... | |
| int | XMcdma_BdChainFromHW (XMcdma_ChanCtrl *Chan, u32 BdLimit, XMcdma_Bd **BdSetPtr) |
| Returns a set of BD(s) that have been processed by hardware. More... | |
| int | XMcdma_BdChainFree (XMcdma_ChanCtrl *Chan, int BdCount, XMcdma_Bd *BdSetPtr) |
| Frees a set of BDs that had been previously retrieved with XMcdma_BdChainFromHW(). More... | |
| u32 | XMcdma_BdSetBufAddr (XMcdma_Bd *BdPtr, UINTPTR Addr) |
| Set the Buffer descriptor buffer address field. More... | |
| void | XMcDma_BdSetCtrl (XMcdma_Bd *BdPtr, u32 Data) |
| Set the control bits for a BD. More... | |
| void | XMcDma_DumpBd (XMcdma_Bd *BdPtr) |
| Dump the fields of a BD. More... | |
| int | XMcDma_BdSetAppWord (XMcdma_Bd *BdPtr, int Offset, u32 Word) |
| Set the APP word at the specified APP word offset for a BD. More... | |
| u32 | XMcDma_BdGetAppWord (XMcdma_Bd *BdPtr, int Offset, int *Valid) |
| Get the APP word at the specified APP word offset for a BD. More... | |
| void | XMcdma_IntrHandler (void *Instance) |
| Handles S2MM (RX) MCDMA interrupts for the MCDMA core. More... | |
| void | XMcdma_TxIntrHandler (void *Instance) |
| Handles MM2S MCDMA interrupts for the MCDMA core. More... | |
| s32 | XMcdma_SetCallBack (XMcdma *InstancePtr, XMcdma_Handler HandlerType, void *CallBackFunc, void *CallBackRef) |
| This routine installs an asynchronous callback function for the given HandlerType. More... | |
| void | XMcdma_ChanIntrHandler (void *Instance) |
| Handles per-channel MCDMA interrupts for the MCDMA core. More... | |
| s32 | XMcdma_ChanSetCallBack (XMcdma_ChanCtrl *Chan, XMcdma_ChanHandler HandlerType, void *CallBackFunc, void *CallBackRef) |
| This routine installs an asynchronous callback function for the given HandlerType. More... | |
| int | main (void) |
| Runs the MCDMA interrupt-mode example entry point. More... | |
Variables | |
| XMcdma_Config | XMcdma_ConfigTable [] |
| Configuration table for each MCDMA instance in the system. More... | |
Registers offsets | |
| #define | XMCDMA_CCR_OFFSET 0x00 |
| Common control register offset. More... | |
| #define | XMCDMA_CSR_OFFSET 0x04 |
| Common status register offset. More... | |
| #define | XMCDMA_CHEN_OFFSET 0x08 |
| Channel enable register offset. More... | |
| #define | XMCDMA_CHSER_OFFSET 0x0C |
| Channel service register offset. More... | |
| #define | XMCDMA_ERR_OFFSET 0x10 |
| Error register offset. More... | |
| #define | XMCDMA_CHOBS1_OFFSET 0x440 |
| Channel observer 1 register offset. More... | |
| #define | XMCDMA_CHOBS2_OFFSET 0x444 |
| Channel observer 2 register offset. More... | |
| #define | XMCDMA_CHOBS3_OFFSET 0x448 |
| Channel observer 3 register offset. More... | |
| #define | XMCDMA_CHOBS4_OFFSET 0x44C |
| Channel observer 4 register offset. More... | |
| #define | XMCDMA_CHOBS5_OFFSET 0x450 |
| Channel observer 5 register offset. More... | |
| #define | XMCDMA_CHOBS6_OFFSET 0x454 |
| Channel observer 6 register offset. More... | |
| #define | XMCDMA_SGCACHE_OFFSET 0x4B0 |
| Scatter-gather cache register offset. More... | |
| #define | XMCDMA_TXSCHD_TYPE_OFFSET 0x14 |
| Transmit scheduler type register offset. More... | |
| #define | XMCDMA_TX_WRR_REG_OFFSET 0x18 |
| Transmit weighted round-robin register 0 offset. More... | |
| #define | XMCDMA_TX_WRR_REG1_OFFSET 0x1C |
| Transmit weighted round-robin register 1 offset. More... | |
| #define | XMCDMA_TXCH_SERV_OFFSET 0x20 |
| Transmit channel service register offset. More... | |
| #define | XMCDMA_TXAXCACHE_OFFSET 0x24 |
| Transmit AXI cache register offset. More... | |
| #define | XMCDMA_TXINT_SER_OFFSET 0x28 |
| Transmit interrupt service register offset. More... | |
| #define | XMCDMA_CPKTDROP_OFFSET 0x14 |
| Common packet drop register offset. More... | |
| #define | XMCDMA_RXCH_SER_OFFSET 0x18 |
| Receive channel service register offset. More... | |
| #define | XMCDMA_RXAXCACHE_OFFSET 0x1C |
| Receive AXI cache register offset. More... | |
| #define | XMCDMA_RXINT_SER_OFFSET 0x20 |
| Receive interrupt service register offset. More... | |
| #define | XMCDMA_CR_OFFSET 0x40 |
| Per-channel control register offset. More... | |
| #define | XMCDMA_SR_OFFSET 0x44 |
| Per-channel status register offset. More... | |
| #define | XMCDMA_CDESC_OFFSET 0x48 |
| Current descriptor pointer register offset. More... | |
| #define | XMCDMA_CDESC_MSB_OFFSET 0x4C |
| Current descriptor pointer MSB register offset. More... | |
| #define | XMCDMA_TDESC_OFFSET 0x50 |
| Tail descriptor pointer register offset. More... | |
| #define | XMCDMA_TDESC_MSB_OFFSET 0x54 |
| Tail descriptor pointer MSB register offset. More... | |
| #define | XMCDMA_PKTDROP_OFFSET 0x58 |
| Packet drop count register offset. More... | |
| #define | XMCDMA_TX_PKTCNT_STAT_OFFSET 0x58 |
| Transmit packet count status register offset. More... | |
| #define | XMCDMA_RX_PKTCNT_STAT_OFFSET 0x5C |
| Receive packet count status register offset. More... | |
| #define | XMCDMA_NXTCHAN_OFFSET 0x40 |
| Next channel register block stride. More... | |
| #define | XMCDMA_NXTOBS_OFFSET 0x4 |
| Next observer register stride. More... | |
| #define | XMCDMA_RX_OFFSET 0x500 |
| Receive path register base offset. More... | |
| #define | XMCDMA_CCR_RUNSTOP_MASK 0x00000001 |
| Common control run/stop bit mask. More... | |
| #define | XMCDMA_CCR_RESET_MASK 0x00000004 |
| Common control reset bit mask. More... | |
| #define | XMCDMA_CSR_HALTED_MASK 0x00000001 |
| Common status halted bit mask. More... | |
| #define | XMCDMA_CSR_IDLE_MASK 0x00000002 |
| Common status idle bit mask. More... | |
| #define | XMCDMA_IRQ_PKTDROP_MASK 0x00000010 |
| Packet drop interrupt mask. More... | |
| #define | XMCDMA_IRQ_IOC_MASK 0x00000020 |
| Interrupt on complete mask. More... | |
| #define | XMCDMA_IRQ_DELAY_MASK 0x00000040 |
| Delay interrupt mask. More... | |
| #define | XMCDMA_IRQ_ERROR_MASK 0x00000080 |
| Error interrupt mask. More... | |
| #define | XMCDMA_IRQ_ALL_MASK 0x000000F0 |
| All interrupt sources mask. More... | |
| #define | XMCDMA_DELAY_MASK 0xFF000000 |
| Interrupt delay counter field mask. More... | |
| #define | XMCDMA_COALESCE_MASK 0x00FF0000 |
| Interrupt coalesce counter field mask. More... | |
| #define | XMCDMA_PKTDROP_COALESCE_MASK 0x0000FF00 |
| Packet drop coalesce field mask. More... | |
| #define | XMCDMA_COALESCE_SHIFT 16 |
| Bit shift for the coalesce counter field. More... | |
| #define | XMCDMA_DELAY_SHIFT 24 |
| Bit shift for the delay counter field. More... | |
| #define | XMCDMA_CHEN_MASK 0x000000FF |
| Channel enable field mask. More... | |
| #define | XMCDMA_CHID_MASK 0x000000FF |
| Channel identifier field mask. More... | |
| #define | XMCDMA_ERR_INTERNAL_MASK 0x00000001 |
| Internal error bit mask. More... | |
| #define | XMCDMA_ERR_SLAVE_MASK 0x00000002 |
| Slave error bit mask. More... | |
| #define | XMCDMA_ERR_DECODE_MASK 0x00000004 |
| Decode error bit mask. More... | |
| #define | XMCDMA_ERR_SG_INT_MASK 0x00000010 |
| Scatter-gather internal error bit mask. More... | |
| #define | XMCDMA_ERR_SG_SLV_MASK 0x00000020 |
| Scatter-gather slave error bit mask. More... | |
| #define | XMCDMA_ERR_SG_DEC_MASK 0x00000040 |
| Scatter-gather decode error bit mask. More... | |
| #define | XMCDMA_PKTDROP_CNT_MASK 0xFFFFFFFF |
| Packet drop count field mask. More... | |
| #define | XMCDMA_AXUSER_MASK 0x00000F00 |
| AXI user sideband field mask. More... | |
| #define | XMCDMA_AXCACHE_MASK 0x0000000F |
| AXI cache attribute field mask. More... | |
| #define | XMCDMA_TX_WRRCH0_MASK 0x0000000F |
| Transmit WRR weight mask for channel 0. More... | |
| #define | XMCDMA_TX_WRRCH1_MASK 0x000000F0 |
| Transmit WRR weight mask for channel 1. More... | |
| #define | XMCDMA_TX_WRRCH2_MASK 0x00000F00 |
| Transmit WRR weight mask for channel 2. More... | |
| #define | XMCDMA_TX_WRRCH3_MASK 0x0000F000 |
| Transmit WRR weight mask for channel 3. More... | |
| #define | XMCDMA_TX_WRRCH4_MASK 0x000F0000 |
| Transmit WRR weight mask for channel 4. More... | |
| #define | XMCDMA_TX_WRRCH5_MASK 0x00F00000 |
| Transmit WRR weight mask for channel 5. More... | |
| #define | XMCDMA_TX_WRRCH6_MASK 0x0F000000 |
| Transmit WRR weight mask for channel 6. More... | |
| #define | XMCDMA_TX_WRRCH7_MASK 0xF0000000 |
| Transmit WRR weight mask for channel 7. More... | |
| #define | XMCDMA_TX_WRRCH_MASK(Chan_id) WRR_MASK((Chan_id * 4 + 3), Chan_id *4) |
| Returns the WRR weight field mask for a transmit channel. More... | |
| #define | XMCDMA_TX_WRRCH_SHIFT(Chan_id) Chan_id * 4 |
| Returns the bit shift for a transmit channel WRR weight field. More... | |
| #define | XMCDMA_SGAWCACHE_MASK 0x000F0000 |
| Scatter-gather AXI write cache field mask. More... | |
| #define | XMCDMA_SGARCACHE_MASK 0x0000000F |
| Scatter-gather AXI read cache field mask. More... | |
| #define | XMCDMA_SGAWCACHE_SHIFT 16 |
| Bit shift for scatter-gather write cache field. More... | |
Buffer Descriptor offsets | |
The first 13 words are used by hardware. All words after the 13rd word are for software use only. | |
| #define | XMCDMA_BD_NDESC_OFFSET 0x00 |
| Next descriptor pointer. More... | |
| #define | XMCDMA_BD_NDESC_MSB_OFFSET 0x04 |
| Next descriptor pointer. More... | |
| #define | XMCDMA_BD_BUFA_OFFSET 0x08 |
| Buffer address. More... | |
| #define | XMCDMA_BD_BUFA_MSB_OFFSET 0x0C |
| Buffer address. More... | |
| #define | XMCDMA_BD_RESERVED_OFFSET 0x10 |
| Reserved field. More... | |
| #define | XMCDMA_BD_CTRL_OFFSET 0x14 |
| Control/buffer length. More... | |
| #define | XMCDMA_BD_STS_OFFSET 0x18 |
| Status. More... | |
| #define | XMCDMA_BD_SIDEBAND_STS_OFFSET 0x1C |
| Side Band Status. More... | |
| #define | XMCDMA_BD_USR0_OFFSET 0x20 |
| User IP specific word0. More... | |
| #define | XMCDMA_BD_USR1_OFFSET 0x24 |
| User IP specific word1. More... | |
| #define | XMCDMA_BD_USR2_OFFSET 0x28 |
| User IP specific word2. More... | |
| #define | XMCDMA_BD_USR3_OFFSET 0x2C |
| User IP specific word3. More... | |
| #define | XMCDMA_BD_USR4_OFFSET 0x30 |
| User IP specific word3. More... | |
| #define | XMCDMA_BD_HAS_DRE_OFFSET 0x34 |
| First unused field by h/w. More... | |
| #define | XMCDMA_BD_HAS_CTRLSTS_OFFSET 0x38 |
| BD offset for status/control stream flag. More... | |
| #define | XMCDMA_BD_SW_ID_OFFSET 0x3C |
| Sw ID. More... | |
| #define BLOCK_SIZE_2MB 0x200000U |
Two-megabyte block size for TLB attributes.
Referenced by main().
| #define BLOCK_SIZE_2MB 0x200000U |
Two-megabyte block size for TLB attributes.
| #define MAX_CHANNELS 16 |
Maximum number of MCDMA channels.
| #define MAX_CHANNELS 16 |
Maximum number of MCDMA channels.
| #define MAX_PKT_LEN 1024 |
Maximum packet length in bytes.
| #define MAX_PKT_LEN 1024 |
Maximum packet length in bytes.
| #define MAX_TRANSFER_LEN | ( | h | ) | (((~0UL) << (0)) & (~0UL >> (32 - 1 - (h)))) |
Computes a contiguous bit mask for the maximum transfer length field.
| [in] | h | is the high bit index of the field. |
Referenced by XMcDma_Initialize().
| #define MCDMA_BASE_ADDR XPAR_XMCDMA_0_BASEADDR |
Base address of the MCDMA device.
Referenced by main().
| #define MCDMA_BASE_ADDR XPAR_XMCDMA_0_BASEADDR |
Base address of the MCDMA device.
| #define MEM_BASE_ADDR 0x01000000 |
Base address for DMA buffers and BD space.
| #define NUM_MAX_CHANNELS 16 |
Maximum number of channels for pattern arrays.
| #define NUMBER_OF_BDS_PER_PKT 10 |
Number of buffer descriptors per packet.
| #define NUMBER_OF_BDS_PER_PKT 10 |
Number of buffer descriptors per packet.
| #define NUMBER_OF_BDS_TO_TRANSFER |
Total buffer descriptors to transfer.
Referenced by main().
| #define NUMBER_OF_BDS_TO_TRANSFER |
Total buffer descriptors to transfer.
| #define NUMBER_OF_EVENTS 1 |
Number of interrupt events expected to complete the test.
Referenced by main().
| #define NUMBER_OF_PKTS_TO_TRANSFER 100 |
Number of packets to transfer in the test.
| #define NUMBER_OF_PKTS_TO_TRANSFER 100 |
Number of packets to transfer in the test.
| #define PACKETS_PER_IRQ 50 |
Number of packets processed per interrupt.
| #define POLL_TIMEOUT_COUNTER 1000000U |
Maximum poll iterations before a transfer times out.
Referenced by main().
| #define POLL_TIMEOUT_COUNTER 1000000U |
Maximum poll iterations before a transfer times out.
| #define RX_BD_SPACE_BASE (MEM_BASE_ADDR + 0x10000000) |
Base address of the receive BD space.
| #define RX_BD_SPACE_SIZE (NUMBER_OF_BDS_TO_TRANSFER * sizeof(XMcdma_Bd) * MAX_CHANNELS) |
Receive BD space size in bytes.
| #define RX_BD_SPACE_SIZE (NUMBER_OF_BDS_TO_TRANSFER * sizeof(XMcdma_Bd) * MAX_CHANNELS ) |
Receive BD space size in bytes.
| #define RX_BUFFER_BASE (MEM_BASE_ADDR + 0x50000000) |
Base address of the receive buffer.
| #define RX_BUFFER_SIZE (NUMBER_OF_BDS_TO_TRANSFER * MAX_PKT_LEN * MAX_CHANNELS ) |
Receive buffer size in bytes.
| #define RX_BUFFER_SIZE (NUMBER_OF_BDS_TO_TRANSFER * MAX_PKT_LEN * MAX_CHANNELS ) |
Receive buffer size in bytes.
| #define TEST_START_VALUE 0xC |
Starting value used to fill and verify test data.
| #define TEST_START_VALUE 0xC |
Starting value used to fill and verify test data.
| #define TX_BD_SPACE_BASE (MEM_BASE_ADDR) |
Base address of the transmit BD space.
| #define TX_BD_SPACE_SIZE (NUMBER_OF_BDS_TO_TRANSFER * sizeof(XMcdma_Bd) * MAX_CHANNELS) |
Transmit BD space size in bytes.
| #define TX_BD_SPACE_SIZE (NUMBER_OF_BDS_TO_TRANSFER * sizeof(XMcdma_Bd) * MAX_CHANNELS ) |
Transmit BD space size in bytes.
| #define TX_BUFFER_BASE (MEM_BASE_ADDR + 0x20000000) |
Base address of the transmit buffer.
| #define TX_BUFFER_SIZE (NUMBER_OF_BDS_TO_TRANSFER * MAX_PKT_LEN * MAX_CHANNELS ) |
Transmit buffer size in bytes.
| #define TX_BUFFER_SIZE (NUMBER_OF_BDS_TO_TRANSFER * MAX_PKT_LEN * MAX_CHANNELS ) |
Transmit buffer size in bytes.
| #define WRR_MASK | ( | h, | |
| l | |||
| ) | (((~0UL) << (l)) & (~0UL >> (32 - 1 - (h)))) |
Computes a contiguous bit mask between high and low bit indices.
| [in] | h | is the high bit index of the field. |
| [in] | l | is the low bit index of the field. |
| #define XMCDMA_AXCACHE 0xB |
Default AXI cache attribute value.
Referenced by XMcDma_CfgInitialize().
| #define XMCDMA_AXCACHE_MASK 0x0000000F |
AXI cache attribute field mask.
| #define XMCDMA_AXUSER_MASK 0x00000F00 |
AXI user sideband field mask.
| #define XMCDMA_BD_BUFA_MSB_OFFSET 0x0C |
Buffer address.
| #define XMCDMA_BD_BUFA_OFFSET 0x08 |
Buffer address.
Referenced by XMcdma_BdSetBufAddr(), and XMcDma_DumpBd().
| #define XMCDMA_BD_BYTES_TO_CLEAR 44 |
BD-specific bytes to clear.
| #define XMCDMA_BD_CTRL_ALL_MASK 0xC0000000 |
Buffer descriptor SOF and EOF control mask.
Referenced by XMcDma_BdSetCtrl().
| #define XMCDMA_BD_CTRL_EOF_MASK 0x40000000 |
Buffer descriptor end-of-frame control mask.
Referenced by XMcdma_BdChainFromHW().
| #define XMCDMA_BD_CTRL_OFFSET 0x14 |
Control/buffer length.
Referenced by XMcdma_BdChainFromHW(), XMcDma_BdSetCtrl(), XMcDma_Chan_Sideband_Submit(), XMcDma_ChanSubmit(), and XMcDma_DumpBd().
| #define XMCDMA_BD_CTRL_SBAND_OFFSET 0x18 |
Status.
| #define XMCDMA_BD_CTRL_SBAND_SHIFT 24 |
Bit shift for BD sideband control fields.
| #define XMCDMA_BD_CTRL_SOF_MASK 0x80000000 |
Buffer descriptor start-of-frame control mask.
| #define XMCDMA_BD_HAS_CTRLSTS_OFFSET 0x38 |
BD offset for status/control stream flag.
Referenced by XMcDma_BdGetAppWord(), XMcDma_BdSetAppWord(), and XMcDma_ChanBdCreate().
| #define XMCDMA_BD_HAS_DRE_MASK 0xF00 |
Whether has DRE mask.
Referenced by XMcdma_BdSetBufAddr().
| #define XMCDMA_BD_HAS_DRE_OFFSET 0x34 |
First unused field by h/w.
Referenced by XMcdma_BdSetBufAddr(), and XMcDma_ChanBdCreate().
| #define XMCDMA_BD_HAS_DRE_SHIFT 8 |
Whether has DRE shift.
Referenced by XMcDma_ChanBdCreate().
| #define XMCDMA_BD_HW_NUM_BYTES 52 |
Number of bytes hw used.
| #define XMCDMA_BD_MINIMUM_ALIGNMENT 0x40 |
Minimum buffer descriptor alignment in bytes.
| #define XMCDMA_BD_NDESC_MSB_OFFSET 0x04 |
Next descriptor pointer.
Referenced by XMcDma_ChanBdCreate().
| #define XMCDMA_BD_NDESC_OFFSET 0x00 |
Next descriptor pointer.
Referenced by XMcDma_ChanBdCreate(), and XMcDma_DumpBd().
| #define XMCDMA_BD_RESERVED_OFFSET 0x10 |
Reserved field.
| #define XMCDMA_BD_SIDEBAND_STS_OFFSET 0x1C |
Side Band Status.
Referenced by XMcdma_BdChainFromHW(), and XMcDma_DumpBd().
| #define XMCDMA_BD_SIDEBAND_STS_TDEST_MASK 0x000F0000 |
BD sideband status TDEST field mask.
| #define XMCDMA_BD_SIDEBAND_STS_TID_MASK 0xFF000000 |
BD sideband status TID field mask.
| #define XMCDMA_BD_SIDEBAND_STS_TUSER_MASK 0x0000FFFF |
BD sideband status TUSER field mask.
| #define XMCDMA_BD_START_CLEAR 8 |
Offset to start clear.
| #define XMCDMA_BD_STS_ALL_ERR_MASK 0x70000000 |
All errors.
| #define XMCDMA_BD_STS_ALL_MASK 0xFC000000 |
All status bits.
| #define XMCDMA_BD_STS_COMPLETE_MASK 0x80000000 |
Completed.
Referenced by XMcdma_BdChainFromHW().
| #define XMCDMA_BD_STS_DEC_ERR_MASK 0x40000000 |
Decode error.
| #define XMCDMA_BD_STS_INT_ERR_MASK 0x10000000 |
Internal err.
| #define XMCDMA_BD_STS_OFFSET 0x18 |
Status.
Referenced by XMcdma_BdChainFromHW(), and XMcDma_DumpBd().
| #define XMCDMA_BD_STS_RXEOF_MASK 0x04000000 |
Last rx pkt.
Referenced by XMcdma_BdChainFromHW().
| #define XMCDMA_BD_STS_RXSOF_MASK 0x08000000 |
First rx pkt.
| #define XMCDMA_BD_STS_SLV_ERR_MASK 0x20000000 |
Slave error.
| #define XMCDMA_BD_SW_ID_OFFSET 0x3C |
Sw ID.
| #define XMCDMA_BD_USR0_OFFSET 0x20 |
User IP specific word0.
Referenced by XMcDma_BdGetAppWord(), XMcDma_BdSetAppWord(), XMcDma_Chan_Sideband_Submit(), and XMcDma_DumpBd().
| #define XMCDMA_BD_USR1_OFFSET 0x24 |
User IP specific word1.
Referenced by XMcDma_DumpBd().
| #define XMCDMA_BD_USR2_OFFSET 0x28 |
User IP specific word2.
Referenced by XMcDma_DumpBd().
| #define XMCDMA_BD_USR3_OFFSET 0x2C |
User IP specific word3.
Referenced by XMcDma_DumpBd().
| #define XMCDMA_BD_USR4_OFFSET 0x30 |
User IP specific word3.
Referenced by XMcDma_DumpBd().
| #define XMCDMA_BD_WORDLEN_MASK 0xFF |
Whether has DRE mask.
Referenced by XMcdma_BdSetBufAddr().
| #define XMCDMA_BD_WORDLEN_SHIFT 0 |
Whether has DRE shift.
| #define XMcdma_BdChainNextBd | ( | Chan, | |
| BdPtr | |||
| ) |
Return the next BD in the Chain.
| [in] | Chan | is the Channel BD Chain to operate on. |
| [in] | BdPtr | is the current BD. |
Referenced by XMcdma_BdChainFree(), XMcdma_BdChainFromHW(), XMcDma_Chan_Sideband_Submit(), and XMcDma_ChanSubmit().
| #define XMcdma_BdChainPrevBd | ( | Chan, | |
| BdPtr | |||
| ) |
Return the previous BD in the Chain.
| [in] | Chan | is the MCDMA channel to operate on. |
| [in] | BdPtr | is the current BD. |
| #define XMcdma_BdClear | ( | BdPtr | ) |
Clears the BD Contents.
| [in] | BdPtr | is the BD to operate on |
Referenced by XMcdma_BdChainFree(), XMcDma_Chan_Sideband_Submit(), and XMcDma_ChanSubmit().
| #define XMcDma_BdGetActualLength | ( | BdPtr, | |
| LengthMask | |||
| ) |
Get the actual transfer length of a Ingress (S2MM)BD.
The BD has completed in hw.
May not work if the BD is in cached memory.
| [in] | BdPtr | is the BD to check on |
| [in] | LengthMask | is the Maximum Transfer Length. |
| #define XMcDma_BdGetCtrl | ( | BdPtr | ) |
Gets the control bits of a BD.
| [in] | BdPtr | is the BD to operate on |
| #define XMcDma_BdGetSts | ( | BdPtr | ) | XMcdma_BdRead((BdPtr), XMCDMA_BD_STS_OFFSET) |
Retrieve the status of a Ingress(S2MM) BD.
| [in] | BdPtr | is the BD to operate on |
| #define XMcdma_BdGetSwId | ( | BdPtr | ) | (XMcdma_BdRead((BdPtr), XMCDMA_BD_SW_ID_OFFSET)) |
Retrieve the Sw ID field of the given BD previously set with XMcdma_BdSetSwId.
| [in] | BdPtr | is the BD to operate on |
| #define XMcdma_BdHwCompleted | ( | BdPtr | ) |
Check whether a Ingress(S2MM) BD has completed in hardware.
This BD has been submitted to hardware. The application can use this function To poll for the Completion of the BD.
May not work if the BD is in cached memory.
| [in] | BdPtr | is the BD to check on |
| #define XMcdma_BdRead | ( | BaseAddress, | |
| Offset | |||
| ) | (*(u32 *)(((UINTPTR)(void *)(BaseAddress)) + (u32)(Offset))) |
Read the given Buffer Descriptor word.
| [in] | BaseAddress | is the base address of the BD to read |
| [in] | Offset | is the word offset to be read |
Referenced by XMcdma_BdChainFromHW(), XMcDma_BdGetAppWord(), XMcDma_BdSetAppWord(), XMcdma_BdSetBufAddr(), XMcDma_BdSetCtrl(), and XMcDma_DumpBd().
| #define XMcdma_BdRead64 | ( | BaseAddress, | |
| Offset | |||
| ) | (*(u64 *)(((UINTPTR)(void *)(BaseAddress)) + (u32)(Offset))) |
Read the given Buffer Descriptor word.
| [in] | BaseAddress | is the base address of the BD to read |
| [in] | Offset | is the word offset to be read |
| #define XMcDma_BdSetCtrlSideBand | ( | BdPtr, | |
| Tid, | |||
| Tuser | |||
| ) |
Set the Tid and Tuser fields of a BD with the user provided values.
| [in] | BdPtr | is the BD to operate on. |
| [in] | Tid | is Tid value to be written in the Bd field. |
| [in] | Tuser | is Tuser value to be written in the Bd field. |
Referenced by XMcDma_Chan_Sideband_Submit().
| #define XMcdma_BdSetSwId | ( | BdPtr, | |
| Id | |||
| ) | (XMcdma_BdWrite((BdPtr), XMCDMA_BD_SW_ID_OFFSET, (UINTPTR)(Id))) |
Set the Sw ID field of the given BD.
The ID is an arbitrary piece of data the application can associate with a specific BD.
| [in] | BdPtr | is the BD to operate on |
| [in] | Id | is a 32-bit quantity to set in the BD |
| #define XMcdma_BdWrite | ( | BaseAddress, | |
| Offset, | |||
| Data | |||
| ) | (*(u32 *)((UINTPTR)(void *)(BaseAddress) + (u32)(Offset))) = (u32)(Data) |
Write the given Buffer Descriptor word.
| [in] | BaseAddress | is the base address of the BD to write |
| [in] | Offset | is the word offset to be written |
| [in] | Data | is the 32-bit value to write to the field |
Referenced by XMcDma_BdSetAppWord(), XMcdma_BdSetBufAddr(), XMcDma_BdSetCtrl(), XMcDma_Chan_Sideband_Submit(), XMcDma_ChanBdCreate(), and XMcDma_ChanSubmit().
| #define XMcdma_BdWrite64 | ( | BaseAddress, | |
| Offset, | |||
| Data | |||
| ) | (*(u64 *)((UINTPTR)(void *)(BaseAddress) + (u32)(Offset))) = (u64)(Data) |
Write the given Buffer Descriptor double word.
| [in] | BaseAddress | is the base address of the BD to write |
| [in] | Offset | is the word offset to be written |
| [in] | Data | is the 64-bit value to write to the field |
Referenced by XMcdma_BdSetBufAddr().
| #define XMCDMA_CACHE_FLUSH | ( | BdPtr | ) | Xil_DCacheFlushRange((UINTPTR)(BdPtr), XMCDMA_BD_HW_NUM_BYTES) |
Declares cache flush and invalidate helpers for BDs in cached memory.
Flushes the data cache for a buffer descriptor.
| [in] | BdPtr | is the buffer descriptor address. |
Referenced by XMcDma_Chan_Sideband_Submit(), XMcDma_ChanBdCreate(), XMcDma_ChanSubmit(), and XMcdma_UpdateChanCDesc().
| #define XMCDMA_CACHE_INVALIDATE | ( | BdPtr | ) | Xil_DCacheInvalidateRange((UINTPTR)(BdPtr), XMCDMA_BD_HW_NUM_BYTES) |
Invalidates the data cache for a buffer descriptor.
| [in] | BdPtr | is the buffer descriptor address. |
Referenced by XMcdma_BdChainFromHW(), and XMcdma_UpdateChanTDesc().
| #define XMCDMA_CCR_OFFSET 0x00 |
Common control register offset.
Referenced by XMcDma_Reset(), XMcdma_ResetIsDone(), and XMcdma_Start().
| #define XMCDMA_CCR_RESET_MASK 0x00000004 |
Common control reset bit mask.
Referenced by XMcDma_Reset(), and XMcdma_ResetIsDone().
| #define XMCDMA_CCR_RUNSTOP_MASK 0x00000001 |
Common control run/stop bit mask.
Referenced by XMcdma_ChanHwStop(), XMcdma_Start(), and XMcdma_UpdateChanTDesc().
| #define XMCDMA_CDESC_MSB_OFFSET 0x4C |
Current descriptor pointer MSB register offset.
Referenced by XMcdma_DumpChanRegs(), and XMcdma_UpdateChanCDesc().
| #define XMCDMA_CDESC_OFFSET 0x48 |
Current descriptor pointer register offset.
Referenced by XMcdma_DumpChanRegs(), and XMcdma_UpdateChanCDesc().
| #define XMCDMA_CHAN_BUSY 2 |
Channel busy state value.
Referenced by XMcdma_UpdateChanCDesc(), and XMcdma_UpdateChanTDesc().
| #define XMCDMA_CHAN_IDLE 0 |
Channel idle state value.
Referenced by XMcDma_ChanBdCreate(), XMcdma_ChanIntrHandler(), XMcdma_IntrHandler(), XMcDma_Reset(), and XMcdma_TxIntrHandler().
| #define XMCDMA_CHAN_PAUSE 1 |
Channel paused state value.
Referenced by XMcdma_ChanIntrHandler(), XMcdma_IntrHandler(), and XMcdma_TxIntrHandler().
| #define XMCDMA_CHAN_SEEKAHEAD | ( | Chan, | |
| BdPtr, | |||
| NumBd | |||
| ) |
Advances a BD pointer by a number of descriptors with ring wrap.
Wraparound occurs when the new BD pointer is greater than the high address in the ring or when the pointer crosses the 0xFFFFFFFF to 0 boundary.
| [in] | Chan | is the MCDMA channel that contains BdPtr. |
| [in,out] | BdPtr | is the starting BD position on entry and the updated BD position on return. |
| [in] | NumBd | is the number of BD spaces to advance. |
Referenced by XMcdma_BdChainFromHW().
| #define XMcdma_ChanAckIrq | ( | Chan, | |
| Mask | |||
| ) |
Acknowledges the specified channel interrupts that are specified in Mask.
| [in] | Chan | is the MCDMA Channel to Operate on. |
| [in] | Mask | is the mask for the interrupts to be acknowledge |
Referenced by XMcdma_ChanIntrHandler(), XMcdma_IntrHandler(), and XMcdma_TxIntrHandler().
| #define XMcdma_ChanGetIrq | ( | Chan | ) |
Returns asserted channel interrupts.
| [in] | Chan | is the MCDMA Channel to Operate on. |
Referenced by XMcdma_ChanIntrHandler(), XMcdma_IntrHandler(), and XMcdma_TxIntrHandler().
| #define XMcdma_ChanHwIsStarted | ( | Chan, | |
| Chan_id | |||
| ) |
Check whether a DMA channel is started, meaning the channel is not halted.
| [in] | Chan | is the channel instance to operate on. |
| [in] | Chan_id | is the channel number to operate on. |
Referenced by XMcdma_UpdateChanTDesc().
| #define XMCDMA_CHEN_MASK 0x000000FF |
Channel enable field mask.
| #define XMCDMA_CHEN_OFFSET 0x08 |
Channel enable register offset.
Referenced by XMcdma_EnableCh().
| #define XMCDMA_CHID_MASK 0x000000FF |
Channel identifier field mask.
| #define XMCDMA_CHOBS1_OFFSET 0x440 |
Channel observer 1 register offset.
| #define XMCDMA_CHOBS2_OFFSET 0x444 |
Channel observer 2 register offset.
| #define XMCDMA_CHOBS3_OFFSET 0x448 |
Channel observer 3 register offset.
| #define XMCDMA_CHOBS4_OFFSET 0x44C |
Channel observer 4 register offset.
| #define XMCDMA_CHOBS5_OFFSET 0x450 |
Channel observer 5 register offset.
| #define XMCDMA_CHOBS6_OFFSET 0x454 |
Channel observer 6 register offset.
| #define XMCDMA_CHSER_OFFSET 0x0C |
Channel service register offset.
Referenced by XMcdma_GetChanServiced(), and XMcdma_GetTxChanServiced().
| #define XMCDMA_COALESCE_MASK 0x00FF0000 |
Interrupt coalesce counter field mask.
Referenced by XMcdma_SetChanCoalesceDelay().
| #define XMCDMA_COALESCE_SHIFT 16 |
Bit shift for the coalesce counter field.
Referenced by XMcdma_SetChanCoalesceDelay().
| #define XMCDMA_CPKTDROP_OFFSET 0x14 |
Common packet drop register offset.
| #define XMCDMA_CR_OFFSET 0x40 |
Per-channel control register offset.
Referenced by XMcdma_ChanHwStop(), XMcdma_DumpChanRegs(), XMcdma_SetChanCoalesceDelay(), and XMcdma_UpdateChanTDesc().
| #define XMCDMA_CSR_HALTED_MASK 0x00000001 |
Common status halted bit mask.
Referenced by XMcdma_Start().
| #define XMCDMA_CSR_IDLE_MASK 0x00000002 |
Common status idle bit mask.
| #define XMCDMA_CSR_OFFSET 0x04 |
Common status register offset.
Referenced by XMcdma_Start().
| #define XMCDMA_DELAY_MASK 0xFF000000 |
Interrupt delay counter field mask.
Referenced by XMcdma_SetChanCoalesceDelay().
| #define XMCDMA_DELAY_SHIFT 24 |
Bit shift for the delay counter field.
Referenced by XMcdma_SetChanCoalesceDelay().
| #define XMCDMA_DEV_TO_MEM 0 |
Transfer direction from device to memory.
| #define XMcdma_DisableCh | ( | Chan, | |
| ChanId | |||
| ) |
Disable Particular Channel in the MCDMA Core.
| [in] | Chan | is the MCDMA Channel to be worked on. |
| [in] | ChanId | is the channel to disable. |
| #define XMCDMA_ERR_DECODE_MASK 0x00000004 |
Decode error bit mask.
| #define XMCDMA_ERR_INTERNAL_MASK 0x00000001 |
Internal error bit mask.
| #define XMCDMA_ERR_OFFSET 0x10 |
Error register offset.
| #define XMCDMA_ERR_SG_DEC_MASK 0x00000040 |
Scatter-gather decode error bit mask.
| #define XMCDMA_ERR_SG_INT_MASK 0x00000010 |
Scatter-gather internal error bit mask.
| #define XMCDMA_ERR_SG_SLV_MASK 0x00000020 |
Scatter-gather slave error bit mask.
| #define XMCDMA_ERR_SLAVE_MASK 0x00000002 |
Slave error bit mask.
| #define XMcDma_GetBdSbandStats | ( | BdPtr | ) | XMcdma_BdRead((BdPtr), XMCDMA_BD_SIDEBAND_STS_OFFSET) |
Retrieve the side band status of a BD.
| [in] | BdPtr | is the BD to operate on |
| #define XMcdma_GetChan | ( | Chan | ) | XMcdma_ReadReg(Chan->ChanBase, XMCDMA_CHSER_OFFSET) |
Get Channel number that last Serviced.
| [in] | Chan | is the MCDMA Channel to be worked on. |
| #define XMcdma_GetChanBdDoneCnt | ( | Chan | ) | ((Chan)->BdDoneCnt) |
Returns the buffer descriptor count processed by the h/w.
| [in] | Chan | is the MCDMA Channel to Operate on. |
| #define XMcdma_GetChanCurBd | ( | Chan | ) | ((Chan)->BdRestart) |
Gets the Channel BD Chain Current BD.
| [in] | Chan | is the MCDMA Channel to Operate on. |
| #define XMcdma_GetChanPktDrp_Cnt | ( | Chan, | |
| ChanId | |||
| ) |
Get Packet drop Count for the particular Channel.
| [in] | Chan | is the MCDMA Channel to be worked on. |
| [in] | ChanId | is the Channel number to be worked on. |
| #define XMcdma_GetEgressObserver | ( | InstancePtr, | |
| ObsId | |||
| ) |
Get Egress Channel Observer contents.
| [in] | InstancePtr | is the driver instance we are working on. |
| [in] | ObsId | is the Egress Channel observer number to be worked on. |
| #define XMcdma_GetIngressObserver | ( | InstancePtr, | |
| ObsId | |||
| ) |
Get Ingress Channel Observer contents.
| [in] | InstancePtr | is the driver instance we are working on. |
| [in] | ObsId | is the Ingress Channel observer number to be worked on. |
| #define XMcdma_GetMcdmaRxChan | ( | InstancePtr, | |
| ChanId | |||
| ) | (&((InstancePtr)->Rx_Chan[ChanId])) |
Gets the RX Channel Pointer.
| [in] | InstancePtr | is a pointer to the DMA engine instance to be worked on. |
| [in] | ChanId | is the channel to operate on |
Referenced by XMcdma_IntrHandler(), and XMcdma_ResetIsDone().
| #define XMcdma_GetMcdmaTxChan | ( | InstancePtr, | |
| ChanId | |||
| ) | (&((InstancePtr)->Tx_Chan[ChanId])) |
Gets the TX Channel Pointer.
| [in] | InstancePtr | is a pointer to the DMA engine instance to be worked on. |
| [in] | ChanId | is the channel to operate on |
Referenced by XMcdma_ResetIsDone(), and XMcdma_TxIntrHandler().
| #define XMcdma_GetPktDrp_cnt | ( | Chan | ) | XMcdma_ReadReg(Chan->ChanBase, XMCDMA_CPKTDROP_OFFSET) |
Gets global Packet drop Count.
| [in] | Chan | is the MCDMA Channel to be worked on. |
| #define XMcdma_HwIsStarted | ( | Chan | ) |
Check whether a DMA is started, meaning the channel is not halted.
| [in] | Chan | is the channel instance to operate on. |
Referenced by XMcdma_UpdateChanTDesc().
| #define XMcdma_In32 Xil_In32 |
Input operation.
| #define XMcdma_IntrDisable | ( | Chan, | |
| Mask | |||
| ) |
Disables interrupts specified by the Mask.
Interrupts that are not in the mask are not affected.
| [in] | Chan | is the MCDMA Channel to be worked on. |
| [in] | Mask | is the mask for the interrupts to be disabled |
| #define XMcdma_IntrEnable | ( | Chan, | |
| Mask | |||
| ) |
Enables interrupts specified by the Mask in specified direction, Interrupts that are not in the mask are not affected.
| [in] | Chan | is the MCDMA Channel to be worked on. |
| [in] | Mask | is the mask for the interrupts to be enabled |
| #define XMCDMA_IRQ_ALL_MASK 0x000000F0 |
All interrupt sources mask.
Referenced by XMcdma_ChanIntrHandler(), XMcdma_IntrHandler(), and XMcdma_TxIntrHandler().
| #define XMCDMA_IRQ_DELAY_MASK 0x00000040 |
Delay interrupt mask.
Referenced by XMcdma_ChanIntrHandler(), XMcdma_IntrHandler(), and XMcdma_TxIntrHandler().
| #define XMCDMA_IRQ_ERROR_MASK 0x00000080 |
Error interrupt mask.
Referenced by XMcdma_ChanIntrHandler(), XMcdma_IntrHandler(), and XMcdma_TxIntrHandler().
| #define XMCDMA_IRQ_IOC_MASK 0x00000020 |
Interrupt on complete mask.
Referenced by XMcdma_ChanIntrHandler(), XMcdma_IntrHandler(), and XMcdma_TxIntrHandler().
| #define XMCDMA_IRQ_PKTDROP_MASK 0x00000010 |
Packet drop interrupt mask.
Referenced by XMcdma_IntrHandler().
| #define XMcdma_isidle | ( | Chan | ) |
Checks whether the DMA channel is idle or not.
| [in] | Chan | is the MCDMA Channel to be worked on. |
| #define XMCDMA_LAST_APPWORD 4 |
Last application word index in the BD.
Referenced by XMcDma_BdGetAppWord(), XMcDma_BdSetAppWord(), and XMcDma_Chan_Sideband_Submit().
| #define XMCDMA_LOOP_COUNT 1000000 |
Default poll loop iteration limit.
Referenced by XMcDma_CfgInitialize(), XMcdma_ChanHwStop(), XMcdma_SelfTest(), and XMcdma_Start().
| #define XMCDMA_MAX_CHAN_PER_DEVICE 32 |
Maximum number of channels per MCDMA device.
| #define XMCDMA_MAX_TRANSFER_LEN 0x03FFFFFF |
Maximum buffer transfer length mask.
| #define XMCDMA_MEM_TO_DEV 1 |
Transfer direction from memory to device.
| #define XMCDMA_NUM_APP_WORDS 5 |
Number of application words in a buffer descriptor.
| #define XMCDMA_NXTCHAN_OFFSET 0x40 |
Next channel register block stride.
Referenced by XMcdma_ChanHwStop(), XMcdma_DumpChanRegs(), XMCdma_GetChan_PktDoneCnt(), XMcdma_SetChanCoalesceDelay(), XMcdma_UpdateChanCDesc(), and XMcdma_UpdateChanTDesc().
| #define XMCDMA_NXTOBS_OFFSET 0x4 |
Next observer register stride.
| #define XMcdma_Out32 Xil_Out32 |
Output operation.
| #define XMCDMA_PKTDROP_CNT_MASK 0xFFFFFFFF |
Packet drop count field mask.
| #define XMCDMA_PKTDROP_COALESCE_MASK 0x0000FF00 |
Packet drop coalesce field mask.
| #define XMCDMA_PKTDROP_OFFSET 0x58 |
Packet drop count register offset.
Referenced by XMcdma_DumpChanRegs().
| #define XMcdma_ReadReg | ( | BaseAddress, | |
| RegOffset | |||
| ) | XMcdma_In32((BaseAddress) + (u32)(RegOffset)) |
Reads the given register.
| [in] | BaseAddress | is the base address of the MCDMA core. |
| [in] | RegOffset | is the register offset of the register. |
Referenced by XMcdma_ChanHwStop(), XMcdma_DumpChanRegs(), XMcdma_EnableCh(), XMCdma_GetChan_PktDoneCnt(), XMCdma_GetChan_Weight(), XMcdma_GetChanServiced(), XMcdma_GetTxChanServiced(), XMcdma_IntrHandler(), XMcdma_ResetIsDone(), XMCdma_SetChan_Weight(), XMcdma_SetChanCoalesceDelay(), XMcdma_SetSGARCache(), XMcdma_SetSGAWCache(), XMcdma_Start(), XMcdma_TxIntrHandler(), and XMcdma_UpdateChanTDesc().
| #define XMCDMA_RX_OFFSET 0x500 |
Receive path register base offset.
Referenced by XMcdma_GetChanServiced(), XMcDma_Initialize(), XMcdma_IntrHandler(), and XMcDma_Reset().
| #define XMCDMA_RX_PKTCNT_STAT_OFFSET 0x5C |
Receive packet count status register offset.
Referenced by XMCdma_GetChan_PktDoneCnt().
| #define XMCDMA_RXAXCACHE_OFFSET 0x1C |
Receive AXI cache register offset.
| #define XMCDMA_RXCH_SER_OFFSET 0x18 |
Receive channel service register offset.
| #define XMCDMA_RXINT_SER_OFFSET 0x20 |
Receive interrupt service register offset.
Referenced by XMcdma_IntrHandler().
| #define XMcdma_SetARCache | ( | InstancePtr, | |
| Value | |||
| ) |
Sets the ARCACHE field with the user specified value.
| [in] | InstancePtr | is the driver instance we are working on |
| [in] | Value | is the ARCACHE value to be written. |
Referenced by XMcDma_CfgInitialize().
| #define XMcdma_SetAWCache | ( | InstancePtr, | |
| Value | |||
| ) |
Sets the AWCACHE field with the user specified value.
| [in] | InstancePtr | is the driver instance we are working on |
| [in] | Value | is the AWCACHE value to be written. |
Referenced by XMcDma_CfgInitialize().
| #define XMCDMA_SGARCACHE_MASK 0x0000000F |
Scatter-gather AXI read cache field mask.
Referenced by XMcdma_SetSGARCache().
| #define XMCDMA_SGAWCACHE_MASK 0x000F0000 |
Scatter-gather AXI write cache field mask.
Referenced by XMcdma_SetSGAWCache().
| #define XMCDMA_SGAWCACHE_SHIFT 16 |
Bit shift for scatter-gather write cache field.
Referenced by XMcdma_SetSGAWCache().
| #define XMCDMA_SGCACHE_OFFSET 0x4B0 |
Scatter-gather cache register offset.
Referenced by XMcdma_SetSGARCache(), and XMcdma_SetSGAWCache().
| #define XMCDMA_SR_OFFSET 0x44 |
Per-channel status register offset.
Referenced by XMcdma_DumpChanRegs().
| #define XMCDMA_TDESC_MSB_OFFSET 0x54 |
Tail descriptor pointer MSB register offset.
Referenced by XMcdma_DumpChanRegs(), and XMcdma_UpdateChanTDesc().
| #define XMCDMA_TDESC_OFFSET 0x50 |
Tail descriptor pointer register offset.
Referenced by XMcdma_DumpChanRegs(), and XMcdma_UpdateChanTDesc().
| #define XMCDMA_TX_PKTCNT_STAT_OFFSET 0x58 |
Transmit packet count status register offset.
Referenced by XMCdma_GetChan_PktDoneCnt().
| #define XMCDMA_TX_WRR_REG1_OFFSET 0x1C |
Transmit weighted round-robin register 1 offset.
Referenced by XMCdma_GetChan_Weight(), and XMCdma_SetChan_Weight().
| #define XMCDMA_TX_WRR_REG_OFFSET 0x18 |
Transmit weighted round-robin register 0 offset.
Referenced by XMCdma_GetChan_Weight(), and XMCdma_SetChan_Weight().
| #define XMCDMA_TX_WRRCH0_MASK 0x0000000F |
Transmit WRR weight mask for channel 0.
| #define XMCDMA_TX_WRRCH1_MASK 0x000000F0 |
Transmit WRR weight mask for channel 1.
| #define XMCDMA_TX_WRRCH2_MASK 0x00000F00 |
Transmit WRR weight mask for channel 2.
| #define XMCDMA_TX_WRRCH3_MASK 0x0000F000 |
Transmit WRR weight mask for channel 3.
| #define XMCDMA_TX_WRRCH4_MASK 0x000F0000 |
Transmit WRR weight mask for channel 4.
| #define XMCDMA_TX_WRRCH5_MASK 0x00F00000 |
Transmit WRR weight mask for channel 5.
| #define XMCDMA_TX_WRRCH6_MASK 0x0F000000 |
Transmit WRR weight mask for channel 6.
| #define XMCDMA_TX_WRRCH7_MASK 0xF0000000 |
Transmit WRR weight mask for channel 7.
| #define XMCDMA_TX_WRRCH_MASK | ( | Chan_id | ) | WRR_MASK((Chan_id * 4 + 3), Chan_id *4) |
Returns the WRR weight field mask for a transmit channel.
| [in] | Chan_id | is the zero-based WRR channel index within the register. |
Referenced by XMCdma_GetChan_Weight(), and XMCdma_SetChan_Weight().
| #define XMCDMA_TX_WRRCH_SHIFT | ( | Chan_id | ) | Chan_id * 4 |
Returns the bit shift for a transmit channel WRR weight field.
| [in] | Chan_id | is the zero-based WRR channel index within the register. |
Referenced by XMCdma_GetChan_Weight(), and XMCdma_SetChan_Weight().
| #define XMCDMA_TXAXCACHE_OFFSET 0x24 |
Transmit AXI cache register offset.
| #define XMcDma_TxBdGetActualLength | ( | BdPtr, | |
| LengthMask | |||
| ) |
Get the actual transfer length of a Egress(MM2S) BD.
The BD has completed in hw.
May not work if the BD is in cached memory.
| [in] | BdPtr | is the BD to check on |
| [in] | LengthMask | is the Maximum Transfer Length. |
| #define XMcDma_TxBdGetSts | ( | BdPtr | ) | XMcdma_BdRead((BdPtr), XMCDMA_BD_SIDEBAND_STS_OFFSET) |
Retrieve the status of a Egress(MM2S) BD.
| [in] | BdPtr | is the BD to operate on |
| #define XMcdma_TxBdHwCompleted | ( | BdPtr | ) |
Check whether a Egress(MM2S) BD has completed in hardware.
This BD has been submitted to hardware. The application can use this function To poll for the Completion of the BD.
May not work if the BD is in cached memory.
| [in] | BdPtr | is the BD to check on |
| #define XMCDMA_TXCH_SERV_OFFSET 0x20 |
Transmit channel service register offset.
| #define XMCDMA_TXINT_SER_OFFSET 0x28 |
Transmit interrupt service register offset.
Referenced by XMcdma_TxIntrHandler().
| #define XMCDMA_TXSCHD_TYPE_OFFSET 0x14 |
Transmit scheduler type register offset.
| #define XMcdma_WriteReg | ( | BaseAddress, | |
| RegOffset, | |||
| Data | |||
| ) | XMcdma_Out32(((BaseAddress) + (RegOffset)), (Data)) |
Writes the given register.
| [in] | BaseAddress | is the base address of the MCDMA core. |
| [in] | RegOffset | is the register offset of the register. |
| [in] | Data | is the 32-bit value to write to the register. |
Referenced by XMcdma_ChanHwStop(), XMcdma_EnableCh(), XMcDma_Reset(), XMCdma_SetChan_Weight(), XMcdma_SetChanCoalesceDelay(), XMcdma_SetSGARCache(), XMcdma_SetSGAWCache(), XMcdma_Start(), XMcdma_UpdateChanCDesc(), and XMcdma_UpdateChanTDesc().
| typedef u32 XMcdma_Bd[16] |
Buffer descriptor storage as an array of 32-bit words.
| enum XMcdma_ChanHandler |
| enum XMcdma_Handler |
| enum XMcdma_QScheduler |
| int main | ( | void | ) |
Runs the MCDMA interrupt-mode example entry point.
Runs the MCDMA polled-mode example entry point.
Sets up the DMA engine to send and receive packets, then verifies the data.
References BLOCK_SIZE_2MB, MCDMA_BASE_ADDR, NUMBER_OF_BDS_TO_TRANSFER, NUMBER_OF_EVENTS, POLL_TIMEOUT_COUNTER, XMcDma_CfgInitialize(), and XMcdma_LookupConfig().
| int XMcdma_BdChainFree | ( | XMcdma_ChanCtrl * | Chan, |
| int | BdCount, | ||
| XMcdma_Bd * | BdSetPtr | ||
| ) |
Frees a set of BDs that had been previously retrieved with XMcdma_BdChainFromHW().
| [in] | Chan | is the MCDMA Channel to be worked on. |
| [in] | BdCount | is the number of BDs to free. |
| [in] | BdSetPtr | is the head of a list of BDs returned by XMcdma_BdChainFromHW(). |
References XMcdma_ChanCtrl::BdDoneCnt, XMcdma_BdChainNextBd, and XMcdma_BdClear.
| int XMcdma_BdChainFromHW | ( | XMcdma_ChanCtrl * | Chan, |
| u32 | BdLimit, | ||
| XMcdma_Bd ** | BdSetPtr | ||
| ) |
Returns a set of BD(s) that have been processed by hardware.
The returned BDs may be examined by the application to determine the outcome of the DMA transactions. Once the BDs have been examined, the application must call XMcdma_BdChainFree() in the same order which they were retrieved here.
If hardware has partially completed a packet spanning multiple BDs, then none of the BDs for that packet will be included in the results.
| [in] | Chan | is the MCDMA Channel to be worked on. |
| [in] | BdLimit | is the maximum number of BDs to return in the set. |
| [in] | BdSetPtr | is an output parameter, it points to the first BD available for examination. |
References XMcdma_ChanCtrl::BdCnt, XMcdma_ChanCtrl::BdDoneCnt, XMcdma_ChanCtrl::BdHead, XMcdma_ChanCtrl::BdSubmitCnt, XMcdma_ChanCtrl::BdTail, XMcdma_ChanCtrl::IsRxChan, XMCDMA_BD_CTRL_EOF_MASK, XMCDMA_BD_CTRL_OFFSET, XMCDMA_BD_SIDEBAND_STS_OFFSET, XMCDMA_BD_STS_COMPLETE_MASK, XMCDMA_BD_STS_OFFSET, XMCDMA_BD_STS_RXEOF_MASK, XMcdma_BdChainNextBd, XMcdma_BdRead, XMCDMA_CACHE_INVALIDATE, and XMCDMA_CHAN_SEEKAHEAD.
| u32 XMcDma_BdGetAppWord | ( | XMcdma_Bd * | BdPtr, |
| int | Offset, | ||
| int * | Valid | ||
| ) |
Get the APP word at the specified APP word offset for a BD.
| [in] | BdPtr | is the BD to operate on. |
| [in] | Offset | is the offset inside the APP word, it is valid from 0 to 4 |
| [in] | Valid | is to tell the caller whether parameters are valid |
References XMCDMA_BD_HAS_CTRLSTS_OFFSET, XMCDMA_BD_USR0_OFFSET, XMcdma_BdRead, and XMCDMA_LAST_APPWORD.
| int XMcDma_BdSetAppWord | ( | XMcdma_Bd * | BdPtr, |
| int | Offset, | ||
| u32 | Word | ||
| ) |
Set the APP word at the specified APP word offset for a BD.
| [in] | BdPtr | is the BD to operate on |
| [in] | Offset | is the offset inside the APP word, it is valid from 0 to 4 |
| [in] | Word | is the value to set |
References XMCDMA_BD_HAS_CTRLSTS_OFFSET, XMCDMA_BD_USR0_OFFSET, XMcdma_BdRead, XMcdma_BdWrite, and XMCDMA_LAST_APPWORD.
| u32 XMcdma_BdSetBufAddr | ( | XMcdma_Bd * | BdPtr, |
| UINTPTR | Addr | ||
| ) |
Set the Buffer descriptor buffer address field.
| [in] | BdPtr | is the BD to operate on |
| [in] | Addr | is the address to set |
References XMCDMA_BD_BUFA_OFFSET, XMCDMA_BD_HAS_DRE_MASK, XMCDMA_BD_HAS_DRE_OFFSET, XMCDMA_BD_WORDLEN_MASK, XMcdma_BdRead, XMcdma_BdWrite, and XMcdma_BdWrite64.
Referenced by XMcDma_Chan_Sideband_Submit(), and XMcDma_ChanSubmit().
| void XMcDma_BdSetCtrl | ( | XMcdma_Bd * | BdPtr, |
| u32 | Data | ||
| ) |
Set the control bits for a BD.
| [in] | BdPtr | is the BD to operate on. |
| [in] | Data | is the bit value to set |
References XMCDMA_BD_CTRL_ALL_MASK, XMCDMA_BD_CTRL_OFFSET, XMcdma_BdRead, and XMcdma_BdWrite.
| s32 XMcDma_CfgInitialize | ( | XMcdma * | InstancePtr, |
| XMcdma_Config * | CfgPtr | ||
| ) |
Initializes an MCDMA core before any other driver function is called.
Initialization includes setting up the instance data and ensuring the hardware is in a quiescent state and resets all the hardware configurations.
| [in] | InstancePtr | is a pointer to the XMcdma instance. |
| [in] | CfgPtr | is a reference to a structure containing information about a specific XMcdma instance. |
References XMcdma::Config, XMcdma::IsReady, XMCDMA_AXCACHE, XMcDma_Initialize(), XMCDMA_LOOP_COUNT, XMcDma_Reset(), XMcdma_ResetIsDone(), XMcdma_SetARCache, and XMcdma_SetAWCache.
Referenced by main().
| u32 XMcDma_Chan_Sideband_Submit | ( | XMcdma_ChanCtrl * | ChanPtr, |
| UINTPTR | BufAddr, | ||
| u32 | Len, | ||
| u32 * | AppPtr, | ||
| u16 | Tuser, | ||
| u16 | Tid | ||
| ) |
Populates the BD chain with the required buffer address, length APP(user application), TUSER and TID fields.
User can submit multiple buffers/buffer descriptors by calling this function multiple times
| [in] | ChanPtr | is the MCDMA Channel to be worked on. |
| [in] | BufAddr | is the buffer address to which data should send/recv. |
| [in] | Len | is the Amount of data user requested to send/recv. |
| [in] | AppPtr | is the point to APP fields. |
| [in] | Tuser | is the value presented on the beat that has TLAST. |
| [in] | Tid | is the value value presented on the beat that has TLAST. |
References XMcdma_ChanCtrl::BdCnt, XMcdma_ChanCtrl::BdPendingCnt, XMcdma_ChanCtrl::BdRestart, XMcdma_ChanCtrl::BdTail, XMcdma_ChanCtrl::HasRxLength, XMcdma_ChanCtrl::IsRxChan, XMcdma_ChanCtrl::MaxTransferLen, XMCDMA_BD_CTRL_OFFSET, XMCDMA_BD_USR0_OFFSET, XMcdma_BdChainNextBd, XMcdma_BdClear, XMcdma_BdSetBufAddr(), XMcDma_BdSetCtrlSideBand, XMcdma_BdWrite, XMCDMA_CACHE_FLUSH, and XMCDMA_LAST_APPWORD.
| u32 XMcDma_ChanBdCreate | ( | XMcdma_ChanCtrl * | Chan, |
| UINTPTR | Addr, | ||
| u32 | Count | ||
| ) |
Using a memory segment allocated by the caller, creates and setup the BD Chain for the MCDMA Channel.
| [in] | Chan | is the MCDMA Channel to be worked on. |
| [in] | Addr | is the address of the application memory region. |
| [in] | Count | is the number of BDs to setup in the application memory region. |
References XMcdma_ChanCtrl::BdCnt, XMcdma_ChanCtrl::BdDoneCnt, XMcdma_ChanCtrl::BdHead, XMcdma_ChanCtrl::BdPendingCnt, XMcdma_ChanCtrl::BdRestart, XMcdma_ChanCtrl::BdSubmitCnt, XMcdma_ChanCtrl::BdTail, XMcdma_ChanCtrl::ChanState, XMcdma_ChanCtrl::FirstBdAddr, XMcdma_ChanCtrl::Has_Rxdre, XMcdma_ChanCtrl::Has_Txdre, XMcdma_ChanCtrl::HasStsCntrlStrm, XMcdma_ChanCtrl::IsRxChan, XMcdma_ChanCtrl::LastBdAddr, XMcdma_ChanCtrl::Length, XMcdma_ChanCtrl::RxDataWidth, XMcdma_ChanCtrl::Separation, XMcdma_ChanCtrl::TxDataWidth, XMCDMA_BD_HAS_CTRLSTS_OFFSET, XMCDMA_BD_HAS_DRE_OFFSET, XMCDMA_BD_HAS_DRE_SHIFT, XMCDMA_BD_NDESC_MSB_OFFSET, XMCDMA_BD_NDESC_OFFSET, XMcdma_BdWrite, XMCDMA_CACHE_FLUSH, and XMCDMA_CHAN_IDLE.
| u32 XMcdma_ChanHwStop | ( | XMcdma_ChanCtrl * | Chan | ) |
Stops the DMA engine.
| [in] | Chan | is the Channel instance to be worked on. |
References XMcdma_ChanCtrl::Chan_id, XMcdma_ChanCtrl::ChanBase, XMCDMA_CCR_RUNSTOP_MASK, XMCDMA_CR_OFFSET, XMCDMA_LOOP_COUNT, XMCDMA_NXTCHAN_OFFSET, XMcdma_ReadReg, and XMcdma_WriteReg.
| void XMcdma_ChanIntrHandler | ( | void * | Instance | ) |
Handles per-channel MCDMA interrupts for the MCDMA core.
This handler reads the pending interrupt from Status register, determines the source of the interrupts and calls the respective callbacks for the interrupts that are enabled in the per channel control register, and finally clears the interrupts.
The application is responsible for connecting this function to the interrupt system. Application beyond this driver is also responsible for providing callbacks to handle interrupts and installing the callbacks using XMcdma_ChanSetCallBack() during initialization phase.
| [in] | Instance | is a pointer to the Channel instance to be worked on. |
References XMcdma_ChanCtrl::ChanState, XMcdma_ChanCtrl::DoneHandler, XMcdma_ChanCtrl::DoneRef, XMcdma_ChanCtrl::ErrorHandler, XMcdma_ChanCtrl::ErrorRef, XMCDMA_CHAN_IDLE, XMCDMA_CHAN_PAUSE, XMcdma_ChanAckIrq, XMcdma_ChanGetIrq, XMCDMA_IRQ_ALL_MASK, XMCDMA_IRQ_DELAY_MASK, XMCDMA_IRQ_ERROR_MASK, and XMCDMA_IRQ_IOC_MASK.
| s32 XMcdma_ChanSetCallBack | ( | XMcdma_ChanCtrl * | Chan, |
| XMcdma_ChanHandler | HandlerType, | ||
| void * | CallBackFunc, | ||
| void * | CallBackRef | ||
| ) |
This routine installs an asynchronous callback function for the given HandlerType.
HandlerType Callback Function Type ----------------------- -------------------------------------------------- XMCDMA_HANDLER_DONE Channel Done handler XMCDMA_HANDLER_ERROR Channel Error handler
| [in] | Chan | is the Channel instance to be worked on. |
| [in] | HandlerType | specifies which callback is to be attached. |
| [in] | CallBackFunc | is the address of the callback function. |
| [in] | CallBackRef | is a user data item that will be passed to the callback function when it is invoked. |
References XMcdma_ChanCtrl::DoneHandler, XMcdma_ChanCtrl::DoneRef, XMcdma_ChanCtrl::ErrorHandler, XMcdma_ChanCtrl::ErrorRef, XMCDMA_CHAN_HANDLER_DONE, and XMCDMA_CHAN_HANDLER_ERROR.
| u32 XMcDma_ChanSubmit | ( | XMcdma_ChanCtrl * | Chan, |
| UINTPTR | BufAddr, | ||
| u32 | len | ||
| ) |
Populates the BD chain with the required buffer address and length fields.
User can submit multiple buffers/buffer descriptors by calling this function multiple times
| [in] | Chan | is the MCDMA Channel to be worked on. |
| [in] | BufAddr | is the buffer address to which data should send/recv. |
| [in] | len | is the Amount of data user requested to send/recv. |
References XMcdma_ChanCtrl::BdCnt, XMcdma_ChanCtrl::BdPendingCnt, XMcdma_ChanCtrl::BdRestart, XMcdma_ChanCtrl::BdTail, XMcdma_ChanCtrl::MaxTransferLen, XMCDMA_BD_CTRL_OFFSET, XMcdma_BdChainNextBd, XMcdma_BdClear, XMcdma_BdSetBufAddr(), XMcdma_BdWrite, and XMCDMA_CACHE_FLUSH.
| u32 XMcDma_ChanToHw | ( | XMcdma_ChanCtrl * | Chan | ) |
Starts hardware by programming current and tail descriptors by programming the Current and Tail Descriptors and enabling the particular channel.
| [in] | Chan | is the MCDMA Channel to be worked on. |
References XMcdma_EnableCh(), XMcdma_UpdateChanCDesc(), and XMcdma_UpdateChanTDesc().
| void XMcDma_DumpBd | ( | XMcdma_Bd * | BdPtr | ) |
Dump the fields of a BD.
| [in] | BdPtr | is the BD to operate on. |
References XMCDMA_BD_BUFA_OFFSET, XMCDMA_BD_CTRL_OFFSET, XMCDMA_BD_NDESC_OFFSET, XMCDMA_BD_SIDEBAND_STS_OFFSET, XMCDMA_BD_STS_OFFSET, XMCDMA_BD_USR0_OFFSET, XMCDMA_BD_USR1_OFFSET, XMCDMA_BD_USR2_OFFSET, XMCDMA_BD_USR3_OFFSET, XMCDMA_BD_USR4_OFFSET, and XMcdma_BdRead.
| void XMcdma_DumpChanRegs | ( | XMcdma_ChanCtrl * | Chan | ) |
Dump the registers for a channel.
| [in] | Chan | is the MCDMA Channel to be worked on. |
References XMcdma_ChanCtrl::Chan_id, XMcdma_ChanCtrl::ChanBase, XMCDMA_CDESC_MSB_OFFSET, XMCDMA_CDESC_OFFSET, XMCDMA_CR_OFFSET, XMCDMA_NXTCHAN_OFFSET, XMCDMA_PKTDROP_OFFSET, XMcdma_ReadReg, XMCDMA_SR_OFFSET, XMCDMA_TDESC_MSB_OFFSET, and XMCDMA_TDESC_OFFSET.
| void XMcdma_EnableCh | ( | XMcdma_ChanCtrl * | Chan | ) |
Enables a particular channel.
| [in] | Chan | is the Channel instance to be worked on. |
References XMcdma_ChanCtrl::Chan_id, XMcdma_ChanCtrl::ChanBase, XMCDMA_CHEN_OFFSET, XMcdma_ReadReg, and XMcdma_WriteReg.
Referenced by XMcDma_ChanToHw().
| u32 XMCdma_GetChan_PktDoneCnt | ( | XMcdma_ChanCtrl * | Chan | ) |
Gets the packet-done count for an MCDMA channel.
| [in] | Chan | is a pointer to the MCDMA channel to query. |
References XMcdma_ChanCtrl::Chan_id, XMcdma_ChanCtrl::ChanBase, XMcdma_ChanCtrl::IsRxChan, XMCDMA_NXTCHAN_OFFSET, XMcdma_ReadReg, XMCDMA_RX_PKTCNT_STAT_OFFSET, and XMCDMA_TX_PKTCNT_STAT_OFFSET.
| u32 XMCdma_GetChan_Weight | ( | XMcdma_ChanCtrl * | Chan | ) |
Gets the weighted round-robin weight for a transmit channel.
| [in] | Chan | is a pointer to the MCDMA channel to query. |
References XMcdma_ChanCtrl::Chan_id, XMcdma_ChanCtrl::ChanBase, XMcdma_ChanCtrl::IsRxChan, XMcdma_ReadReg, XMCDMA_TX_WRR_REG1_OFFSET, XMCDMA_TX_WRR_REG_OFFSET, XMCDMA_TX_WRRCH_MASK, and XMCDMA_TX_WRRCH_SHIFT.
| u16 XMcdma_GetChanServiced | ( | XMcdma * | InstancePtr | ) |
Gets the last serviced s2mm channel number.
| [in] | InstancePtr | is a pointer to the DMA engine instance to be worked on. |
References XMcdma::Config, XMCDMA_CHSER_OFFSET, XMcdma_ReadReg, and XMCDMA_RX_OFFSET.
| u16 XMcdma_GetTxChanServiced | ( | XMcdma * | InstancePtr | ) |
Gets the last serviced mm2s channel number.
| [in] | InstancePtr | is a pointer to the DMA engine instance to be worked on. |
References XMcdma::Config, XMCDMA_CHSER_OFFSET, and XMcdma_ReadReg.
| s32 XMcDma_Initialize | ( | XMcdma * | InstancePtr, |
| XMcdma_Config * | CfgPtr | ||
| ) |
Initializes an MCDMA core before any other driver function is called.
Initialization includes setting up the instance data and updating driver fields with proper values.
| [in] | InstancePtr | is a pointer to the XMcdma instance. |
| [in] | CfgPtr | is a reference to a structure containing information about a specific XMcdma instance. |
References XMcdma_ChanCtrl::Chan_id, XMcdma_ChanCtrl::ChanBase, XMcdma::Config, XMcdma_ChanCtrl::ext_addr, XMcdma_ChanCtrl::Has_Rxdre, XMcdma_ChanCtrl::Has_Txdre, XMcdma_ChanCtrl::HasRxLength, XMcdma_ChanCtrl::HasStsCntrlStrm, XMcdma::IsReady, XMcdma_ChanCtrl::IsRxChan, MAX_TRANSFER_LEN, XMcdma_ChanCtrl::MaxTransferLen, XMcdma::Rx_Chan, XMcdma_ChanCtrl::RxDataWidth, XMcdma::Tx_Chan, XMcdma_ChanCtrl::TxDataWidth, and XMCDMA_RX_OFFSET.
Referenced by XMcDma_CfgInitialize().
| void XMcdma_IntrHandler | ( | void * | Instance | ) |
Handles S2MM (RX) MCDMA interrupts for the MCDMA core.
This handler reads the pending interrupt from Status register, determines the source of the interrupts and calls the respective callbacks for the interrupts that are enabled in global control register, and finally clears the interrupts.
The application is responsible for connecting this function to the interrupt system. Application beyond this driver is also responsible for providing callbacks to handle interrupts and installing the callbacks using XMcdma_SetCallBack() during initialization phase.
| [in] | Instance | is a pointer to the XMcdma instance to be worked on. |
References XMcdma_ChanCtrl::ChanState, XMcdma::Config, XMcdma::DoneHandler, XMcdma::DoneRef, XMcdma::ErrorHandler, XMcdma::ErrorRef, XMcdma::PktDropHandler, XMcdma::PktDropRef, XMCDMA_CHAN_IDLE, XMCDMA_CHAN_PAUSE, XMcdma_ChanAckIrq, XMcdma_ChanGetIrq, XMcdma_GetMcdmaRxChan, XMCDMA_IRQ_ALL_MASK, XMCDMA_IRQ_DELAY_MASK, XMCDMA_IRQ_ERROR_MASK, XMCDMA_IRQ_IOC_MASK, XMCDMA_IRQ_PKTDROP_MASK, XMcdma_ReadReg, XMCDMA_RX_OFFSET, and XMCDMA_RXINT_SER_OFFSET.
| XMcdma_Config * XMcdma_LookupConfig | ( | UINTPTR | BaseAddress | ) |
Looks up device configuration by base address.
| [in] | BaseAddress | contains the base address of the device. |
Referenced by main().
| void XMcDma_Reset | ( | XMcdma * | InstancePtr | ) |
Resets the MCDMA core.
| [in] | InstancePtr | is a pointer to the XMcdma instance. |
References XMcdma_ChanCtrl::ChanState, XMcdma::Config, XMcdma::Rx_Chan, XMcdma::Tx_Chan, XMCDMA_CCR_OFFSET, XMCDMA_CCR_RESET_MASK, XMCDMA_CHAN_IDLE, XMCDMA_RX_OFFSET, and XMcdma_WriteReg.
Referenced by XMcDma_CfgInitialize(), and XMcdma_SelfTest().
| u32 XMcdma_ResetIsDone | ( | XMcdma * | InstancePtr | ) |
Check whether reset is done.
| [in] | InstancePtr | is a pointer to the DMA engine instance to be worked on. |
References XMcdma_ChanCtrl::ChanBase, XMcdma::Config, XMCDMA_CCR_OFFSET, XMCDMA_CCR_RESET_MASK, XMcdma_GetMcdmaRxChan, XMcdma_GetMcdmaTxChan, and XMcdma_ReadReg.
Referenced by XMcDma_CfgInitialize(), and XMcdma_SelfTest().
| s32 XMcdma_SelfTest | ( | XMcdma * | InstancePtr | ) |
This file contains a diagnostic self-test function for the MCDMA driver.
| [in] | InstancePtr | is a pointer to XMcDma instance. |
References XMCDMA_LOOP_COUNT, XMcDma_Reset(), and XMcdma_ResetIsDone().
| s32 XMcdma_SetCallBack | ( | XMcdma * | InstancePtr, |
| XMcdma_Handler | HandlerType, | ||
| void * | CallBackFunc, | ||
| void * | CallBackRef | ||
| ) |
This routine installs an asynchronous callback function for the given HandlerType.
HandlerType Callback Function Type ----------------------- -------------------------------------------------- XMCDMA_TX_HANDLER_DONE MM2S(TX) Done handler XMCDMA_TX_HANDLER_ERROR MM2S(TX) Error handler XMCDMA_HANDLER_DONE S2MM(RX) Done handler XMCDMA_HANDLER_ERROR S2MM(RX) Error handler XMCDMA_HANDLER_PKTDROP S2MM(RX) Packet drop handler
| [in] | InstancePtr | is a pointer to the XMcdma instance to be worked on. |
| [in] | HandlerType | specifies which callback is to be attached. |
| [in] | CallBackFunc | is the address of the callback function. |
| [in] | CallBackRef | is a user data item that will be passed to the callback function when it is invoked. |
References XMcdma::DoneHandler, XMcdma::DoneRef, XMcdma::ErrorHandler, XMcdma::ErrorRef, XMcdma::PktDropHandler, XMcdma::PktDropRef, XMcdma::TxDoneHandler, XMcdma::TxDoneRef, XMcdma::TxErrorHandler, XMcdma::TxErrorRef, XMCDMA_HANDLER_DONE, XMCDMA_HANDLER_ERROR, XMCDMA_HANDLER_PKTDROP, XMCDMA_TX_HANDLER_DONE, and XMCDMA_TX_HANDLER_ERROR.
| u32 XMCdma_SetChan_Weight | ( | XMcdma_ChanCtrl * | Chan, |
| u8 | Weight | ||
| ) |
Sets the weighted round-robin weight for a transmit channel.
| [in] | Chan | is a pointer to the MCDMA channel to configure. |
| [in] | Weight | is the WRR weight value in the range 1 to 15. |
References XMcdma_ChanCtrl::Chan_id, XMcdma_ChanCtrl::ChanBase, XMcdma_ChanCtrl::IsRxChan, XMcdma_ReadReg, XMCDMA_TX_WRR_REG1_OFFSET, XMCDMA_TX_WRR_REG_OFFSET, XMCDMA_TX_WRRCH_MASK, XMCDMA_TX_WRRCH_SHIFT, and XMcdma_WriteReg.
| u32 XMcdma_SetChanCoalesceDelay | ( | XMcdma_ChanCtrl * | Chan, |
| u32 | IrqCoalesce, | ||
| u32 | IrqDelay | ||
| ) |
Set interrupt coalescing parameters for a particular channel.
| [in] | Chan | is the MCDMA Channel to be worked on. |
| [in] | IrqCoalesce | is the Irq Threshold value valid ranges are 1 to 255 |
| [in] | IrqDelay | is the Irq Delay value valid ranges are 1 to 255 |
References XMcdma_ChanCtrl::Chan_id, XMcdma_ChanCtrl::ChanBase, XMCDMA_COALESCE_MASK, XMCDMA_COALESCE_SHIFT, XMCDMA_CR_OFFSET, XMCDMA_DELAY_MASK, XMCDMA_DELAY_SHIFT, XMCDMA_NXTCHAN_OFFSET, XMcdma_ReadReg, and XMcdma_WriteReg.
| void XMcdma_SetSGARCache | ( | XMcdma * | InstancePtr, |
| u8 | Value | ||
| ) |
Sets the ARCACHE field of the SG interface With the user specified value.
| [in] | InstancePtr | is the driver instance we are working on |
| [in] | Value | is the ARCACHE value to be written. |
References XMcdma::Config, XMcdma_ReadReg, XMCDMA_SGARCACHE_MASK, XMCDMA_SGCACHE_OFFSET, and XMcdma_WriteReg.
| void XMcdma_SetSGAWCache | ( | XMcdma * | InstancePtr, |
| u8 | Value | ||
| ) |
Sets the AWCACHE field of the SG interface With the user specified value.
| [in] | InstancePtr | is the driver instance we are working on |
| [in] | Value | is the AWCACHE value to be written. |
References XMcdma::Config, XMcdma_ReadReg, XMCDMA_SGAWCACHE_MASK, XMCDMA_SGAWCACHE_SHIFT, XMCDMA_SGCACHE_OFFSET, and XMcdma_WriteReg.
| u32 XMcdma_Start | ( | XMcdma_ChanCtrl * | Chan | ) |
Start the DMA engine.
| [in] | Chan | is the Channel instance to be worked on. |
References XMcdma_ChanCtrl::ChanBase, XMCDMA_CCR_OFFSET, XMCDMA_CCR_RUNSTOP_MASK, XMCDMA_CSR_HALTED_MASK, XMCDMA_CSR_OFFSET, XMCDMA_LOOP_COUNT, XMcdma_ReadReg, and XMcdma_WriteReg.
Referenced by XMcdma_UpdateChanTDesc().
| void XMcdma_TxIntrHandler | ( | void * | Instance | ) |
Handles MM2S MCDMA interrupts for the MCDMA core.
This handler reads the pending interrupt from Status register, determines the source of the interrupts and calls the respective callbacks for the interrupts that are enabled in global control register, and finally clears the interrupts.
The application is responsible for connecting this function to the interrupt system. Application beyond this driver is also responsible for providing callbacks to handle interrupts and installing the callbacks using XMcdma_SetCallBack() during initialization phase.
| [in] | Instance | is a pointer to the XMcdma instance to be worked on. |
References XMcdma_ChanCtrl::ChanState, XMcdma::Config, XMcdma::TxDoneHandler, XMcdma::TxDoneRef, XMcdma::TxErrorHandler, XMcdma::TxErrorRef, XMCDMA_CHAN_IDLE, XMCDMA_CHAN_PAUSE, XMcdma_ChanAckIrq, XMcdma_ChanGetIrq, XMcdma_GetMcdmaTxChan, XMCDMA_IRQ_ALL_MASK, XMCDMA_IRQ_DELAY_MASK, XMCDMA_IRQ_ERROR_MASK, XMCDMA_IRQ_IOC_MASK, XMcdma_ReadReg, and XMCDMA_TXINT_SER_OFFSET.
| int XMcdma_UpdateChanCDesc | ( | XMcdma_ChanCtrl * | Chan | ) |
Update Current Descriptor for the MCDMA Channel.
| [in] | Chan | is the Channel instance to be worked on. |
References XMcdma_ChanCtrl::BdHead, XMcdma_ChanCtrl::Chan_id, XMcdma_ChanCtrl::ChanBase, XMcdma_ChanCtrl::ChanState, XMcdma_ChanCtrl::ext_addr, XMCDMA_CACHE_FLUSH, XMCDMA_CDESC_MSB_OFFSET, XMCDMA_CDESC_OFFSET, XMCDMA_CHAN_BUSY, XMCDMA_NXTCHAN_OFFSET, and XMcdma_WriteReg.
Referenced by XMcDma_ChanToHw().
| int XMcdma_UpdateChanTDesc | ( | XMcdma_ChanCtrl * | Chan | ) |
Update Tail Desc for the Channel.
| [in] | Chan | is the MCDMA Channel to be worked on. |
References XMcdma_ChanCtrl::BdPendingCnt, XMcdma_ChanCtrl::BdSubmitCnt, XMcdma_ChanCtrl::BdTail, XMcdma_ChanCtrl::Chan_id, XMcdma_ChanCtrl::ChanBase, XMcdma_ChanCtrl::ChanState, XMcdma_ChanCtrl::ext_addr, XMCDMA_CACHE_INVALIDATE, XMCDMA_CCR_RUNSTOP_MASK, XMCDMA_CHAN_BUSY, XMcdma_ChanHwIsStarted, XMCDMA_CR_OFFSET, XMcdma_HwIsStarted, XMCDMA_NXTCHAN_OFFSET, XMcdma_ReadReg, XMcdma_Start(), XMCDMA_TDESC_MSB_OFFSET, XMCDMA_TDESC_OFFSET, and XMcdma_WriteReg.
Referenced by XMcDma_ChanToHw().
| XMcdma_Config XMcdma_ConfigTable[] |
Configuration table for each MCDMA instance in the system.