]> asedeno.scripts.mit.edu Git - linux.git/commit
spi: ti-qspi: use 128 bit transfer mode where possible
authorVignesh R <vigneshr@ti.com>
Thu, 20 Aug 2015 10:30:59 +0000 (16:00 +0530)
committerMark Brown <broonie@kernel.org>
Thu, 20 Aug 2015 17:56:42 +0000 (10:56 -0700)
commitf682c4ffd25a19594d21987c19a69fa123242eb7
tree40bb253223b77994bca219c996af5238c6632178
parentbc0195aad0daa2ad5b0d76cce22b167bc3435590
spi: ti-qspi: use 128 bit transfer mode where possible

TI QSPI has four 32 bit data regsiters which can be used to transfer 16
bytes of data at once. The register group QSPI_SPI_DATA_REG_3,
QSPI_SPI_DATA_REG_2, QSPI_SPI_DATA_REG_1 and QSPI_SPI_DATA_REG is
treated as a single 128-bit word for shifting data in and out. The bit
at QSPI_SPI_DATA_REG_3[31] position is the first bit to be shifted out
in case of 128 bit transfer mode. Therefore the first byte to be written
to flash should be at QSPI_SPI_DATA_REG_3[31-25] position.
Instead of writing 1 byte at a time when interacting with spi-nor flash,
make use of all the four registers so that 16 bytes can be transferred
in one go. This reduces number of register writes and Word Complete
interrupts for a given transfer message size, thereby increasing the
write performance.

Without this patch the raw flash write speed is ~100KB/s, with this
patch the write speed increases to ~400 kB/s on DRA74 EVM.

Signed-off-by: Vignesh R <vigneshr@ti.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-ti-qspi.c