Skip to content

spi/spi-atmel: add dmaengine support for atmel spi controller and to test the device tree support

Douglas Gilbert linux-arm-kernel linux-spi lkml 1 version New

Get series with b4
b4 am [email protected]

Versions newest first

  1. v5 Latest0 of 16 patches 0 repliesNew

Patches in v5 No applies recorded yet

None of the 16 patches the cover letter announces are in this archive.

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v5 yet.

Read the v5 thread

Cover letter [PATCH Resend v5 00/16] spi/spi-atmel: add dmaengine support for atmel spi controller and to test the device tree support
Quoted 12 lines · Wenyou Yang

Hi All,

This set of patches is to add dmaengine support for atmel spi and to test device tree support.

The work is based on Nicolas and Richard's work.

Because the Atmel DMA device tree support hasn't on mainline, to at91sam9x5ek and at91sam9n12ek
with dma support, it doesn't work on the dmaengine mode, only on PIO mode so far.

Quoted 8 lines

It has been tested as below:
1./tested on v3.8, by using mtd utils, "mount", "umount" and "cp"
commands.
2./tested on "spi/next" git tree after removing commit "spi: make sure all
transfer has proper speed set".
3./tested by using Documentation/spi/spidev_test.c on "/dev/spidev". 4./tested on on at91sam9x5ek, at91sam9m10g45ek, at91sam9263ek and
at91sam9g20ek boards

I took a different approach to testing this patch. Try the world's most common SPI device, namely a (micro)SD card. There are a few issues.

The mmc_spi driver isn't very DT friendly. I added some DT SPI attributes, patch attached. In my case cd-inverted was needed.

Also I ran into a boot sequence problem since my hardware boots of a microSD card using the MCI interface. I was using a second microSD for SPI testing. at91bootstrap and u-boot (plus the kernel image) are on my MCI microSD card and they got the kernel booting. However since the kernel probes SPI before MCI, then by the time of the rootfs remount, my SPI microSD card had overtaken the /dev/mmcblk0 device node leading to some confusion.

There are several ways of coping with this problem and I took an easy one: making mmc_spi a module. Just wondering if there are any DT mechanisms to cope with these "order of probing" type problems?

And data transfers to and from that microSD card using SPI were slow, as in 200 kB/sec (should be closer to 1 MB/sec). So Atmel, when are we getting DMA working for the AT91SAM9x5 family?

Doug Gilbert

-------------- next part --------------
A non-text attachment was scrubbed...
Name: at91_mmc_spi_dg1.patch
Type: text/x-patch
Size: 1627 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130318/153b1fcd/attachment.bin>