war.h 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. /*
  2. * This file is subject to the terms and conditions of the GNU General Public
  3. * License. See the file "COPYING" in the main directory of this archive
  4. * for more details.
  5. *
  6. * Copyright (C) 2002, 2004 by Ralf Baechle
  7. */
  8. #ifndef _ASM_WAR_H
  9. #define _ASM_WAR_H
  10. #include <linux/config.h>
  11. /*
  12. * Another R4600 erratum. Due to the lack of errata information the exact
  13. * technical details aren't known. I've experimentally found that disabling
  14. * interrupts during indexed I-cache flushes seems to be sufficient to deal
  15. * with the issue.
  16. *
  17. * #define R4600_V1_INDEX_ICACHEOP_WAR 1
  18. */
  19. /*
  20. * Pleasures of the R4600 V1.x. Cite from the IDT R4600 V1.7 errata:
  21. *
  22. * 18. The CACHE instructions Hit_Writeback_Invalidate_D, Hit_Writeback_D,
  23. * Hit_Invalidate_D and Create_Dirty_Excl_D should only be
  24. * executed if there is no other dcache activity. If the dcache is
  25. * accessed for another instruction immeidately preceding when these
  26. * cache instructions are executing, it is possible that the dcache
  27. * tag match outputs used by these cache instructions will be
  28. * incorrect. These cache instructions should be preceded by at least
  29. * four instructions that are not any kind of load or store
  30. * instruction.
  31. *
  32. * This is not allowed: lw
  33. * nop
  34. * nop
  35. * nop
  36. * cache Hit_Writeback_Invalidate_D
  37. *
  38. * This is allowed: lw
  39. * nop
  40. * nop
  41. * nop
  42. * nop
  43. * cache Hit_Writeback_Invalidate_D
  44. *
  45. * #define R4600_V1_HIT_CACHEOP_WAR 1
  46. */
  47. /*
  48. * Writeback and invalidate the primary cache dcache before DMA.
  49. *
  50. * R4600 v2.0 bug: "The CACHE instructions Hit_Writeback_Inv_D,
  51. * Hit_Writeback_D, Hit_Invalidate_D and Create_Dirty_Exclusive_D will only
  52. * operate correctly if the internal data cache refill buffer is empty. These
  53. * CACHE instructions should be separated from any potential data cache miss
  54. * by a load instruction to an uncached address to empty the response buffer."
  55. * (Revision 2.0 device errata from IDT available on http://www.idt.com/
  56. * in .pdf format.)
  57. *
  58. * #define R4600_V2_HIT_CACHEOP_WAR 1
  59. */
  60. /*
  61. * R4600 CPU modules for the Indy come with both V1.7 and V2.0 processors.
  62. */
  63. #ifdef CONFIG_SGI_IP22
  64. #define R4600_V1_INDEX_ICACHEOP_WAR 1
  65. #define R4600_V1_HIT_CACHEOP_WAR 1
  66. #define R4600_V2_HIT_CACHEOP_WAR 1
  67. #endif
  68. /*
  69. * But the RM200C seems to have been shipped only with V2.0 R4600s
  70. */
  71. #ifdef CONFIG_SNI_RM200_PCI
  72. #define R4600_V2_HIT_CACHEOP_WAR 1
  73. #endif
  74. #ifdef CONFIG_CPU_R5432
  75. /*
  76. * When an interrupt happens on a CP0 register read instruction, CPU may
  77. * lock up or read corrupted values of CP0 registers after it enters
  78. * the exception handler.
  79. *
  80. * This workaround makes sure that we read a "safe" CP0 register as the
  81. * first thing in the exception handler, which breaks one of the
  82. * pre-conditions for this problem.
  83. */
  84. #define R5432_CP0_INTERRUPT_WAR 1
  85. #endif
  86. #if defined(CONFIG_SB1_PASS_1_WORKAROUNDS) || \
  87. defined(CONFIG_SB1_PASS_2_WORKAROUNDS)
  88. /*
  89. * Workaround for the Sibyte M3 errata the text of which can be found at
  90. *
  91. * http://sibyte.broadcom.com/hw/bcm1250/docs/pass2errata.txt
  92. *
  93. * This will enable the use of a special TLB refill handler which does a
  94. * consistency check on the information in c0_badvaddr and c0_entryhi and
  95. * will just return and take the exception again if the information was
  96. * found to be inconsistent.
  97. */
  98. #define BCM1250_M3_WAR 1
  99. /*
  100. * This is a DUART workaround related to glitches around register accesses
  101. */
  102. #define SIBYTE_1956_WAR 1
  103. #endif
  104. /*
  105. * Fill buffers not flushed on CACHE instructions
  106. *
  107. * Hit_Invalidate_I cacheops invalidate an icache line but the refill
  108. * for that line can get stale data from the fill buffer instead of
  109. * accessing memory if the previous icache miss was also to that line.
  110. *
  111. * Workaround: generate an icache refill from a different line
  112. *
  113. * Affects:
  114. * MIPS 4K RTL revision <3.0, PRID revision <4
  115. */
  116. #if defined(CONFIG_MIPS_MALTA) || defined(CONFIG_MIPS_ATLAS) || \
  117. defined(CONFIG_MIPS_SEAD)
  118. #define MIPS4K_ICACHE_REFILL_WAR 1
  119. #endif
  120. /*
  121. * Missing implicit forced flush of evictions caused by CACHE
  122. * instruction
  123. *
  124. * Evictions caused by a CACHE instructions are not forced on to the
  125. * bus. The BIU gives higher priority to fetches than to the data from
  126. * the eviction buffer and no collision detection is performed between
  127. * fetches and pending data from the eviction buffer.
  128. *
  129. * Workaround: Execute a SYNC instruction after the cache instruction
  130. *
  131. * Affects:
  132. * MIPS 5Kc,5Kf RTL revision <2.3, PRID revision <8
  133. * MIPS 20Kc RTL revision <4.0, PRID revision <?
  134. */
  135. #if defined(CONFIG_MIPS_MALTA) || defined(CONFIG_MIPS_ATLAS) || \
  136. defined(CONFIG_MIPS_SEAD)
  137. #define MIPS_CACHE_SYNC_WAR 1
  138. #endif
  139. /*
  140. * From TX49/H2 manual: "If the instruction (i.e. CACHE) is issued for
  141. * the line which this instruction itself exists, the following
  142. * operation is not guaranteed."
  143. *
  144. * Workaround: do two phase flushing for Index_Invalidate_I
  145. */
  146. #ifdef CONFIG_CPU_TX49XX
  147. #define TX49XX_ICACHE_INDEX_INV_WAR 1
  148. #endif
  149. /*
  150. * On the RM9000 there is a problem which makes the CreateDirtyExclusive
  151. * cache operation unusable on SMP systems.
  152. */
  153. #if defined(CONFIG_MOMENCO_JAGUAR_ATX) || defined(CONFIG_PMC_YOSEMITE)
  154. #define RM9000_CDEX_SMP_WAR 1
  155. #endif
  156. /*
  157. * The RM9000 has a bug (though PMC-Sierra opposes it being called that)
  158. * where invalid instructions in the same I-cache line worth of instructions
  159. * being fetched may case spurious exceptions.
  160. */
  161. #if defined(CONFIG_MOMENCO_JAGUAR_ATX) || defined(CONFIG_MOMENCO_OCELOT_3) || \
  162. defined(CONFIG_PMC_YOSEMITE)
  163. #define ICACHE_REFILLS_WORKAROUND_WAR 1
  164. #endif
  165. /*
  166. * ON the R10000 upto version 2.6 (not sure about 2.7) there is a bug that
  167. * may cause ll / sc and lld / scd sequences to execute non-atomically.
  168. */
  169. #ifdef CONFIG_SGI_IP27
  170. #define R10000_LLSC_WAR 1
  171. #endif
  172. /*
  173. * Workarounds default to off
  174. */
  175. #ifndef ICACHE_REFILLS_WORKAROUND_WAR
  176. #define ICACHE_REFILLS_WORKAROUND_WAR 0
  177. #endif
  178. #ifndef R4600_V1_INDEX_ICACHEOP_WAR
  179. #define R4600_V1_INDEX_ICACHEOP_WAR 0
  180. #endif
  181. #ifndef R4600_V1_HIT_CACHEOP_WAR
  182. #define R4600_V1_HIT_CACHEOP_WAR 0
  183. #endif
  184. #ifndef R4600_V2_HIT_CACHEOP_WAR
  185. #define R4600_V2_HIT_CACHEOP_WAR 0
  186. #endif
  187. #ifndef R5432_CP0_INTERRUPT_WAR
  188. #define R5432_CP0_INTERRUPT_WAR 0
  189. #endif
  190. #ifndef BCM1250_M3_WAR
  191. #define BCM1250_M3_WAR 0
  192. #endif
  193. #ifndef SIBYTE_1956_WAR
  194. #define SIBYTE_1956_WAR 0
  195. #endif
  196. #ifndef MIPS4K_ICACHE_REFILL_WAR
  197. #define MIPS4K_ICACHE_REFILL_WAR 0
  198. #endif
  199. #ifndef MIPS_CACHE_SYNC_WAR
  200. #define MIPS_CACHE_SYNC_WAR 0
  201. #endif
  202. #ifndef TX49XX_ICACHE_INDEX_INV_WAR
  203. #define TX49XX_ICACHE_INDEX_INV_WAR 0
  204. #endif
  205. #ifndef RM9000_CDEX_SMP_WAR
  206. #define RM9000_CDEX_SMP_WAR 0
  207. #endif
  208. #ifndef R10000_LLSC_WAR
  209. #define R10000_LLSC_WAR 0
  210. #endif
  211. #endif /* _ASM_WAR_H */