spi/spi-bcm2835: Split transfers that exceed DLEN
authorMeghana Madhyastha <meghana.madhyastha@gmail.com>
Sat, 13 Apr 2019 18:24:14 +0000 (20:24 +0200)
committerMark Brown <broonie@kernel.org>
Thu, 2 May 2019 01:37:55 +0000 (10:37 +0900)
commit8b7bd10eb00d02e74a75556ba1d85b5e2d568caf
tree2952de27df4400e3700eb7afb4080ed5a68e4219
parent937e6d756422637eeb212c645ded69569a67fabc
spi/spi-bcm2835: Split transfers that exceed DLEN

Split spi transfers into chunks of <=65532 to enable the driver to
perform DMA transfer on big buffers. The DLEN register specifies the
number of bytes to transfer in DMA mode. It is 16-bit wide and thus the
maximum DMA transfer is 65535 bytes. Set the maximum to 65532 (4 byte
aligned) since the FIFO in DMA mode is accessed in 4 byte chunks.

->max_dma_len is the value the spi core uses when splitting the buffer
into scatter gather entries.
The BCM2835 DMA block has 2 types of channels/engines:
- Normal: Max length: 1G
- Lite: Max length: 65535

Even when using a Lite channel we will not exceed the max length, so
let's drop setting ->max_dma_len.

Signed-off-by: Meghana Madhyastha <meghana.madhyastha@gmail.com>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Reviewed-by: Lukas Wunner <lukas@wunner.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-bcm2835.c