spi: Use interrupt status register Tx empty bit
Use interrupt status register Tx empty bit instead of status register Signed-off-by: Subbaraya Sundeep Bhatta <sbhatta@xilinx.com> Acked-by: Kedareswara rao Appana <appanad@xilinx.com>
This commit is contained in:
parent
10d10f8c2e
commit
9a61962682
3 changed files with 16 additions and 4 deletions
|
@ -90,6 +90,9 @@
|
|||
* register inorder to work with CPOL and CPHA High Options.
|
||||
* As per spec (Dual/Quad SPI Transaction instrunction 7,8,9)
|
||||
* CR:732962
|
||||
* 4.1 bss 08/07/14 Modified XSpi_Transfer to check for Interrupt Status
|
||||
* register Tx Empty bit instead of Status register
|
||||
* CR#810294.
|
||||
* </pre>
|
||||
*
|
||||
******************************************************************************/
|
||||
|
@ -687,8 +690,10 @@ int XSpi_Transfer(XSpi *InstancePtr, u8 *SendBufPtr,
|
|||
* Transmit empty status bit
|
||||
*/
|
||||
do {
|
||||
StatusReg = XSpi_GetStatusReg(InstancePtr);
|
||||
} while ((StatusReg & XSP_SR_TX_EMPTY_MASK) == 0);
|
||||
StatusReg = XSpi_IntrGetStatus(InstancePtr);
|
||||
} while ((StatusReg & XSP_INTR_TX_EMPTY_MASK) == 0);
|
||||
|
||||
XSpi_IntrClear(InstancePtr,XSP_INTR_TX_EMPTY_MASK);
|
||||
|
||||
/*
|
||||
* A transmit has just completed. Process received data
|
||||
|
|
|
@ -277,6 +277,10 @@
|
|||
* block is used in the h/w design (CR 721229).
|
||||
* 3.07a adk 11/10/13 Fixed CR:732962 Changes are made in the xspi.c file
|
||||
* 4.0 adk 19/12/13 Updated as per the New Tcl API's
|
||||
* 4.1 bss 08/07/14 Modified XSpi_Transfer in xspi.c and LoopbackTest in
|
||||
* xspi_selftest.c to check for Interrupt Status
|
||||
* register Tx Empty bit instead of Status register
|
||||
* CR#810294.
|
||||
*
|
||||
*
|
||||
* </pre>
|
||||
|
|
|
@ -305,12 +305,15 @@ static int LoopbackTest(XSpi *InstancePtr)
|
|||
* empty status bit.
|
||||
*/
|
||||
do {
|
||||
StatusReg = XSpi_GetStatusReg(InstancePtr);
|
||||
} while ((StatusReg & XSP_SR_TX_EMPTY_MASK) == 0);
|
||||
StatusReg = XSpi_IntrGetStatus(InstancePtr);
|
||||
} while ((StatusReg & XSP_INTR_TX_EMPTY_MASK) == 0);
|
||||
|
||||
XSpi_IntrClear(InstancePtr, XSP_INTR_TX_EMPTY_MASK);
|
||||
|
||||
/*
|
||||
* Receive and verify the data just transmitted.
|
||||
*/
|
||||
StatusReg = XSpi_GetStatusReg(InstancePtr);
|
||||
while ((StatusReg & XSP_SR_RX_EMPTY_MASK) == 0) {
|
||||
|
||||
RxData = XSpi_ReadReg(InstancePtr->BaseAddr,
|
||||
|
|
Loading…
Add table
Reference in a new issue