]> git.karo-electronics.de Git - karo-tx-linux.git/blob - arch/sh/include/asm/dmaengine.h
9586e4a482b1360e0d74e2d3462e452debeea7c9
[karo-tx-linux.git] / arch / sh / include / asm / dmaengine.h
1 /*
2  * Header for the new SH dmaengine driver
3  *
4  * Copyright (C) 2010 Guennadi Liakhovetski <g.liakhovetski@gmx.de>
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 ASM_DMAENGINE_H
11 #define ASM_DMAENGINE_H
12
13 #include <asm/dma-register.h>
14
15 #define SH_DMAC_MAX_CHANNELS    6
16
17 enum sh_dmae_slave_chan_id {
18         SHDMA_SLAVE_SCIF0_TX,
19         SHDMA_SLAVE_SCIF0_RX,
20         SHDMA_SLAVE_SCIF1_TX,
21         SHDMA_SLAVE_SCIF1_RX,
22         SHDMA_SLAVE_SCIF2_TX,
23         SHDMA_SLAVE_SCIF2_RX,
24         SHDMA_SLAVE_SCIF3_TX,
25         SHDMA_SLAVE_SCIF3_RX,
26         SHDMA_SLAVE_SCIF4_TX,
27         SHDMA_SLAVE_SCIF4_RX,
28         SHDMA_SLAVE_SCIF5_TX,
29         SHDMA_SLAVE_SCIF5_RX,
30         SHDMA_SLAVE_SIUA_TX,
31         SHDMA_SLAVE_SIUA_RX,
32         SHDMA_SLAVE_SIUB_TX,
33         SHDMA_SLAVE_SIUB_RX,
34         SHDMA_SLAVE_NUMBER,     /* Must stay last */
35 };
36
37 struct sh_dmae_slave_config {
38         enum sh_dmae_slave_chan_id      slave_id;
39         dma_addr_t                      addr;
40         u32                             chcr;
41         char                            mid_rid;
42 };
43
44 struct sh_dmae_channel {
45         unsigned int    offset;
46         unsigned int    dmars;
47         unsigned int    dmars_bit;
48 };
49
50 struct sh_dmae_pdata {
51         struct sh_dmae_slave_config *slave;
52         int slave_num;
53         struct sh_dmae_channel *channel;
54         int channel_num;
55         unsigned int ts_low_shift;
56         unsigned int ts_low_mask;
57         unsigned int ts_high_shift;
58         unsigned int ts_high_mask;
59         unsigned int *ts_shift;
60         int ts_shift_num;
61         u16 dmaor_init;
62 };
63
64 struct device;
65
66 /* Used by slave DMA clients to request DMA to/from a specific peripheral */
67 struct sh_dmae_slave {
68         enum sh_dmae_slave_chan_id      slave_id; /* Set by the platform */
69         struct device                   *dma_dev; /* Set by the platform */
70         struct sh_dmae_slave_config     *config;  /* Set by the driver */
71 };
72
73 #endif