]> git.ipfire.org Git - people/ms/u-boot.git/commit
spi: ti_qspi: use 128 bit transfer mode when writing to flash
authorVignesh R <vigneshr@ti.com>
Wed, 7 Sep 2016 09:48:22 +0000 (15:18 +0530)
committerJagan Teki <jagannadh.teki@gmail.com>
Wed, 21 Sep 2016 19:28:26 +0000 (00:58 +0530)
commit260368507a15de9503f509b175796935f65fbfc3
tree40d7f3ddeb162a78e919dd7132b2a930d07a62f4
parentd2998286fc58e3ac6c75ed4d3a1e77b618bbf2ae
spi: ti_qspi: use 128 bit transfer mode when writing to flash

TI QSPI has four 32 bit data registers 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.

With this patch, the flash write speed increases from ~250KBs/ to
~650KB/s on DRA74 EVM.

Signed-off-by: Vignesh R <vigneshr@ti.com>
Reviewed-by: Tom Rini <trini@konsulko.com>
Reviewed-by: Jagan Teki <jteki@openedev.com>
drivers/spi/ti_qspi.c