blob: d2808edfd4e9a516e764dc35517359067211543a [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
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 *
Ralf Baechlebaf22c12007-10-11 23:46:07 +01006 * Copyright (C) 2002, 2004, 2007 by Ralf Baechle
Linus Torvalds1da177e2005-04-16 15:20:36 -07007 */
8#ifndef _ASM_WAR_H
9#define _ASM_WAR_H
10
Ralf Baechlebaf22c12007-10-11 23:46:07 +010011#include <war.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -070012
13/*
14 * Another R4600 erratum. Due to the lack of errata information the exact
15 * technical details aren't known. I've experimentally found that disabling
16 * interrupts during indexed I-cache flushes seems to be sufficient to deal
17 * with the issue.
Linus Torvalds1da177e2005-04-16 15:20:36 -070018 */
Ralf Baechlebaf22c12007-10-11 23:46:07 +010019#ifndef R4600_V1_INDEX_ICACHEOP_WAR
20#error Check setting of R4600_V1_INDEX_ICACHEOP_WAR for your platform
21#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -070022
23/*
24 * Pleasures of the R4600 V1.x. Cite from the IDT R4600 V1.7 errata:
25 *
26 * 18. The CACHE instructions Hit_Writeback_Invalidate_D, Hit_Writeback_D,
27 * Hit_Invalidate_D and Create_Dirty_Excl_D should only be
28 * executed if there is no other dcache activity. If the dcache is
29 * accessed for another instruction immeidately preceding when these
30 * cache instructions are executing, it is possible that the dcache
31 * tag match outputs used by these cache instructions will be
32 * incorrect. These cache instructions should be preceded by at least
33 * four instructions that are not any kind of load or store
34 * instruction.
35 *
36 * This is not allowed: lw
37 * nop
38 * nop
39 * nop
40 * cache Hit_Writeback_Invalidate_D
41 *
42 * This is allowed: lw
43 * nop
44 * nop
45 * nop
46 * nop
47 * cache Hit_Writeback_Invalidate_D
Linus Torvalds1da177e2005-04-16 15:20:36 -070048 */
Ralf Baechlebaf22c12007-10-11 23:46:07 +010049#ifndef R4600_V1_HIT_CACHEOP_WAR
50#error Check setting of R4600_V1_HIT_CACHEOP_WAR for your platform
51#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -070052
53
54/*
55 * Writeback and invalidate the primary cache dcache before DMA.
56 *
57 * R4600 v2.0 bug: "The CACHE instructions Hit_Writeback_Inv_D,
58 * Hit_Writeback_D, Hit_Invalidate_D and Create_Dirty_Exclusive_D will only
59 * operate correctly if the internal data cache refill buffer is empty. These
60 * CACHE instructions should be separated from any potential data cache miss
61 * by a load instruction to an uncached address to empty the response buffer."
62 * (Revision 2.0 device errata from IDT available on http://www.idt.com/
63 * in .pdf format.)
Linus Torvalds1da177e2005-04-16 15:20:36 -070064 */
Ralf Baechlebaf22c12007-10-11 23:46:07 +010065#ifndef R4600_V2_HIT_CACHEOP_WAR
66#error Check setting of R4600_V2_HIT_CACHEOP_WAR for your platform
Linus Torvalds1da177e2005-04-16 15:20:36 -070067#endif
68
69/*
Linus Torvalds1da177e2005-04-16 15:20:36 -070070 * When an interrupt happens on a CP0 register read instruction, CPU may
71 * lock up or read corrupted values of CP0 registers after it enters
72 * the exception handler.
73 *
74 * This workaround makes sure that we read a "safe" CP0 register as the
75 * first thing in the exception handler, which breaks one of the
76 * pre-conditions for this problem.
77 */
Ralf Baechlebaf22c12007-10-11 23:46:07 +010078#ifndef R5432_CP0_INTERRUPT_WAR
79#error Check setting of R5432_CP0_INTERRUPT_WAR for your platform
Linus Torvalds1da177e2005-04-16 15:20:36 -070080#endif
81
Linus Torvalds1da177e2005-04-16 15:20:36 -070082/*
83 * Workaround for the Sibyte M3 errata the text of which can be found at
84 *
85 * http://sibyte.broadcom.com/hw/bcm1250/docs/pass2errata.txt
86 *
87 * This will enable the use of a special TLB refill handler which does a
88 * consistency check on the information in c0_badvaddr and c0_entryhi and
89 * will just return and take the exception again if the information was
90 * found to be inconsistent.
91 */
Ralf Baechlebaf22c12007-10-11 23:46:07 +010092#ifndef BCM1250_M3_WAR
93#error Check setting of BCM1250_M3_WAR for your platform
94#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -070095
Ralf Baechle42a3b4f2005-09-03 15:56:17 -070096/*
Linus Torvalds1da177e2005-04-16 15:20:36 -070097 * This is a DUART workaround related to glitches around register accesses
98 */
Ralf Baechlebaf22c12007-10-11 23:46:07 +010099#ifndef SIBYTE_1956_WAR
100#error Check setting of SIBYTE_1956_WAR for your platform
Linus Torvalds1da177e2005-04-16 15:20:36 -0700101#endif
102
103/*
104 * Fill buffers not flushed on CACHE instructions
Ralf Baechle42a3b4f2005-09-03 15:56:17 -0700105 *
Linus Torvalds1da177e2005-04-16 15:20:36 -0700106 * 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 */
Ralf Baechlebaf22c12007-10-11 23:46:07 +0100115#ifndef MIPS4K_ICACHE_REFILL_WAR
116#error Check setting of MIPS4K_ICACHE_REFILL_WAR for your platform
Linus Torvalds1da177e2005-04-16 15:20:36 -0700117#endif
118
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 */
Ralf Baechlebaf22c12007-10-11 23:46:07 +0100134#ifndef MIPS_CACHE_SYNC_WAR
135#error Check setting of MIPS_CACHE_SYNC_WAR for your platform
Linus Torvalds1da177e2005-04-16 15:20:36 -0700136#endif
137
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 */
Ralf Baechlebaf22c12007-10-11 23:46:07 +0100145#ifndef TX49XX_ICACHE_INDEX_INV_WAR
146#error Check setting of TX49XX_ICACHE_INDEX_INV_WAR for your platform
Linus Torvalds1da177e2005-04-16 15:20:36 -0700147#endif
148
149/*
150 * On the RM9000 there is a problem which makes the CreateDirtyExclusive
Adrian Bunka4b156d2007-06-19 22:27:04 +0200151 * eache operation unusable on SMP systems.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700152 */
Ralf Baechlebaf22c12007-10-11 23:46:07 +0100153#ifndef RM9000_CDEX_SMP_WAR
154#error Check setting of RM9000_CDEX_SMP_WAR for your platform
Linus Torvalds1da177e2005-04-16 15:20:36 -0700155#endif
156
157/*
Ralf Baechle075c7332007-07-05 08:14:21 +0100158 * The RM7000 processors and the E9000 cores have a bug (though PMC-Sierra
159 * opposes it being called that) where invalid instructions in the same
160 * I-cache line worth of instructions being fetched may case spurious
161 * exceptions.
Ralf Baechle02416dc2005-06-15 13:00:12 +0000162 */
Ralf Baechlebaf22c12007-10-11 23:46:07 +0100163#ifndef ICACHE_REFILLS_WORKAROUND_WAR
164#error Check setting of ICACHE_REFILLS_WORKAROUND_WAR for your platform
Ralf Baechle02416dc2005-06-15 13:00:12 +0000165#endif
166
Ralf Baechle02416dc2005-06-15 13:00:12 +0000167/*
Ralf Baechle075c7332007-07-05 08:14:21 +0100168 * On the R10000 upto version 2.6 (not sure about 2.7) there is a bug that
Linus Torvalds1da177e2005-04-16 15:20:36 -0700169 * may cause ll / sc and lld / scd sequences to execute non-atomically.
170 */
Ralf Baechlebaf22c12007-10-11 23:46:07 +0100171#ifndef R10000_LLSC_WAR
172#error Check setting of R10000_LLSC_WAR for your platform
Linus Torvalds1da177e2005-04-16 15:20:36 -0700173#endif
174
175/*
Marc St-Jean9267a302007-06-14 15:55:31 -0600176 * 34K core erratum: "Problems Executing the TLBR Instruction"
177 */
Marc St-Jean9267a302007-06-14 15:55:31 -0600178#ifndef MIPS34K_MISSED_ITLB_WAR
Ralf Baechlebaf22c12007-10-11 23:46:07 +0100179#error Check setting of MIPS34K_MISSED_ITLB_WAR for your platform
Marc St-Jean9267a302007-06-14 15:55:31 -0600180#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700181
182#endif /* _ASM_WAR_H */