2 * Renesas SuperH DMA Engine support
4 * Copyright (C) 2009 Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>
5 * Copyright (C) 2009 Renesas Solutions, Inc. All rights reserved.
7 * This is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
16 #include <linux/shdma-base.h>
17 #include <linux/dmaengine.h>
18 #include <linux/interrupt.h>
19 #include <linux/list.h>
21 #define SH_DMAE_MAX_CHANNELS 20
22 #define SH_DMAE_TCR_MAX 0x00FFFFFF /* 16MB */
27 struct shdma_chan shdma_chan;
28 int xmit_shift; /* log_2(bytes_per_xfer) */
30 char dev_id[16]; /* unique name per DMAC of channel */
34 struct sh_dmae_device {
35 struct shdma_dev shdma_dev;
36 struct sh_dmae_chan *chan[SH_DMAE_MAX_CHANNELS];
37 struct sh_dmae_pdata *pdata;
38 struct list_head node;
39 u32 __iomem *chan_reg;
41 unsigned int chcr_offset;
46 u32 sar; /* SAR / source address */
47 u32 dar; /* DAR / destination address */
48 u32 tcr; /* TCR / transfer count */
52 struct sh_dmae_regs hw;
53 struct shdma_desc shdma_desc;
56 #define to_sh_chan(chan) container_of(chan, struct sh_dmae_chan, shdma_chan)
57 #define to_sh_desc(lh) container_of(lh, struct sh_desc, node)
58 #define tx_to_sh_desc(tx) container_of(tx, struct sh_desc, async_tx)
59 #define to_sh_dev(chan) container_of(chan->shdma_chan.dma_chan.device,\
60 struct sh_dmae_device, shdma_dev.dma_dev)
62 #endif /* __DMA_SHDMA_H */