qspips_v3_2: Added SLCR lock check before SLCR reset.

This patch added check for SLCR lock before doing the SLCR
reset. If it is unlocked we ahould not lock after reset.

Signed-off-by: P L Sai Krishna <lakshmis@xilinx.com>
This commit is contained in:
P L Sai Krishna 2015-02-16 15:24:29 +05:30 committed by Nava kishore Manne
parent fd4a99ddbf
commit bf93dc207e

View file

@ -303,6 +303,7 @@ void XQspiPs_Reset(XQspiPs *InstancePtr)
void XQspiPs_Abort(XQspiPs *InstancePtr)
{
u32 ConfigReg;
u32 IsLock;
XQspiPs_Disable(InstancePtr);
@ -318,13 +319,18 @@ void XQspiPs_Abort(XQspiPs *InstancePtr)
/*
* QSPI Software Reset
*/
XQspiPs_WriteReg(XPAR_XSLCR_0_BASEADDR, SLCR_UNLOCK,
SLCR_UNLOCK_MASK);
IsLock = XQspiPs_ReadReg(XPAR_XSLCR_0_BASEADDR, 0x0);
if (IsLock) {
XQspiPs_WriteReg(XPAR_XSLCR_0_BASEADDR, SLCR_UNLOCK,
SLCR_UNLOCK_MASK);
}
XQspiPs_WriteReg(XPAR_XSLCR_0_BASEADDR, LQSPI_RST_CTRL,
LQSPI_RST_CTRL_MASK);
XQspiPs_WriteReg(XPAR_XSLCR_0_BASEADDR, LQSPI_RST_CTRL, 0x0);
XQspiPs_WriteReg(XPAR_XSLCR_0_BASEADDR, SLCR_LOCK,
SLCR_LOCK_MASK);
if (IsLock) {
XQspiPs_WriteReg(XPAR_XSLCR_0_BASEADDR, SLCR_LOCK,
SLCR_LOCK_MASK);
}
/*
* Set the RX and TX FIFO threshold to reset value (one)