diff options
author | Daniel Kurtz <djkurtz@chromium.org> | 2017-01-26 17:21:54 +0100 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2017-01-31 20:55:38 +0100 |
commit | 1ce24864bff40e11500a699789412115fdf244bf (patch) | |
tree | 3be94f991de7179870c8be5e42db3ea7c55e2905 /drivers/spi/spi-cadence.c | |
parent | spi: When no dma_chan map buffers with spi_master's parent (diff) | |
download | linux-1ce24864bff40e11500a699789412115fdf244bf.tar.xz linux-1ce24864bff40e11500a699789412115fdf244bf.zip |
spi: mediatek: Only do dma for 4-byte aligned buffers
Mediatek SPI DMA only works when tx and rx buffer addresses are 4-byte
aligned.
Unaligned DMA transactions appeared to work previously, since we the
spi core was incorrectly using the spi_master device for dma, which
had a 0 dma_mask, and therefore the swiotlb dma map operations were
falling back to using bounce buffers. Since each DMA transaction would
use its own buffer, the mapped starting address of each transaction was
always aligned. When doing real DMA, the mapped address will share the
alignment of the raw tx/rx buffer provided by the SPI user, which may or
may not be aligned.
If a buffer is not aligned, we cannot use DMA, and must use FIFO based
transaction instead.
So, this patch implements a scheme that allows using the FIFO for
arbitrary length transactions (larger than the 32-byte FIFO size) by
reloading the FIFO in the interrupt handler.
Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
Cc: Leilk Liu <leilk.liu@mediatek.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'drivers/spi/spi-cadence.c')
0 files changed, 0 insertions, 0 deletions