From 8dc4f9e7fd053808e241af290ac64e78046eb234 Mon Sep 17 00:00:00 2001 From: RamyaSree Date: Wed, 29 Jul 2015 16:18:34 +0530 Subject: [PATCH] sw_apps: zynqmp_fsbl: Modified bus width in dummy phase. This patch modifies the buswidth in dummy phase as in data phase. Signed-off-by: RamyaSree Reviewed-by: Harini Katakam --- lib/sw_apps/zynqmp_fsbl/src/xfsbl_qspi.c | 34 ++++++++++++++++++------ 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/lib/sw_apps/zynqmp_fsbl/src/xfsbl_qspi.c b/lib/sw_apps/zynqmp_fsbl/src/xfsbl_qspi.c index d8f29fd5..b8ed6bd8 100644 --- a/lib/sw_apps/zynqmp_fsbl/src/xfsbl_qspi.c +++ b/lib/sw_apps/zynqmp_fsbl/src/xfsbl_qspi.c @@ -619,11 +619,20 @@ u32 XFsbl_Qspi24Copy(u32 SrcAddress, PTRSIZE DestAddress, u32 Length) /* Update Dummy cycles as per flash specs for QUAD IO */ /* - * 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. + * It is recommended that Bus width value during dummy + * phase should be same as data phase */ - FlashMsg[1].BusWidth = FlashMsg[0].BusWidth; + 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; + } FlashMsg[1].TxBfrPtr = NULL; FlashMsg[1].RxBfrPtr = NULL; @@ -908,11 +917,20 @@ u32 XFsbl_Qspi32Copy(u32 SrcAddress, PTRSIZE DestAddress, u32 Length) /* Update Dummy cycles as per flash specs for QUAD IO */ /* - * 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. + * It is recommended that Bus width value during dummy + * phase should be same as data phase */ - FlashMsg[1].BusWidth = FlashMsg[0].BusWidth; + if (ReadCommand == FAST_READ_CMD_32BIT) { + FlashMsg[1].BusWidth = XQSPIPSU_SELECT_MODE_SPI; + } + + if (ReadCommand == DUAL_READ_CMD_32BIT) { + FlashMsg[1].BusWidth = XQSPIPSU_SELECT_MODE_DUALSPI; + } + + if (ReadCommand == QUAD_READ_CMD_32BIT) { + FlashMsg[1].BusWidth = XQSPIPSU_SELECT_MODE_QUADSPI; + } FlashMsg[1].TxBfrPtr = NULL; FlashMsg[1].RxBfrPtr = NULL;