[U-Boot] [PATCH] Davinci: SPI performance enhancements

Nick Thompson nick.thompson at ge.com
Tue Jun 22 10:29:40 CEST 2010


On 21/06/10 19:38, Delio Brignoli wrote:
> Hello Nick,
> 
> On 21/06/2010, at 11:27, Nick Thompson wrote:
>> The following restructuring and optimisations increase the SPI
>> read performance from 1.3MiB/s (on da850) to 2.87MiB/s (on da830):
> 
> Using this patch I get 2.21MiB/s on my L138 EVM (da850), quite 
> an improvement! I would like to see how much my original patch can
> be improved using some of your changes without splitting the code
> to handle the three cases. I will try later this week.

Not testing the txp and rxp pointers in the loop was a significant
gain for me and pipe-lining the TX and RX operations is going to be
a little trickier, but give it a go by all means.

> 
> [...]
>> +	if (!dout)
>> +		return davinci_spi_read(slave, len, din, flags);
>> +	else if (!din)
>> +		return davinci_spi_write(slave, len, dout, flags);
>> +#ifndef CONFIG_SPI_HALF_DUPLEX
>> +	else
>> +		return davinci_spi_read_write(slave, len, din, dout, flags);
>> +#endif
> 
> I think there should always be an else branch at the end even if 
> CONFIG_SPI_HALF_DUPLEX is not defined. Something like:
> 
> #else
> 	flags |= SPI_XFER_END;
> #endif

Hmmm, yes, you are correct. That must be added, else in the unexpected
case, the transaction will be opened and left open. I'll fix that.

> 
> to terminate the transfer instead of failing silently.
> In fact it should signal the error condition somehow, but 
> I do not know enough about u-boot to provide an advice on this.

I think maybe a printk(KERN_ERR ...) will do it. I'll add that too.

> 
> Thanks
> --
> Delio

Thanks for the review.

Nick.


More information about the U-Boot mailing list