diff options
author | Anton Vorontsov <avorontsov@ru.mvista.com> | 2008-05-23 12:39:06 -0400 |
---|---|---|
committer | Kumar Gala <galak@kernel.crashing.org> | 2008-06-10 12:11:21 -0400 |
commit | 5093bb965a163fe288c3e5db0275165f86c895c2 (patch) | |
tree | 77af9fbf28f45e277443be5abffb85feacc0097c /include/asm-powerpc | |
parent | b13e930906b313d787f4dd07fe78b74a3a8c22c4 (diff) |
powerpc/QE: switch to the cpm_muram implementation
This is very trivial patch. We're transitioning to the cpm_muram_*
calls. That's it.
Less trivial changes:
- BD_SC_* defines were defined in the cpm.h and qe.h, so to avoid redefines
we remove BD_SC from the qe.h and use cpm.h along with cpm_muram_*
prototypes;
- qe_muram_dump was unused and thus removed;
- added some code to the cpm_common.c to support legacy QE bindings
(data-only node name).
- For convenience, define qe_* calls to cpm_*. So drivers need not to be
changed.
Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'include/asm-powerpc')
-rw-r--r-- | include/asm-powerpc/cpm.h | 1 | ||||
-rw-r--r-- | include/asm-powerpc/qe.h | 36 |
2 files changed, 9 insertions, 28 deletions
diff --git a/include/asm-powerpc/cpm.h b/include/asm-powerpc/cpm.h index ede38ffe466a..63a55337c2de 100644 --- a/include/asm-powerpc/cpm.h +++ b/include/asm-powerpc/cpm.h | |||
@@ -96,6 +96,7 @@ unsigned long cpm_muram_alloc(unsigned long size, unsigned long align); | |||
96 | int cpm_muram_free(unsigned long offset); | 96 | int cpm_muram_free(unsigned long offset); |
97 | unsigned long cpm_muram_alloc_fixed(unsigned long offset, unsigned long size); | 97 | unsigned long cpm_muram_alloc_fixed(unsigned long offset, unsigned long size); |
98 | void __iomem *cpm_muram_addr(unsigned long offset); | 98 | void __iomem *cpm_muram_addr(unsigned long offset); |
99 | unsigned long cpm_muram_offset(void __iomem *addr); | ||
99 | dma_addr_t cpm_muram_dma(void __iomem *addr); | 100 | dma_addr_t cpm_muram_dma(void __iomem *addr); |
100 | int cpm_command(u32 command, u8 opcode); | 101 | int cpm_command(u32 command, u8 opcode); |
101 | 102 | ||
diff --git a/include/asm-powerpc/qe.h b/include/asm-powerpc/qe.h index 01e3c70b93ab..80807fd6a706 100644 --- a/include/asm-powerpc/qe.h +++ b/include/asm-powerpc/qe.h | |||
@@ -17,6 +17,7 @@ | |||
17 | #ifdef __KERNEL__ | 17 | #ifdef __KERNEL__ |
18 | 18 | ||
19 | #include <linux/spinlock.h> | 19 | #include <linux/spinlock.h> |
20 | #include <asm/cpm.h> | ||
20 | #include <asm/immap_qe.h> | 21 | #include <asm/immap_qe.h> |
21 | 22 | ||
22 | #define QE_NUM_OF_SNUM 28 | 23 | #define QE_NUM_OF_SNUM 28 |
@@ -119,20 +120,13 @@ unsigned int qe_get_brg_clk(void); | |||
119 | int qe_setbrg(enum qe_clock brg, unsigned int rate, unsigned int multiplier); | 120 | int qe_setbrg(enum qe_clock brg, unsigned int rate, unsigned int multiplier); |
120 | int qe_get_snum(void); | 121 | int qe_get_snum(void); |
121 | void qe_put_snum(u8 snum); | 122 | void qe_put_snum(u8 snum); |
122 | unsigned long qe_muram_alloc(int size, int align); | 123 | /* we actually use cpm_muram implementation, define this for convenience */ |
123 | int qe_muram_free(unsigned long offset); | 124 | #define qe_muram_init cpm_muram_init |
124 | unsigned long qe_muram_alloc_fixed(unsigned long offset, int size); | 125 | #define qe_muram_alloc cpm_muram_alloc |
125 | void qe_muram_dump(void); | 126 | #define qe_muram_alloc_fixed cpm_muram_alloc_fixed |
126 | 127 | #define qe_muram_free cpm_muram_free | |
127 | static inline void __iomem *qe_muram_addr(unsigned long offset) | 128 | #define qe_muram_addr cpm_muram_addr |
128 | { | 129 | #define qe_muram_offset cpm_muram_offset |
129 | return (void __iomem *)&qe_immr->muram[offset]; | ||
130 | } | ||
131 | |||
132 | static inline unsigned long qe_muram_offset(void __iomem *addr) | ||
133 | { | ||
134 | return addr - (void __iomem *)qe_immr->muram; | ||
135 | } | ||
136 | 130 | ||
137 | /* Structure that defines QE firmware binary files. | 131 | /* Structure that defines QE firmware binary files. |
138 | * | 132 | * |
@@ -199,20 +193,6 @@ struct qe_bd { | |||
199 | #define BD_STATUS_MASK 0xffff0000 | 193 | #define BD_STATUS_MASK 0xffff0000 |
200 | #define BD_LENGTH_MASK 0x0000ffff | 194 | #define BD_LENGTH_MASK 0x0000ffff |
201 | 195 | ||
202 | #define BD_SC_EMPTY 0x8000 /* Receive is empty */ | ||
203 | #define BD_SC_READY 0x8000 /* Transmit is ready */ | ||
204 | #define BD_SC_WRAP 0x2000 /* Last buffer descriptor */ | ||
205 | #define BD_SC_INTRPT 0x1000 /* Interrupt on change */ | ||
206 | #define BD_SC_LAST 0x0800 /* Last buffer in frame */ | ||
207 | #define BD_SC_CM 0x0200 /* Continous mode */ | ||
208 | #define BD_SC_ID 0x0100 /* Rec'd too many idles */ | ||
209 | #define BD_SC_P 0x0100 /* xmt preamble */ | ||
210 | #define BD_SC_BR 0x0020 /* Break received */ | ||
211 | #define BD_SC_FR 0x0010 /* Framing error */ | ||
212 | #define BD_SC_PR 0x0008 /* Parity error */ | ||
213 | #define BD_SC_OV 0x0002 /* Overrun */ | ||
214 | #define BD_SC_CD 0x0001 /* ?? */ | ||
215 | |||
216 | /* Alignment */ | 196 | /* Alignment */ |
217 | #define QE_INTR_TABLE_ALIGN 16 /* ??? */ | 197 | #define QE_INTR_TABLE_ALIGN 16 /* ??? */ |
218 | #define QE_ALIGNMENT_OF_BD 8 | 198 | #define QE_ALIGNMENT_OF_BD 8 |