Buffer Descriptors
A BD defines a DMA transaction (see "Transaction" section in xaxidma.h). All accesses to a BD go through this set of API.
The XAxiDma_Bd structure defines a BD. The first XAXIDMA_BD_HW_NUM_BYTES are shared between hardware and software.
Actual Transfer Length
The actual transfer length for receive could be smaller than the requested transfer length. The hardware sets the actual transfer length in the completed BD. The API to retrieve the actual transfer length is XAxiDma_GetActualLength().
User IP words
There are 5 user IP words in each BD.
If hardware does not have the StsCntrl stream built in, then these words are not usable. Retrieving these words get a NULL pointer and setting these words results an error.
Performance
BDs are typically in a non-cached memory space. Reducing the number of I/O operations to BDs can improve overall performance of the DMA channel.
MODIFICATION HISTORY:
Ver Who Date Changes ----- ---- -------- ------------------------------------------------------ 1.00a jz 05/18/10 First release 2.00a jz 08/10/10 Second release, added in xaxidma_g.c, xaxidma_sinit.c, updated tcl file, added xaxidma_porting_guide.h 3.00a jz 11/22/10 Support IP core parameters change
Defines | |
#define | XAxiDma_BdRead(BaseAddress, Offset) |
#define | XAxiDma_BdWrite(BaseAddress, Offset, Data) |
#define | XAxiDma_BdClear(BdPtr) |
#define | XAxiDma_BdGetCtrl(BdPtr) |
#define | XAxiDma_BdGetSts(BdPtr) |
#define | XAxiDma_BdGetLength(BdPtr) |
#define | XAxiDma_BdSetId(BdPtr, Id) |
#define | XAxiDma_BdGetId(BdPtr) |
#define | XAxiDma_BdGetBufAddr(BdPtr) |
#define | XAxiDma_BdHwCompleted(BdPtr) |
#define | XAxiDma_BdGetActualLength(BdPtr) |
Typedefs | |
typedef u32 | XAxiDma_Bd [XAXIDMA_BD_NUM_WORDS] |
Functions | |
int | XAxiDma_BdSetLength (XAxiDma_Bd *BdPtr, u32 LenBytes) |
int | XAxiDma_BdSetBufAddr (XAxiDma_Bd *BdPtr, u32 Addr) |
int | XAxiDma_BdSetAppWord (XAxiDma_Bd *BdPtr, int Offset, u32 Word) |
u32 | XAxiDma_BdGetAppWord (XAxiDma_Bd *BdPtr, int Offset, int *Valid) |
void | XAxiDma_BdSetCtrl (XAxiDma_Bd *BdPtr, u32 Data) |
void | XAxiDma_DumpBd (XAxiDma_Bd *BdPtr) |
|
Zero out BD specific fields. BD fields that are for the BD ring or for the system hardware build information are not touched.
|
|
Get the actual transfer length of a BD. The BD has completed in hw. This function may not work if the BD is in cached memory.
|
|
Get the BD's buffer address
|
|
Get the control bits for the BD
|
|
Retrieve the ID field of the given BD previously set with XAxiDma_BdSetId.
|
|
Retrieve the length field value from the given BD. The returned value is the same as what was written with XAxiDma_BdSetLength(). Note that in the this value does not reflect the real length of received data. See the comments of XAxiDma_BdSetLength() for more details. To obtain the actual transfer length, use XAxiDma_BdGetActualLength().
|
|
Retrieve the status of a BD
|
|
Check whether a BD has completed in hardware. This BD has been submitted to hardware. The application can use this function to poll for the completion of the BD. This function may not work if the BD is in cached memory.
|
|
Read the given Buffer Descriptor word.
|
|
Set the ID field of the given BD. The ID is an arbitrary piece of data the application can associate with a specific BD.
|
|
Write the given Buffer Descriptor word.
|
|
The XAxiDma_Bd is the type for a buffer descriptor (BD). |
|
Get the APP word at the specified APP word offset for a BD.
|
|
Set the APP word at the specified APP word offset for a BD.
|
|
Set the BD's buffer address.
|
|
Set the control bits for a BD.
|
|
Set the length field for the given BD. Length has to be non-zero and less than XAXIDMA_MAX_TRANSFER_LEN. For TX channels, the value passed in should be the number of bytes to transmit from the TX buffer associated with the given BD. For RX channels, the value passed in should be the size of the RX buffer associated with the given BD in bytes. This is to notify the RX channel the capability of the RX buffer to avoid buffer overflow. The actual receive length can be equal or smaller than the specified length. The actual transfer length will be updated by the hardware in the XAXIDMA_BD_STS_OFFSET word in the BD.
|
|
Dump the fields of a BD.
|
Copyright © 1995-2010 Xilinx, Inc. All rights reserved.