2009-03-10 08:26:49 +00:00
|
|
|
/*
|
|
|
|
* arch/sh/include/asm/dma-sh.h
|
|
|
|
*
|
|
|
|
* Copyright (C) 2000 Takashi YOSHII
|
|
|
|
* Copyright (C) 2003 Paul Mundt
|
|
|
|
*
|
|
|
|
* This file is subject to the terms and conditions of the GNU General Public
|
|
|
|
* License. See the file "COPYING" in the main directory of this archive
|
|
|
|
* for more details.
|
|
|
|
*/
|
|
|
|
#ifndef __DMA_SH_H
|
|
|
|
#define __DMA_SH_H
|
|
|
|
|
2010-02-11 16:50:14 +00:00
|
|
|
#include <asm/dma-register.h>
|
|
|
|
#include <cpu/dma-register.h>
|
2009-03-10 08:26:49 +00:00
|
|
|
#include <cpu/dma.h>
|
|
|
|
|
|
|
|
/* DMAOR contorl: The DMAOR access size is different by CPU.*/
|
|
|
|
#if defined(CONFIG_CPU_SUBTYPE_SH7723) || \
|
2009-08-03 04:52:24 +00:00
|
|
|
defined(CONFIG_CPU_SUBTYPE_SH7724) || \
|
2009-03-10 08:26:49 +00:00
|
|
|
defined(CONFIG_CPU_SUBTYPE_SH7780) || \
|
|
|
|
defined(CONFIG_CPU_SUBTYPE_SH7785)
|
|
|
|
#define dmaor_read_reg(n) \
|
2010-01-26 03:58:40 +00:00
|
|
|
(n ? __raw_readw(SH_DMAC_BASE1 + DMAOR) \
|
|
|
|
: __raw_readw(SH_DMAC_BASE0 + DMAOR))
|
2009-03-10 08:26:49 +00:00
|
|
|
#define dmaor_write_reg(n, data) \
|
2010-01-26 03:58:40 +00:00
|
|
|
(n ? __raw_writew(data, SH_DMAC_BASE1 + DMAOR) \
|
|
|
|
: __raw_writew(data, SH_DMAC_BASE0 + DMAOR))
|
2009-03-10 08:26:49 +00:00
|
|
|
#else /* Other CPU */
|
2010-01-26 03:58:40 +00:00
|
|
|
#define dmaor_read_reg(n) __raw_readw(SH_DMAC_BASE0 + DMAOR)
|
|
|
|
#define dmaor_write_reg(n, data) __raw_writew(data, SH_DMAC_BASE0 + DMAOR)
|
2009-03-10 08:26:49 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
static int dmte_irq_map[] __maybe_unused = {
|
2009-03-12 06:34:39 +00:00
|
|
|
#if (MAX_DMA_CHANNELS >= 4)
|
2009-03-10 08:26:49 +00:00
|
|
|
DMTE0_IRQ,
|
|
|
|
DMTE0_IRQ + 1,
|
|
|
|
DMTE0_IRQ + 2,
|
|
|
|
DMTE0_IRQ + 3,
|
|
|
|
#endif
|
2009-03-12 06:34:39 +00:00
|
|
|
#if (MAX_DMA_CHANNELS >= 6)
|
2009-03-10 08:26:49 +00:00
|
|
|
DMTE4_IRQ,
|
|
|
|
DMTE4_IRQ + 1,
|
|
|
|
#endif
|
2009-03-12 06:34:39 +00:00
|
|
|
#if (MAX_DMA_CHANNELS >= 8)
|
2009-03-10 08:26:49 +00:00
|
|
|
DMTE6_IRQ,
|
|
|
|
DMTE6_IRQ + 1,
|
|
|
|
#endif
|
2009-03-12 06:34:39 +00:00
|
|
|
#if (MAX_DMA_CHANNELS >= 12)
|
2009-03-10 08:26:49 +00:00
|
|
|
DMTE8_IRQ,
|
|
|
|
DMTE9_IRQ,
|
|
|
|
DMTE10_IRQ,
|
|
|
|
DMTE11_IRQ,
|
|
|
|
#endif
|
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Define the default configuration for dual address memory-memory transfer.
|
|
|
|
* The 0x400 value represents auto-request, external->external.
|
|
|
|
*/
|
2010-02-03 14:44:12 +00:00
|
|
|
#define RS_DUAL (DM_INC | SM_INC | 0x400 | TS_INDEX2VAL(XMIT_SZ_32BIT))
|
2009-03-10 08:26:49 +00:00
|
|
|
|
|
|
|
/* DMA base address */
|
|
|
|
static u32 dma_base_addr[] __maybe_unused = {
|
2009-03-12 06:34:39 +00:00
|
|
|
#if (MAX_DMA_CHANNELS >= 4)
|
2009-03-10 08:26:49 +00:00
|
|
|
SH_DMAC_BASE0 + 0x00, /* channel 0 */
|
|
|
|
SH_DMAC_BASE0 + 0x10,
|
|
|
|
SH_DMAC_BASE0 + 0x20,
|
|
|
|
SH_DMAC_BASE0 + 0x30,
|
|
|
|
#endif
|
2009-03-12 06:34:39 +00:00
|
|
|
#if (MAX_DMA_CHANNELS >= 6)
|
2009-03-10 08:26:49 +00:00
|
|
|
SH_DMAC_BASE0 + 0x50,
|
|
|
|
SH_DMAC_BASE0 + 0x60,
|
|
|
|
#endif
|
2009-03-12 06:34:39 +00:00
|
|
|
#if (MAX_DMA_CHANNELS >= 8)
|
2009-03-10 08:26:49 +00:00
|
|
|
SH_DMAC_BASE1 + 0x00,
|
|
|
|
SH_DMAC_BASE1 + 0x10,
|
|
|
|
#endif
|
2009-03-12 06:34:39 +00:00
|
|
|
#if (MAX_DMA_CHANNELS >= 12)
|
2009-03-10 08:26:49 +00:00
|
|
|
SH_DMAC_BASE1 + 0x20,
|
|
|
|
SH_DMAC_BASE1 + 0x30,
|
|
|
|
SH_DMAC_BASE1 + 0x50,
|
|
|
|
SH_DMAC_BASE1 + 0x60, /* channel 11 */
|
|
|
|
#endif
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* __DMA_SH_H */
|