diff options
author | Nate Case <ncase@xes-inc.com> | 2009-06-10 16:37:28 -0400 |
---|---|---|
committer | Kumar Gala <galak@kernel.crashing.org> | 2009-06-15 22:45:30 -0400 |
commit | cab888e678d0986ebce95464d3842a6aeca1e3d8 (patch) | |
tree | e6ead4aac68d3a1b694c1cfed56b4650a1ab8715 /arch/powerpc/kernel | |
parent | c7a7a5b9a27e28ce5f800ead9091ce68d37e8088 (diff) |
powerpc/fsl-booke: Enable L1 cache on e500v1/e500v2/e500mc CPUs
Some boot loaders may not enable L1 instruction/data cache. Check if
data and instruction caches are enabled, and enable them if needed.
Signed-off-by: Nate Case <ncase@xes-inc.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/kernel')
-rw-r--r-- | arch/powerpc/kernel/cpu_setup_fsl_booke.S | 49 |
1 files changed, 46 insertions, 3 deletions
diff --git a/arch/powerpc/kernel/cpu_setup_fsl_booke.S b/arch/powerpc/kernel/cpu_setup_fsl_booke.S index eb4b9adcedb4..0adb50ad8031 100644 --- a/arch/powerpc/kernel/cpu_setup_fsl_booke.S +++ b/arch/powerpc/kernel/cpu_setup_fsl_booke.S | |||
@@ -17,6 +17,40 @@ | |||
17 | #include <asm/cputable.h> | 17 | #include <asm/cputable.h> |
18 | #include <asm/ppc_asm.h> | 18 | #include <asm/ppc_asm.h> |
19 | 19 | ||
20 | _GLOBAL(__e500_icache_setup) | ||
21 | mfspr r0, SPRN_L1CSR1 | ||
22 | andi. r3, r0, L1CSR1_ICE | ||
23 | bnelr /* Already enabled */ | ||
24 | oris r0, r0, L1CSR1_CPE@h | ||
25 | ori r0, r0, (L1CSR1_ICFI | L1CSR1_ICLFR | L1CSR1_ICE) | ||
26 | mtspr SPRN_L1CSR1, r0 /* Enable I-Cache */ | ||
27 | isync | ||
28 | blr | ||
29 | |||
30 | _GLOBAL(__e500_dcache_setup) | ||
31 | mfspr r0, SPRN_L1CSR0 | ||
32 | andi. r3, r0, L1CSR0_DCE | ||
33 | bnelr /* Already enabled */ | ||
34 | msync | ||
35 | isync | ||
36 | li r0, 0 | ||
37 | mtspr SPRN_L1CSR0, r0 /* Disable */ | ||
38 | msync | ||
39 | isync | ||
40 | li r0, (L1CSR0_DCFI | L1CSR0_CLFC) | ||
41 | mtspr SPRN_L1CSR0, r0 /* Invalidate */ | ||
42 | isync | ||
43 | 1: mfspr r0, SPRN_L1CSR0 | ||
44 | andi. r3, r0, L1CSR0_CLFC | ||
45 | bne+ 1b /* Wait for lock bits reset */ | ||
46 | oris r0, r0, L1CSR0_CPE@h | ||
47 | ori r0, r0, L1CSR0_DCE | ||
48 | msync | ||
49 | isync | ||
50 | mtspr SPRN_L1CSR0, r0 /* Enable */ | ||
51 | isync | ||
52 | blr | ||
53 | |||
20 | _GLOBAL(__setup_cpu_e200) | 54 | _GLOBAL(__setup_cpu_e200) |
21 | /* enable dedicated debug exception handling resources (Debug APU) */ | 55 | /* enable dedicated debug exception handling resources (Debug APU) */ |
22 | mfspr r3,SPRN_HID0 | 56 | mfspr r3,SPRN_HID0 |
@@ -25,7 +59,16 @@ _GLOBAL(__setup_cpu_e200) | |||
25 | b __setup_e200_ivors | 59 | b __setup_e200_ivors |
26 | _GLOBAL(__setup_cpu_e500v1) | 60 | _GLOBAL(__setup_cpu_e500v1) |
27 | _GLOBAL(__setup_cpu_e500v2) | 61 | _GLOBAL(__setup_cpu_e500v2) |
28 | b __setup_e500_ivors | 62 | mflr r4 |
63 | bl __e500_icache_setup | ||
64 | bl __e500_dcache_setup | ||
65 | bl __setup_e500_ivors | ||
66 | mtlr r4 | ||
67 | blr | ||
29 | _GLOBAL(__setup_cpu_e500mc) | 68 | _GLOBAL(__setup_cpu_e500mc) |
30 | b __setup_e500mc_ivors | 69 | mflr r4 |
31 | 70 | bl __e500_icache_setup | |
71 | bl __e500_dcache_setup | ||
72 | bl __setup_e500mc_ivors | ||
73 | mtlr r4 | ||
74 | blr | ||