blackfin.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  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)
  17. __asm__ __volatile__(
  18. "cli %0;"
  19. "nop;"
  20. "nop;"
  21. "ssync;"
  22. "sti %0;"
  23. : "=d" (_tmp)
  24. );
  25. else if (ANOMALY_05000244)
  26. __asm__ __volatile__(
  27. "nop;"
  28. "nop;"
  29. "nop;"
  30. "ssync;"
  31. );
  32. else
  33. __asm__ __volatile__("ssync;");
  34. }
  35. /* CSYNC implementation for C file */
  36. static inline void CSYNC(void)
  37. {
  38. int _tmp;
  39. if (ANOMALY_05000312)
  40. __asm__ __volatile__(
  41. "cli %0;"
  42. "nop;"
  43. "nop;"
  44. "csync;"
  45. "sti %0;"
  46. : "=d" (_tmp)
  47. );
  48. else if (ANOMALY_05000244)
  49. __asm__ __volatile__(
  50. "nop;"
  51. "nop;"
  52. "nop;"
  53. "csync;"
  54. );
  55. else
  56. __asm__ __volatile__("csync;");
  57. }
  58. #else /* __ASSEMBLY__ */
  59. #define LO(con32) ((con32) & 0xFFFF)
  60. #define lo(con32) ((con32) & 0xFFFF)
  61. #define HI(con32) (((con32) >> 16) & 0xFFFF)
  62. #define hi(con32) (((con32) >> 16) & 0xFFFF)
  63. /* SSYNC & CSYNC implementations for assembly files */
  64. #define ssync(x) SSYNC(x)
  65. #define csync(x) CSYNC(x)
  66. #if ANOMALY_05000312
  67. #define SSYNC(scratch) cli scratch; nop; nop; SSYNC; sti scratch;
  68. #define CSYNC(scratch) cli scratch; nop; nop; CSYNC; sti scratch;
  69. #elif ANOMALY_05000244
  70. #define SSYNC(scratch) nop; nop; nop; SSYNC;
  71. #define CSYNC(scratch) nop; nop; nop; CSYNC;
  72. #else
  73. #define SSYNC(scratch) SSYNC;
  74. #define CSYNC(scratch) CSYNC;
  75. #endif /* ANOMALY_05000312 & ANOMALY_05000244 handling */
  76. #endif /* __ASSEMBLY__ */
  77. #include <asm/mem_map.h>
  78. #include <mach/blackfin.h>
  79. #include <asm/bfin-global.h>
  80. #endif /* _BLACKFIN_H_ */