Skip to contentSkip to conversation

tegra: Add APB DMA support

PATCH New Colin Cross 1 participant 1 message Jul 30, 2010

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tegra: Add APB DMA support

From: Colin Cross <[email protected]>

The APB DMA block handles DMA transfers to and from some peripherals in the Tegra SOC. It reads from sequential addresses on the memory bus, and writes repeatedly to the same address on the APB bus.

Two transfer modes are supported, oneshot for transferring a known size to or from a peripheral, and continuous for streaming data. In continuous mode, a callback occurs when the buffer is half full to allow the existing data to be handled and a new request queued.x

---
 arch/arm/mach-tegra/Kconfig            |    7 +
 arch/arm/mach-tegra/Makefile           |    1 +
 arch/arm/mach-tegra/common.c           |    7 +
 arch/arm/mach-tegra/dma.c              |  752 ++++++++++++++++++++++++++++++++
 arch/arm/mach-tegra/include/mach/dma.h |  155 +++++++
 5 files changed, 922 insertions(+), 0 deletions(-)
 create mode 100644 arch/arm/mach-tegra/dma.c
 create mode 100644 arch/arm/mach-tegra/include/mach/dma.h
arch/arm/mach-tegra/Kconfig +7 -0
index a57713c..8e32d9d 100644
@@ -47,4 +47,11 @@ config TEGRA_DEBUG_UARTE
 
 endchoice
 
+config TEGRA_SYSTEM_DMA
+	bool "Enable system DMA driver for NVIDIA Tegra SoCs"
+	default y
+	help
+	  Adds system DMA functionality for NVIDIA Tegra SoCs, used by
+	  several Tegra device drivers
+
 endif
arch/arm/mach-tegra/Makefile +1 -0
index 2a37621..fc069a9 100644
@@ -12,6 +12,7 @@ obj-$(CONFIG_ARCH_TEGRA_2x_SOC)         += tegra2_dvfs.o
 obj-$(CONFIG_ARCH_TEGRA_2x_SOC)		+= pinmux-t2-tables.o
 obj-$(CONFIG_SMP)                       += platsmp.o localtimer.o headsmp.o
 obj-$(CONFIG_HOTPLUG_CPU)               += hotplug.o
+obj-$(CONFIG_TEGRA_SYSTEM_DMA)		+= dma.o
 obj-$(CONFIG_CPU_FREQ)                  += cpu-tegra.o
 
 obj-${CONFIG_MACH_HARMONY}              += board-harmony.o
arch/arm/mach-tegra/common.c +7 -0
index 445104a..7c91e2b 100644
@@ -19,10 +19,13 @@
 
 #include <linux/init.h>
 #include <linux/io.h>
+#include <linux/clk.h>
+#include <linux/delay.h>
 
 #include <asm/hardware/cache-l2x0.h>
 
 #include <mach/iomap.h>
+#include <mach/dma.h>
 
 #include "board.h"
 #include "clock.h"
@@ -52,6 +55,7 @@ void __init tegra_init_cache(void)
 
 	l2x0_init(p, 0x6C080001, 0x8200c3fe);
 #endif
+
 }
 
 void __init tegra_common_init(void)
@@ -60,4 +64,7 @@ void __init tegra_common_init(void)
 	tegra_init_clock();
 	tegra_clk_init_from_table(common_clk_init_table);
 	tegra_init_cache();
+#ifdef CONFIG_TEGRA_SYSTEM_DMA
+	tegra_dma_init();
+#endif
 }
arch/arm/mach-tegra/dma.c new file +752 -0

752 lines not on this page · raw message

arch/arm/mach-tegra/include/mach/dma.h new file +155 -0

155 lines not on this page · raw message

Signature · 1 line
1.7.1