Commit b780c3f3 authored by Tudor Ambarus's avatar Tudor Ambarus Committed by Mark Brown

spi: atmel-quadspi: Use optimezed memcpy_fromio()/memcpy_toio()

Optimezed mem*io operations are defined for LE platforms, use them.

The ARM and !ARCH_EBSA110 dependencies for COMPILE_TEST were added
only for the _memcpy_fromio()/_memcpy_toio() functions. Drop these
dependencies.

Tested unaligned accesses on both sama5d2 and sam9x60 QSPI controllers
using SPI NOR flashes, everything works ok. The following performance
improvement can be seen when running mtd_speedtest:

sama5d2_xplained (mx25l25635e)
- before:
	mtd_speedtest: eraseblock write speed is 983 KiB/s
	mtd_speedtest: eraseblock read speed is 6150 KiB/s
- after:
	mtd_speedtest: eraseblock write speed is 1055 KiB/s
	mtd_speedtest: eraseblock read speed is 20144 KiB/s

sam9x60ek (sst26vf064b)
- before:
	mtd_speedtest: eraseblock write speed is 4770 KiB/s
	mtd_speedtest: eraseblock read speed is 8062 KiB/s
- after:
	mtd_speedtest: eraseblock write speed is 4524 KiB/s
	mtd_speedtest: eraseblock read speed is 21186 KiB/s
Signed-off-by: default avatarTudor Ambarus <tudor.ambarus@microchip.com>
Link: https://lore.kernel.org/r/20200716043139.565734-1-tudor.ambarus@microchip.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent e1268597
...@@ -103,7 +103,7 @@ config SPI_AT91_USART ...@@ -103,7 +103,7 @@ config SPI_AT91_USART
config SPI_ATMEL_QUADSPI config SPI_ATMEL_QUADSPI
tristate "Atmel Quad SPI Controller" tristate "Atmel Quad SPI Controller"
depends on ARCH_AT91 || (ARM && COMPILE_TEST && !ARCH_EBSA110) depends on ARCH_AT91 || COMPILE_TEST
depends on OF && HAS_IOMEM depends on OF && HAS_IOMEM
help help
This enables support for the Quad SPI controller in master mode. This enables support for the Quad SPI controller in master mode.
......
...@@ -430,11 +430,11 @@ static int atmel_qspi_exec_op(struct spi_mem *mem, const struct spi_mem_op *op) ...@@ -430,11 +430,11 @@ static int atmel_qspi_exec_op(struct spi_mem *mem, const struct spi_mem_op *op)
/* Send/Receive data */ /* Send/Receive data */
if (op->data.dir == SPI_MEM_DATA_IN) if (op->data.dir == SPI_MEM_DATA_IN)
_memcpy_fromio(op->data.buf.in, aq->mem + offset, memcpy_fromio(op->data.buf.in, aq->mem + offset,
op->data.nbytes); op->data.nbytes);
else else
_memcpy_toio(aq->mem + offset, op->data.buf.out, memcpy_toio(aq->mem + offset, op->data.buf.out,
op->data.nbytes); op->data.nbytes);
/* Release the chip-select */ /* Release the chip-select */
atmel_qspi_write(QSPI_CR_LASTXFER, aq, QSPI_CR); atmel_qspi_write(QSPI_CR_LASTXFER, aq, QSPI_CR);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment