aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/include/asm/dma-sh.h
diff options
context:
space:
mode:
authorNobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com>2009-03-10 04:26:49 -0400
committerPaul Mundt <lethal@linux-sh.org>2009-03-10 04:26:49 -0400
commit71b973a42c5456824c8712e00659d9616d395919 (patch)
tree1367c85de45159c66752a93fc062a6f67f616607 /arch/sh/include/asm/dma-sh.h
parentae68df5635a191c7edb75f5c1c1406353cb24a9f (diff)
sh: dma-sh updates for multi IRQ and new SH-4A CPUs.
This adds DMA support for newer SH-4A CPUs, particularly SH7763/64/80/85. This also enables multi IRQ support for platforms that have multiple vectors bound to the same IRQ source. Signed-off-by: Nobuhiro Iwamatsu <iwamatsu.nobuhiro@renesas.com> Signed-off-by: Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/include/asm/dma-sh.h')
-rw-r--r--arch/sh/include/asm/dma-sh.h117
1 files changed, 117 insertions, 0 deletions
diff --git a/arch/sh/include/asm/dma-sh.h b/arch/sh/include/asm/dma-sh.h
new file mode 100644
index 00000000000..e873ecaa506
--- /dev/null
+++ b/arch/sh/include/asm/dma-sh.h
@@ -0,0 +1,117 @@
1/*
2 * arch/sh/include/asm/dma-sh.h
3 *
4 * Copyright (C) 2000 Takashi YOSHII
5 * Copyright (C) 2003 Paul Mundt
6 *
7 * This file is subject to the terms and conditions of the GNU General Public
8 * License. See the file "COPYING" in the main directory of this archive
9 * for more details.
10 */
11#ifndef __DMA_SH_H
12#define __DMA_SH_H
13
14#include <cpu/dma.h>
15
16/* DMAOR contorl: The DMAOR access size is different by CPU.*/
17#if defined(CONFIG_CPU_SUBTYPE_SH7723) || \
18 defined(CONFIG_CPU_SUBTYPE_SH7780) || \
19 defined(CONFIG_CPU_SUBTYPE_SH7785)
20#define dmaor_read_reg(n) \
21 (n ? ctrl_inw(SH_DMAC_BASE1 + DMAOR) \
22 : ctrl_inw(SH_DMAC_BASE0 + DMAOR))
23#define dmaor_write_reg(n, data) \
24 (n ? ctrl_outw(data, SH_DMAC_BASE1 + DMAOR) \
25 : ctrl_outw(data, SH_DMAC_BASE0 + DMAOR))
26#else /* Other CPU */
27#define dmaor_read_reg(n) ctrl_inw(SH_DMAC_BASE0 + DMAOR)
28#define dmaor_write_reg(n, data) ctrl_outw(data, SH_DMAC_BASE0 + DMAOR)
29#endif
30
31static int dmte_irq_map[] __maybe_unused = {
32#if (CONFIG_NR_ONCHIP_DMA_CHANNELS >= 4)
33 DMTE0_IRQ,
34 DMTE0_IRQ + 1,
35 DMTE0_IRQ + 2,
36 DMTE0_IRQ + 3,
37#endif
38#if (CONFIG_NR_ONCHIP_DMA_CHANNELS >= 6)
39 DMTE4_IRQ,
40 DMTE4_IRQ + 1,
41#endif
42#if (CONFIG_NR_ONCHIP_DMA_CHANNELS >= 8)
43 DMTE6_IRQ,
44 DMTE6_IRQ + 1,
45#endif
46#if (CONFIG_NR_ONCHIP_DMA_CHANNELS >= 12)
47 DMTE8_IRQ,
48 DMTE9_IRQ,
49 DMTE10_IRQ,
50 DMTE11_IRQ,
51#endif
52};
53
54/* Definitions for the SuperH DMAC */
55#define REQ_L 0x00000000
56#define REQ_E 0x00080000
57#define RACK_H 0x00000000
58#define RACK_L 0x00040000
59#define ACK_R 0x00000000
60#define ACK_W 0x00020000
61#define ACK_H 0x00000000
62#define ACK_L 0x00010000
63#define DM_INC 0x00004000
64#define DM_DEC 0x00008000
65#define SM_INC 0x00001000
66#define SM_DEC 0x00002000
67#define RS_IN 0x00000200
68#define RS_OUT 0x00000300
69#define TS_BLK 0x00000040
70#define TM_BUR 0x00000020
71#define CHCR_DE 0x00000001
72#define CHCR_TE 0x00000002
73#define CHCR_IE 0x00000004
74
75/* DMAOR definitions */
76#define DMAOR_AE 0x00000004
77#define DMAOR_NMIF 0x00000002
78#define DMAOR_DME 0x00000001
79
80/*
81 * Define the default configuration for dual address memory-memory transfer.
82 * The 0x400 value represents auto-request, external->external.
83 */
84#define RS_DUAL (DM_INC | SM_INC | 0x400 | TS_32)
85
86/* DMA base address */
87static u32 dma_base_addr[] __maybe_unused = {
88#if (CONFIG_NR_ONCHIP_DMA_CHANNELS >= 4)
89 SH_DMAC_BASE0 + 0x00, /* channel 0 */
90 SH_DMAC_BASE0 + 0x10,
91 SH_DMAC_BASE0 + 0x20,
92 SH_DMAC_BASE0 + 0x30,
93#endif
94#if (CONFIG_NR_ONCHIP_DMA_CHANNELS >= 6)
95 SH_DMAC_BASE0 + 0x50,
96 SH_DMAC_BASE0 + 0x60,
97#endif
98#if (CONFIG_NR_ONCHIP_DMA_CHANNELS >= 8)
99 SH_DMAC_BASE1 + 0x00,
100 SH_DMAC_BASE1 + 0x10,
101#endif
102#if (CONFIG_NR_ONCHIP_DMA_CHANNELS >= 12)
103 SH_DMAC_BASE1 + 0x20,
104 SH_DMAC_BASE1 + 0x30,
105 SH_DMAC_BASE1 + 0x50,
106 SH_DMAC_BASE1 + 0x60, /* channel 11 */
107#endif
108};
109
110/* DMA register */
111#define SAR 0x00
112#define DAR 0x04
113#define TCR 0x08
114#define CHCR 0x0C
115#define DMAOR 0x40
116
117#endif /* __DMA_SH_H */