public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] spi: designware_spi: Fix off-by-one for checking fifo depth
@ 2014-12-19  4:40 Axel Lin
  2014-12-19  7:35 ` Stefan Roese
  0 siblings, 1 reply; 3+ messages in thread
From: Axel Lin @ 2014-12-19  4:40 UTC (permalink / raw)
  To: u-boot

The depth could be from 2 to 256 from HW spec, so fix off-by-one for checking
fifo depth.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
---
Hi,
I don't have this hardware handy, so please test it.
 drivers/spi/designware_spi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/spi/designware_spi.c b/drivers/spi/designware_spi.c
index 98c9f03..14d0c23 100644
--- a/drivers/spi/designware_spi.c
+++ b/drivers/spi/designware_spi.c
@@ -164,7 +164,7 @@ static void spi_hw_init(struct dw_spi_priv *priv)
 	if (!priv->fifo_len) {
 		u32 fifo;
 
-		for (fifo = 2; fifo <= 257; fifo++) {
+		for (fifo = 2; fifo <= 256; fifo++) {
 			dw_writew(priv, DW_SPI_TXFLTR, fifo);
 			if (fifo != dw_readw(priv, DW_SPI_TXFLTR))
 				break;
-- 
1.9.1

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

end of thread, other threads:[~2014-12-19  7:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-19  4:40 [U-Boot] [PATCH] spi: designware_spi: Fix off-by-one for checking fifo depth Axel Lin
2014-12-19  7:35 ` Stefan Roese
2014-12-19  7:44   ` Axel Lin

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