Commit | Line | Data |
---|---|---|
1394f032 | 1 | /* |
96f1050d | 2 | * Common header file for Blackfin family of processors. |
1394f032 | 3 | * |
96956450 MF |
4 | * Copyright 2004-2009 Analog Devices Inc. |
5 | * | |
6 | * Licensed under the GPL-2 or later. | |
1394f032 BW |
7 | */ |
8 | ||
9 | #ifndef _BLACKFIN_H_ | |
10 | #define _BLACKFIN_H_ | |
11 | ||
639f6571 | 12 | #include <mach/anomaly.h> |
1394f032 BW |
13 | |
14 | #ifndef __ASSEMBLY__ | |
15 | ||
16 | /* SSYNC implementation for C file */ | |
1aafd909 | 17 | static inline void SSYNC(void) |
1394f032 BW |
18 | { |
19 | int _tmp; | |
0db07a90 | 20 | if (ANOMALY_05000312 || ANOMALY_05000244) |
1aafd909 MF |
21 | __asm__ __volatile__( |
22 | "cli %0;" | |
23 | "nop;" | |
24 | "nop;" | |
0db07a90 | 25 | "nop;" |
1aafd909 MF |
26 | "ssync;" |
27 | "sti %0;" | |
28 | : "=d" (_tmp) | |
29 | ); | |
1aafd909 MF |
30 | else |
31 | __asm__ __volatile__("ssync;"); | |
1394f032 | 32 | } |
1394f032 BW |
33 | |
34 | /* CSYNC implementation for C file */ | |
1aafd909 | 35 | static inline void CSYNC(void) |
1394f032 BW |
36 | { |
37 | int _tmp; | |
0db07a90 | 38 | if (ANOMALY_05000312 || ANOMALY_05000244) |
1aafd909 MF |
39 | __asm__ __volatile__( |
40 | "cli %0;" | |
41 | "nop;" | |
42 | "nop;" | |
0db07a90 | 43 | "nop;" |
1aafd909 MF |
44 | "csync;" |
45 | "sti %0;" | |
46 | : "=d" (_tmp) | |
47 | ); | |
1aafd909 MF |
48 | else |
49 | __asm__ __volatile__("csync;"); | |
1394f032 | 50 | } |
1394f032 | 51 | |
4bf3f3cb RG |
52 | #else /* __ASSEMBLY__ */ |
53 | ||
b5e986c4 MF |
54 | #define LO(con32) ((con32) & 0xFFFF) |
55 | #define lo(con32) ((con32) & 0xFFFF) | |
56 | #define HI(con32) (((con32) >> 16) & 0xFFFF) | |
57 | #define hi(con32) (((con32) >> 16) & 0xFFFF) | |
58 | ||
4bf3f3cb RG |
59 | /* SSYNC & CSYNC implementations for assembly files */ |
60 | ||
61 | #define ssync(x) SSYNC(x) | |
62 | #define csync(x) CSYNC(x) | |
63 | ||
0db07a90 BL |
64 | #if ANOMALY_05000312 || ANOMALY_05000244 |
65 | #define SSYNC(scratch) \ | |
0db07a90 BL |
66 | cli scratch; \ |
67 | nop; nop; nop; \ | |
68 | SSYNC; \ | |
b2286f2b | 69 | sti scratch; |
0db07a90 BL |
70 | |
71 | #define CSYNC(scratch) \ | |
0db07a90 BL |
72 | cli scratch; \ |
73 | nop; nop; nop; \ | |
74 | CSYNC; \ | |
b2286f2b | 75 | sti scratch; |
4bf3f3cb | 76 | |
fb51d566 | 77 | #else |
4bf3f3cb RG |
78 | #define SSYNC(scratch) SSYNC; |
79 | #define CSYNC(scratch) CSYNC; | |
4bf3f3cb RG |
80 | #endif /* ANOMALY_05000312 & ANOMALY_05000244 handling */ |
81 | ||
1394f032 BW |
82 | #endif /* __ASSEMBLY__ */ |
83 | ||
fa48f84a | 84 | #include <asm/mem_map.h> |
639f6571 | 85 | #include <mach/blackfin.h> |
36a1548f MF |
86 | #include <asm/bfin-global.h> |
87 | ||
1394f032 | 88 | #endif /* _BLACKFIN_H_ */ |