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>
This commit is contained in:
Bob Liu 2012-01-27 22:10:04 +08:00
parent ff4db3b14c
commit 0db07a9056
1 changed files with 19 additions and 23 deletions

View File

@ -17,22 +17,16 @@
static inline void SSYNC(void)
{
int _tmp;
if (ANOMALY_05000312)
if (ANOMALY_05000312 || ANOMALY_05000244)
__asm__ __volatile__(
"cli %0;"
"nop;"
"nop;"
"nop;"
"ssync;"
"sti %0;"
: "=d" (_tmp)
);
else if (ANOMALY_05000244)
__asm__ __volatile__(
"nop;"
"nop;"
"nop;"
"ssync;"
);
else
__asm__ __volatile__("ssync;");
}
@ -41,22 +35,16 @@ static inline void SSYNC(void)
static inline void CSYNC(void)
{
int _tmp;
if (ANOMALY_05000312)
if (ANOMALY_05000312 || ANOMALY_05000244)
__asm__ __volatile__(
"cli %0;"
"nop;"
"nop;"
"nop;"
"csync;"
"sti %0;"
: "=d" (_tmp)
);
else if (ANOMALY_05000244)
__asm__ __volatile__(
"nop;"
"nop;"
"nop;"
"csync;"
);
else
__asm__ __volatile__("csync;");
}
@ -73,18 +61,26 @@ static inline void CSYNC(void)
#define ssync(x) SSYNC(x)
#define csync(x) CSYNC(x)
#if ANOMALY_05000312
#define SSYNC(scratch) cli scratch; nop; nop; SSYNC; sti scratch;
#define CSYNC(scratch) cli scratch; nop; nop; CSYNC; sti scratch;
#if ANOMALY_05000312 || ANOMALY_05000244
#define SSYNC(scratch) \
do { \
cli scratch; \
nop; nop; nop; \
SSYNC; \
sti scratch; \
} while (0)
#elif ANOMALY_05000244
#define SSYNC(scratch) nop; nop; nop; SSYNC;
#define CSYNC(scratch) nop; nop; nop; CSYNC;
#define CSYNC(scratch) \
do { \
cli scratch; \
nop; nop; nop; \
CSYNC; \
sti scratch; \
} while (0)
#else
#define SSYNC(scratch) SSYNC;
#define CSYNC(scratch) CSYNC;
#endif /* ANOMALY_05000312 & ANOMALY_05000244 handling */
#endif /* __ASSEMBLY__ */