Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | #ifndef __ASM_CPU_SH4_DMA_H |
| 2 | #define __ASM_CPU_SH4_DMA_H |
| 3 | |
Paul Mundt | 5283ecb | 2006-09-27 15:59:17 +0900 | [diff] [blame] | 4 | #define DMAOR_INIT ( 0x8000 | DMAOR_DME ) |
| 5 | |
Paul Mundt | 0d83177 | 2006-01-16 22:14:09 -0800 | [diff] [blame] | 6 | #ifdef CONFIG_CPU_SH4A |
| 7 | #define SH_DMAC_BASE 0xfc808020 |
Paul Mundt | 5283ecb | 2006-09-27 15:59:17 +0900 | [diff] [blame] | 8 | |
| 9 | #define CHCR_TS_MASK 0x18 |
| 10 | #define CHCR_TS_SHIFT 3 |
| 11 | |
| 12 | #include <asm/cpu/dma-sh7780.h> |
Paul Mundt | 0d83177 | 2006-01-16 22:14:09 -0800 | [diff] [blame] | 13 | #else |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 14 | #define SH_DMAC_BASE 0xffa00000 |
| 15 | |
Paul Mundt | 0d83177 | 2006-01-16 22:14:09 -0800 | [diff] [blame] | 16 | /* Definitions for the SuperH DMAC */ |
| 17 | #define TM_BURST 0x0000080 |
| 18 | #define TS_8 0x00000010 |
| 19 | #define TS_16 0x00000020 |
| 20 | #define TS_32 0x00000030 |
| 21 | #define TS_64 0x00000000 |
| 22 | |
| 23 | #define CHCR_TS_MASK 0x30 |
| 24 | #define CHCR_TS_SHIFT 4 |
| 25 | |
| 26 | #define DMAOR_COD 0x00000008 |
| 27 | |
Paul Mundt | 0d83177 | 2006-01-16 22:14:09 -0800 | [diff] [blame] | 28 | /* |
| 29 | * The SuperH DMAC supports a number of transmit sizes, we list them here, |
| 30 | * with their respective values as they appear in the CHCR registers. |
| 31 | * |
| 32 | * Defaults to a 64-bit transfer size. |
| 33 | */ |
| 34 | enum { |
| 35 | XMIT_SZ_64BIT, |
| 36 | XMIT_SZ_8BIT, |
| 37 | XMIT_SZ_16BIT, |
| 38 | XMIT_SZ_32BIT, |
| 39 | XMIT_SZ_256BIT, |
| 40 | }; |
| 41 | |
| 42 | /* |
| 43 | * The DMA count is defined as the number of bytes to transfer. |
| 44 | */ |
| 45 | static unsigned int ts_shift[] __attribute__ ((used)) = { |
| 46 | [XMIT_SZ_64BIT] = 3, |
| 47 | [XMIT_SZ_8BIT] = 0, |
| 48 | [XMIT_SZ_16BIT] = 1, |
| 49 | [XMIT_SZ_32BIT] = 2, |
| 50 | [XMIT_SZ_256BIT] = 5, |
| 51 | }; |
Paul Mundt | 5283ecb | 2006-09-27 15:59:17 +0900 | [diff] [blame] | 52 | #endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 53 | |
| 54 | #endif /* __ASM_CPU_SH4_DMA_H */ |