diff options
Diffstat (limited to 'arch/arc/kernel')
-rw-r--r-- | arch/arc/kernel/head.S | 38 |
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 | |||
37 | 1: | ||
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 | |||
49 | 1: | ||
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 | ||
91 | first_lines_of_secondary: | 123 | first_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] |