From fdf41ec349d12a0b59176becbcfa29d2da6eb369 Mon Sep 17 00:00:00 2001 From: P L Sai Krishna Date: Mon, 15 Jun 2015 20:32:26 +0530 Subject: [PATCH] qspipsu: Modified Bus width during dummy phase in examples. This patch modifies the Bus width value during dummy phase in examples since it is recommended to be same as in data phase. Signed-off-by: P L Sai Krishna --- .../xqspipsu_generic_flash_interrupt_example.c | 16 +++++++++++++--- .../xqspipsu_generic_flash_polled_example.c | 16 +++++++++++++--- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/XilinxProcessorIPLib/drivers/qspipsu/examples/xqspipsu_generic_flash_interrupt_example.c b/XilinxProcessorIPLib/drivers/qspipsu/examples/xqspipsu_generic_flash_interrupt_example.c index 78b6c10c..210f9ff9 100644 --- a/XilinxProcessorIPLib/drivers/qspipsu/examples/xqspipsu_generic_flash_interrupt_example.c +++ b/XilinxProcessorIPLib/drivers/qspipsu/examples/xqspipsu_generic_flash_interrupt_example.c @@ -1236,10 +1236,20 @@ int FlashRead(XQspiPsu *QspiPsuPtr, u32 Address, u32 ByteCount, u8 Command, /* Update Dummy cycles as per flash specs for QUAD IO */ /* - * Bus width of dummy phase is recommended to be the same as - * address phase + * It is recommended that Bus width value during dummy + * phase should be same as data phase */ - FlashMsg[1].BusWidth = FlashMsg[0].BusWidth; + 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; + } FlashMsg[1].TxBfrPtr = NULL; FlashMsg[1].RxBfrPtr = NULL; diff --git a/XilinxProcessorIPLib/drivers/qspipsu/examples/xqspipsu_generic_flash_polled_example.c b/XilinxProcessorIPLib/drivers/qspipsu/examples/xqspipsu_generic_flash_polled_example.c index a2460df6..9ae29fac 100644 --- a/XilinxProcessorIPLib/drivers/qspipsu/examples/xqspipsu_generic_flash_polled_example.c +++ b/XilinxProcessorIPLib/drivers/qspipsu/examples/xqspipsu_generic_flash_polled_example.c @@ -1154,10 +1154,20 @@ int FlashRead(XQspiPsu *QspiPsuPtr, u32 Address, u32 ByteCount, u8 Command, /* Update Dummy cycles as per flash specs for QUAD IO */ /* - * Bus width of dummy phase is recommended to be the same as - * address phase + * It is recommended that Bus width value during dummy + * phase should be same as data phase */ - FlashMsg[1].BusWidth = FlashMsg[0].BusWidth; + 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; + } FlashMsg[1].TxBfrPtr = NULL; FlashMsg[1].RxBfrPtr = NULL;