[U-Boot] FSL SPI read fix.

Jagan Teki jagannadh.teki at gmail.com
Wed Jun 12 21:02:39 CEST 2013


Hi,

Can you please update the commit header and logic of the code
w.r.t current master tree.

also please use proper commit body.

--
Thanks,
Jagan.

On 27-09-2012 02:37, Dale Smith wrote:
> 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