aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/netlogic
diff options
context:
space:
mode:
authorYonghong Song <ysong@broadcom.com>2013-12-21 06:22:16 -0500
committerRalf Baechle <ralf@linux-mips.org>2014-01-24 16:39:47 -0500
commited8dfc46e0099540cb923f61bca885b460f1365e (patch)
treed7856bf6134c31844729669663a8d8917e74c4ae /arch/mips/netlogic
parentd3b94285025732379df8a46c02416400c70daa85 (diff)
MIPS: Netlogic: L1D cacheflush before thread enable on XLPII
On XLPII CPUs, the L1D cache has to be flushed with regular cache operations before enabling threads in a core. Signed-off-by: Jayachandran C <jchandra@broadcom.com> Signed-off-by: John Crispin <blogic@openwrt.org> Patchwork: http://patchwork.linux-mips.org/patch/6276/
Diffstat (limited to 'arch/mips/netlogic')
-rw-r--r--arch/mips/netlogic/common/reset.S25
1 files changed, 23 insertions, 2 deletions
diff --git a/arch/mips/netlogic/common/reset.S b/arch/mips/netlogic/common/reset.S
index 06381e11863e..57eb7a141fbf 100644
--- a/arch/mips/netlogic/common/reset.S
+++ b/arch/mips/netlogic/common/reset.S
@@ -36,6 +36,7 @@
36 36
37#include <asm/asm.h> 37#include <asm/asm.h>
38#include <asm/asm-offsets.h> 38#include <asm/asm-offsets.h>
39#include <asm/cacheops.h>
39#include <asm/regdef.h> 40#include <asm/regdef.h>
40#include <asm/mipsregs.h> 41#include <asm/mipsregs.h>
41#include <asm/stackframe.h> 42#include <asm/stackframe.h>
@@ -74,10 +75,18 @@
74.endm 75.endm
75 76
76/* 77/*
77 * Low level flush for L1D cache on XLP, the normal cache ops does 78 * L1D cache has to be flushed before enabling threads in XLP.
78 * not do the complete and correct cache flush. 79 * On XLP8xx/XLP3xx, we do a low level flush using processor control
80 * registers. On XLPII CPUs, usual cache instructions work.
79 */ 81 */
80.macro xlp_flush_l1_dcache 82.macro xlp_flush_l1_dcache
83 mfc0 t0, CP0_EBASE, 0
84 andi t0, t0, 0xff00
85 slt t1, t0, 0x1200
86 beqz t1, 15f
87 nop
88
89 /* XLP8xx low level cache flush */
81 li t0, LSU_DEBUG_DATA0 90 li t0, LSU_DEBUG_DATA0
82 li t1, LSU_DEBUG_ADDR 91 li t1, LSU_DEBUG_ADDR
83 li t2, 0 /* index */ 92 li t2, 0 /* index */
@@ -103,6 +112,18 @@
103 addi t2, 1 112 addi t2, 1
104 bne t3, t2, 11b 113 bne t3, t2, 11b
105 nop 114 nop
115 b 17f
116 nop
117
118 /* XLPII CPUs, Invalidate all 64k of L1 D-cache */
11915:
120 li t0, 0x80000000
121 li t1, 0x80010000
12216: cache Index_Writeback_Inv_D, 0(t0)
123 addiu t0, t0, 32
124 bne t0, t1, 16b
125 nop
12617:
106.endm 127.endm
107 128
108/* 129/*