diff options
author | Bob Liu <lliubbo@gmail.com> | 2012-01-27 09:10:04 -0500 |
---|---|---|
committer | Bob Liu <lliubbo@gmail.com> | 2012-03-20 23:00:08 -0400 |
commit | 0db07a905628d7f2952691df40853ffd95ceb097 (patch) | |
tree | 71e29ef0fffa436a66912145ab344ec4d9e50b19 /arch/blackfin/include/asm | |
parent | ff4db3b14c30974c4c951772cb4e13b16bd676bb (diff) |
blackfin: cleanup anomaly workarounds
cleanup ANOMALY_05000312 and ANOMALY_05000244
Signed-off-by: Robin Getz <robin.getz@analog.com>
Signed-off-by: Bob Liu <lliubbo@gmail.com>
Diffstat (limited to 'arch/blackfin/include/asm')
-rw-r--r-- | arch/blackfin/include/asm/blackfin.h | 44 |
1 files changed, 20 insertions, 24 deletions
diff --git a/arch/blackfin/include/asm/blackfin.h b/arch/blackfin/include/asm/blackfin.h index 0928700b6bc4..7be5368c0512 100644 --- a/arch/blackfin/include/asm/blackfin.h +++ b/arch/blackfin/include/asm/blackfin.h | |||
@@ -17,22 +17,16 @@ | |||
17 | static inline void SSYNC(void) | 17 | static inline void SSYNC(void) |
18 | { | 18 | { |
19 | int _tmp; | 19 | int _tmp; |
20 | if (ANOMALY_05000312) | 20 | if (ANOMALY_05000312 || ANOMALY_05000244) |
21 | __asm__ __volatile__( | 21 | __asm__ __volatile__( |
22 | "cli %0;" | 22 | "cli %0;" |
23 | "nop;" | 23 | "nop;" |
24 | "nop;" | 24 | "nop;" |
25 | "nop;" | ||
25 | "ssync;" | 26 | "ssync;" |
26 | "sti %0;" | 27 | "sti %0;" |
27 | : "=d" (_tmp) | 28 | : "=d" (_tmp) |
28 | ); | 29 | ); |
29 | else if (ANOMALY_05000244) | ||
30 | __asm__ __volatile__( | ||
31 | "nop;" | ||
32 | "nop;" | ||
33 | "nop;" | ||
34 | "ssync;" | ||
35 | ); | ||
36 | else | 30 | else |
37 | __asm__ __volatile__("ssync;"); | 31 | __asm__ __volatile__("ssync;"); |
38 | } | 32 | } |
@@ -41,22 +35,16 @@ static inline void SSYNC(void) | |||
41 | static inline void CSYNC(void) | 35 | static inline void CSYNC(void) |
42 | { | 36 | { |
43 | int _tmp; | 37 | int _tmp; |
44 | if (ANOMALY_05000312) | 38 | if (ANOMALY_05000312 || ANOMALY_05000244) |
45 | __asm__ __volatile__( | 39 | __asm__ __volatile__( |
46 | "cli %0;" | 40 | "cli %0;" |
47 | "nop;" | 41 | "nop;" |
48 | "nop;" | 42 | "nop;" |
43 | "nop;" | ||
49 | "csync;" | 44 | "csync;" |
50 | "sti %0;" | 45 | "sti %0;" |
51 | : "=d" (_tmp) | 46 | : "=d" (_tmp) |
52 | ); | 47 | ); |
53 | else if (ANOMALY_05000244) | ||
54 | __asm__ __volatile__( | ||
55 | "nop;" | ||
56 | "nop;" | ||
57 | "nop;" | ||
58 | "csync;" | ||
59 | ); | ||
60 | else | 48 | else |
61 | __asm__ __volatile__("csync;"); | 49 | __asm__ __volatile__("csync;"); |
62 | } | 50 | } |
@@ -73,18 +61,26 @@ static inline void CSYNC(void) | |||
73 | #define ssync(x) SSYNC(x) | 61 | #define ssync(x) SSYNC(x) |
74 | #define csync(x) CSYNC(x) | 62 | #define csync(x) CSYNC(x) |
75 | 63 | ||
76 | #if ANOMALY_05000312 | 64 | #if ANOMALY_05000312 || ANOMALY_05000244 |
77 | #define SSYNC(scratch) cli scratch; nop; nop; SSYNC; sti scratch; | 65 | #define SSYNC(scratch) \ |
78 | #define CSYNC(scratch) cli scratch; nop; nop; CSYNC; sti scratch; | 66 | do { \ |
79 | 67 | cli scratch; \ | |
80 | #elif ANOMALY_05000244 | 68 | nop; nop; nop; \ |
81 | #define SSYNC(scratch) nop; nop; nop; SSYNC; | 69 | SSYNC; \ |
82 | #define CSYNC(scratch) nop; nop; nop; CSYNC; | 70 | sti scratch; \ |
71 | } while (0) | ||
72 | |||
73 | #define CSYNC(scratch) \ | ||
74 | do { \ | ||
75 | cli scratch; \ | ||
76 | nop; nop; nop; \ | ||
77 | CSYNC; \ | ||
78 | sti scratch; \ | ||
79 | } while (0) | ||
83 | 80 | ||
84 | #else | 81 | #else |
85 | #define SSYNC(scratch) SSYNC; | 82 | #define SSYNC(scratch) SSYNC; |
86 | #define CSYNC(scratch) CSYNC; | 83 | #define CSYNC(scratch) CSYNC; |
87 | |||
88 | #endif /* ANOMALY_05000312 & ANOMALY_05000244 handling */ | 84 | #endif /* ANOMALY_05000312 & ANOMALY_05000244 handling */ |
89 | 85 | ||
90 | #endif /* __ASSEMBLY__ */ | 86 | #endif /* __ASSEMBLY__ */ |