aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arc/kernel
diff options
context:
space:
mode:
authorVineet Gupta <vgupta@synopsys.com>2014-03-07 07:38:11 -0500
committerVineet Gupta <vgupta@synopsys.com>2014-06-03 05:44:48 -0400
commitef680cdc24376f394841a3f19b3a7ef6d57a009d (patch)
treed70faaeb25f0109b051d675e3ca02641785cbe34 /arch/arc/kernel
parente87a850b9c92be6a8cf5735c516ec864d65f24dd (diff)
ARC: Disable caches in early boot if so configured
Requested-by: Noam Camus <noamc@ezchip.com> Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
Diffstat (limited to 'arch/arc/kernel')
-rw-r--r--arch/arc/kernel/head.S38
1 files changed, 35 insertions, 3 deletions
diff --git a/arch/arc/kernel/head.S b/arch/arc/kernel/head.S
index 4ad04915dc6b..07a58f2d3077 100644
--- a/arch/arc/kernel/head.S
+++ b/arch/arc/kernel/head.S
@@ -12,10 +12,42 @@
12 * to skip certain things during boot on simulator 12 * to skip certain things during boot on simulator
13 */ 13 */
14 14
15#include <linux/linkage.h>
15#include <asm/asm-offsets.h> 16#include <asm/asm-offsets.h>
16#include <asm/entry.h> 17#include <asm/entry.h>
17#include <linux/linkage.h>
18#include <asm/arcregs.h> 18#include <asm/arcregs.h>
19#include <asm/cache.h>
20
21.macro CPU_EARLY_SETUP
22
23 ; Setting up Vectror Table (in case exception happens in early boot
24 sr @_int_vec_base_lds, [AUX_INTR_VEC_BASE]
25
26 ; Disable I-cache/D-cache if kernel so configured
27 lr r5, [ARC_REG_IC_BCR]
28 breq r5, 0, 1f ; I$ doesn't exist
29 lr r5, [ARC_REG_IC_CTRL]
30#ifdef CONFIG_ARC_HAS_ICACHE
31 bclr r5, r5, 0 ; 0 - Enable, 1 is Disable
32#else
33 bset r5, r5, 0 ; I$ exists, but is not used
34#endif
35 sr r5, [ARC_REG_IC_CTRL]
36
371:
38 lr r5, [ARC_REG_DC_BCR]
39 breq r5, 0, 1f ; D$ doesn't exist
40 lr r5, [ARC_REG_DC_CTRL]
41 bclr r5, r5, 6 ; Invalidate (discard w/o wback)
42#ifdef CONFIG_ARC_HAS_DCACHE
43 bclr r5, r5, 0 ; Enable (+Inv)
44#else
45 bset r5, r5, 0 ; Disable (+Inv)
46#endif
47 sr r5, [ARC_REG_DC_CTRL]
48
491:
50.endm
19 51
20 .cpu A7 52 .cpu A7
21 53
@@ -27,7 +59,7 @@ stext:
27 ; Don't clobber r0-r2 yet. It might have bootloader provided info 59 ; Don't clobber r0-r2 yet. It might have bootloader provided info
28 ;------------------------------------------------------------------- 60 ;-------------------------------------------------------------------
29 61
30 sr @_int_vec_base_lds, [AUX_INTR_VEC_BASE] 62 CPU_EARLY_SETUP
31 63
32#ifdef CONFIG_SMP 64#ifdef CONFIG_SMP
33 ; Ensure Boot (Master) proceeds. Others wait in platform dependent way 65 ; Ensure Boot (Master) proceeds. Others wait in platform dependent way
@@ -90,7 +122,7 @@ stext:
90 122
91first_lines_of_secondary: 123first_lines_of_secondary:
92 124
93 sr @_int_vec_base_lds, [AUX_INTR_VEC_BASE] 125 CPU_EARLY_SETUP
94 126
95 ; setup per-cpu idle task as "current" on this CPU 127 ; setup per-cpu idle task as "current" on this CPU
96 ld r0, [@secondary_idle_tsk] 128 ld r0, [@secondary_idle_tsk]