[RFC 7/7][PATCH] AMBA DMA: Patch to implement AMBA DMA for the Versatile AACI.

[RFC 7/7][PATCH] AMBA DMA: Patch to implement AMBA DMA for the Versatile AACI.

Post by Peter Pear » Tue, 31 Oct 2006 21:10:10


rovides an example of use.
This patches completes the implementation of the example -
Audio playback via DMA on the Versatile board, which has an AMBA bus,
with an AMBA PL080 DMA controller and an AMBA PL041 Advanced Audio
Codec Interface.

Signed-off-by: Peter M Pearse < XXXX@XXXXX.COM >

---

diff -purN arm_amba_aaci/arch/arm/mach-versatile/Makefile
arm_amba_dma_versatile/arch/arm/mach-versatile/Makefile
--- arm_amba_aaci/arch/arm/mach-versatile/Makefile 2006-10-17
13:28:39.000000000 +0100
+++ arm_amba_dma_versatile/arch/arm/mach-versatile/Makefile 2006-10-18
08:41:54.000000000 +0100
@@ -6,3 +6,4 @@ obj-y := core.o clock.o
obj-$(CONFIG_ARCH_VERSATILE_PB) += versatile_pb.o
obj-$(CONFIG_MACH_VERSATILE_AB) += versatile_ab.o
obj-$(CONFIG_PCI) += pci.o
+obj-$(CONFIG_ARM_AMBA_DMA) += dma.o
diff -purN arm_amba_aaci/arch/arm/mach-versatile/core.c
arm_amba_dma_versatile/arch/arm/mach-versatile/core.c
--- arm_amba_aaci/arch/arm/mach-versatile/core.c 2006-10-17
13:28:39.000000000 +0100
+++ arm_amba_dma_versatile/arch/arm/mach-versatile/core.c 2006-10-18
08:41:54.000000000 +0100
@@ -47,13 +47,17 @@
#include "core.h"
#include "clock.h"

+#ifdef CONFIG_ARM_AMBA_DMA
+# include "dma.h"
+#endif
+
+
/*
* All IO addresses are mapped onto VA 0xFFFx.xxxx, where x.xxxx
* is the (PA >> 12).
*
* Setup a VA for the Versatile Vectored Interrupt Controller.
*/
-#define __io_address(n) __io(IO_ADDRESS(n))
#define VA_VIC_BASE __io_address(VERSATILE_VIC_BASE)
#define VA_SIC_BASE __io_address(VERSATILE_SIC_BASE)

@@ -704,7 +708,21 @@ AMBA_DEVICE(uart1, "dev:f2", UART1,
AMBA_DEVICE(uart2, "dev:f3", UART2, NULL);
AMBA_DEVICE(ssp0, "dev:f4", SSP, NULL);

-static struct amba_device *amba_devs[] __initdata = {
+
+
+/*
+ * These devices are common to Versatile AB && PB
+ */
+static struct amba_device *amba_devs[]
+
+#ifdef CONFIG_ARM_AMBA_DMA
+/*
+ * Do not discard - used by AMBA DMA code
+ */
+__initdata =
+#endif
+
+{
&dmac_device,
&uart0_device,
&uart1_device,
@@ -771,6 +789,16 @@ void __init versatile_init(void)
platform_device_register(&versatile_flash_device);
platform_device_register(&smc91x_device);

+#ifdef CONFIG_ARM_AMBA_DMA
+ /*
+ * Register structure with device
+ * for later use by DMAC controller
+ */
+ dmac_device.dmac_ops = &dmac_ops;
+#endif
+
+
+
for (i = 0; i < ARRAY_SIZE(amba_devs); i++) {
struct amba_device *d = amba_devs[i];
amba_device_register(d, &iomem_resource);
diff -purN arm_amba_aaci/arch/arm/mach-versatile/core.h
arm_amba_dma_versatile/arch/arm/mach-versatile/core.h
--- arm_amba_aaci/arch/arm/mach-versatile/core.h 2006-10-17
13:28:39.000000000 +0100
+++ arm_amba_dma_versatile/arch/arm/mach-versatile/core.h 2006-10-18
08:41:54.000000000 +0100
@@ -30,6 +30,12 @@ extern void __init versatile_map_io(void
extern struct sys_timer versatile_timer;
extern unsigned int mmc_status(struct device *dev);

+/*
+ * All IO addresses are mapped onto VA 0xFFFx.xxxx, where x.xxxx
+ * is the (PA >> 12).
+ */
+#define __io_address(n) __io(IO_ADDRESS(n))
+
#define AMBA_DEVICE(name,busid,base,plat) \
static struct amba_device name##_device = { \
.dev = { \
@@ -44,7 +50,6 @@ static struct amba_device name##_device
}, \
.dma_mask = ~0, \
.irq = base##_IRQ, \
- /* .dma = base##_DMA,*/ \
}

#endif
diff -purN