aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2013-06-20 10:43:11 -0400
committerArnd Bergmann <arnd@arndb.de>2013-06-20 10:43:11 -0400
commit3c373f9983f5531c10c29ae1e3136371c8949140 (patch)
tree56649c7c898b89afe2e2dc3bfd5336231d3e2da6
parent0a15e0b5b9342fd7fb3f40b24872c174b0e402ea (diff)
parente2081f96ba1be3aa22a44daec82af9b226a6d7d6 (diff)
Merge tag 'omap-for-v3.11/dma-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into next/cleanup
From Tony Lindgren: Non-critical omap DMA fixes and removal of unused legacy code. * tag 'omap-for-v3.11/dma-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap: ARM: OMAP1: Remove dma.h ARM: OMAP1: Remove legacy irda.h and irda setup from board files ARM: OMAP1: Remove duplicated DMA channel definitions ARM: OMAP1: Remove McBSP DMA channel definitions ARM: OMAP2+: Remove dma.h ARM: OMAP2+: hwmod: Remove remaining DMA channel definitions ARM: OMAP2+: Remove duplicated DMA channel definitions ARM: OMAP2+: Remove AES crypto device DMA channel definitions ARM: OMAP: dma: Remove the erroneous freeing of platform data ARM: OMAP: dma: Fix the dma_chan_link_map init order ARM: OMAP: dma: Remove the wrong dev_id check Signed-off-by: Arnd Bergmann <arnd@arndb.de>
-rw-r--r--arch/arm/mach-omap1/board-h2.c36
-rw-r--r--arch/arm/mach-omap1/board-palmte.c31
-rw-r--r--arch/arm/mach-omap1/board-palmtt.c30
-rw-r--r--arch/arm/mach-omap1/board-palmz71.c31
-rw-r--r--arch/arm/mach-omap1/board-sx1.c36
-rw-r--r--arch/arm/mach-omap1/devices.c9
-rw-r--r--arch/arm/mach-omap1/dma.c2
-rw-r--r--arch/arm/mach-omap1/dma.h42
-rw-r--r--arch/arm/mach-omap1/include/mach/irda.h33
-rw-r--r--arch/arm/mach-omap1/lcd_dma.c2
-rw-r--r--arch/arm/mach-omap1/mcbsp.c33
-rw-r--r--arch/arm/mach-omap2/devices.c1
-rw-r--r--arch/arm/mach-omap2/dma.h61
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_2xxx_3xxx_ipblock_data.c21
-rw-r--r--arch/arm/mach-omap2/omap_hwmod_3xxx_data.c19
-rw-r--r--arch/arm/plat-omap/dma.c11
16 files changed, 43 insertions, 355 deletions
diff --git a/arch/arm/mach-omap1/board-h2.c b/arch/arm/mach-omap1/board-h2.c
index 0dac3d239e32..fd90cafc2e36 100644
--- a/arch/arm/mach-omap1/board-h2.c
+++ b/arch/arm/mach-omap1/board-h2.c
@@ -41,7 +41,6 @@
41#include <mach/mux.h> 41#include <mach/mux.h>
42#include <linux/omap-dma.h> 42#include <linux/omap-dma.h>
43#include <mach/tc.h> 43#include <mach/tc.h>
44#include <mach/irda.h>
45#include <linux/platform_data/keypad-omap.h> 44#include <linux/platform_data/keypad-omap.h>
46#include <mach/flash.h> 45#include <mach/flash.h>
47 46
@@ -50,7 +49,6 @@
50 49
51#include "common.h" 50#include "common.h"
52#include "board-h2.h" 51#include "board-h2.h"
53#include "dma.h"
54 52
55/* At OMAP1610 Innovator the Ethernet is directly connected to CS1 */ 53/* At OMAP1610 Innovator the Ethernet is directly connected to CS1 */
56#define OMAP1610_ETHR_START 0x04000300 54#define OMAP1610_ETHR_START 0x04000300
@@ -276,39 +274,6 @@ static struct platform_device h2_kp_device = {
276 .resource = h2_kp_resources, 274 .resource = h2_kp_resources,
277}; 275};
278 276
279#define H2_IRDA_FIRSEL_GPIO_PIN 17
280
281static struct omap_irda_config h2_irda_data = {
282 .transceiver_cap = IR_SIRMODE | IR_MIRMODE | IR_FIRMODE,
283 .rx_channel = OMAP_DMA_UART3_RX,
284 .tx_channel = OMAP_DMA_UART3_TX,
285 .dest_start = UART3_THR,
286 .src_start = UART3_RHR,
287 .tx_trigger = 0,
288 .rx_trigger = 0,
289};
290
291static struct resource h2_irda_resources[] = {
292 [0] = {
293 .start = INT_UART3,
294 .end = INT_UART3,
295 .flags = IORESOURCE_IRQ,
296 },
297};
298
299static u64 irda_dmamask = 0xffffffff;
300
301static struct platform_device h2_irda_device = {
302 .name = "omapirda",
303 .id = 0,
304 .dev = {
305 .platform_data = &h2_irda_data,
306 .dma_mask = &irda_dmamask,
307 },
308 .num_resources = ARRAY_SIZE(h2_irda_resources),
309 .resource = h2_irda_resources,
310};
311
312static struct gpio_led h2_gpio_led_pins[] = { 277static struct gpio_led h2_gpio_led_pins[] = {
313 { 278 {
314 .name = "h2:red", 279 .name = "h2:red",
@@ -339,7 +304,6 @@ static struct platform_device *h2_devices[] __initdata = {
339 &h2_nor_device, 304 &h2_nor_device,
340 &h2_nand_device, 305 &h2_nand_device,
341 &h2_smc91x_device, 306 &h2_smc91x_device,
342 &h2_irda_device,
343 &h2_kp_device, 307 &h2_kp_device,
344 &h2_gpio_leds, 308 &h2_gpio_leds,
345}; 309};
diff --git a/arch/arm/mach-omap1/board-palmte.c b/arch/arm/mach-omap1/board-palmte.c
index 845a1a7aef95..3b8e98f4353c 100644
--- a/arch/arm/mach-omap1/board-palmte.c
+++ b/arch/arm/mach-omap1/board-palmte.c
@@ -38,14 +38,12 @@
38#include <mach/mux.h> 38#include <mach/mux.h>
39#include <mach/tc.h> 39#include <mach/tc.h>
40#include <linux/omap-dma.h> 40#include <linux/omap-dma.h>
41#include <mach/irda.h>
42#include <linux/platform_data/keypad-omap.h> 41#include <linux/platform_data/keypad-omap.h>
43 42
44#include <mach/hardware.h> 43#include <mach/hardware.h>
45#include <mach/usb.h> 44#include <mach/usb.h>
46 45
47#include "common.h" 46#include "common.h"
48#include "dma.h"
49 47
50#define PALMTE_USBDETECT_GPIO 0 48#define PALMTE_USBDETECT_GPIO 0
51#define PALMTE_USB_OR_DC_GPIO 1 49#define PALMTE_USB_OR_DC_GPIO 1
@@ -167,40 +165,11 @@ static struct platform_device palmte_backlight_device = {
167 }, 165 },
168}; 166};
169 167
170static struct omap_irda_config palmte_irda_config = {
171 .transceiver_cap = IR_SIRMODE,
172 .rx_channel = OMAP_DMA_UART3_RX,
173 .tx_channel = OMAP_DMA_UART3_TX,
174 .dest_start = UART3_THR,
175 .src_start = UART3_RHR,
176 .tx_trigger = 0,
177 .rx_trigger = 0,
178};
179
180static struct resource palmte_irda_resources[] = {
181 [0] = {
182 .start = INT_UART3,
183 .end = INT_UART3,
184 .flags = IORESOURCE_IRQ,
185 },
186};
187
188static struct platform_device palmte_irda_device = {
189 .name = "omapirda",
190 .id = -1,
191 .dev = {
192 .platform_data = &palmte_irda_config,
193 },
194 .num_resources = ARRAY_SIZE(palmte_irda_resources),
195 .resource = palmte_irda_resources,
196};
197
198static struct platform_device *palmte_devices[] __initdata = { 168static struct platform_device *palmte_devices[] __initdata = {
199 &palmte_rom_device, 169 &palmte_rom_device,
200 &palmte_kp_device, 170 &palmte_kp_device,
201 &palmte_lcd_device, 171 &palmte_lcd_device,
202 &palmte_backlight_device, 172 &palmte_backlight_device,
203 &palmte_irda_device,
204}; 173};
205 174
206static struct omap_usb_config palmte_usb_config __initdata = { 175static struct omap_usb_config palmte_usb_config __initdata = {
diff --git a/arch/arm/mach-omap1/board-palmtt.c b/arch/arm/mach-omap1/board-palmtt.c
index 65a4a3e357f2..ca501208825f 100644
--- a/arch/arm/mach-omap1/board-palmtt.c
+++ b/arch/arm/mach-omap1/board-palmtt.c
@@ -38,14 +38,12 @@
38#include <mach/mux.h> 38#include <mach/mux.h>
39#include <linux/omap-dma.h> 39#include <linux/omap-dma.h>
40#include <mach/tc.h> 40#include <mach/tc.h>
41#include <mach/irda.h>
42#include <linux/platform_data/keypad-omap.h> 41#include <linux/platform_data/keypad-omap.h>
43 42
44#include <mach/hardware.h> 43#include <mach/hardware.h>
45#include <mach/usb.h> 44#include <mach/usb.h>
46 45
47#include "common.h" 46#include "common.h"
48#include "dma.h"
49 47
50#define PALMTT_USBDETECT_GPIO 0 48#define PALMTT_USBDETECT_GPIO 0
51#define PALMTT_CABLE_GPIO 1 49#define PALMTT_CABLE_GPIO 1
@@ -163,33 +161,6 @@ static struct platform_device palmtt_lcd_device = {
163 .name = "lcd_palmtt", 161 .name = "lcd_palmtt",
164 .id = -1, 162 .id = -1,
165}; 163};
166static struct omap_irda_config palmtt_irda_config = {
167 .transceiver_cap = IR_SIRMODE,
168 .rx_channel = OMAP_DMA_UART3_RX,
169 .tx_channel = OMAP_DMA_UART3_TX,
170 .dest_start = UART3_THR,
171 .src_start = UART3_RHR,
172 .tx_trigger = 0,
173 .rx_trigger = 0,
174};
175
176static struct resource palmtt_irda_resources[] = {
177 [0] = {
178 .start = INT_UART3,
179 .end = INT_UART3,
180 .flags = IORESOURCE_IRQ,
181 },
182};
183
184static struct platform_device palmtt_irda_device = {
185 .name = "omapirda",
186 .id = -1,
187 .dev = {
188 .platform_data = &palmtt_irda_config,
189 },
190 .num_resources = ARRAY_SIZE(palmtt_irda_resources),
191 .resource = palmtt_irda_resources,
192};
193 164
194static struct platform_device palmtt_spi_device = { 165static struct platform_device palmtt_spi_device = {
195 .name = "spi_palmtt", 166 .name = "spi_palmtt",
@@ -234,7 +205,6 @@ static struct platform_device *palmtt_devices[] __initdata = {
234 &palmtt_flash_device, 205 &palmtt_flash_device,
235 &palmtt_kp_device, 206 &palmtt_kp_device,
236 &palmtt_lcd_device, 207 &palmtt_lcd_device,
237 &palmtt_irda_device,
238 &palmtt_spi_device, 208 &palmtt_spi_device,
239 &palmtt_backlight_device, 209 &palmtt_backlight_device,
240 &palmtt_led_device, 210 &palmtt_led_device,
diff --git a/arch/arm/mach-omap1/board-palmz71.c b/arch/arm/mach-omap1/board-palmz71.c
index 01c970071fd8..470e12d67360 100644
--- a/arch/arm/mach-omap1/board-palmz71.c
+++ b/arch/arm/mach-omap1/board-palmz71.c
@@ -40,14 +40,12 @@
40#include <mach/mux.h> 40#include <mach/mux.h>
41#include <linux/omap-dma.h> 41#include <linux/omap-dma.h>
42#include <mach/tc.h> 42#include <mach/tc.h>
43#include <mach/irda.h>
44#include <linux/platform_data/keypad-omap.h> 43#include <linux/platform_data/keypad-omap.h>
45 44
46#include <mach/hardware.h> 45#include <mach/hardware.h>
47#include <mach/usb.h> 46#include <mach/usb.h>
48 47
49#include "common.h" 48#include "common.h"
50#include "dma.h"
51 49
52#define PALMZ71_USBDETECT_GPIO 0 50#define PALMZ71_USBDETECT_GPIO 0
53#define PALMZ71_PENIRQ_GPIO 6 51#define PALMZ71_PENIRQ_GPIO 6
@@ -153,34 +151,6 @@ static struct platform_device palmz71_lcd_device = {
153 .id = -1, 151 .id = -1,
154}; 152};
155 153
156static struct omap_irda_config palmz71_irda_config = {
157 .transceiver_cap = IR_SIRMODE,
158 .rx_channel = OMAP_DMA_UART3_RX,
159 .tx_channel = OMAP_DMA_UART3_TX,
160 .dest_start = UART3_THR,
161 .src_start = UART3_RHR,
162 .tx_trigger = 0,
163 .rx_trigger = 0,
164};
165
166static struct resource palmz71_irda_resources[] = {
167 [0] = {
168 .start = INT_UART3,
169 .end = INT_UART3,
170 .flags = IORESOURCE_IRQ,
171 },
172};
173
174static struct platform_device palmz71_irda_device = {
175 .name = "omapirda",
176 .id = -1,
177 .dev = {
178 .platform_data = &palmz71_irda_config,
179 },
180 .num_resources = ARRAY_SIZE(palmz71_irda_resources),
181 .resource = palmz71_irda_resources,
182};
183
184static struct platform_device palmz71_spi_device = { 154static struct platform_device palmz71_spi_device = {
185 .name = "spi_palmz71", 155 .name = "spi_palmz71",
186 .id = -1, 156 .id = -1,
@@ -202,7 +172,6 @@ static struct platform_device *devices[] __initdata = {
202 &palmz71_rom_device, 172 &palmz71_rom_device,
203 &palmz71_kp_device, 173 &palmz71_kp_device,
204 &palmz71_lcd_device, 174 &palmz71_lcd_device,
205 &palmz71_irda_device,
206 &palmz71_spi_device, 175 &palmz71_spi_device,
207 &palmz71_backlight_device, 176 &palmz71_backlight_device,
208}; 177};
diff --git a/arch/arm/mach-omap1/board-sx1.c b/arch/arm/mach-omap1/board-sx1.c
index 9732a98f3e06..0a8d3349149c 100644
--- a/arch/arm/mach-omap1/board-sx1.c
+++ b/arch/arm/mach-omap1/board-sx1.c
@@ -37,7 +37,6 @@
37#include <mach/flash.h> 37#include <mach/flash.h>
38#include <mach/mux.h> 38#include <mach/mux.h>
39#include <linux/omap-dma.h> 39#include <linux/omap-dma.h>
40#include <mach/irda.h>
41#include <mach/tc.h> 40#include <mach/tc.h>
42#include <mach/board-sx1.h> 41#include <mach/board-sx1.h>
43 42
@@ -45,7 +44,6 @@
45#include <mach/usb.h> 44#include <mach/usb.h>
46 45
47#include "common.h" 46#include "common.h"
48#include "dma.h"
49 47
50/* Write to I2C device */ 48/* Write to I2C device */
51int sx1_i2c_write_byte(u8 devaddr, u8 regoffset, u8 value) 49int sx1_i2c_write_byte(u8 devaddr, u8 regoffset, u8 value)
@@ -228,39 +226,6 @@ static struct platform_device sx1_kp_device = {
228 .resource = sx1_kp_resources, 226 .resource = sx1_kp_resources,
229}; 227};
230 228
231/*----------- IRDA -------------------------*/
232
233static struct omap_irda_config sx1_irda_data = {
234 .transceiver_cap = IR_SIRMODE,
235 .rx_channel = OMAP_DMA_UART3_RX,
236 .tx_channel = OMAP_DMA_UART3_TX,
237 .dest_start = UART3_THR,
238 .src_start = UART3_RHR,
239 .tx_trigger = 0,
240 .rx_trigger = 0,
241};
242
243static struct resource sx1_irda_resources[] = {
244 [0] = {
245 .start = INT_UART3,
246 .end = INT_UART3,
247 .flags = IORESOURCE_IRQ,
248 },
249};
250
251static u64 irda_dmamask = 0xffffffff;
252
253static struct platform_device sx1_irda_device = {
254 .name = "omapirda",
255 .id = 0,
256 .dev = {
257 .platform_data = &sx1_irda_data,
258 .dma_mask = &irda_dmamask,
259 },
260 .num_resources = ARRAY_SIZE(sx1_irda_resources),
261 .resource = sx1_irda_resources,
262};
263
264/*----------- MTD -------------------------*/ 229/*----------- MTD -------------------------*/
265 230
266static struct mtd_partition sx1_partitions[] = { 231static struct mtd_partition sx1_partitions[] = {
@@ -366,7 +331,6 @@ static struct omap_lcd_config sx1_lcd_config __initdata = {
366static struct platform_device *sx1_devices[] __initdata = { 331static struct platform_device *sx1_devices[] __initdata = {
367 &sx1_flash_device, 332 &sx1_flash_device,
368 &sx1_kp_device, 333 &sx1_kp_device,
369 &sx1_irda_device,
370}; 334};
371 335
372/*-----------------------------------------*/ 336/*-----------------------------------------*/
diff --git a/arch/arm/mach-omap1/devices.c b/arch/arm/mach-omap1/devices.c
index 0af635205e8a..325e6030095e 100644
--- a/arch/arm/mach-omap1/devices.c
+++ b/arch/arm/mach-omap1/devices.c
@@ -30,7 +30,6 @@
30 30
31#include "common.h" 31#include "common.h"
32#include "clock.h" 32#include "clock.h"
33#include "dma.h"
34#include "mmc.h" 33#include "mmc.h"
35#include "sram.h" 34#include "sram.h"
36 35
@@ -223,16 +222,16 @@ void __init omap1_init_mmc(struct omap_mmc_platform_data **mmc_data,
223 case 0: 222 case 0:
224 base = OMAP1_MMC1_BASE; 223 base = OMAP1_MMC1_BASE;
225 irq = INT_MMC; 224 irq = INT_MMC;
226 rx_req = OMAP_DMA_MMC_RX; 225 rx_req = 22;
227 tx_req = OMAP_DMA_MMC_TX; 226 tx_req = 21;
228 break; 227 break;
229 case 1: 228 case 1:
230 if (!cpu_is_omap16xx()) 229 if (!cpu_is_omap16xx())
231 return; 230 return;
232 base = OMAP1_MMC2_BASE; 231 base = OMAP1_MMC2_BASE;
233 irq = INT_1610_MMC2; 232 irq = INT_1610_MMC2;
234 rx_req = OMAP_DMA_MMC2_RX; 233 rx_req = 55;
235 tx_req = OMAP_DMA_MMC2_TX; 234 tx_req = 54;
236 break; 235 break;
237 default: 236 default:
238 continue; 237 continue;
diff --git a/arch/arm/mach-omap1/dma.c b/arch/arm/mach-omap1/dma.c
index a94b3a718d1a..5bb8ce86d54b 100644
--- a/arch/arm/mach-omap1/dma.c
+++ b/arch/arm/mach-omap1/dma.c
@@ -30,8 +30,6 @@
30 30
31#include <mach/irqs.h> 31#include <mach/irqs.h>
32 32
33#include "dma.h"
34
35#define OMAP1_DMA_BASE (0xfffed800) 33#define OMAP1_DMA_BASE (0xfffed800)
36#define OMAP1_LOGICAL_DMA_CH_COUNT 17 34#define OMAP1_LOGICAL_DMA_CH_COUNT 17
37#define OMAP1_DMA_STRIDE 0x40 35#define OMAP1_DMA_STRIDE 0x40
diff --git a/arch/arm/mach-omap1/dma.h b/arch/arm/mach-omap1/dma.h
deleted file mode 100644
index d05909c96715..000000000000
--- a/arch/arm/mach-omap1/dma.h
+++ /dev/null
@@ -1,42 +0,0 @@
1/*
2 * OMAP1 DMA channel definitions
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18
19#ifndef __OMAP1_DMA_CHANNEL_H
20#define __OMAP1_DMA_CHANNEL_H
21
22/* DMA channels for omap1 */
23#define OMAP_DMA_NO_DEVICE 0
24#define OMAP_DMA_MCBSP1_TX 8
25#define OMAP_DMA_MCBSP1_RX 9
26#define OMAP_DMA_MCBSP3_TX 10
27#define OMAP_DMA_MCBSP3_RX 11
28#define OMAP_DMA_MCBSP2_TX 16
29#define OMAP_DMA_MCBSP2_RX 17
30#define OMAP_DMA_UART3_TX 18
31#define OMAP_DMA_UART3_RX 19
32#define OMAP_DMA_CAMERA_IF_RX 20
33#define OMAP_DMA_MMC_TX 21
34#define OMAP_DMA_MMC_RX 22
35#define OMAP_DMA_USB_W2FC_RX0 26
36#define OMAP_DMA_USB_W2FC_TX0 29
37
38/* These are only for 1610 */
39#define OMAP_DMA_MMC2_TX 54
40#define OMAP_DMA_MMC2_RX 55
41
42#endif /* __OMAP1_DMA_CHANNEL_H */
diff --git a/arch/arm/mach-omap1/include/mach/irda.h b/arch/arm/mach-omap1/include/mach/irda.h
deleted file mode 100644
index 40f60339d1c6..000000000000
--- a/arch/arm/mach-omap1/include/mach/irda.h
+++ /dev/null
@@ -1,33 +0,0 @@
1/*
2 * arch/arm/plat-omap/include/mach/irda.h
3 *
4 * Copyright (C) 2005-2006 Komal Shah <komal_shah802003@yahoo.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#ifndef ASMARM_ARCH_IRDA_H
11#define ASMARM_ARCH_IRDA_H
12
13/* board specific transceiver capabilities */
14
15#define IR_SEL 1 /* Selects IrDA */
16#define IR_SIRMODE 2
17#define IR_FIRMODE 4
18#define IR_MIRMODE 8
19
20struct omap_irda_config {
21 int transceiver_cap;
22 int (*transceiver_mode)(struct device *dev, int mode);
23 int (*select_irda)(struct device *dev, int state);
24 int rx_channel;
25 int tx_channel;
26 unsigned long dest_start;
27 unsigned long src_start;
28 int tx_trigger;
29 int rx_trigger;
30 int mode;
31};
32
33#endif
diff --git a/arch/arm/mach-omap1/lcd_dma.c b/arch/arm/mach-omap1/lcd_dma.c
index 77924be37d41..26a2b01c7c4f 100644
--- a/arch/arm/mach-omap1/lcd_dma.c
+++ b/arch/arm/mach-omap1/lcd_dma.c
@@ -32,8 +32,6 @@
32#include <mach/hardware.h> 32#include <mach/hardware.h>
33#include <mach/lcdc.h> 33#include <mach/lcdc.h>
34 34
35#include "dma.h"
36
37int omap_lcd_dma_running(void) 35int omap_lcd_dma_running(void)
38{ 36{
39 /* 37 /*
diff --git a/arch/arm/mach-omap1/mcbsp.c b/arch/arm/mach-omap1/mcbsp.c
index b0d4723c9a90..8ed67f8d1762 100644
--- a/arch/arm/mach-omap1/mcbsp.c
+++ b/arch/arm/mach-omap1/mcbsp.c
@@ -27,7 +27,6 @@
27#include <mach/irqs.h> 27#include <mach/irqs.h>
28 28
29#include "iomap.h" 29#include "iomap.h"
30#include "dma.h"
31 30
32#define DPS_RSTCT2_PER_EN (1 << 0) 31#define DPS_RSTCT2_PER_EN (1 << 0)
33#define DSP_RSTCT2_WD_PER_EN (1 << 1) 32#define DSP_RSTCT2_WD_PER_EN (1 << 1)
@@ -114,12 +113,12 @@ struct resource omap7xx_mcbsp_res[][6] = {
114 }, 113 },
115 { 114 {
116 .name = "rx", 115 .name = "rx",
117 .start = OMAP_DMA_MCBSP1_RX, 116 .start = 9,
118 .flags = IORESOURCE_DMA, 117 .flags = IORESOURCE_DMA,
119 }, 118 },
120 { 119 {
121 .name = "tx", 120 .name = "tx",
122 .start = OMAP_DMA_MCBSP1_TX, 121 .start = 8,
123 .flags = IORESOURCE_DMA, 122 .flags = IORESOURCE_DMA,
124 }, 123 },
125 }, 124 },
@@ -141,12 +140,12 @@ struct resource omap7xx_mcbsp_res[][6] = {
141 }, 140 },
142 { 141 {
143 .name = "rx", 142 .name = "rx",
144 .start = OMAP_DMA_MCBSP3_RX, 143 .start = 11,
145 .flags = IORESOURCE_DMA, 144 .flags = IORESOURCE_DMA,
146 }, 145 },
147 { 146 {
148 .name = "tx", 147 .name = "tx",
149 .start = OMAP_DMA_MCBSP3_TX, 148 .start = 10,
150 .flags = IORESOURCE_DMA, 149 .flags = IORESOURCE_DMA,
151 }, 150 },
152 }, 151 },
@@ -191,12 +190,12 @@ struct resource omap15xx_mcbsp_res[][6] = {
191 }, 190 },
192 { 191 {
193 .name = "rx", 192 .name = "rx",
194 .start = OMAP_DMA_MCBSP1_RX, 193 .start = 9,
195 .flags = IORESOURCE_DMA, 194 .flags = IORESOURCE_DMA,
196 }, 195 },
197 { 196 {
198 .name = "tx", 197 .name = "tx",
199 .start = OMAP_DMA_MCBSP1_TX, 198 .start = 8,
200 .flags = IORESOURCE_DMA, 199 .flags = IORESOURCE_DMA,
201 }, 200 },
202 }, 201 },
@@ -218,12 +217,12 @@ struct resource omap15xx_mcbsp_res[][6] = {
218 }, 217 },
219 { 218 {
220 .name = "rx", 219 .name = "rx",
221 .start = OMAP_DMA_MCBSP2_RX, 220 .start = 17,
222 .flags = IORESOURCE_DMA, 221 .flags = IORESOURCE_DMA,
223 }, 222 },
224 { 223 {
225 .name = "tx", 224 .name = "tx",
226 .start = OMAP_DMA_MCBSP2_TX, 225 .start = 16,
227 .flags = IORESOURCE_DMA, 226 .flags = IORESOURCE_DMA,
228 }, 227 },
229 }, 228 },
@@ -245,12 +244,12 @@ struct resource omap15xx_mcbsp_res[][6] = {
245 }, 244 },
246 { 245 {
247 .name = "rx", 246 .name = "rx",
248 .start = OMAP_DMA_MCBSP3_RX, 247 .start = 11,
249 .flags = IORESOURCE_DMA, 248 .flags = IORESOURCE_DMA,
250 }, 249 },
251 { 250 {
252 .name = "tx", 251 .name = "tx",
253 .start = OMAP_DMA_MCBSP3_TX, 252 .start = 10,
254 .flags = IORESOURCE_DMA, 253 .flags = IORESOURCE_DMA,
255 }, 254 },
256 }, 255 },
@@ -298,12 +297,12 @@ struct resource omap16xx_mcbsp_res[][6] = {
298 }, 297 },
299 { 298 {
300 .name = "rx", 299 .name = "rx",
301 .start = OMAP_DMA_MCBSP1_RX, 300 .start = 9,
302 .flags = IORESOURCE_DMA, 301 .flags = IORESOURCE_DMA,
303 }, 302 },
304 { 303 {
305 .name = "tx", 304 .name = "tx",
306 .start = OMAP_DMA_MCBSP1_TX, 305 .start = 8,
307 .flags = IORESOURCE_DMA, 306 .flags = IORESOURCE_DMA,
308 }, 307 },
309 }, 308 },
@@ -325,12 +324,12 @@ struct resource omap16xx_mcbsp_res[][6] = {
325 }, 324 },
326 { 325 {
327 .name = "rx", 326 .name = "rx",
328 .start = OMAP_DMA_MCBSP2_RX, 327 .start = 17,
329 .flags = IORESOURCE_DMA, 328 .flags = IORESOURCE_DMA,
330 }, 329 },
331 { 330 {
332 .name = "tx", 331 .name = "tx",
333 .start = OMAP_DMA_MCBSP2_TX, 332 .start = 16,
334 .flags = IORESOURCE_DMA, 333 .flags = IORESOURCE_DMA,
335 }, 334 },
336 }, 335 },
@@ -352,12 +351,12 @@ struct resource omap16xx_mcbsp_res[][6] = {
352 }, 351 },
353 { 352 {
354 .name = "rx", 353 .name = "rx",
355 .start = OMAP_DMA_MCBSP3_RX, 354 .start = 11,
356 .flags = IORESOURCE_DMA, 355 .flags = IORESOURCE_DMA,
357 }, 356 },
358 { 357 {
359 .name = "tx", 358 .name = "tx",
360 .start = OMAP_DMA_MCBSP3_TX, 359 .start = 10,
361 .flags = IORESOURCE_DMA, 360 .flags = IORESOURCE_DMA,
362 }, 361 },
363 }, 362 },
diff --git a/arch/arm/mach-omap2/devices.c b/arch/arm/mach-omap2/devices.c
index 721da484d8ec..f874a3da8917 100644
--- a/arch/arm/mach-omap2/devices.c
+++ b/arch/arm/mach-omap2/devices.c
@@ -37,7 +37,6 @@
37#include "mux.h" 37#include "mux.h"
38#include "control.h" 38#include "control.h"
39#include "devices.h" 39#include "devices.h"
40#include "dma.h"
41 40
42#define L3_MODULES_MAX_LEN 12 41#define L3_MODULES_MAX_LEN 12
43#define L3_MODULES 3 42#define L3_MODULES 3
diff --git a/arch/arm/mach-omap2/dma.h b/arch/arm/mach-omap2/dma.h
deleted file mode 100644
index 65f80cacf178..000000000000
--- a/arch/arm/mach-omap2/dma.h
+++ /dev/null
@@ -1,61 +0,0 @@
1/*
2 * OMAP2PLUS DMA channel definitions
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 */
18
19#ifndef __OMAP2PLUS_DMA_CHANNEL_H
20#define __OMAP2PLUS_DMA_CHANNEL_H
21
22
23/* DMA channels for 24xx */
24#define OMAP24XX_DMA_NO_DEVICE 0
25#define OMAP24XX_DMA_EXT_DMAREQ0 2 /* S_DMA_1 */
26#define OMAP24XX_DMA_EXT_DMAREQ1 3 /* S_DMA_2 */
27#define OMAP24XX_DMA_GPMC 4 /* S_DMA_3 */
28#define OMAP24XX_DMA_AES_TX 9 /* S_DMA_8 */
29#define OMAP24XX_DMA_AES_RX 10 /* S_DMA_9 */
30#define OMAP242X_DMA_EXT_DMAREQ2 14 /* S_DMA_13 */
31#define OMAP242X_DMA_EXT_DMAREQ3 15 /* S_DMA_14 */
32#define OMAP242X_DMA_EXT_DMAREQ4 16 /* S_DMA_15 */
33#define OMAP34XX_DMA_I2C3_TX 25 /* S_DMA_24 */
34#define OMAP34XX_DMA_I2C3_RX 26 /* S_DMA_25 */
35#define OMAP24XX_DMA_I2C1_TX 27 /* S_DMA_26 */
36#define OMAP24XX_DMA_I2C1_RX 28 /* S_DMA_27 */
37#define OMAP24XX_DMA_I2C2_TX 29 /* S_DMA_28 */
38#define OMAP24XX_DMA_I2C2_RX 30 /* S_DMA_29 */
39#define OMAP24XX_DMA_MMC2_TX 47 /* S_DMA_46 */
40#define OMAP24XX_DMA_MMC2_RX 48 /* S_DMA_47 */
41#define OMAP24XX_DMA_UART1_TX 49 /* S_DMA_48 */
42#define OMAP24XX_DMA_UART1_RX 50 /* S_DMA_49 */
43#define OMAP24XX_DMA_UART2_TX 51 /* S_DMA_50 */
44#define OMAP24XX_DMA_UART2_RX 52 /* S_DMA_51 */
45#define OMAP24XX_DMA_UART3_TX 53 /* S_DMA_52 */
46#define OMAP24XX_DMA_UART3_RX 54 /* S_DMA_53 */
47#define OMAP24XX_DMA_MMC1_TX 61 /* S_DMA_60 */
48#define OMAP24XX_DMA_MMC1_RX 62 /* S_DMA_61 */
49#define OMAP242X_DMA_EXT_DMAREQ5 64 /* S_DMA_63 */
50#define OMAP34XX_DMA_AES2_TX 65 /* S_DMA_64 */
51#define OMAP34XX_DMA_AES2_RX 66 /* S_DMA_65 */
52#define OMAP34XX_DMA_SHA1MD5_RX 69 /* S_DMA_68 */
53
54#define OMAP36XX_DMA_UART4_TX 81 /* S_DMA_80 */
55#define OMAP36XX_DMA_UART4_RX 82 /* S_DMA_81 */
56
57/* Only for AM35xx */
58#define AM35XX_DMA_UART4_TX 54
59#define AM35XX_DMA_UART4_RX 55
60
61#endif /* __OMAP2PLUS_DMA_CHANNEL_H */
diff --git a/arch/arm/mach-omap2/omap_hwmod_2xxx_3xxx_ipblock_data.c b/arch/arm/mach-omap2/omap_hwmod_2xxx_3xxx_ipblock_data.c
index 534974e08add..5da7a42a6d90 100644
--- a/arch/arm/mach-omap2/omap_hwmod_2xxx_3xxx_ipblock_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_2xxx_3xxx_ipblock_data.c
@@ -17,7 +17,6 @@
17#include "hdq1w.h" 17#include "hdq1w.h"
18 18
19#include "omap_hwmod_common_data.h" 19#include "omap_hwmod_common_data.h"
20#include "dma.h"
21 20
22/* UART */ 21/* UART */
23 22
@@ -89,32 +88,32 @@ struct omap_hwmod_class omap2_venc_hwmod_class = {
89 88
90/* Common DMA request line data */ 89/* Common DMA request line data */
91struct omap_hwmod_dma_info omap2_uart1_sdma_reqs[] = { 90struct omap_hwmod_dma_info omap2_uart1_sdma_reqs[] = {
92 { .name = "rx", .dma_req = OMAP24XX_DMA_UART1_RX, }, 91 { .name = "rx", .dma_req = 50, },
93 { .name = "tx", .dma_req = OMAP24XX_DMA_UART1_TX, }, 92 { .name = "tx", .dma_req = 49, },
94 { .dma_req = -1 } 93 { .dma_req = -1 }
95}; 94};
96 95
97struct omap_hwmod_dma_info omap2_uart2_sdma_reqs[] = { 96struct omap_hwmod_dma_info omap2_uart2_sdma_reqs[] = {
98 { .name = "rx", .dma_req = OMAP24XX_DMA_UART2_RX, }, 97 { .name = "rx", .dma_req = 52, },
99 { .name = "tx", .dma_req = OMAP24XX_DMA_UART2_TX, }, 98 { .name = "tx", .dma_req = 51, },
100 { .dma_req = -1 } 99 { .dma_req = -1 }
101}; 100};
102 101
103struct omap_hwmod_dma_info omap2_uart3_sdma_reqs[] = { 102struct omap_hwmod_dma_info omap2_uart3_sdma_reqs[] = {
104 { .name = "rx", .dma_req = OMAP24XX_DMA_UART3_RX, }, 103 { .name = "rx", .dma_req = 54, },
105 { .name = "tx", .dma_req = OMAP24XX_DMA_UART3_TX, }, 104 { .name = "tx", .dma_req = 53, },
106 { .dma_req = -1 } 105 { .dma_req = -1 }
107}; 106};
108 107
109struct omap_hwmod_dma_info omap2_i2c1_sdma_reqs[] = { 108struct omap_hwmod_dma_info omap2_i2c1_sdma_reqs[] = {
110 { .name = "tx", .dma_req = OMAP24XX_DMA_I2C1_TX }, 109 { .name = "tx", .dma_req = 27 },
111 { .name = "rx", .dma_req = OMAP24XX_DMA_I2C1_RX }, 110 { .name = "rx", .dma_req = 28 },
112 { .dma_req = -1 } 111 { .dma_req = -1 }
113}; 112};
114 113
115struct omap_hwmod_dma_info omap2_i2c2_sdma_reqs[] = { 114struct omap_hwmod_dma_info omap2_i2c2_sdma_reqs[] = {
116 { .name = "tx", .dma_req = OMAP24XX_DMA_I2C2_TX }, 115 { .name = "tx", .dma_req = 29 },
117 { .name = "rx", .dma_req = OMAP24XX_DMA_I2C2_RX }, 116 { .name = "rx", .dma_req = 30 },
118 { .dma_req = -1 } 117 { .dma_req = -1 }
119}; 118};
120 119
diff --git a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
index 31c7126eb3bb..fa9915411440 100644
--- a/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
+++ b/arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
@@ -35,7 +35,6 @@
35#include "prm-regbits-34xx.h" 35#include "prm-regbits-34xx.h"
36#include "cm-regbits-34xx.h" 36#include "cm-regbits-34xx.h"
37 37
38#include "dma.h"
39#include "i2c.h" 38#include "i2c.h"
40#include "mmc.h" 39#include "mmc.h"
41#include "wd_timer.h" 40#include "wd_timer.h"
@@ -548,8 +547,8 @@ static struct omap_hwmod_irq_info uart4_mpu_irqs[] = {
548}; 547};
549 548
550static struct omap_hwmod_dma_info uart4_sdma_reqs[] = { 549static struct omap_hwmod_dma_info uart4_sdma_reqs[] = {
551 { .name = "rx", .dma_req = OMAP36XX_DMA_UART4_RX, }, 550 { .name = "rx", .dma_req = 82, },
552 { .name = "tx", .dma_req = OMAP36XX_DMA_UART4_TX, }, 551 { .name = "tx", .dma_req = 81, },
553 { .dma_req = -1 } 552 { .dma_req = -1 }
554}; 553};
555 554
@@ -577,8 +576,8 @@ static struct omap_hwmod_irq_info am35xx_uart4_mpu_irqs[] = {
577}; 576};
578 577
579static struct omap_hwmod_dma_info am35xx_uart4_sdma_reqs[] = { 578static struct omap_hwmod_dma_info am35xx_uart4_sdma_reqs[] = {
580 { .name = "rx", .dma_req = AM35XX_DMA_UART4_RX, }, 579 { .name = "rx", .dma_req = 55, },
581 { .name = "tx", .dma_req = AM35XX_DMA_UART4_TX, }, 580 { .name = "tx", .dma_req = 54, },
582 { .dma_req = -1 } 581 { .dma_req = -1 }
583}; 582};
584 583
@@ -857,8 +856,8 @@ static struct omap_hwmod_irq_info i2c3_mpu_irqs[] = {
857}; 856};
858 857
859static struct omap_hwmod_dma_info i2c3_sdma_reqs[] = { 858static struct omap_hwmod_dma_info i2c3_sdma_reqs[] = {
860 { .name = "tx", .dma_req = OMAP34XX_DMA_I2C3_TX }, 859 { .name = "tx", .dma_req = 25 },
861 { .name = "rx", .dma_req = OMAP34XX_DMA_I2C3_RX }, 860 { .name = "rx", .dma_req = 26 },
862 { .dma_req = -1 } 861 { .dma_req = -1 }
863}; 862};
864 863
@@ -3581,7 +3580,7 @@ static struct omap_hwmod_irq_info omap3_sham_mpu_irqs[] = {
3581}; 3580};
3582 3581
3583static struct omap_hwmod_dma_info omap3_sham_sdma_reqs[] = { 3582static struct omap_hwmod_dma_info omap3_sham_sdma_reqs[] = {
3584 { .name = "rx", .dma_req = OMAP34XX_DMA_SHA1MD5_RX, }, 3583 { .name = "rx", .dma_req = 69, },
3585 { .dma_req = -1 } 3584 { .dma_req = -1 }
3586}; 3585};
3587 3586
@@ -3642,8 +3641,8 @@ static struct omap_hwmod_class omap3xxx_aes_class = {
3642}; 3641};
3643 3642
3644static struct omap_hwmod_dma_info omap3_aes_sdma_reqs[] = { 3643static struct omap_hwmod_dma_info omap3_aes_sdma_reqs[] = {
3645 { .name = "tx", .dma_req = OMAP34XX_DMA_AES2_TX, }, 3644 { .name = "tx", .dma_req = 65, },
3646 { .name = "rx", .dma_req = OMAP34XX_DMA_AES2_RX, }, 3645 { .name = "rx", .dma_req = 66, },
3647 { .dma_req = -1 } 3646 { .dma_req = -1 }
3648}; 3647};
3649 3648
diff --git a/arch/arm/plat-omap/dma.c b/arch/arm/plat-omap/dma.c
index e06c34bdc34a..4d463ca6821f 100644
--- a/arch/arm/plat-omap/dma.c
+++ b/arch/arm/plat-omap/dma.c
@@ -701,8 +701,8 @@ int omap_request_dma(int dev_id, const char *dev_name,
701 for (ch = 0; ch < dma_chan_count; ch++) { 701 for (ch = 0; ch < dma_chan_count; ch++) {
702 if (free_ch == -1 && dma_chan[ch].dev_id == -1) { 702 if (free_ch == -1 && dma_chan[ch].dev_id == -1) {
703 free_ch = ch; 703 free_ch = ch;
704 if (dev_id == 0) 704 /* Exit after first free channel found */
705 break; 705 break;
706 } 706 }
707 } 707 }
708 if (free_ch == -1) { 708 if (free_ch == -1) {
@@ -894,11 +894,12 @@ void omap_start_dma(int lch)
894 int next_lch, cur_lch; 894 int next_lch, cur_lch;
895 char dma_chan_link_map[MAX_LOGICAL_DMA_CH_COUNT]; 895 char dma_chan_link_map[MAX_LOGICAL_DMA_CH_COUNT];
896 896
897 dma_chan_link_map[lch] = 1;
898 /* Set the link register of the first channel */ 897 /* Set the link register of the first channel */
899 enable_lnk(lch); 898 enable_lnk(lch);
900 899
901 memset(dma_chan_link_map, 0, sizeof(dma_chan_link_map)); 900 memset(dma_chan_link_map, 0, sizeof(dma_chan_link_map));
901 dma_chan_link_map[lch] = 1;
902
902 cur_lch = dma_chan[lch].next_lch; 903 cur_lch = dma_chan[lch].next_lch;
903 do { 904 do {
904 next_lch = dma_chan[cur_lch].next_lch; 905 next_lch = dma_chan[cur_lch].next_lch;
@@ -2110,8 +2111,6 @@ exit_dma_irq_fail:
2110 } 2111 }
2111 2112
2112exit_dma_lch_fail: 2113exit_dma_lch_fail:
2113 kfree(p);
2114 kfree(d);
2115 kfree(dma_chan); 2114 kfree(dma_chan);
2116 return ret; 2115 return ret;
2117} 2116}
@@ -2132,8 +2131,6 @@ static int omap_system_dma_remove(struct platform_device *pdev)
2132 free_irq(dma_irq, (void *)(irq_rel + 1)); 2131 free_irq(dma_irq, (void *)(irq_rel + 1));
2133 } 2132 }
2134 } 2133 }
2135 kfree(p);
2136 kfree(d);
2137 kfree(dma_chan); 2134 kfree(dma_chan);
2138 return 0; 2135 return 0;
2139} 2136}