Skip to content

Commit

Permalink
llfifo: Updated comments in the usage section
Browse files Browse the repository at this point in the history
This patch updates the comments in the usage section
as per the example sequence also fixes the doxygen
warnings in the driver.

Signed-off-by: Kedareswara rao Appana <appanad@xilinx.com>
Acked-by: Anirudha Sarangi <anirudh@xilinx.com>
  • Loading branch information
kedareswararao authored and vdubakul committed Sep 15, 2017
1 parent 5a4ff63 commit 3197d3a
Show file tree
Hide file tree
Showing 7 changed files with 52 additions and 50 deletions.
16 changes: 6 additions & 10 deletions XilinxProcessorIPLib/drivers/llfifo/src/xllfifo.c
Expand Up @@ -99,7 +99,7 @@
*
* Interrupts
* Interrupts are handled in the OS/Application layer above this driver.
*/
******************************************************************************/

xdbg_stmnt(u32 _xllfifo_rr_value;)
xdbg_stmnt(u32 _xllfifo_ipie_value;)
Expand Down Expand Up @@ -176,11 +176,6 @@ u32 XLlFifo_iRxGetLen(XLlFifo *InstancePtr)
* @return XLlFifo_iRead_Aligned always returns XST_SUCCESS. Error handling is
* otherwise handled through hardware exceptions and interrupts.
*
* @note
*
* C Signature: int XLlFifo_iRead_Aligned(XLlFifo *InstancePtr,
* void *BufPtr, unsigned WordCount);
*
******************************************************************************/
int XLlFifo_iRead_Aligned(XLlFifo *InstancePtr, void *BufPtr,
unsigned WordCount)
Expand Down Expand Up @@ -210,7 +205,7 @@ int XLlFifo_iRead_Aligned(XLlFifo *InstancePtr, void *BufPtr,
}

/****************************************************************************/
/*
/**
*
* XLlFifo_iTxVacancy returns the number of unused 32 bit words available
* (vacancy) in the send channel of the FIFO, specified by <i>InstancePtr</i>.
Expand All @@ -230,7 +225,7 @@ u32 XLlFifo_iTxVacancy(XLlFifo *InstancePtr)
}

/*****************************************************************************/
/*
/**
*
* XLlFifo_iTxSetLen begins a hardware transfer of data out of the transmit
* channel of the FIFO, specified by <i>InstancePtr</i>. <i>Bytes</i> specifies the number
Expand Down Expand Up @@ -324,9 +319,9 @@ int XLlFifo_iWrite_Aligned(XLlFifo *InstancePtr, void *BufPtr,
*
* @param InstancePtr is a pointer to the Axi Streaming FIFO instance
* to be worked on.
* @param CfgPtr references the structure holding the hardware
* @param Config references the structure holding the hardware
* configuration for the Axi Streaming FIFO core to initialize.
* @param EffectiveAddr is the device base address in the virtual memory
* @param EffectiveAddress is the device base address in the virtual memory
* address space. The caller is responsible for keeping the
* address mapping from EffectiveAddr to the device physical base
* address unchanged once this function is invoked. Unexpected
Expand Down Expand Up @@ -425,6 +420,7 @@ u32 XLlFifo_RxGetWord(XLlFifo *InstancePtr)
* <i>InstancePtr</i>.
*
* @param InstancePtr references the FIFO on which to operate.
* @param Word is the data word to be written to FIFO.
*
* @return N/A
*
Expand Down
62 changes: 32 additions & 30 deletions XilinxProcessorIPLib/drivers/llfifo/src/xllfifo.h
Expand Up @@ -72,56 +72,56 @@
* <h3>Receive</h3>
*
* A frame is received by using the following sequence:<br>
* 1) call XLlFifo_RxOccupancy() to check the occupancy count<br>
* 2) call XLlFifo_RxGetLen() to get the length of the next incoming frame<br>
* 3) call XLlFifo_Read() one or more times to read the number of bytes
* reported by XLlFifo_RxGetLen().<br>
* 1) call XLlFifo_iRxGetLen() to get the length of the incoming frame<br>
* 2) call XLlFifo_RxGetWord() one or more times to read the number of
* bytes reported by the hardware<br>
* 3) call XLlFifo_iRxOccupancy() to know the availability of the data
* in the FIFO.<br>
*
* For example:
* <pre>
* while (XLlFifo_RxOccupancy(&RxInstance)) {
* frame_len = XLlFifo_RxGetLen(&RxInstance);
* while (frame_len) {
* unsigned bytes = min(sizeof(buffer), frame_len);
* XLlFifo_Read(&RxInstance, buffer, bytes);
* // ********
* // do something with buffer here
* // ********
* frame_len -= bytes;
* ReceiveLength = (XLlFifo_iRxGetLen(InstancePtr))/WORD_SIZE;
* for ( i=0; i < ReceiveLength; i++){
* RxWord = XLlFifo_RxGetWord(InstancePtr);
* // ********
* // do something here with the data
* // ********
* if(XLlFifo_iRxOccupancy(InstancePtr)){
* RxWord = XLlFifo_RxGetWord(InstancePtr);
* }
* }
* }
*
* </pre>
*
* This FIFO hardware core does <b>not</b> support a sequence where the
* calling code calls RxGetLen() twice in a row and then receive the data
* for two frames. Each frame must be read in by calling RxGetLen() just
* calling code calls iRxGetLen() twice in a row and then receive the data
* for two frames. Each frame must be read in by calling iRxGetLen() just
* prior to reading the data.
*
* <h3>Transmit</h3>
* A frame is transmittted by using the following sequence:<br>
* 1) call XLlFifo_Write() one or more times to write all the of bytes in
* 1) XLlFifo_iTxVacancy() one or more times to know the availability of
* unused 32-bit words in the FIFO channel.<br>
* 2) call XLlFifo_TxPutWord() one or more times to write all the of bytes in
* the next frame.<br>
* 2) call XLlFifo_TxSetLen() to begin the transmission of frame just
* 3) call XLlFifo_iTxSetLen() to begin the transmission of frame just
* written.<br>
*
* For example:
* <pre>
* frame_left = frame_len;
* while (frame_left) {
* unsigned bytes = min(sizeof(buffer), frame_left);
* XLlFifo_Write(&TxInstance, buffer, bytes);
* // ********
* // do something here to refill buffer
* // ********
* frame_left -= bytes;
* }
* XLlFifo_TxSetLen(&RxInstance, frame_len);
* for (j=0 ; j < MAX_PACKET_LEN ; j++){
* if( XLlFifo_iTxVacancy(InstancePtr) ){
* XLlFifo_TxPutWord(InstancePtr,
* *(SourceAddr+(i*MAX_PACKET_LEN)+j));
* }
* }
* XLlFifo_iTxSetLen(InstancePtr, (MAX_DATA_BUFFER_SIZE * WORD_SIZE));
* </pre>
*
* This FIFO hardware core does <b>not</b> support a sequence where the
* calling code writes the data for two frames and then calls TxSetLen()
* calling code writes the data for two frames and then calls iTxSetLen()
* twice in a row. Each frame must be written by writting the data for one
* frame and then calling TxSetLen().
* frame and then calling iTxSetLen().
*
* <h2>Interrupts</h2>
* This driver does not handle interrupts from the FIFO hardware. The
Expand Down Expand Up @@ -185,6 +185,8 @@
* 5.2 ms 04/18/17 Modified tcl file to add suffix U for all macros
* definitions of llfifo in xparameters.h
* 5.2 adk 03/07/17 CR#978769 Fix doxygen issues in the driver.
* Updated comments in the usage section as per example code.
* Fix doxygen warnings in the driver.
* </pre>
*
*****************************************************************************/
Expand Down
2 changes: 1 addition & 1 deletion XilinxProcessorIPLib/drivers/llfifo/src/xllfifo_g.c
Expand Up @@ -32,7 +32,7 @@
/*****************************************************************************/
/**
*
* @file xtrafgen_g.c
* @file xllfifo_g.c
* @addtogroup llfifo_v5_0
* @{
*
Expand Down
2 changes: 1 addition & 1 deletion XilinxProcessorIPLib/drivers/llfifo/src/xllfifo_sinit.c
Expand Up @@ -32,7 +32,7 @@
/*****************************************************************************/
/**
*
* @file xtrafgen_sinit.c
* @file xllfifo_sinit.c
* @addtogroup llfifo_v5_0
* @{
*
Expand Down
15 changes: 8 additions & 7 deletions XilinxProcessorIPLib/drivers/llfifo/src/xstreamer.c
Expand Up @@ -29,7 +29,8 @@
* this Software without prior written authorization from Xilinx.
*
******************************************************************************/
/*
/*****************************************************************************/
/**
* @file xstreamer.c
* @addtogroup llfifo_v5_0
* @{
Expand Down Expand Up @@ -162,7 +163,7 @@ xdbg_stmnt(u32 _xstrm_ro_value;)
xdbg_stmnt(u32 _xstrm_buffered;)

/*****************************************************************************/
/*
/**
*
* XStrm_RxInitialize initializes the XStrm_RxFifoStreamer object referenced by
* <i>InstancePtr</i>.
Expand Down Expand Up @@ -206,7 +207,7 @@ void XStrm_RxInitialize(XStrm_RxFifoStreamer *InstancePtr, unsigned FifoWidth,
}

/*****************************************************************************/
/*
/**
*
* XStrm_TxInitialize initializes the XStrm_TxFifoStreamer object referenced by
* <i>InstancePtr</i>.
Expand Down Expand Up @@ -250,7 +251,7 @@ void XStrm_TxInitialize(XStrm_TxFifoStreamer *InstancePtr, unsigned FifoWidth,
}

/*****************************************************************************/
/*
/**
*
* XStrm_RxGetLen notifies the hardware that the program is ready to receive the
* next frame from the receive channel of the FIFO, specified by
Expand All @@ -276,7 +277,7 @@ u32 XStrm_RxGetLen(XStrm_RxFifoStreamer *InstancePtr)
}

/*****************************************************************************/
/*
/**
*
* XStrm_Read reads <i>Bytes</i> bytes from the FIFO specified by
* <i>InstancePtr</i> to the block of memory, referenced by <i>BufPtr</i>.
Expand Down Expand Up @@ -377,7 +378,7 @@ void XStrm_Read(XStrm_RxFifoStreamer *InstancePtr, void *BufPtr,
}

/*****************************************************************************/
/*
/**
*
* XStrm_TxSetLen flushes to the FIFO, specified by <i>InstancePtr</i>, any
* bytes remaining in internal buffers and begins a hardware transfer of data
Expand Down Expand Up @@ -410,7 +411,7 @@ void XStrm_TxSetLen(XStrm_TxFifoStreamer *InstancePtr, u32 Bytes)
}

/*****************************************************************************/
/*
/**
*
* XStrm_Write writes <i>Bytes</i> bytes of the block of memory, referenced by
* <i>BufPtr</i>, to the transmit channel of the FIFO referenced by
Expand Down
3 changes: 2 additions & 1 deletion XilinxProcessorIPLib/drivers/llfifo/src/xstreamer.h
Expand Up @@ -29,7 +29,8 @@
* this Software without prior written authorization from Xilinx.
*
******************************************************************************/
/*
/*****************************************************************************/
/**
*
* @file xstreamer.h
* @addtogroup llfifo_v5_0
Expand Down
2 changes: 2 additions & 0 deletions doc/ChangeLog
Expand Up @@ -11,6 +11,8 @@ SW workaround for TI DP83867 PHY Data integrity issues on KCU116/VCU118 Boards.

llfifo_v5_2:
CR#978769 Fix doxygen issues in the driver.
Updated comments in the usage section as per example code.
Fixed doxygen warnings in the driver.

axidma_v9_4:
CR#974218 Add support for cyclic DMA mode.
Expand Down

0 comments on commit 3197d3a

Please sign in to comment.