Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
dma.c
Go to the documentation of this file.
1 /*
2  * arch/arm/mach-ep93xx/dma.c
3  *
4  * Platform support code for the EP93xx dmaengine driver.
5  *
6  * Copyright (C) 2011 Mika Westerberg
7  *
8  * This work is based on the original dma-m2p implementation with
9  * following copyrights:
10  *
11  * Copyright (C) 2006 Lennert Buytenhek <[email protected]>
12  * Copyright (C) 2006 Applied Data Systems
13  * Copyright (C) 2009 Ryan Mallon <[email protected]>
14  *
15  * This program is free software; you can redistribute it and/or modify
16  * it under the terms of the GNU General Public License as published by
17  * the Free Software Foundation; either version 2 of the License, or (at
18  * your option) any later version.
19  */
20 
21 #include <linux/dmaengine.h>
22 #include <linux/dma-mapping.h>
23 #include <linux/init.h>
24 #include <linux/interrupt.h>
25 #include <linux/kernel.h>
26 #include <linux/platform_device.h>
27 
29 #include <mach/hardware.h>
30 
31 #include "soc.h"
32 
33 #define DMA_CHANNEL(_name, _base, _irq) \
34  { .name = (_name), .base = (_base), .irq = (_irq) }
35 
36 /*
37  * DMA M2P channels.
38  *
39  * On the EP93xx chip the following peripherals my be allocated to the 10
40  * Memory to Internal Peripheral (M2P) channels (5 transmit + 5 receive).
41  *
42  * I2S contains 3 Tx and 3 Rx DMA Channels
43  * AAC contains 3 Tx and 3 Rx DMA Channels
44  * UART1 contains 1 Tx and 1 Rx DMA Channels
45  * UART2 contains 1 Tx and 1 Rx DMA Channels
46  * UART3 contains 1 Tx and 1 Rx DMA Channels
47  * IrDA contains 1 Tx and 1 Rx DMA Channels
48  *
49  * Registers are mapped statically in ep93xx_map_io().
50  */
51 static struct ep93xx_dma_chan_data ep93xx_dma_m2p_channels[] = {
62 };
63 
64 static struct ep93xx_dma_platform_data ep93xx_dma_m2p_data = {
65  .channels = ep93xx_dma_m2p_channels,
66  .num_channels = ARRAY_SIZE(ep93xx_dma_m2p_channels),
67 };
68 
69 static struct platform_device ep93xx_dma_m2p_device = {
70  .name = "ep93xx-dma-m2p",
71  .id = -1,
72  .dev = {
73  .platform_data = &ep93xx_dma_m2p_data,
74  },
75 };
76 
77 /*
78  * DMA M2M channels.
79  *
80  * There are 2 M2M channels which support memcpy/memset and in addition simple
81  * hardware requests from/to SSP and IDE. We do not implement an external
82  * hardware requests.
83  *
84  * Registers are mapped statically in ep93xx_map_io().
85  */
86 static struct ep93xx_dma_chan_data ep93xx_dma_m2m_channels[] = {
89 };
90 
91 static struct ep93xx_dma_platform_data ep93xx_dma_m2m_data = {
92  .channels = ep93xx_dma_m2m_channels,
93  .num_channels = ARRAY_SIZE(ep93xx_dma_m2m_channels),
94 };
95 
96 static struct platform_device ep93xx_dma_m2m_device = {
97  .name = "ep93xx-dma-m2m",
98  .id = -1,
99  .dev = {
100  .platform_data = &ep93xx_dma_m2m_data,
101  },
102 };
103 
104 static int __init ep93xx_dma_init(void)
105 {
106  platform_device_register(&ep93xx_dma_m2p_device);
107  platform_device_register(&ep93xx_dma_m2m_device);
108  return 0;
109 }
110 arch_initcall(ep93xx_dma_init);