From d29f0631365316397ec55d23c1a704e8b159febd Mon Sep 17 00:00:00 2001 From: Punnaiah Choudary Kalluri Date: Thu, 18 Jun 2015 11:50:14 +0530 Subject: [PATCH] nandpsu: Fix timeout error for erase operation on slower devices The current timeout value is not enough for erase operation on slower devices. so increasing the timeout value and also added usleep for timeout routine to have a precise timeout. Signed-off-by: Punnaiah Choudary Kalluri --- XilinxProcessorIPLib/drivers/nandpsu/src/xnandpsu.c | 2 ++ XilinxProcessorIPLib/drivers/nandpsu/src/xnandpsu.h | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/XilinxProcessorIPLib/drivers/nandpsu/src/xnandpsu.c b/XilinxProcessorIPLib/drivers/nandpsu/src/xnandpsu.c index 47c720af..c4aa358f 100644 --- a/XilinxProcessorIPLib/drivers/nandpsu/src/xnandpsu.c +++ b/XilinxProcessorIPLib/drivers/nandpsu/src/xnandpsu.c @@ -97,6 +97,7 @@ * SDR and NVDDR interface for timing modes 0 to 5. * Modified Bbt Signature and Version Offset value for * Oob and No-Oob region. +* 1.0 kpc 17/6/2015 Added timer based timeout intsead of sw counter. * * ******************************************************************************/ @@ -897,6 +898,7 @@ static s32 XNandPsu_PollRegTimeout(XNandPsu *InstancePtr, u32 RegOffset, break; } TimeoutVar--; + usleep(1); } if (TimeoutVar <= 0U) { diff --git a/XilinxProcessorIPLib/drivers/nandpsu/src/xnandpsu.h b/XilinxProcessorIPLib/drivers/nandpsu/src/xnandpsu.h index ebbe456b..73af3c77 100644 --- a/XilinxProcessorIPLib/drivers/nandpsu/src/xnandpsu.h +++ b/XilinxProcessorIPLib/drivers/nandpsu/src/xnandpsu.h @@ -155,6 +155,8 @@ * SDR and NVDDR interface for timing modes 0 to 5. * Modified Bbt Signature and Version Offset value for * Oob and No-Oob region. +* 1.0 kpc 17/06/2015 Increased the timeout for complete event to avoid +* timeout errors for erase operation on slower devices. * * ******************************************************************************/ @@ -200,7 +202,7 @@ extern "C" { #define XNANDPSU_MAX_SPARE_SIZE 0x800U /**< Max spare bytes of a NAND flash page of 16K */ -#define XNANDPSU_INTR_POLL_TIMEOUT 10000U +#define XNANDPSU_INTR_POLL_TIMEOUT 0xF000000U #define XNANDPSU_SDR_CLK ((u16)100U * (u16)1000U * (u16)1000U) #define XNANDPSU_NVDDR_CLK_0 ((u16)20U * (u16)1000U * (u16)1000U)