blackfin.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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. do { \
  57. cli scratch; \
  58. nop; nop; nop; \
  59. SSYNC; \
  60. sti scratch; \
  61. } while (0)
  62. #define CSYNC(scratch) \
  63. do { \
  64. cli scratch; \
  65. nop; nop; nop; \
  66. CSYNC; \
  67. sti scratch; \
  68. } while (0)
  69. #else
  70. #define SSYNC(scratch) SSYNC;
  71. #define CSYNC(scratch) CSYNC;
  72. #endif /* ANOMALY_05000312 & ANOMALY_05000244 handling */
  73. #endif /* __ASSEMBLY__ */
  74. #include <asm/mem_map.h>
  75. #include <mach/blackfin.h>
  76. #include <asm/bfin-global.h>
  77. #endif /* _BLACKFIN_H_ */