[U-Boot] [PATCH] FSL SPI read fix.
    Dale Smith 
    dalepsmith at gmail.com
       
    Wed Sep 26 23:07:47 CEST 2012
    
    
  
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;
 }
    
    
More information about the U-Boot
mailing list