diff options
author | Eric Miao <eric.miao@marvell.com> | 2009-01-02 06:38:42 -0500 |
---|---|---|
committer | Eric Miao <eric.miao@marvell.com> | 2009-03-09 09:22:36 -0400 |
commit | 7ebc8d56f407184a457dd5fc739cf39e423a25aa (patch) | |
tree | 6c5e7ba83c22def2304bf6db69116ca5d763c0b8 /arch/arm | |
parent | fef1f99a0c2928893c074bf3eff27efd36a4532a (diff) |
[ARM] pxa: move DMA registers definitions into <mach/dma.h>
1. Driver code where pxa_request_dma() is called will most likely
reference DMA registers as well, and it is really unnecessary
to include pxa-regs.h just for this. Move the definitions into
<mach/dma.h> and make relevant drivers include it instead of
<mach/pxa-regs.h>.
2. Introduce DMAC_REGS_VIRT as the virtual address base for these
DMA registers. This allows later processors to re-use the same
IP while registers may start at different I/O address.
Signed-off-by: Eric Miao <eric.miao@marvell.com>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-pxa/dma.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-pxa/include/mach/dma.h | 56 | ||||
-rw-r--r-- | arch/arm/mach-pxa/include/mach/pxa-regs.h | 59 |
3 files changed, 56 insertions, 61 deletions
diff --git a/arch/arm/mach-pxa/dma.c b/arch/arm/mach-pxa/dma.c index 4613bf1fe43c..01217e01f7d2 100644 --- a/arch/arm/mach-pxa/dma.c +++ b/arch/arm/mach-pxa/dma.c | |||
@@ -23,8 +23,6 @@ | |||
23 | #include <mach/hardware.h> | 23 | #include <mach/hardware.h> |
24 | #include <mach/dma.h> | 24 | #include <mach/dma.h> |
25 | 25 | ||
26 | #include <mach/pxa-regs.h> | ||
27 | |||
28 | struct dma_channel { | 26 | struct dma_channel { |
29 | char *name; | 27 | char *name; |
30 | pxa_dma_prio prio; | 28 | pxa_dma_prio prio; |
diff --git a/arch/arm/mach-pxa/include/mach/dma.h b/arch/arm/mach-pxa/include/mach/dma.h index 77607fe4bd65..b0812f59d3f8 100644 --- a/arch/arm/mach-pxa/include/mach/dma.h +++ b/arch/arm/mach-pxa/include/mach/dma.h | |||
@@ -12,6 +12,62 @@ | |||
12 | #ifndef __ASM_ARCH_DMA_H | 12 | #ifndef __ASM_ARCH_DMA_H |
13 | #define __ASM_ARCH_DMA_H | 13 | #define __ASM_ARCH_DMA_H |
14 | 14 | ||
15 | #include <mach/hardware.h> | ||
16 | |||
17 | /* DMA Controller Registers Definitions */ | ||
18 | #define DMAC_REGS_VIRT io_p2v(0x40000000) | ||
19 | #define DMAC_REG(x) (*((volatile u32 *)(DMAC_REGS_VIRT + (x)))) | ||
20 | |||
21 | #define DCSR(n) DMAC_REG((n) << 2) | ||
22 | #define DALGN DMAC_REG(0x00a0) /* DMA Alignment Register */ | ||
23 | #define DINT DMAC_REG(0x00f0) /* DMA Interrupt Register */ | ||
24 | #define DDADR(n) DMAC_REG(0x0200 + ((n) << 4)) | ||
25 | #define DSADR(n) DMAC_REG(0x0204 + ((n) << 4)) | ||
26 | #define DTADR(n) DMAC_REG(0x0208 + ((n) << 4)) | ||
27 | #define DCMD(n) DMAC_REG(0x020c + ((n) << 4)) | ||
28 | #define DRCMR(n) DMAC_REG((((n) < 64) ? 0x0100 : 0x1100) + \ | ||
29 | (((n) & 0x3f) << 2)) | ||
30 | |||
31 | #define DCSR_RUN (1 << 31) /* Run Bit (read / write) */ | ||
32 | #define DCSR_NODESC (1 << 30) /* No-Descriptor Fetch (read / write) */ | ||
33 | #define DCSR_STOPIRQEN (1 << 29) /* Stop Interrupt Enable (read / write) */ | ||
34 | #define DCSR_REQPEND (1 << 8) /* Request Pending (read-only) */ | ||
35 | #define DCSR_STOPSTATE (1 << 3) /* Stop State (read-only) */ | ||
36 | #define DCSR_ENDINTR (1 << 2) /* End Interrupt (read / write) */ | ||
37 | #define DCSR_STARTINTR (1 << 1) /* Start Interrupt (read / write) */ | ||
38 | #define DCSR_BUSERR (1 << 0) /* Bus Error Interrupt (read / write) */ | ||
39 | |||
40 | #if defined(CONFIG_PXA27x) || defined(CONFIG_PXA3xx) | ||
41 | #define DCSR_EORIRQEN (1 << 28) /* End of Receive Interrupt Enable (R/W) */ | ||
42 | #define DCSR_EORJMPEN (1 << 27) /* Jump to next descriptor on EOR */ | ||
43 | #define DCSR_EORSTOPEN (1 << 26) /* STOP on an EOR */ | ||
44 | #define DCSR_SETCMPST (1 << 25) /* Set Descriptor Compare Status */ | ||
45 | #define DCSR_CLRCMPST (1 << 24) /* Clear Descriptor Compare Status */ | ||
46 | #define DCSR_CMPST (1 << 10) /* The Descriptor Compare Status */ | ||
47 | #define DCSR_EORINTR (1 << 9) /* The end of Receive */ | ||
48 | #endif | ||
49 | |||
50 | #define DRCMR_MAPVLD (1 << 7) /* Map Valid (read / write) */ | ||
51 | #define DRCMR_CHLNUM 0x1f /* mask for Channel Number (read / write) */ | ||
52 | |||
53 | #define DDADR_DESCADDR 0xfffffff0 /* Address of next descriptor (mask) */ | ||
54 | #define DDADR_STOP (1 << 0) /* Stop (read / write) */ | ||
55 | |||
56 | #define DCMD_INCSRCADDR (1 << 31) /* Source Address Increment Setting. */ | ||
57 | #define DCMD_INCTRGADDR (1 << 30) /* Target Address Increment Setting. */ | ||
58 | #define DCMD_FLOWSRC (1 << 29) /* Flow Control by the source. */ | ||
59 | #define DCMD_FLOWTRG (1 << 28) /* Flow Control by the target. */ | ||
60 | #define DCMD_STARTIRQEN (1 << 22) /* Start Interrupt Enable */ | ||
61 | #define DCMD_ENDIRQEN (1 << 21) /* End Interrupt Enable */ | ||
62 | #define DCMD_ENDIAN (1 << 18) /* Device Endian-ness. */ | ||
63 | #define DCMD_BURST8 (1 << 16) /* 8 byte burst */ | ||
64 | #define DCMD_BURST16 (2 << 16) /* 16 byte burst */ | ||
65 | #define DCMD_BURST32 (3 << 16) /* 32 byte burst */ | ||
66 | #define DCMD_WIDTH1 (1 << 14) /* 1 byte width */ | ||
67 | #define DCMD_WIDTH2 (2 << 14) /* 2 byte width (HalfWord) */ | ||
68 | #define DCMD_WIDTH4 (3 << 14) /* 4 byte width (Word) */ | ||
69 | #define DCMD_LENGTH 0x01fff /* length mask (max = 8K - 1) */ | ||
70 | |||
15 | /* | 71 | /* |
16 | * Descriptor structure for PXA's DMA engine | 72 | * Descriptor structure for PXA's DMA engine |
17 | * Note: this structure must always be aligned to a 16-byte boundary. | 73 | * Note: this structure must always be aligned to a 16-byte boundary. |
diff --git a/arch/arm/mach-pxa/include/mach/pxa-regs.h b/arch/arm/mach-pxa/include/mach/pxa-regs.h index 31d615aa7723..7d8db197615c 100644 --- a/arch/arm/mach-pxa/include/mach/pxa-regs.h +++ b/arch/arm/mach-pxa/include/mach/pxa-regs.h | |||
@@ -65,65 +65,6 @@ | |||
65 | #define _PCMCIA1Attr _PCMCIAAttr (1) /* PCMCIA 1 Attribute */ | 65 | #define _PCMCIA1Attr _PCMCIAAttr (1) /* PCMCIA 1 Attribute */ |
66 | #define _PCMCIA1Mem _PCMCIAMem (1) /* PCMCIA 1 Memory */ | 66 | #define _PCMCIA1Mem _PCMCIAMem (1) /* PCMCIA 1 Memory */ |
67 | 67 | ||
68 | |||
69 | |||
70 | /* | ||
71 | * DMA Controller | ||
72 | */ | ||
73 | #define DCSR(x) __REG2(0x40000000, (x) << 2) | ||
74 | |||
75 | #define DCSR_RUN (1 << 31) /* Run Bit (read / write) */ | ||
76 | #define DCSR_NODESC (1 << 30) /* No-Descriptor Fetch (read / write) */ | ||
77 | #define DCSR_STOPIRQEN (1 << 29) /* Stop Interrupt Enable (read / write) */ | ||
78 | #define DCSR_REQPEND (1 << 8) /* Request Pending (read-only) */ | ||
79 | #define DCSR_STOPSTATE (1 << 3) /* Stop State (read-only) */ | ||
80 | #define DCSR_ENDINTR (1 << 2) /* End Interrupt (read / write) */ | ||
81 | #define DCSR_STARTINTR (1 << 1) /* Start Interrupt (read / write) */ | ||
82 | #define DCSR_BUSERR (1 << 0) /* Bus Error Interrupt (read / write) */ | ||
83 | |||
84 | #if defined(CONFIG_PXA27x) || defined(CONFIG_PXA3xx) | ||
85 | #define DCSR_EORIRQEN (1 << 28) /* End of Receive Interrupt Enable (R/W) */ | ||
86 | #define DCSR_EORJMPEN (1 << 27) /* Jump to next descriptor on EOR */ | ||
87 | #define DCSR_EORSTOPEN (1 << 26) /* STOP on an EOR */ | ||
88 | #define DCSR_SETCMPST (1 << 25) /* Set Descriptor Compare Status */ | ||
89 | #define DCSR_CLRCMPST (1 << 24) /* Clear Descriptor Compare Status */ | ||
90 | #define DCSR_CMPST (1 << 10) /* The Descriptor Compare Status */ | ||
91 | #define DCSR_EORINTR (1 << 9) /* The end of Receive */ | ||
92 | #endif | ||
93 | |||
94 | #define DALGN __REG(0x400000a0) /* DMA Alignment Register */ | ||
95 | #define DINT __REG(0x400000f0) /* DMA Interrupt Register */ | ||
96 | |||
97 | #define DRCMR(n) (*(((n) < 64) ? \ | ||
98 | &__REG2(0x40000100, ((n) & 0x3f) << 2) : \ | ||
99 | &__REG2(0x40001100, ((n) & 0x3f) << 2))) | ||
100 | |||
101 | #define DRCMR_MAPVLD (1 << 7) /* Map Valid (read / write) */ | ||
102 | #define DRCMR_CHLNUM 0x1f /* mask for Channel Number (read / write) */ | ||
103 | |||
104 | #define DDADR(x) __REG2(0x40000200, (x) << 4) | ||
105 | #define DSADR(x) __REG2(0x40000204, (x) << 4) | ||
106 | #define DTADR(x) __REG2(0x40000208, (x) << 4) | ||
107 | #define DCMD(x) __REG2(0x4000020c, (x) << 4) | ||
108 | |||
109 | #define DDADR_DESCADDR 0xfffffff0 /* Address of next descriptor (mask) */ | ||
110 | #define DDADR_STOP (1 << 0) /* Stop (read / write) */ | ||
111 | |||
112 | #define DCMD_INCSRCADDR (1 << 31) /* Source Address Increment Setting. */ | ||
113 | #define DCMD_INCTRGADDR (1 << 30) /* Target Address Increment Setting. */ | ||
114 | #define DCMD_FLOWSRC (1 << 29) /* Flow Control by the source. */ | ||
115 | #define DCMD_FLOWTRG (1 << 28) /* Flow Control by the target. */ | ||
116 | #define DCMD_STARTIRQEN (1 << 22) /* Start Interrupt Enable */ | ||
117 | #define DCMD_ENDIRQEN (1 << 21) /* End Interrupt Enable */ | ||
118 | #define DCMD_ENDIAN (1 << 18) /* Device Endian-ness. */ | ||
119 | #define DCMD_BURST8 (1 << 16) /* 8 byte burst */ | ||
120 | #define DCMD_BURST16 (2 << 16) /* 16 byte burst */ | ||
121 | #define DCMD_BURST32 (3 << 16) /* 32 byte burst */ | ||
122 | #define DCMD_WIDTH1 (1 << 14) /* 1 byte width */ | ||
123 | #define DCMD_WIDTH2 (2 << 14) /* 2 byte width (HalfWord) */ | ||
124 | #define DCMD_WIDTH4 (3 << 14) /* 4 byte width (Word) */ | ||
125 | #define DCMD_LENGTH 0x01fff /* length mask (max = 8K - 1) */ | ||
126 | |||
127 | /* | 68 | /* |
128 | * Real Time Clock | 69 | * Real Time Clock |
129 | */ | 70 | */ |