public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/2] spi: ti_qspi: Fix failure on multiple READ_ID cmd
@ 2016-07-11  5:30 Vignesh R
  2016-07-11  5:30 ` [U-Boot] [PATCH 2/2] spi: ti_qspi: Fix compiler warning when DEBUG macro is set Vignesh R
  2016-07-11  6:35 ` [U-Boot] [PATCH 1/2] spi: ti_qspi: Fix failure on multiple READ_ID cmd Jagan Teki
  0 siblings, 2 replies; 4+ messages in thread
From: Vignesh R @ 2016-07-11  5:30 UTC (permalink / raw)
  To: u-boot

Populating QSPI_RD_SNGL bit(0x1) in priv->cmd means that value
QSPI_INVAL (0x4) is not written to CMD field of QSPI_SPI_CMD_REG in
ti_qspi_cs_deactivate(). Therefore CS is never deactivated between
successive READ ID which results in sf probe to fail.
Fix this by not populating priv->cmd with QSPI_RD_SNGL and OR it wih
priv->cmd as required (similar to the convention followed in the
driver).

Signed-off-by: Vignesh R <vigneshr@ti.com>
---
 drivers/spi/ti_qspi.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/spi/ti_qspi.c b/drivers/spi/ti_qspi.c
index 9a372ad31dae..376fe378ed63 100644
--- a/drivers/spi/ti_qspi.c
+++ b/drivers/spi/ti_qspi.c
@@ -247,13 +247,12 @@ static int __ti_qspi_xfer(struct ti_qspi_priv *priv, unsigned int bitlen,
 			debug("tx done, status %08x\n", status);
 		}
 		if (rxp) {
-			priv->cmd |= QSPI_RD_SNGL;
 			debug("rx cmd %08x dc %08x\n",
 			      priv->cmd, priv->dc);
 			#ifdef CONFIG_DRA7XX
 				udelay(500);
 			#endif
-			writel(priv->cmd, &priv->base->cmd);
+			writel(priv->cmd | QSPI_RD_SNGL, &priv->base->cmd);
 			status = readl(&priv->base->status);
 			timeout = QSPI_TIMEOUT;
 			while ((status & QSPI_WC_BUSY) != QSPI_XFER_DONE) {
-- 
2.9.0

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-07-11 16:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-07-11  5:30 [U-Boot] [PATCH 1/2] spi: ti_qspi: Fix failure on multiple READ_ID cmd Vignesh R
2016-07-11  5:30 ` [U-Boot] [PATCH 2/2] spi: ti_qspi: Fix compiler warning when DEBUG macro is set Vignesh R
2016-07-11  6:35 ` [U-Boot] [PATCH 1/2] spi: ti_qspi: Fix failure on multiple READ_ID cmd Jagan Teki
2016-07-11 16:39   ` R, Vignesh

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox