aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips
diff options
context:
space:
mode:
authorMarkos Chandras <markos.chandras@imgtec.com>2014-07-18 05:51:30 -0400
committerRalf Baechle <ralf@linux-mips.org>2014-09-22 07:35:52 -0400
commitfb02035083d9e2de1deba529b45835a698944f07 (patch)
tree516eff5b8eb9d42f86f4c4556bfd60d684450368 /arch/mips
parentf46493826a79f6a2bf9d8a0030e627e0255bbf48 (diff)
MIPS: pgtable-bits: Move the CCA bits out of the core's ifdef blocks
Define all the CCA bits outside the ifdef blocks for specific cores but also allow cores to override them if necessary. Signed-off-by: Markos Chandras <markos.chandras@imgtec.com> Cc: linux-mips@linux-mips.org Patchwork: https://patchwork.linux-mips.org/patch/7400/ Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips')
-rw-r--r--arch/mips/include/asm/pgtable-bits.h41
1 files changed, 25 insertions, 16 deletions
diff --git a/arch/mips/include/asm/pgtable-bits.h b/arch/mips/include/asm/pgtable-bits.h
index e592f3687d6f..011b0dcf306e 100644
--- a/arch/mips/include/asm/pgtable-bits.h
+++ b/arch/mips/include/asm/pgtable-bits.h
@@ -224,38 +224,47 @@ static inline uint64_t pte_to_entrylo(unsigned long pte_val)
224#if defined(CONFIG_CPU_R3000) || defined(CONFIG_CPU_TX39XX) 224#if defined(CONFIG_CPU_R3000) || defined(CONFIG_CPU_TX39XX)
225 225
226#define _CACHE_CACHABLE_NONCOHERENT 0 226#define _CACHE_CACHABLE_NONCOHERENT 0
227#define _CACHE_UNCACHED_ACCELERATED _CACHE_UNCACHED
227 228
228#elif defined(CONFIG_CPU_SB1) 229#elif defined(CONFIG_CPU_SB1)
229 230
230/* No penalty for being coherent on the SB1, so just 231/* No penalty for being coherent on the SB1, so just
231 use it for "noncoherent" spaces, too. Shouldn't hurt. */ 232 use it for "noncoherent" spaces, too. Shouldn't hurt. */
232 233
233#define _CACHE_UNCACHED (2<<_CACHE_SHIFT)
234#define _CACHE_CACHABLE_COW (5<<_CACHE_SHIFT)
235#define _CACHE_CACHABLE_NONCOHERENT (5<<_CACHE_SHIFT) 234#define _CACHE_CACHABLE_NONCOHERENT (5<<_CACHE_SHIFT)
236#define _CACHE_UNCACHED_ACCELERATED (7<<_CACHE_SHIFT)
237 235
238#elif defined(CONFIG_CPU_LOONGSON3) 236#elif defined(CONFIG_CPU_LOONGSON3)
239 237
240/* Using COHERENT flag for NONCOHERENT doesn't hurt. */ 238/* Using COHERENT flag for NONCOHERENT doesn't hurt. */
241 239
242#define _CACHE_UNCACHED (2<<_CACHE_SHIFT) /* LOONGSON */
243#define _CACHE_CACHABLE_NONCOHERENT (3<<_CACHE_SHIFT) /* LOONGSON */ 240#define _CACHE_CACHABLE_NONCOHERENT (3<<_CACHE_SHIFT) /* LOONGSON */
244#define _CACHE_CACHABLE_COHERENT (3<<_CACHE_SHIFT) /* LOONGSON-3 */ 241#define _CACHE_CACHABLE_COHERENT (3<<_CACHE_SHIFT) /* LOONGSON-3 */
245#define _CACHE_UNCACHED_ACCELERATED (7<<_CACHE_SHIFT) /* LOONGSON */
246 242
247#else 243#endif
248
249#define _CACHE_CACHABLE_NO_WA (0<<_CACHE_SHIFT) /* R4600 only */
250#define _CACHE_CACHABLE_WA (1<<_CACHE_SHIFT) /* R4600 only */
251#define _CACHE_UNCACHED (2<<_CACHE_SHIFT) /* R4[0246]00 */
252#define _CACHE_CACHABLE_NONCOHERENT (3<<_CACHE_SHIFT) /* R4[0246]00 */
253#define _CACHE_CACHABLE_CE (4<<_CACHE_SHIFT) /* R4[04]00MC only */
254#define _CACHE_CACHABLE_COW (5<<_CACHE_SHIFT) /* R4[04]00MC only */
255#define _CACHE_CACHABLE_COHERENT (5<<_CACHE_SHIFT) /* MIPS32R2 CMP */
256#define _CACHE_CACHABLE_CUW (6<<_CACHE_SHIFT) /* R4[04]00MC only */
257#define _CACHE_UNCACHED_ACCELERATED (7<<_CACHE_SHIFT) /* R10000 only */
258 244
245#ifndef _CACHE_CACHABLE_NO_WA
246#define _CACHE_CACHABLE_NO_WA (0<<_CACHE_SHIFT)
247#endif
248#ifndef _CACHE_CACHABLE_WA
249#define _CACHE_CACHABLE_WA (1<<_CACHE_SHIFT)
250#endif
251#ifndef _CACHE_UNCACHED
252#define _CACHE_UNCACHED (2<<_CACHE_SHIFT)
253#endif
254#ifndef _CACHE_CACHABLE_NONCOHERENT
255#define _CACHE_CACHABLE_NONCOHERENT (3<<_CACHE_SHIFT)
256#endif
257#ifndef _CACHE_CACHABLE_CE
258#define _CACHE_CACHABLE_CE (4<<_CACHE_SHIFT)
259#endif
260#ifndef _CACHE_CACHABLE_COW
261#define _CACHE_CACHABLE_COW (5<<_CACHE_SHIFT)
262#endif
263#ifndef _CACHE_CACHABLE_CUW
264#define _CACHE_CACHABLE_CUW (6<<_CACHE_SHIFT)
265#endif
266#ifndef _CACHE_UNCACHED_ACCELERATED
267#define _CACHE_UNCACHED_ACCELERATED (7<<_CACHE_SHIFT)
259#endif 268#endif
260 269
261#define __READABLE (_PAGE_SILENT_READ | _PAGE_ACCESSED | (cpu_has_rixi ? 0 : _PAGE_READ)) 270#define __READABLE (_PAGE_SILENT_READ | _PAGE_ACCESSED | (cpu_has_rixi ? 0 : _PAGE_READ))