qspi: Fix dummy mode in examples

QSPI HW doesn't actually care what the SPI mode is for the dummy phase
of flash commands. We have confirmed this with randomized testing.
However due to a core limitation of QEMU it is expected to match the
mode of the address phase for QEMU.

So since QEMU is the only platform that cares, set the dummy mode to
QEMUs expectation.

Signed-off-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
This commit is contained in:
Peter Crosthwaite 2015-03-23 22:16:24 -07:00 committed by Nava kishore Manne
parent dde36d829d
commit b9dc06aac8
2 changed files with 12 additions and 20 deletions

View file

@ -1224,17 +1224,13 @@ int FlashRead(XQspiPsu *QspiPsuPtr, u32 Address, u32 ByteCount, u8 Command,
(Command == QUAD_READ_CMD) || (Command == FAST_READ_CMD_4B) ||
(Command == DUAL_READ_CMD_4B) || (Command == QUAD_READ_CMD_4B)) {
/* Update Dummy cycles as per flash specs for QUAD IO */
if ((Command == FAST_READ_CMD) || (Command == FAST_READ_CMD_4B)) {
FlashMsg[1].BusWidth = XQSPIPSU_SELECT_MODE_SPI;
}
if ((Command == DUAL_READ_CMD) || (Command == DUAL_READ_CMD_4B)) {
FlashMsg[1].BusWidth = XQSPIPSU_SELECT_MODE_DUALSPI;
}
if ((Command == QUAD_READ_CMD) || (Command == QUAD_READ_CMD_4B)) {
FlashMsg[1].BusWidth = XQSPIPSU_SELECT_MODE_QUADSPI;
}
/*
* Silicon and REMUS do not care what the SPI mode is
* for dummies, but QEMU expects it to match the address
* phase. Make it so.
*/
FlashMsg[1].BusWidth = FlashMsg[0].BusWidth;
FlashMsg[1].TxBfrPtr = NULL;
FlashMsg[1].RxBfrPtr = NULL;

View file

@ -1142,17 +1142,13 @@ int FlashRead(XQspiPsu *QspiPsuPtr, u32 Address, u32 ByteCount, u8 Command,
(Command == QUAD_READ_CMD) || (Command == FAST_READ_CMD_4B) ||
(Command == DUAL_READ_CMD_4B) || (Command == QUAD_READ_CMD_4B)) {
/* Update Dummy cycles as per flash specs for QUAD IO */
if ((Command == FAST_READ_CMD) || (Command == FAST_READ_CMD_4B)) {
FlashMsg[1].BusWidth = XQSPIPSU_SELECT_MODE_SPI;
}
if ((Command == DUAL_READ_CMD) || (Command == DUAL_READ_CMD_4B)) {
FlashMsg[1].BusWidth = XQSPIPSU_SELECT_MODE_DUALSPI;
}
if ((Command == QUAD_READ_CMD) || (Command == QUAD_READ_CMD_4B)) {
FlashMsg[1].BusWidth = XQSPIPSU_SELECT_MODE_QUADSPI;
}
/*
* Silicon and REMUS do not care what the SPI mode is
* for dummies, but QEMU expects it to match the address
* phase. Make it so.
*/
FlashMsg[1].BusWidth = FlashMsg[0].BusWidth;
FlashMsg[1].TxBfrPtr = NULL;
FlashMsg[1].RxBfrPtr = NULL;