From: Martin Sperl Date: Sun, 10 May 2015 20:47:28 +0000 (+0000) Subject: spi: bcm2835: enable dma modes for transfers meeting certain conditions X-Git-Tag: omap-for-v4.3/legacy-v2-signed~175^2~5^2~2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3ecd37edaa2a6ba3246e2c35714be9316b1087fe;p=pandora-kernel.git spi: bcm2835: enable dma modes for transfers meeting certain conditions Conditions per spi_transfer are: * transfer.len >= 96 bytes (to avoid mapping overhead costs) * transfer.len < 65536 bytes (limitaion by spi-hw block - could get extended) * an individual scatter/gather transfer length must be a multiple of 4 for anything but the last transfer - spi-hw block limit. (some shortcut has been taken in can_dma to avoid unnecessary mapping of pages which, for which there is a chance that there is a split with a transfer length not a multiple of 4) If it becomes a necessity these restrictions can get removed by additional code. Note that this patch requires a patch to dma-bcm2835.c by Noralf to enable scatter-gather mode inside the dmaengine, which has not been merged yet. That is why no patch to arch/arm/boot/dts/bcm2835.dtsi is included - the code works as before without dma when tx/rx are not set, but it writes a message warning about dma not used: spi-bcm2835 20204000.spi: no tx-dma configuration found - not using dma mode To enable dma-mode add the following lines to the device-tree: dmas = <&dma 6>, <&dma 7>; dma-names = "tx", "rx"; Tested-by: Noralf Trønnes (private communication) Signed-off-by: Martin Sperl Signed-off-by: Mark Brown --- Reading git-diff-tree failed