diff options
author | Bernd Schmidt <bernd.schmidt@analog.com> | 2007-07-12 04:25:29 -0400 |
---|---|---|
committer | Bryan Wu <bryan.wu@analog.com> | 2007-07-12 04:25:29 -0400 |
commit | 29440a2b4cd37e32dfe0fa60ef1665775b24dab1 (patch) | |
tree | 1b7bd1c1793feba0719f04de2eb68e418498e827 /include/asm-blackfin/mach-common | |
parent | 474f1a667d4bd40b6dcacc6870b70f4d2ba4e155 (diff) |
Blackfin arch: Start untangling the CPLB handling code.
- Move cache initialization to C from assembly.
- Move anomaly workaround for writing [ID]MEM_CONTROL to assembly, so
that we don't have to mess around with .align directives in C source.
- Fix a bug where bfin_write_DMEM_CONTROL would write to IMEM_CONTROL
- Break out CPLB related code from kernel/setup.c into their own file.
- Don't define variables in header files, only declare them.
Signed-off-by: Bernd Schmidt <bernd.schmidt@analog.com>
Signed-off-by: Bryan Wu <bryan.wu@analog.com>
Diffstat (limited to 'include/asm-blackfin/mach-common')
-rw-r--r-- | include/asm-blackfin/mach-common/cdef_LPBlackfin.h | 23 |
1 files changed, 2 insertions, 21 deletions
diff --git a/include/asm-blackfin/mach-common/cdef_LPBlackfin.h b/include/asm-blackfin/mach-common/cdef_LPBlackfin.h index 58f878947cbc..94ed381e5606 100644 --- a/include/asm-blackfin/mach-common/cdef_LPBlackfin.h +++ b/include/asm-blackfin/mach-common/cdef_LPBlackfin.h | |||
@@ -40,16 +40,7 @@ | |||
40 | #define bfin_write_SRAM_BASE_ADDRESS(val) bfin_write32(SRAM_BASE_ADDRESS,val) | 40 | #define bfin_write_SRAM_BASE_ADDRESS(val) bfin_write32(SRAM_BASE_ADDRESS,val) |
41 | #define bfin_read_DMEM_CONTROL() bfin_read32(DMEM_CONTROL) | 41 | #define bfin_read_DMEM_CONTROL() bfin_read32(DMEM_CONTROL) |
42 | #ifdef ANOMALY_05000125 | 42 | #ifdef ANOMALY_05000125 |
43 | static __inline__ void bfin_write_DMEM_CONTROL(unsigned int val) | 43 | extern void bfin_write_DMEM_CONTROL(unsigned int val); |
44 | { | ||
45 | unsigned long flags, iwr; | ||
46 | |||
47 | local_irq_save(flags); | ||
48 | __asm__(".align 8\n"); | ||
49 | bfin_write32(IMEM_CONTROL, val); | ||
50 | __builtin_bfin_ssync(); | ||
51 | local_irq_restore(flags); | ||
52 | } | ||
53 | #else | 44 | #else |
54 | #define bfin_write_DMEM_CONTROL(val) bfin_write32(DMEM_CONTROL,val) | 45 | #define bfin_write_DMEM_CONTROL(val) bfin_write32(DMEM_CONTROL,val) |
55 | #endif | 46 | #endif |
@@ -139,17 +130,7 @@ static __inline__ void bfin_write_DMEM_CONTROL(unsigned int val) | |||
139 | */ | 130 | */ |
140 | #define bfin_read_IMEM_CONTROL() bfin_read32(IMEM_CONTROL) | 131 | #define bfin_read_IMEM_CONTROL() bfin_read32(IMEM_CONTROL) |
141 | #ifdef ANOMALY_05000125 | 132 | #ifdef ANOMALY_05000125 |
142 | static __inline__ void bfin_write_IMEM_CONTROL(unsigned int val) | 133 | extern void bfin_write_IMEM_CONTROL(unsigned int val); |
143 | { | ||
144 | unsigned long flags, iwr; | ||
145 | |||
146 | local_irq_save(flags); | ||
147 | __asm__(".align 8\n"); | ||
148 | bfin_write32(IMEM_CONTROL, val); | ||
149 | __builtin_bfin_ssync(); | ||
150 | local_irq_restore(flags); | ||
151 | |||
152 | } | ||
153 | #else | 134 | #else |
154 | #define bfin_write_IMEM_CONTROL(val) bfin_write32(IMEM_CONTROL,val) | 135 | #define bfin_write_IMEM_CONTROL(val) bfin_write32(IMEM_CONTROL,val) |
155 | #endif | 136 | #endif |