]> git.kernelconcepts.de Git - karo-tx-uboot.git/commit
spi: exynos: Minimise access to SPI FIFO level
authorRajeshwari Shinde <rajeshwari.s@samsung.com>
Tue, 8 Oct 2013 10:50:05 +0000 (16:20 +0530)
committerJagannadha Sutradharudu Teki <jaganna@xilinx.com>
Tue, 8 Oct 2013 12:48:11 +0000 (18:18 +0530)
commit120af1572a3647bb87eff2f62dd8f8a919ee71f0
tree60e8c86eabec0f346baa1c8b9a9d95e37546f4ce
parent8d203afdd3bf54ad5b2523cdacaff4ac35da6b08
spi: exynos: Minimise access to SPI FIFO level

Accessing SPI registers is slow, but access to the FIFO level register
in particular seems to be extraordinarily expensive (I measure up to
600ns). Perhaps it is required to synchronise with the SPI byte output
logic which might run at 1/8th of the 40MHz SPI speed (just a guess).

Reduce access to this register by filling up and emptying FIFOs
more completely, rather than just one word each time around the inner
loop.

Since the rxfifo value will now likely be much greater that what we read
before we fill the txfifo, we only fill the txfifo halfway. This is
because if the txfifo is empty, but the rxfifo has data in it, then writing
too much data to the txfifo may overflow the rxfifo as data arrives.

This speeds up SPI flash reading from about 1MB/s to about 2MB/s on snow.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Rajeshwari S Shinde <rajeshwari.s@samsung.com>
Reviewed-by: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
drivers/spi/exynos_spi.c