From fffe1b33b974fd29637b7cfb64832bc620f1d533 Mon Sep 17 00:00:00 2001 From: Punnaiah Choudary Kalluri Date: Thu, 24 Jul 2014 18:24:59 +0530 Subject: [PATCH] nandps: Fix updating the command phase register twice Fixed updating the command phase register twice for the flash devices that require four address cycles. Signed-off-by: Punnaiah Choudary Kalluri Acked-by: Anirudha Sarangi --- .../drivers/nandps/src/xnandps.c | 21 +++++++++++-------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/XilinxProcessorIPLib/drivers/nandps/src/xnandps.c b/XilinxProcessorIPLib/drivers/nandps/src/xnandps.c index 8cd855ba..0fd82a3a 100755 --- a/XilinxProcessorIPLib/drivers/nandps/src/xnandps.c +++ b/XilinxProcessorIPLib/drivers/nandps/src/xnandps.c @@ -1119,15 +1119,18 @@ void XNandPs_SendCommand(XNandPs *InstancePtr, XNandPs_CommandFormat CmdPhaseData = Column; PageShift = InstancePtr->Geometry.ColAddrCycles * 8; CmdPhaseData |= Page << PageShift; - /* Send lower bytes of page - address in first address - cycle */ - XNandPs_WriteReg(CmdPhaseAddr, CmdPhaseData); - /* - * Send the upper bytes of the page address in second address - * address cycle - */ - CmdPhaseData = Page >> (32 - PageShift); + if (Command->AddrCycles > 4) { + /* + * Send lower bytes of page address in first address + * cycle + */ + XNandPs_WriteReg(CmdPhaseAddr, CmdPhaseData); + /* + * Send the upper bytes of the page address in second + * address cycle + */ + CmdPhaseData = Page >> (32 - PageShift); + } } else if (Page != XNANDPS_PAGE_NOT_VALID) { CmdPhaseData = Page; } else {