aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-omap/include/plat/dma.h
diff options
context:
space:
mode:
authorG, Manjunath Kondaiah <manjugk@ti.com>2010-12-20 21:27:19 -0500
committerTony Lindgren <tony@atomide.com>2010-12-20 21:38:31 -0500
commitf31cc9622d75c1c6f041d786698daa425c0425c2 (patch)
tree4e52cc4a4d5a6c478823150d263cecbb08271f7b /arch/arm/plat-omap/include/plat/dma.h
parent59de3cf1ce9a961ba9ab657707727db2111e72fa (diff)
OMAP: DMA: Convert DMA library into platform driver
Convert DMA library into DMA platform driver and make use of platform data provided by hwmod data base for OMAP2+ onwards. For OMAP1 processors, the DMA driver in mach-omap uses resource structures for getting platform data. Thanks to Tony Lindgren <tony@atomide.com> for fixing various omap1 issues and testing the same on OSK5912 board. Signed-off-by: G, Manjunath Kondaiah <manjugk@ti.com> Tested-by: Kevin Hilman <khilman@deeprootsystems.com> Acked-by: Kevin Hilman <khilman@deeprootsystems.com> Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/plat-omap/include/plat/dma.h')
-rw-r--r--arch/arm/plat-omap/include/plat/dma.h57
1 files changed, 46 insertions, 11 deletions
diff --git a/arch/arm/plat-omap/include/plat/dma.h b/arch/arm/plat-omap/include/plat/dma.h
index 4b51d2b93b0e..d1c916fcf770 100644
--- a/arch/arm/plat-omap/include/plat/dma.h
+++ b/arch/arm/plat-omap/include/plat/dma.h
@@ -21,19 +21,15 @@
21#ifndef __ASM_ARCH_DMA_H 21#ifndef __ASM_ARCH_DMA_H
22#define __ASM_ARCH_DMA_H 22#define __ASM_ARCH_DMA_H
23 23
24/* Move omap4 specific defines to dma-44xx.h */ 24#include <linux/platform_device.h>
25#include "dma-44xx.h"
26
27/* Hardware registers for omap1 */
28#define OMAP1_DMA_BASE (0xfffed800)
29 25
30/* Hardware registers for omap2 and omap3 */ 26/*
31#define OMAP24XX_DMA4_BASE (L4_24XX_BASE + 0x56000) 27 * TODO: These dma channel defines should go away once all
32#define OMAP34XX_DMA4_BASE (L4_34XX_BASE + 0x56000) 28 * the omap drivers hwmod adapted.
33#define OMAP44XX_DMA4_BASE (L4_44XX_BASE + 0x56000) 29 */
34 30
35#define OMAP1_LOGICAL_DMA_CH_COUNT 17 31/* Move omap4 specific defines to dma-44xx.h */
36#define OMAP_DMA4_LOGICAL_DMA_CH_COUNT 32 /* REVISIT: Is this 32 + 2? */ 32#include "dma-44xx.h"
37 33
38/* DMA channels for omap1 */ 34/* DMA channels for omap1 */
39#define OMAP_DMA_NO_DEVICE 0 35#define OMAP_DMA_NO_DEVICE 0
@@ -302,6 +298,14 @@
302#define IS_CSSA_32 BIT(0x3) 298#define IS_CSSA_32 BIT(0x3)
303#define IS_CDSA_32 BIT(0x4) 299#define IS_CDSA_32 BIT(0x4)
304#define IS_RW_PRIORITY BIT(0x5) 300#define IS_RW_PRIORITY BIT(0x5)
301#define ENABLE_1510_MODE BIT(0x6)
302#define SRC_PORT BIT(0x7)
303#define DST_PORT BIT(0x8)
304#define SRC_INDEX BIT(0x9)
305#define DST_INDEX BIT(0xA)
306#define IS_BURST_ONLY4 BIT(0xB)
307#define CLEAR_CSR_ON_READ BIT(0xC)
308#define IS_WORD_16 BIT(0xD)
305 309
306enum omap_reg_offsets { 310enum omap_reg_offsets {
307 311
@@ -397,9 +401,40 @@ struct omap_dma_channel_params {
397#endif 401#endif
398}; 402};
399 403
404struct omap_dma_lch {
405 int next_lch;
406 int dev_id;
407 u16 saved_csr;
408 u16 enabled_irqs;
409 const char *dev_name;
410 void (*callback)(int lch, u16 ch_status, void *data);
411 void *data;
412 long flags;
413 /* required for Dynamic chaining */
414 int prev_linked_ch;
415 int next_linked_ch;
416 int state;
417 int chain_id;
418 int status;
419};
420
400struct omap_dma_dev_attr { 421struct omap_dma_dev_attr {
401 u32 dev_caps; 422 u32 dev_caps;
402 u16 lch_count; 423 u16 lch_count;
424 u16 chan_count;
425 struct omap_dma_lch *chan;
426};
427
428/* System DMA platform data structure */
429struct omap_system_dma_plat_info {
430 struct omap_dma_dev_attr *dma_attr;
431 u32 errata;
432 void (*disable_irq_lch)(int lch);
433 void (*show_dma_caps)(void);
434 void (*clear_lch_regs)(int lch);
435 void (*clear_dma)(int lch);
436 void (*dma_write)(u32 val, int reg, int lch);
437 u32 (*dma_read)(int reg, int lch);
403}; 438};
404 439
405extern void omap_set_dma_priority(int lch, int dst_port, int priority); 440extern void omap_set_dma_priority(int lch, int dst_port, int priority);