Commit a6670615 authored by Chip Coldwell's avatar Chip Coldwell Committed by Linus Torvalds

atmel_serial: add DMA support

This patch is based on the DMA-patch by Chip Coldwell for the AT91/AT32 serial
USARTS, with some tweaks to make it apply neatly on top of the other patches
in this series.

The RX and TX code has been moved to a tasklet and reworked a bit.  Instead of
depending on the ENDRX and TIMEOUT bits in CSR, we simply grab as much data as
we can from the DMA buffers.  I think this closes a race where the ENDRX bit
is set after we read CSR but before we read RPR, although I haven't confirmed
this.

Similarly, the two TX handlers (ENDTX and TXBUFE) have been combined into one.
 Since the current code only uses a single TX buffer, there's no point in
handling those interrupts separately.

This also fixes a DMA sync bug in the original patch.

[linux@bohmer.net: rebased onto irq-splitup patch]
[hskinnemoen@atmel.com: moved to tasklet, fixed dma bug, misc cleanups]
[hskinnemoen@atmel.com: atmel_serial dma: Misc fixes and cleanups]
Signed-off-by: default avatarRemy Bohmer <linux@bohmer.net>
Signed-off-by: default avatarHaavard Skinnemoen <hskinnemoen@atmel.com>
Cc: Andrew Victor <linux@maxim.org.za>
Tested-by: default avatarMarc Pignat <marc.pignat@hevs.ch>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 1ecc26bd
...@@ -380,6 +380,21 @@ config SERIAL_ATMEL_CONSOLE ...@@ -380,6 +380,21 @@ config SERIAL_ATMEL_CONSOLE
console is the device which receives all kernel messages and console is the device which receives all kernel messages and
warnings and which allows logins in single user mode). warnings and which allows logins in single user mode).
config SERIAL_ATMEL_PDC
bool "Support DMA transfers on AT91 / AT32 serial port"
depends on SERIAL_ATMEL
default y
help
Say Y here if you wish to use the PDC to do DMA transfers to
and from the Atmel AT91 / AT32 serial port. In order to
actually use DMA transfers, make sure that the use_dma_tx
and use_dma_rx members in the atmel_uart_data struct is set
appropriately for each port.
Note that break and error handling currently doesn't work
properly when DMA is enabled. Make sure that ports where
this matters don't use DMA.
config SERIAL_ATMEL_TTYAT config SERIAL_ATMEL_TTYAT
bool "Install as device ttyATn instead of ttySn" bool "Install as device ttyATn instead of ttySn"
depends on SERIAL_ATMEL=y depends on SERIAL_ATMEL=y
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment