qspipsu_v1_1: Added returns for failure cases in examples.
This patch add returns for failure cases in examples. Signed-off-by: P L Sai Krishna <lakshmis@xilinx.com>
This commit is contained in:
parent
6fcd63974f
commit
b2ef81cba0
2 changed files with 41 additions and 17 deletions
|
@ -535,7 +535,10 @@ int QspiPsuInterruptFlashExample(XScuGic *IntcInstancePtr, XQspiPsu *QspiPsuInst
|
|||
* performing proceeding to any operation, including
|
||||
* preparing the WriteBuffer
|
||||
*/
|
||||
FlashReadID(QspiPsuInstancePtr);
|
||||
Status = FlashReadID(QspiPsuInstancePtr);
|
||||
if (Status != XST_SUCCESS) {
|
||||
return XST_FAILURE;
|
||||
}
|
||||
|
||||
xil_printf("Flash connection mode : %d \n\r",
|
||||
QspiPsuConfig->ConnectionMode);
|
||||
|
@ -589,16 +592,25 @@ int QspiPsuInterruptFlashExample(XScuGic *IntcInstancePtr, XQspiPsu *QspiPsuInst
|
|||
ReadBuffer[Count] = 0;
|
||||
}
|
||||
|
||||
FlashErase(QspiPsuInstancePtr, TEST_ADDRESS, MaxData, CmdBfr);
|
||||
|
||||
for (Page = 0; Page < PAGE_COUNT; Page++) {
|
||||
FlashWrite(QspiPsuInstancePtr,
|
||||
(Page * Flash_Config_Table[FCTIndex].PageSize) + TEST_ADDRESS,
|
||||
Flash_Config_Table[FCTIndex].PageSize, WriteCmd, WriteBuffer);
|
||||
Status = FlashErase(QspiPsuInstancePtr, TEST_ADDRESS, MaxData, CmdBfr);
|
||||
if (Status != XST_SUCCESS) {
|
||||
return XST_FAILURE;
|
||||
}
|
||||
|
||||
FlashRead(QspiPsuInstancePtr, TEST_ADDRESS, MaxData, ReadCmd,
|
||||
for (Page = 0; Page < PAGE_COUNT; Page++) {
|
||||
Status = FlashWrite(QspiPsuInstancePtr,
|
||||
(Page * Flash_Config_Table[FCTIndex].PageSize) + TEST_ADDRESS,
|
||||
Flash_Config_Table[FCTIndex].PageSize, WriteCmd, WriteBuffer);
|
||||
if (Status != XST_SUCCESS) {
|
||||
return XST_FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
Status = FlashRead(QspiPsuInstancePtr, TEST_ADDRESS, MaxData, ReadCmd,
|
||||
CmdBfr, ReadBuffer);
|
||||
if (Status != XST_SUCCESS) {
|
||||
return XST_FAILURE;
|
||||
}
|
||||
/*
|
||||
* Setup a pointer to the start of the data that was read into the read
|
||||
* buffer and verify the data read is the data that was written
|
||||
|
|
|
@ -496,7 +496,10 @@ int QspiPsuPolledFlashExample(XQspiPsu *QspiPsuInstancePtr, u16 QspiPsuDeviceId)
|
|||
* performing proceeding to any operation, including
|
||||
* preparing the WriteBuffer
|
||||
*/
|
||||
FlashReadID(QspiPsuInstancePtr);
|
||||
Status = FlashReadID(QspiPsuInstancePtr);
|
||||
if (Status != XST_SUCCESS) {
|
||||
return XST_FAILURE;
|
||||
}
|
||||
|
||||
xil_printf("Flash connection mode : %d \n\r",
|
||||
QspiPsuConfig->ConnectionMode);
|
||||
|
@ -552,17 +555,26 @@ int QspiPsuPolledFlashExample(XQspiPsu *QspiPsuInstancePtr, u16 QspiPsuDeviceId)
|
|||
ReadBuffer[Count] = 0;
|
||||
}
|
||||
|
||||
FlashErase(QspiPsuInstancePtr, TEST_ADDRESS, MaxData, CmdBfr);
|
||||
|
||||
for (Page = 0; Page < PAGE_COUNT; Page++) {
|
||||
FlashWrite(QspiPsuInstancePtr,
|
||||
(Page * Flash_Config_Table[FCTIndex].PageSize) + TEST_ADDRESS,
|
||||
Flash_Config_Table[FCTIndex].PageSize,
|
||||
WriteCmd, WriteBuffer);
|
||||
Status = FlashErase(QspiPsuInstancePtr, TEST_ADDRESS, MaxData, CmdBfr);
|
||||
if (Status != XST_SUCCESS) {
|
||||
return XST_FAILURE;
|
||||
}
|
||||
|
||||
FlashRead(QspiPsuInstancePtr, TEST_ADDRESS, MaxData, ReadCmd,
|
||||
for (Page = 0; Page < PAGE_COUNT; Page++) {
|
||||
Status = FlashWrite(QspiPsuInstancePtr,
|
||||
(Page * Flash_Config_Table[FCTIndex].PageSize) + TEST_ADDRESS,
|
||||
Flash_Config_Table[FCTIndex].PageSize,
|
||||
WriteCmd, WriteBuffer);
|
||||
if (Status != XST_SUCCESS) {
|
||||
return XST_FAILURE;
|
||||
}
|
||||
}
|
||||
|
||||
Status = FlashRead(QspiPsuInstancePtr, TEST_ADDRESS, MaxData, ReadCmd,
|
||||
CmdBfr, ReadBuffer);
|
||||
if (Status != XST_SUCCESS) {
|
||||
return XST_FAILURE;
|
||||
}
|
||||
/*
|
||||
* Setup a pointer to the start of the data that was read into the read
|
||||
* buffer and verify the data read is the data that was written
|
||||
|
|
Loading…
Add table
Reference in a new issue