blob: bcb30246e85c9fce6c85593736884eac76242bcf [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#ifndef __ASM_CPU_SH4_DMA_H
2#define __ASM_CPU_SH4_DMA_H
3
Manuel Lauss9f8a5e32007-01-25 15:22:11 +09004/* SH7751/7760/7780 DMA IRQ sources */
Manuel Lauss9f8a5e32007-01-25 15:22:11 +09005
Paul Mundt0d831772006-01-16 22:14:09 -08006#ifdef CONFIG_CPU_SH4A
Paul Mundt5283ecb2006-09-27 15:59:17 +09007
Nobuhiro Iwamatsu71b973a2009-03-10 17:26:49 +09008#define DMAOR_INIT (DMAOR_DME)
Paul Mundt5283ecb2006-09-27 15:59:17 +09009#define CHCR_TS_MASK 0x18
10#define CHCR_TS_SHIFT 3
11
Nobuhiro Iwamatsu71b973a2009-03-10 17:26:49 +090012#include <cpu/dma-sh4a.h>
13#else /* CONFIG_CPU_SH4A */
14/*
15 * SH7750/SH7751/SH7760
16 */
17#define DMTE0_IRQ 34
18#define DMTE4_IRQ 44
19#define DMTE6_IRQ 46
20#define DMAE0_IRQ 38
Linus Torvalds1da177e2005-04-16 15:20:36 -070021
Nobuhiro Iwamatsu71b973a2009-03-10 17:26:49 +090022#define DMAOR_INIT (0x8000|DMAOR_DME)
23#define SH_DMAC_BASE0 0xffa00000
24#define SH_DMAC_BASE1 0xffa00070
Paul Mundt0d831772006-01-16 22:14:09 -080025/* Definitions for the SuperH DMAC */
Nobuhiro Iwamatsu71b973a2009-03-10 17:26:49 +090026#define TM_BURST 0x00000080
Paul Mundt0d831772006-01-16 22:14:09 -080027#define TS_8 0x00000010
28#define TS_16 0x00000020
29#define TS_32 0x00000030
30#define TS_64 0x00000000
31
Adrian McMenamin5d9df8e2007-10-08 05:19:36 +090032#define CHCR_TS_MASK 0x70
Paul Mundt0d831772006-01-16 22:14:09 -080033#define CHCR_TS_SHIFT 4
34
35#define DMAOR_COD 0x00000008
36
Paul Mundt0d831772006-01-16 22:14:09 -080037/*
38 * The SuperH DMAC supports a number of transmit sizes, we list them here,
39 * with their respective values as they appear in the CHCR registers.
40 *
41 * Defaults to a 64-bit transfer size.
42 */
43enum {
44 XMIT_SZ_64BIT,
45 XMIT_SZ_8BIT,
46 XMIT_SZ_16BIT,
47 XMIT_SZ_32BIT,
48 XMIT_SZ_256BIT,
49};
50
51/*
52 * The DMA count is defined as the number of bytes to transfer.
53 */
David Rientjesd16aaffa2007-05-09 02:35:28 -070054static unsigned int ts_shift[] __maybe_unused = {
Paul Mundt0d831772006-01-16 22:14:09 -080055 [XMIT_SZ_64BIT] = 3,
56 [XMIT_SZ_8BIT] = 0,
57 [XMIT_SZ_16BIT] = 1,
58 [XMIT_SZ_32BIT] = 2,
59 [XMIT_SZ_256BIT] = 5,
60};
Paul Mundt5283ecb2006-09-27 15:59:17 +090061#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -070062
63#endif /* __ASM_CPU_SH4_DMA_H */