2 * arch/sh/include/asm/dma-sh.h
4 * Copyright (C) 2000 Takashi YOSHII
5 * Copyright (C) 2003 Paul Mundt
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
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))
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)
31 static int dmte_irq_map[] __maybe_unused = {
32 #if (CONFIG_NR_ONCHIP_DMA_CHANNELS >= 4)
38 #if (CONFIG_NR_ONCHIP_DMA_CHANNELS >= 6)
42 #if (CONFIG_NR_ONCHIP_DMA_CHANNELS >= 8)
46 #if (CONFIG_NR_ONCHIP_DMA_CHANNELS >= 12)
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
75 /* DMAOR definitions */
76 #define DMAOR_AE 0x00000004
77 #define DMAOR_NMIF 0x00000002
78 #define DMAOR_DME 0x00000001
81 * Define the default configuration for dual address memory-memory transfer.
82 * The 0x400 value represents auto-request, external->external.
84 #define RS_DUAL (DM_INC | SM_INC | 0x400 | TS_32)
86 /* DMA base address */
87 static u32 dma_base_addr[] __maybe_unused = {
88 #if (CONFIG_NR_ONCHIP_DMA_CHANNELS >= 4)
89 SH_DMAC_BASE0 + 0x00, /* channel 0 */
94 #if (CONFIG_NR_ONCHIP_DMA_CHANNELS >= 6)
98 #if (CONFIG_NR_ONCHIP_DMA_CHANNELS >= 8)
100 SH_DMAC_BASE1 + 0x10,
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 */
117 #endif /* __DMA_SH_H */