From f325b4c8d8651886dac3e21a438175eb8d024fb3 Mon Sep 17 00:00:00 2001 From: Peter Crosthwaite Date: Mon, 23 Mar 2015 22:16:25 -0700 Subject: [PATCH] fsbl 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 --- lib/sw_apps/zynqmp_fsbl/src/xfsbl_qspi.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/lib/sw_apps/zynqmp_fsbl/src/xfsbl_qspi.c b/lib/sw_apps/zynqmp_fsbl/src/xfsbl_qspi.c index 8e2aa1b5..2be3fed0 100644 --- a/lib/sw_apps/zynqmp_fsbl/src/xfsbl_qspi.c +++ b/lib/sw_apps/zynqmp_fsbl/src/xfsbl_qspi.c @@ -623,17 +623,13 @@ u32 XFsbl_Qspi24Copy(u32 SrcAddress, PTRSIZE DestAddress, u32 Length) if ((ReadCommand == FAST_READ_CMD_24BIT) || (ReadCommand == DUAL_READ_CMD_24BIT) || (ReadCommand == QUAD_READ_CMD_24BIT)) { /* Update Dummy cycles as per flash specs for QUAD IO */ - if (ReadCommand == FAST_READ_CMD_24BIT) { - FlashMsg[1].BusWidth = XQSPIPSU_SELECT_MODE_SPI; - } - if (ReadCommand == DUAL_READ_CMD_24BIT) { - FlashMsg[1].BusWidth = XQSPIPSU_SELECT_MODE_DUALSPI; - } - - if (ReadCommand == QUAD_READ_CMD_24BIT){ - 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;