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
Functions | |
int | XAxiDma_StartBdRingHw (XAxiDma_BdRing *RingPtr) |
int | XAxiDma_BdRingCreate (XAxiDma_BdRing *RingPtr, u32 PhysAddr, u32 VirtAddr, u32 Alignment, int BdCount) |
int | XAxiDma_BdRingClone (XAxiDma_BdRing *RingPtr, XAxiDma_Bd *SrcBdPtr) |
int | XAxiDma_BdRingStart (XAxiDma_BdRing *RingPtr) |
int | XAxiDma_BdRingSetCoalesce (XAxiDma_BdRing *RingPtr, u32 Counter, u32 Timer) |
void | XAxiDma_BdRingGetCoalesce (XAxiDma_BdRing *RingPtr, u32 *CounterPtr, u32 *TimerPtr) |
int | XAxiDma_BdRingAlloc (XAxiDma_BdRing *RingPtr, int NumBd, XAxiDma_Bd **BdSetPtr) |
int | XAxiDma_BdRingUnAlloc (XAxiDma_BdRing *RingPtr, int NumBd, XAxiDma_Bd *BdSetPtr) |
int | XAxiDma_BdRingToHw (XAxiDma_BdRing *RingPtr, int NumBd, XAxiDma_Bd *BdSetPtr) |
int | XAxiDma_BdRingFromHw (XAxiDma_BdRing *RingPtr, int BdLimit, XAxiDma_Bd **BdSetPtr) |
int | XAxiDma_BdRingFree (XAxiDma_BdRing *RingPtr, int NumBd, XAxiDma_Bd *BdSetPtr) |
int | XAxiDma_BdRingCheck (XAxiDma_BdRing *RingPtr) |
void | XAxiDma_BdRingDumpRegs (XAxiDma_BdRing *RingPtr) |
|
Reserve locations in the BD ring. The set of returned BDs may be modified in preparation for future DMA transactions. Once the BDs are ready to be submitted to hardware, the application must call XAxiDma_BdRingToHw() in the same order which they were allocated here. Example:
NumBd = 2; Status = XDsma_RingBdAlloc(MyRingPtr, NumBd, &MyBdSet);
if (Status != XST_SUCCESS) { // Not enough BDs available for the request }
CurBd = MyBdSet; for (i=0; i<NumBd; i++) { // Prepare CurBd.....
// Onto next BD CurBd = XAxiDma_BdRingNext(MyRingPtr, CurBd); }
// Give list to hardware Status = XAxiDma_BdRingToHw(MyRingPtr, NumBd, MyBdSet); A more advanced use of this function may allocate multiple sets of BDs. They must be allocated and given to hardware in the correct sequence: // Legal XAxiDma_BdRingAlloc(MyRingPtr, NumBd1, &MySet1); XAxiDma_BdRingToHw(MyRingPtr, NumBd1, MySet1);
// Legal XAxiDma_BdRingAlloc(MyRingPtr, NumBd1, &MySet1); XAxiDma_BdRingAlloc(MyRingPtr, NumBd2, &MySet2); XAxiDma_BdRingToHw(MyRingPtr, NumBd1, MySet1); XAxiDma_BdRingToHw(MyRingPtr, NumBd2, MySet2);
// Not legal XAxiDma_BdRingAlloc(MyRingPtr, NumBd1, &MySet1); XAxiDma_BdRingAlloc(MyRingPtr, NumBd2, &MySet2); XAxiDma_BdRingToHw(MyRingPtr, NumBd2, MySet2); XAxiDma_BdRingToHw(MyRingPtr, NumBd1, MySet1); Use the API defined in xaxidmabd.h to modify individual BDs. Traversal of the BD set can be done using XAxiDma_BdRingNext() and XAxiDma_BdRingPrev().
|
|
Check the internal data structures of the BD ring for the provided channel. The following checks are made:
The channel should be stopped (through XAxiDma_Pause() or XAxiDma_Reset()) prior to calling this function.
|
|
Clone the given BD into every BD in the ring. Only the fields offset from XAXIDMA_BD_START_CLEAR are copied, for XAXIDMA_BD_BYTES_TO_CLEAR bytes. This covers: BufferAddr, Control/Buffer length, status, APP words 0 - 4, and software ID fields. This function can be called only when all BDs are in the free group such as immediately after creation of the ring. This prevents modification of BDs while they are in use by hardware or the application.
|
|
Using a memory segment allocated by the caller, This fundtion creates and setup the BD ring.
1) BdCount is not positive 2) PhysAddr and/or VirtAddr are not aligned to the given Alignment parameter; 3) Alignment parameter does not meet minimum requirements or is not a power of 2 value.
|
|
Dump the registers for a channel.
|
|
Frees a set of BDs that had been previously retrieved with XAxiDma_BdRingFromHw().
|
|
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 XAxiDma_BdRingFree() in the same order which they were retrieved here. Example:
NumBd = XAxiDma_BdRingFromHw(MyRingPtr, XAXIDMA_ALL_BDS, &MyBdSet);
if (NumBd == 0) { // hardware has nothing ready for us yet }
CurBd = MyBdSet; for (i=0; i<NumBd; i++) { // Examine CurBd for post processing.....
// Onto next BD CurBd = XAxiDma_BdRingNext(MyRingPtr, CurBd); }
XAxiDma_BdRingFree(MyRingPtr, NumBd, MyBdSet); // Return the list A more advanced use of this function may allocate multiple sets of BDs. They must be retrieved from hardware and freed in the correct sequence: // Legal XAxiDma_BdRingFromHw(MyRingPtr, NumBd1, &MySet1); XAxiDma_BdRingFree(MyRingPtr, NumBd1, MySet1);
// Legal XAxiDma_BdRingFromHw(MyRingPtr, NumBd1, &MySet1); XAxiDma_BdRingFromHw(MyRingPtr, NumBd2, &MySet2); XAxiDma_BdRingFree(MyRingPtr, NumBd1, MySet1); XAxiDma_BdRingFree(MyRingPtr, NumBd2, MySet2);
// Not legal XAxiDma_BdRingFromHw(MyRingPtr, NumBd1, &MySet1); XAxiDma_BdRingFromHw(MyRingPtr, NumBd2, &MySet2); XAxiDma_BdRingFree(MyRingPtr, NumBd2, MySet2); XAxiDma_BdRingFree(MyRingPtr, NumBd1, MySet1); If hardware has partially completed a packet spanning multiple BDs, then none of the BDs for that packet will be included in the results.
|
|
Retrieve current interrupt coalescing parameters from the given descriptor ring channel.
|
|
Set interrupt coalescing parameters for the given descriptor ring channel.
|
|
Allow DMA transactions to commence on a given channel if descriptors are ready to be processed. This is different from XAxiDma_StartBdRingHw(), where the DMA channel is started. If the DMA engine is stopped, XAxiDma_StartBdRingHw() is called to start the engine first. A channel being started means it is not halted. A BD ring being started means it starts transfers.
|
|
Enqueue a set of BDs to hardware that were previously allocated by XAxiDma_BdRingAlloc(). Once this function returns, the argument BD set goes under hardware control. Changes to these BDs should be held until they are finished by hardware to avoid data corruption and system instability. For transmit, the set will be rejected if the last BD of the set does not mark the end of a packet or the first BD does not mark the start of a packet.
|
|
Fully or partially undo an XAxiDma_BdRingAlloc() operation. Use this function if all the BDs allocated by XAxiDma_BdRingAlloc() could not be transferred to hardware with XAxiDma_BdRingToHw(). This function releases the BDs after they have been allocated but before they have been given to hardware. This function is not the same as XAxiDma_BdRingFree(). The Free function returns BDs to the free list after they have been processed by hardware, while UnAlloc returns them before being processed by hardware. There are two scenarios where this function can be used. Full UnAlloc or Partial UnAlloc. A Full UnAlloc means all the BDs Alloc'd will be returned:
Status = XAxiDma_BdRingAlloc(MyRingPtr, 10, &BdPtr); ... ... if (Error) { Status = XAxiDma_BdRingUnAlloc(MyRingPtr, 10, &BdPtr); } A partial UnAlloc means some of the BDs Alloc'd will be returned:
Status = XAxiDma_BdRingAlloc(MyRingPtr, 10, &BdPtr); BdsLeft = 10; CurBdPtr = BdPtr;
while (BdsLeft) { if (Error) { Status = XAxiDma_BdRingUnAlloc(MyRingPtr, BdsLeft, CurBdPtr); }
CurBdPtr = XAxiDma_BdRingNext(MyRingPtr, CurBdPtr); BdsLeft--; } A partial UnAlloc must include the last BD in the list that was Alloc'd.
|
|
Start a DMA channel This is different from XAxiDma_BdRingStart(), where transfers are started on a channel. After a DMA channel is started, it is not halted, and it is idle (no active DMA transfers).
|
Copyright © 1995-2010 Xilinx, Inc. All rights reserved.