blackfin.h 1.5 KB

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