public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] FSL SPI read fix.
@ 2012-09-26 21:07 Dale Smith
  2013-06-12 19:02 ` [U-Boot] " Jagan Teki
  0 siblings, 1 reply; 9+ messages in thread
From: Dale Smith @ 2012-09-26 21:07 UTC (permalink / raw)
  To: u-boot

The fsl spi engine is non functional when reading from a device.  This
patch fixes it.

Note that none of the other spi interfaces parse through the
datastream looking for 0x0b bytes.

-Dale

diff --git a/drivers/spi/fsl_espi.c b/drivers/spi/fsl_espi.c
index a1ebd33..737719b 100644
--- a/drivers/spi/fsl_espi.c
+++ b/drivers/spi/fsl_espi.c
@@ -291,17 +291,10 @@ int spi_xfer(struct spi_slave *slave, unsigned
int bitlen, const void *data_out,
 				debug("***spi_xfer:...%08x readed\n", tmpdin);
 			}
 		}
-		if (data_in) {
-			memcpy(data_in, buffer + 2 * cmd_len, tran_len);
-			if (*buffer == 0x0b) {
-				data_in += tran_len;
-				data_len -= tran_len;
-				*(int *)buffer += tran_len;
-			}
-		}
 		spi_cs_deactivate(slave);
 	}
-
+	if (data_in)
+		memcpy(data_in, buffer + rx_offset, len);
 	free(buffer);
 	return 0;
 }

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

end of thread, other threads:[~2015-12-14  7:01 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-26 21:07 [U-Boot] [PATCH] FSL SPI read fix Dale Smith
2013-06-12 19:02 ` [U-Boot] " Jagan Teki
2013-06-12 21:54   ` [U-Boot] [PATCH] FSL espi: Return all data read from device unmodified Dale P. Smith
2013-06-13  2:39     ` Jagan Teki
2013-06-13  9:09       ` Albert ARIBAUD
2013-06-13  9:22         ` Jagan Teki
2015-12-12  2:19     ` [U-Boot] [PATCH v3] spi: fsl_espi: " Dale P. Smith
2015-12-12 17:10       ` Joakim Tjernlund
2015-12-14  7:01         ` Jagan Teki

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