aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/include/cpu-sh4/cpu/dma-sh4a.h
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sh/include/cpu-sh4/cpu/dma-sh4a.h')
-rw-r--r--arch/sh/include/cpu-sh4/cpu/dma-sh4a.h97
1 files changed, 73 insertions, 24 deletions
diff --git a/arch/sh/include/cpu-sh4/cpu/dma-sh4a.h b/arch/sh/include/cpu-sh4/cpu/dma-sh4a.h
index c4ed660c14cf..cc1cf3e8f163 100644
--- a/arch/sh/include/cpu-sh4/cpu/dma-sh4a.h
+++ b/arch/sh/include/cpu-sh4/cpu/dma-sh4a.h
@@ -2,13 +2,26 @@
2#define __ASM_SH_CPU_SH4_DMA_SH7780_H 2#define __ASM_SH_CPU_SH4_DMA_SH7780_H
3 3
4#if defined(CONFIG_CPU_SUBTYPE_SH7343) || \ 4#if defined(CONFIG_CPU_SUBTYPE_SH7343) || \
5 defined(CONFIG_CPU_SUBTYPE_SH7722) || \
6 defined(CONFIG_CPU_SUBTYPE_SH7730) 5 defined(CONFIG_CPU_SUBTYPE_SH7730)
7#define DMTE0_IRQ 48 6#define DMTE0_IRQ 48
8#define DMTE4_IRQ 76 7#define DMTE4_IRQ 76
9#define DMAE0_IRQ 78 /* DMA Error IRQ*/ 8#define DMAE0_IRQ 78 /* DMA Error IRQ*/
10#define SH_DMAC_BASE0 0xFE008020 9#define SH_DMAC_BASE0 0xFE008020
11#define SH_DMARS_BASE 0xFE009000 10#define SH_DMARS_BASE 0xFE009000
11#define CHCR_TS_LOW_MASK 0x00000018
12#define CHCR_TS_LOW_SHIFT 3
13#define CHCR_TS_HIGH_MASK 0
14#define CHCR_TS_HIGH_SHIFT 0
15#elif defined(CONFIG_CPU_SUBTYPE_SH7722)
16#define DMTE0_IRQ 48
17#define DMTE4_IRQ 76
18#define DMAE0_IRQ 78 /* DMA Error IRQ*/
19#define SH_DMAC_BASE0 0xFE008020
20#define SH_DMARS_BASE 0xFE009000
21#define CHCR_TS_LOW_MASK 0x00000018
22#define CHCR_TS_LOW_SHIFT 3
23#define CHCR_TS_HIGH_MASK 0x00300000
24#define CHCR_TS_HIGH_SHIFT 20
12#elif defined(CONFIG_CPU_SUBTYPE_SH7763) || \ 25#elif defined(CONFIG_CPU_SUBTYPE_SH7763) || \
13 defined(CONFIG_CPU_SUBTYPE_SH7764) 26 defined(CONFIG_CPU_SUBTYPE_SH7764)
14#define DMTE0_IRQ 34 27#define DMTE0_IRQ 34
@@ -16,8 +29,11 @@
16#define DMAE0_IRQ 38 29#define DMAE0_IRQ 38
17#define SH_DMAC_BASE0 0xFF608020 30#define SH_DMAC_BASE0 0xFF608020
18#define SH_DMARS_BASE 0xFF609000 31#define SH_DMARS_BASE 0xFF609000
19#elif defined(CONFIG_CPU_SUBTYPE_SH7723) || \ 32#define CHCR_TS_LOW_MASK 0x00000018
20 defined(CONFIG_CPU_SUBTYPE_SH7724) 33#define CHCR_TS_LOW_SHIFT 3
34#define CHCR_TS_HIGH_MASK 0
35#define CHCR_TS_HIGH_SHIFT 0
36#elif defined(CONFIG_CPU_SUBTYPE_SH7723)
21#define DMTE0_IRQ 48 /* DMAC0A*/ 37#define DMTE0_IRQ 48 /* DMAC0A*/
22#define DMTE4_IRQ 76 /* DMAC0B */ 38#define DMTE4_IRQ 76 /* DMAC0B */
23#define DMTE6_IRQ 40 39#define DMTE6_IRQ 40
@@ -30,6 +46,27 @@
30#define SH_DMAC_BASE0 0xFE008020 46#define SH_DMAC_BASE0 0xFE008020
31#define SH_DMAC_BASE1 0xFDC08020 47#define SH_DMAC_BASE1 0xFDC08020
32#define SH_DMARS_BASE 0xFDC09000 48#define SH_DMARS_BASE 0xFDC09000
49#define CHCR_TS_LOW_MASK 0x00000018
50#define CHCR_TS_LOW_SHIFT 3
51#define CHCR_TS_HIGH_MASK 0
52#define CHCR_TS_HIGH_SHIFT 0
53#elif defined(CONFIG_CPU_SUBTYPE_SH7724)
54#define DMTE0_IRQ 48 /* DMAC0A*/
55#define DMTE4_IRQ 76 /* DMAC0B */
56#define DMTE6_IRQ 40
57#define DMTE8_IRQ 42 /* DMAC1A */
58#define DMTE9_IRQ 43
59#define DMTE10_IRQ 72 /* DMAC1B */
60#define DMTE11_IRQ 73
61#define DMAE0_IRQ 78 /* DMA Error IRQ*/
62#define DMAE1_IRQ 74 /* DMA Error IRQ*/
63#define SH_DMAC_BASE0 0xFE008020
64#define SH_DMAC_BASE1 0xFDC08020
65#define SH_DMARS_BASE 0xFDC09000
66#define CHCR_TS_LOW_MASK 0x00000018
67#define CHCR_TS_LOW_SHIFT 3
68#define CHCR_TS_HIGH_MASK 0x00600000
69#define CHCR_TS_HIGH_SHIFT 21
33#elif defined(CONFIG_CPU_SUBTYPE_SH7780) 70#elif defined(CONFIG_CPU_SUBTYPE_SH7780)
34#define DMTE0_IRQ 34 71#define DMTE0_IRQ 34
35#define DMTE4_IRQ 44 72#define DMTE4_IRQ 44
@@ -42,6 +79,10 @@
42#define SH_DMAC_BASE0 0xFC808020 79#define SH_DMAC_BASE0 0xFC808020
43#define SH_DMAC_BASE1 0xFC818020 80#define SH_DMAC_BASE1 0xFC818020
44#define SH_DMARS_BASE 0xFC809000 81#define SH_DMARS_BASE 0xFC809000
82#define CHCR_TS_LOW_MASK 0x00000018
83#define CHCR_TS_LOW_SHIFT 3
84#define CHCR_TS_HIGH_MASK 0
85#define CHCR_TS_HIGH_SHIFT 0
45#else /* SH7785 */ 86#else /* SH7785 */
46#define DMTE0_IRQ 33 87#define DMTE0_IRQ 33
47#define DMTE4_IRQ 37 88#define DMTE4_IRQ 37
@@ -55,17 +96,16 @@
55#define SH_DMAC_BASE0 0xFC808020 96#define SH_DMAC_BASE0 0xFC808020
56#define SH_DMAC_BASE1 0xFCC08020 97#define SH_DMAC_BASE1 0xFCC08020
57#define SH_DMARS_BASE 0xFC809000 98#define SH_DMARS_BASE 0xFC809000
99#define CHCR_TS_LOW_MASK 0x00000018
100#define CHCR_TS_LOW_SHIFT 3
101#define CHCR_TS_HIGH_MASK 0
102#define CHCR_TS_HIGH_SHIFT 0
58#endif 103#endif
59 104
60#define REQ_HE 0x000000C0 105#define REQ_HE 0x000000C0
61#define REQ_H 0x00000080 106#define REQ_H 0x00000080
62#define REQ_LE 0x00000040 107#define REQ_LE 0x00000040
63#define TM_BURST 0x0000020 108#define TM_BURST 0x00000020
64#define TS_8 0x00000000
65#define TS_16 0x00000008
66#define TS_32 0x00000010
67#define TS_16BLK 0x00000018
68#define TS_32BLK 0x00100000
69 109
70/* 110/*
71 * The SuperH DMAC supports a number of transmit sizes, we list them here, 111 * The SuperH DMAC supports a number of transmit sizes, we list them here,
@@ -74,22 +114,31 @@
74 * Defaults to a 64-bit transfer size. 114 * Defaults to a 64-bit transfer size.
75 */ 115 */
76enum { 116enum {
77 XMIT_SZ_8BIT, 117 XMIT_SZ_8BIT = 0,
78 XMIT_SZ_16BIT, 118 XMIT_SZ_16BIT = 1,
79 XMIT_SZ_32BIT, 119 XMIT_SZ_32BIT = 2,
80 XMIT_SZ_128BIT, 120 XMIT_SZ_64BIT = 7,
81 XMIT_SZ_256BIT, 121 XMIT_SZ_128BIT = 3,
122 XMIT_SZ_256BIT = 4,
123 XMIT_SZ_128BIT_BLK = 0xb,
124 XMIT_SZ_256BIT_BLK = 0xc,
82}; 125};
83 126
84/* 127/*
85 * The DMA count is defined as the number of bytes to transfer. 128 * The DMA count is defined as the number of bytes to transfer.
86 */ 129 */
87static unsigned int ts_shift[] __maybe_unused = { 130#define TS_SHIFT { \
88 [XMIT_SZ_8BIT] = 0, 131 [XMIT_SZ_8BIT] = 0, \
89 [XMIT_SZ_16BIT] = 1, 132 [XMIT_SZ_16BIT] = 1, \
90 [XMIT_SZ_32BIT] = 2, 133 [XMIT_SZ_32BIT] = 2, \
91 [XMIT_SZ_128BIT] = 4, 134 [XMIT_SZ_64BIT] = 3, \
92 [XMIT_SZ_256BIT] = 5, 135 [XMIT_SZ_128BIT] = 4, \
93}; 136 [XMIT_SZ_256BIT] = 5, \
137 [XMIT_SZ_128BIT_BLK] = 4, \
138 [XMIT_SZ_256BIT_BLK] = 5, \
139}
140
141#define TS_INDEX2VAL(i) ((((i) & 3) << CHCR_TS_LOW_SHIFT) | \
142 ((((i) >> 2) & 3) << CHCR_TS_HIGH_SHIFT))
94 143
95#endif /* __ASM_SH_CPU_SH4_DMA_SH7780_H */ 144#endif /* __ASM_SH_CPU_SH4_DMA_SH7780_H */