Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0db07a90 authored by Bob Liu's avatar Bob Liu
Browse files

blackfin: cleanup anomaly workarounds



cleanup ANOMALY_05000312 and ANOMALY_05000244

Signed-off-by: default avatarRobin Getz <robin.getz@analog.com>
Signed-off-by: default avatarBob Liu <lliubbo@gmail.com>
parent ff4db3b1
Loading
Loading
Loading
Loading
+20 −24
Original line number Original line Diff line number Diff line
@@ -17,22 +17,16 @@
static inline void SSYNC(void)
static inline void SSYNC(void)
{
{
	int _tmp;
	int _tmp;
	if (ANOMALY_05000312)
	if (ANOMALY_05000312 || ANOMALY_05000244)
		__asm__ __volatile__(
		__asm__ __volatile__(
			"cli %0;"
			"cli %0;"
			"nop;"
			"nop;"
			"nop;"
			"nop;"
			"nop;"
			"ssync;"
			"ssync;"
			"sti %0;"
			"sti %0;"
			: "=d" (_tmp)
			: "=d" (_tmp)
		);
		);
	else if (ANOMALY_05000244)
		__asm__ __volatile__(
			"nop;"
			"nop;"
			"nop;"
			"ssync;"
		);
	else
	else
		__asm__ __volatile__("ssync;");
		__asm__ __volatile__("ssync;");
}
}
@@ -41,22 +35,16 @@ static inline void SSYNC(void)
static inline void CSYNC(void)
static inline void CSYNC(void)
{
{
	int _tmp;
	int _tmp;
	if (ANOMALY_05000312)
	if (ANOMALY_05000312 || ANOMALY_05000244)
		__asm__ __volatile__(
		__asm__ __volatile__(
			"cli %0;"
			"cli %0;"
			"nop;"
			"nop;"
			"nop;"
			"nop;"
			"nop;"
			"csync;"
			"csync;"
			"sti %0;"
			"sti %0;"
			: "=d" (_tmp)
			: "=d" (_tmp)
		);
		);
	else if (ANOMALY_05000244)
		__asm__ __volatile__(
			"nop;"
			"nop;"
			"nop;"
			"csync;"
		);
	else
	else
		__asm__ __volatile__("csync;");
		__asm__ __volatile__("csync;");
}
}
@@ -73,18 +61,26 @@ static inline void CSYNC(void)
#define ssync(x) SSYNC(x)
#define ssync(x) SSYNC(x)
#define csync(x) CSYNC(x)
#define csync(x) CSYNC(x)


#if ANOMALY_05000312
#if ANOMALY_05000312 || ANOMALY_05000244
#define SSYNC(scratch) cli scratch; nop; nop; SSYNC; sti scratch;
#define SSYNC(scratch)	\
#define CSYNC(scratch) cli scratch; nop; nop; CSYNC; sti scratch;
do {			\

	cli scratch;	\
#elif ANOMALY_05000244
	nop; nop; nop;	\
#define SSYNC(scratch) nop; nop; nop; SSYNC;
	SSYNC;		\
#define CSYNC(scratch) nop; nop; nop; CSYNC;
	sti scratch;	\
} while (0)

#define CSYNC(scratch)	\
do {			\
	cli scratch;	\
	nop; nop; nop;	\
	CSYNC;		\
	sti scratch;	\
} while (0)


#else
#else
#define SSYNC(scratch) SSYNC;
#define SSYNC(scratch) SSYNC;
#define CSYNC(scratch) CSYNC;
#define CSYNC(scratch) CSYNC;

#endif /* ANOMALY_05000312 & ANOMALY_05000244 handling */
#endif /* ANOMALY_05000312 & ANOMALY_05000244 handling */


#endif /* __ASSEMBLY__ */
#endif /* __ASSEMBLY__ */