spi: ti_qspi: Fix failure on multiple READ_ID cmd
PATCH v2 1/3 spi: ti_qspi: Fix failure on multiple READ_ID cmd
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).
---
v2: fix up debug print
drivers/spi/ti_qspi.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/spi/ti_qspi.c +2 -3
@@ -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); + ((u32)(priv->cmd |QSPI_RD_SNGL )), 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 ) {
Signature · 1 line
2.9.2
PATCH v2 2/3 spi: ti_qspi: Fix compiler warning when DEBUG macro is set
clk_div is uninitialized at the beginning of ti_spi_set_speed(), move debug() print after clk_div calculation to avoid compiler warning and to have proper value of clk_div printed during debugging.
---
v2: no change
drivers/spi/ti_qspi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/spi/ti_qspi.c +2 -2
@@ -110,13 +110,13 @@ static void ti_spi_set_speed(struct ti_qspi_priv *priv, uint hz) {uint clk_div; -debug ("ti_spi_set_speed: hz: %d, clock divider %d\n" , hz, clk_div); -if (!hz) clk_div =0 ;else clk_div = (QSPI_FCLK / hz) -1 ; +debug ("ti_spi_set_speed: hz: %d, clock divider %d\n" , hz, clk_div); +/* disable SCLK */ writel (readl (&priv->base->clk_ctrl) & ~QSPI_CLK_EN , &priv->base->clk_ctrl);
Signature · 1 line
2.9.2
PATCH v2 3/3 spi: ti_qspi: Remove delay in read path for dra7xx
In reply to Vignesh RAs per commit b545a98f5dc563 ("spi: ti_qspi: Add delay
for successful bulk erase) says its added to meet bulk erase timing constraints. But bulk erase is a cmd to flash and delay in read path does not make sense. Morever, testing on DRA74/DRA72 evm has shown that this delay is no longer required.
---
v2: no patch
drivers/spi/ti_qspi.c | 3 --- 1 file changed, 3 deletions(-)
drivers/spi/ti_qspi.c +0 -3
@@ -249,9 +249,6 @@ static int __ti_qspi_xfer(struct ti_qspi_priv *priv, unsigned int bitlen,if (rxp) {debug ("rx cmd %08x dc %08x\n" , ((u32)(priv->cmd |QSPI_RD_SNGL )), priv->dc); -#ifdef CONFIG_DRA7XX -udelay (500 ); -#endif writel (priv->cmd |QSPI_RD_SNGL , &priv->base->cmd); status =readl (&priv->base->status); timeout =QSPI_TIMEOUT ;
Signature · 1 line
2.9.2
PATCH v2 1/3 spi: ti_qspi: Fix failure on multiple READ_ID cmd
In reply to Vignesh RQuoted 9 lines · Vignesh R
Populating
QSPI_RD_SNGLbit(0x1) inpriv->cmdmeans that valueQSPI_INVAL(0x4) is not written to CMD field ofQSPI_SPI_CMD_REGinti_qspi_cs_deactivate(). Therefore CS is never deactivated between successive READ ID which results in sf probe to fail.
Fix this by not populatingpriv->cmdwithQSPI_RD_SNGLand OR it wihpriv->cmdas required (similar to the convention followed in the driver).Signed-off-by Vignesh R <[email protected]>
--
Jagan.
PATCH v2 2/3 spi: ti_qspi: Fix compiler warning when DEBUG macro is set
In reply to Vignesh RQuoted 5 lines · Vignesh R
clk_divis uninitialized at the beginning ofti_spi_set_speed(), movedebug()print afterclk_divcalculation to avoid compiler warning and to have proper value ofclk_divprinted during debugging.Signed-off-by Vignesh R <[email protected]>
Signature · 1 line
Jagan.
PATCH v2 3/3 spi: ti_qspi: Remove delay in read path for dra7xx
In reply to Vignesh RQuoted 7 lines · Vignesh R
As per commit
b545a98f5dc563("spi:ti_qspi: Add delay
for successful bulk erase) says its added to meet bulk erase timing constraints. But bulk erase is a cmd to flash and delay in read path does not make sense. Morever, testing on DRA74/DRA72 evm has shown that this delay is no longer required.Signed-off-by Vignesh R <[email protected]>
Quoted 12 lines
---
v2: no patch
drivers/spi/ti_qspi.c | 3 --- 1 file changed, 3 deletions(-)drivers/spi/ti_qspi.c +0
-0
drivers/spi/ti_qspi.c static int __ti_qspi_xfer(struct ti_qspi_priv *priv, unsigned int bitlen, · line 254
Quoted 6 lines
drivers/spi/ti_qspi.c +0
-3@@ -249,9 +249,6 @@ static int __ti_qspi_xfer(struct ti_qspi_priv *priv, unsigned int bitlen,if (rxp) {debug ("rx cmd %08x dc %08x\n" , ((u32)(priv->cmd |QSPI_RD_SNGL )), priv->dc); -#ifdef CONFIG_DRA7XX -udelay (500 ); -#endif
Thanks for this change.
--
Jagan.
PATCH v2 1/3 spi: ti_qspi: Fix failure on multiple READ_ID cmd
In reply to Vignesh RQuoted 9 lines · Vignesh R
Populating
QSPI_RD_SNGLbit(0x1) inpriv->cmdmeans that valueQSPI_INVAL(0x4) is not written to CMD field ofQSPI_SPI_CMD_REGinti_qspi_cs_deactivate(). Therefore CS is never deactivated between successive READ ID which results in sf probe to fail.
Fix this by not populatingpriv->cmdwithQSPI_RD_SNGLand OR it wihpriv->cmdas required (similar to the convention followed in the driver).Signed-off-by Vignesh R <[email protected]>
Regards
Mugunthan V N
PATCH v2 2/3 spi: ti_qspi: Fix compiler warning when DEBUG macro is set
In reply to Vignesh RQuoted 5 lines · Vignesh R
clk_divis uninitialized at the beginning ofti_spi_set_speed(), movedebug()print afterclk_divcalculation to avoid compiler warning and to have proper value ofclk_divprinted during debugging.Signed-off-by Vignesh R <[email protected]>
Regards
Mugunthan V N
PATCH v2 3/3 spi: ti_qspi: Remove delay in read path for dra7xx
In reply to Vignesh RQuoted 7 lines · Vignesh R
As per commit
b545a98f5dc563("spi:ti_qspi: Add delay
for successful bulk erase) says its added to meet bulk erase timing constraints. But bulk erase is a cmd to flash and delay in read path does not make sense. Morever, testing on DRA74/DRA72 evm has shown that this delay is no longer required.Signed-off-by Vignesh R <[email protected]>
Regards
Mugunthan V N
PATCH v2 1/3 spi: ti_qspi: Fix failure on multiple READ_ID cmd
In reply to Mugunthan V NQuoted 9 lines · Mugunthan V N
Quoted 8 lines · Vignesh R
Populating
QSPI_RD_SNGLbit(0x1) inpriv->cmdmeans that valueQSPI_INVAL(0x4) is not written to CMD field ofQSPI_SPI_CMD_REGinti_qspi_cs_deactivate(). Therefore CS is never deactivated between successive READ ID which results in sf probe to fail.
Fix this by not populatingpriv->cmdwithQSPI_RD_SNGLand OR it wihpriv->cmdas required (similar to the convention followed in the driver).
Quoted 3 lines
Quoted 1 line
Signed-off-by Vignesh R <[email protected]>Reviewed-by Mugunthan V N <[email protected]>
Applied to u-boot-spi/master
thanks!
Signature · 1 line
Jagan.
PATCH v2 2/3 spi: ti_qspi: Fix compiler warning when DEBUG macro is set
In reply to Mugunthan V NQuoted 8 lines · Mugunthan V N
Quoted 5 lines · Vignesh R
clk_divis uninitialized at the beginning ofti_spi_set_speed(), movedebug()print afterclk_divcalculation to avoid compiler warning and to have proper value ofclk_divprinted during debugging.Signed-off-by Vignesh R <[email protected]>Reviewed-by Mugunthan V N <[email protected]>
Applied to u-boot-spi/master
thanks!
Signature · 1 line
Jagan.
PATCH v2 3/3 spi: ti_qspi: Remove delay in read path for dra7xx
In reply to Mugunthan V NQuoted 10 lines · Mugunthan V N
Quoted 7 lines · Vignesh R
As per commit
b545a98f5dc563("spi:ti_qspi: Add delay
for successful bulk erase) says its added to meet bulk erase timing constraints. But bulk erase is a cmd to flash and delay in read path does not make sense. Morever, testing on DRA74/DRA72 evm has shown that this delay is no longer required.Signed-off-by Vignesh R <[email protected]>Reviewed-by Mugunthan V N <[email protected]>
Applied to u-boot-spi/master
thanks!
Signature · 1 line
Jagan.