Skip to content
Unverified Commit 8b7bd10e authored by Meghana Madhyastha's avatar Meghana Madhyastha Committed by Mark Brown
Browse files

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: default avatarMeghana Madhyastha <meghana.madhyastha@gmail.com>
Signed-off-by: default avatarNoralf Trønnes <noralf@tronnes.org>
Reviewed-by: default avatarLukas Wunner <lukas@wunner.de>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 937e6d75
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment