glue-cache.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. /*
  2. * arch/arm/include/asm/glue-cache.h
  3. *
  4. * Copyright (C) 1999-2002 Russell King
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2 as
  8. * published by the Free Software Foundation.
  9. */
  10. #ifndef ASM_GLUE_CACHE_H
  11. #define ASM_GLUE_CACHE_H
  12. #include <asm/glue.h>
  13. /*
  14. * Cache Model
  15. * ===========
  16. */
  17. #undef _CACHE
  18. #undef MULTI_CACHE
  19. #if defined(CONFIG_CPU_CACHE_V4)
  20. # ifdef _CACHE
  21. # define MULTI_CACHE 1
  22. # else
  23. # define _CACHE v4
  24. # endif
  25. #endif
  26. #if defined(CONFIG_CPU_ARM920T) || defined(CONFIG_CPU_ARM922T) || \
  27. defined(CONFIG_CPU_ARM925T) || defined(CONFIG_CPU_ARM1020) || \
  28. defined(CONFIG_CPU_ARM1026)
  29. # define MULTI_CACHE 1
  30. #endif
  31. #if defined(CONFIG_CPU_FA526)
  32. # ifdef _CACHE
  33. # define MULTI_CACHE 1
  34. # else
  35. # define _CACHE fa
  36. # endif
  37. #endif
  38. #if defined(CONFIG_CPU_ARM926T)
  39. # ifdef _CACHE
  40. # define MULTI_CACHE 1
  41. # else
  42. # define _CACHE arm926
  43. # endif
  44. #endif
  45. #if defined(CONFIG_CPU_ARM940T)
  46. # ifdef _CACHE
  47. # define MULTI_CACHE 1
  48. # else
  49. # define _CACHE arm940
  50. # endif
  51. #endif
  52. #if defined(CONFIG_CPU_ARM946E)
  53. # ifdef _CACHE
  54. # define MULTI_CACHE 1
  55. # else
  56. # define _CACHE arm946
  57. # endif
  58. #endif
  59. #if defined(CONFIG_CPU_CACHE_V4WB)
  60. # ifdef _CACHE
  61. # define MULTI_CACHE 1
  62. # else
  63. # define _CACHE v4wb
  64. # endif
  65. #endif
  66. #if defined(CONFIG_CPU_XSCALE)
  67. # ifdef _CACHE
  68. # define MULTI_CACHE 1
  69. # else
  70. # define _CACHE xscale
  71. # endif
  72. #endif
  73. #if defined(CONFIG_CPU_XSC3)
  74. # ifdef _CACHE
  75. # define MULTI_CACHE 1
  76. # else
  77. # define _CACHE xsc3
  78. # endif
  79. #endif
  80. #if defined(CONFIG_CPU_MOHAWK)
  81. # ifdef _CACHE
  82. # define MULTI_CACHE 1
  83. # else
  84. # define _CACHE mohawk
  85. # endif
  86. #endif
  87. #if defined(CONFIG_CPU_FEROCEON)
  88. # define MULTI_CACHE 1
  89. #endif
  90. #if defined(CONFIG_CPU_V6) || defined(CONFIG_CPU_V6K)
  91. # ifdef _CACHE
  92. # define MULTI_CACHE 1
  93. # else
  94. # define _CACHE v6
  95. # endif
  96. #endif
  97. #if defined(CONFIG_CPU_V7)
  98. # ifdef _CACHE
  99. # define MULTI_CACHE 1
  100. # else
  101. # define _CACHE v7
  102. # endif
  103. #endif
  104. #if defined(CONFIG_CPU_V7M)
  105. # define MULTI_CACHE 1
  106. #endif
  107. #if !defined(_CACHE) && !defined(MULTI_CACHE)
  108. #error Unknown cache maintenance model
  109. #endif
  110. #ifndef __ASSEMBLER__
  111. static inline void nop_flush_icache_all(void) { }
  112. static inline void nop_flush_kern_cache_all(void) { }
  113. static inline void nop_flush_kern_cache_louis(void) { }
  114. static inline void nop_flush_user_cache_all(void) { }
  115. static inline void nop_flush_user_cache_range(unsigned long a,
  116. unsigned long b, unsigned int c) { }
  117. static inline void nop_coherent_kern_range(unsigned long a, unsigned long b) { }
  118. static inline int nop_coherent_user_range(unsigned long a,
  119. unsigned long b) { return 0; }
  120. static inline void nop_flush_kern_dcache_area(void *a, size_t s) { }
  121. static inline void nop_dma_flush_range(const void *a, const void *b) { }
  122. static inline void nop_dma_map_area(const void *s, size_t l, int f) { }
  123. static inline void nop_dma_unmap_area(const void *s, size_t l, int f) { }
  124. #endif
  125. #ifndef MULTI_CACHE
  126. #define __cpuc_flush_icache_all __glue(_CACHE,_flush_icache_all)
  127. #define __cpuc_flush_kern_all __glue(_CACHE,_flush_kern_cache_all)
  128. #define __cpuc_flush_kern_louis __glue(_CACHE,_flush_kern_cache_louis)
  129. #define __cpuc_flush_user_all __glue(_CACHE,_flush_user_cache_all)
  130. #define __cpuc_flush_user_range __glue(_CACHE,_flush_user_cache_range)
  131. #define __cpuc_coherent_kern_range __glue(_CACHE,_coherent_kern_range)
  132. #define __cpuc_coherent_user_range __glue(_CACHE,_coherent_user_range)
  133. #define __cpuc_flush_dcache_area __glue(_CACHE,_flush_kern_dcache_area)
  134. #define dmac_flush_range __glue(_CACHE,_dma_flush_range)
  135. #endif
  136. #endif