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. /*
  11. * Another R4600 erratum. Due to the lack of errata information the exact
  12. * technical details aren't known. I've experimentally found that disabling
  13. * interrupts during indexed I-cache flushes seems to be sufficient to deal
  14. * with the issue.
  15. *
  16. * #define R4600_V1_INDEX_ICACHEOP_WAR 1
  17. */
  18. /*
  19. * Pleasures of the R4600 V1.x. Cite from the IDT R4600 V1.7 errata:
  20. *
  21. * 18. The CACHE instructions Hit_Writeback_Invalidate_D, Hit_Writeback_D,
  22. * Hit_Invalidate_D and Create_Dirty_Excl_D should only be
  23. * executed if there is no other dcache activity. If the dcache is
  24. * accessed for another instruction immeidately preceding when these
  25. * cache instructions are executing, it is possible that the dcache
  26. * tag match outputs used by these cache instructions will be
  27. * incorrect. These cache instructions should be preceded by at least
  28. * four instructions that are not any kind of load or store
  29. * instruction.
  30. *
  31. * This is not allowed: lw
  32. * nop
  33. * nop
  34. * nop
  35. * cache Hit_Writeback_Invalidate_D
  36. *
  37. * This is allowed: lw
  38. * nop
  39. * nop
  40. * nop
  41. * nop
  42. * cache Hit_Writeback_Invalidate_D
  43. *
  44. * #define R4600_V1_HIT_CACHEOP_WAR 1
  45. */
  46. /*
  47. * Writeback and invalidate the primary cache dcache before DMA.
  48. *
  49. * R4600 v2.0 bug: "The CACHE instructions Hit_Writeback_Inv_D,
  50. * Hit_Writeback_D, Hit_Invalidate_D and Create_Dirty_Exclusive_D will only
  51. * operate correctly if the internal data cache refill buffer is empty. These
  52. * CACHE instructions should be separated from any potential data cache miss
  53. * by a load instruction to an uncached address to empty the response buffer."
  54. * (Revision 2.0 device errata from IDT available on http://www.idt.com/
  55. * in .pdf format.)
  56. *
  57. * #define R4600_V2_HIT_CACHEOP_WAR 1
  58. */
  59. /*
  60. * R4600 CPU modules for the Indy come with both V1.7 and V2.0 processors.
  61. */
  62. #ifdef CONFIG_SGI_IP22
  63. #define R4600_V1_INDEX_ICACHEOP_WAR 1
  64. #define R4600_V1_HIT_CACHEOP_WAR 1
  65. #define R4600_V2_HIT_CACHEOP_WAR 1
  66. #endif
  67. /*
  68. * But the RM200C seems to have been shipped only with V2.0 R4600s
  69. */
  70. #ifdef CONFIG_SNI_RM200_PCI
  71. #define R4600_V2_HIT_CACHEOP_WAR 1
  72. #endif
  73. #ifdef CONFIG_CPU_R5432
  74. /*
  75. * When an interrupt happens on a CP0 register read instruction, CPU may
  76. * lock up or read corrupted values of CP0 registers after it enters
  77. * the exception handler.
  78. *
  79. * This workaround makes sure that we read a "safe" CP0 register as the
  80. * first thing in the exception handler, which breaks one of the
  81. * pre-conditions for this problem.
  82. */
  83. #define R5432_CP0_INTERRUPT_WAR 1
  84. #endif
  85. #if defined(CONFIG_SB1_PASS_1_WORKAROUNDS) || \
  86. defined(CONFIG_SB1_PASS_2_WORKAROUNDS)
  87. /*
  88. * Workaround for the Sibyte M3 errata the text of which can be found at
  89. *
  90. * http://sibyte.broadcom.com/hw/bcm1250/docs/pass2errata.txt
  91. *
  92. * This will enable the use of a special TLB refill handler which does a
  93. * consistency check on the information in c0_badvaddr and c0_entryhi and
  94. * will just return and take the exception again if the information was
  95. * found to be inconsistent.
  96. */
  97. #define BCM1250_M3_WAR 1
  98. /*
  99. * This is a DUART workaround related to glitches around register accesses
  100. */
  101. #define SIBYTE_1956_WAR 1
  102. #endif
  103. /*
  104. * Fill buffers not flushed on CACHE instructions
  105. *
  106. * Hit_Invalidate_I cacheops invalidate an icache line but the refill
  107. * for that line can get stale data from the fill buffer instead of
  108. * accessing memory if the previous icache miss was also to that line.
  109. *
  110. * Workaround: generate an icache refill from a different line
  111. *
  112. * Affects:
  113. * MIPS 4K RTL revision <3.0, PRID revision <4
  114. */
  115. #if defined(CONFIG_MIPS_MALTA) || defined(CONFIG_MIPS_ATLAS) || \
  116. defined(CONFIG_MIPS_SEAD)
  117. #define MIPS4K_ICACHE_REFILL_WAR 1
  118. #endif
  119. /*
  120. * Missing implicit forced flush of evictions caused by CACHE
  121. * instruction
  122. *
  123. * Evictions caused by a CACHE instructions are not forced on to the
  124. * bus. The BIU gives higher priority to fetches than to the data from
  125. * the eviction buffer and no collision detection is performed between
  126. * fetches and pending data from the eviction buffer.
  127. *
  128. * Workaround: Execute a SYNC instruction after the cache instruction
  129. *
  130. * Affects:
  131. * MIPS 5Kc,5Kf RTL revision <2.3, PRID revision <8
  132. * MIPS 20Kc RTL revision <4.0, PRID revision <?
  133. */
  134. #if defined(CONFIG_MIPS_MALTA) || defined(CONFIG_MIPS_ATLAS) || \
  135. defined(CONFIG_MIPS_SEAD)
  136. #define MIPS_CACHE_SYNC_WAR 1
  137. #endif
  138. /*
  139. * From TX49/H2 manual: "If the instruction (i.e. CACHE) is issued for
  140. * the line which this instruction itself exists, the following
  141. * operation is not guaranteed."
  142. *
  143. * Workaround: do two phase flushing for Index_Invalidate_I
  144. */
  145. #ifdef CONFIG_CPU_TX49XX
  146. #define TX49XX_ICACHE_INDEX_INV_WAR 1
  147. #endif
  148. /*
  149. * On the RM9000 there is a problem which makes the CreateDirtyExclusive
  150. * cache operation unusable on SMP systems.
  151. */
  152. #if defined(CONFIG_MOMENCO_JAGUAR_ATX) || defined(CONFIG_PMC_YOSEMITE) || \
  153. defined(CONFIG_BASLER_EXCITE)
  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) || defined(CONFIG_BASLER_EXCITE)
  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 */