diff options
Diffstat (limited to 'arch/blackfin/kernel/cplb-nompu/cplbmgr.c')
-rw-r--r-- | arch/blackfin/kernel/cplb-nompu/cplbmgr.c | 33 |
1 files changed, 4 insertions, 29 deletions
diff --git a/arch/blackfin/kernel/cplb-nompu/cplbmgr.c b/arch/blackfin/kernel/cplb-nompu/cplbmgr.c index 12b030842fd..aabbb42c42c 100644 --- a/arch/blackfin/kernel/cplb-nompu/cplbmgr.c +++ b/arch/blackfin/kernel/cplb-nompu/cplbmgr.c | |||
@@ -48,36 +48,13 @@ int nr_cplb_flush[NR_CPUS], nr_dcplb_prot[NR_CPUS]; | |||
48 | #define MGR_ATTR | 48 | #define MGR_ATTR |
49 | #endif | 49 | #endif |
50 | 50 | ||
51 | /* | ||
52 | * We're in an exception handler. The normal cli nop nop workaround | ||
53 | * isn't going to do very much, as the only thing that can interrupt | ||
54 | * us is an NMI, and the cli isn't going to stop that. | ||
55 | */ | ||
56 | #define NOWA_SSYNC __asm__ __volatile__ ("ssync;") | ||
57 | |||
58 | /* Anomaly handlers provide SSYNCs, so avoid extra if anomaly is present */ | ||
59 | #if ANOMALY_05000125 | ||
60 | |||
61 | #define bfin_write_DMEM_CONTROL_SSYNC(v) bfin_write_DMEM_CONTROL(v) | ||
62 | #define bfin_write_IMEM_CONTROL_SSYNC(v) bfin_write_IMEM_CONTROL(v) | ||
63 | |||
64 | #else | ||
65 | |||
66 | #define bfin_write_DMEM_CONTROL_SSYNC(v) \ | ||
67 | do { NOWA_SSYNC; bfin_write_DMEM_CONTROL(v); NOWA_SSYNC; } while (0) | ||
68 | #define bfin_write_IMEM_CONTROL_SSYNC(v) \ | ||
69 | do { NOWA_SSYNC; bfin_write_IMEM_CONTROL(v); NOWA_SSYNC; } while (0) | ||
70 | |||
71 | #endif | ||
72 | |||
73 | static inline void write_dcplb_data(int cpu, int idx, unsigned long data, | 51 | static inline void write_dcplb_data(int cpu, int idx, unsigned long data, |
74 | unsigned long addr) | 52 | unsigned long addr) |
75 | { | 53 | { |
76 | unsigned long ctrl = bfin_read_DMEM_CONTROL(); | 54 | _disable_dcplb(); |
77 | bfin_write_DMEM_CONTROL_SSYNC(ctrl & ~ENDCPLB); | ||
78 | bfin_write32(DCPLB_DATA0 + idx * 4, data); | 55 | bfin_write32(DCPLB_DATA0 + idx * 4, data); |
79 | bfin_write32(DCPLB_ADDR0 + idx * 4, addr); | 56 | bfin_write32(DCPLB_ADDR0 + idx * 4, addr); |
80 | bfin_write_DMEM_CONTROL_SSYNC(ctrl); | 57 | _enable_dcplb(); |
81 | 58 | ||
82 | #ifdef CONFIG_CPLB_INFO | 59 | #ifdef CONFIG_CPLB_INFO |
83 | dcplb_tbl[cpu][idx].addr = addr; | 60 | dcplb_tbl[cpu][idx].addr = addr; |
@@ -88,12 +65,10 @@ static inline void write_dcplb_data(int cpu, int idx, unsigned long data, | |||
88 | static inline void write_icplb_data(int cpu, int idx, unsigned long data, | 65 | static inline void write_icplb_data(int cpu, int idx, unsigned long data, |
89 | unsigned long addr) | 66 | unsigned long addr) |
90 | { | 67 | { |
91 | unsigned long ctrl = bfin_read_IMEM_CONTROL(); | 68 | _disable_icplb(); |
92 | |||
93 | bfin_write_IMEM_CONTROL_SSYNC(ctrl & ~ENICPLB); | ||
94 | bfin_write32(ICPLB_DATA0 + idx * 4, data); | 69 | bfin_write32(ICPLB_DATA0 + idx * 4, data); |
95 | bfin_write32(ICPLB_ADDR0 + idx * 4, addr); | 70 | bfin_write32(ICPLB_ADDR0 + idx * 4, addr); |
96 | bfin_write_IMEM_CONTROL_SSYNC(ctrl); | 71 | _enable_icplb(); |
97 | 72 | ||
98 | #ifdef CONFIG_CPLB_INFO | 73 | #ifdef CONFIG_CPLB_INFO |
99 | icplb_tbl[cpu][idx].addr = addr; | 74 | icplb_tbl[cpu][idx].addr = addr; |