Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6365bead authored by Russell King's avatar Russell King
Browse files

DMA: sa11x0: add SA-11x0 DMA driver



Add support for the SA-11x0 DMA driver, which replaces the private
API version in arch/arm/mach-sa1100/dma.c.

We model this as a set of virtual DMA channels, one for each request
signal, and assign the virtual DMA channel to a physical DMA channel
when there is work to be done.  This allows DMA users to claim their
channels, and hold them while not in use, without affecting the
availability of the physical channels.

Another advantage over this approach, compared to the private version,
is that a channel can be reconfigured on the fly without having to
release and re-request it - which for the IrDA driver, allows us to
use DMA for SIR mode transmit without eating up three physical
channels.  As IrDA is half-duplex, we actually only need one physical
channel, and this architecture allows us to achieve that.

Signed-off-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
parent d65b4e98
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -252,6 +252,15 @@ config EP93XX_DMA
	help
	  Enable support for the Cirrus Logic EP93xx M2P/M2M DMA controller.

config DMA_SA11X0
	tristate "SA-11x0 DMA support"
	depends on ARCH_SA1100
	select DMA_ENGINE
	help
	  Support the DMA engine found on Intel StrongARM SA-1100 and
	  SA-1110 SoCs.  This DMA engine can only be used with on-chip
	  devices.

config DMA_ENGINE
	bool

+1 −0
Original line number Diff line number Diff line
@@ -27,3 +27,4 @@ obj-$(CONFIG_PL330_DMA) += pl330.o
obj-$(CONFIG_PCH_DMA) += pch_dma.o
obj-$(CONFIG_AMBA_PL08X) += amba-pl08x.o
obj-$(CONFIG_EP93XX_DMA) += ep93xx_dma.o
obj-$(CONFIG_DMA_SA11X0) += sa11x0-dma.o
+1109 −0

File added.

Preview size limit exceeded, changes collapsed.

+24 −0
Original line number Diff line number Diff line
/*
 * SA11x0 DMA Engine support
 *
 * Copyright (C) 2012 Russell King
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 */
#ifndef __LINUX_SA11X0_DMA_H
#define __LINUX_SA11X0_DMA_H

struct dma_chan;

#if defined(CONFIG_DMA_SA11X0) || defined(CONFIG_DMA_SA11X0_MODULE)
bool sa11x0_dma_filter_fn(struct dma_chan *, void *);
#else
static inline bool sa11x0_dma_filter_fn(struct dma_chan *c, void *d)
{
	return false;
}
#endif

#endif