aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel/cpu/init.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sh/kernel/cpu/init.c')
-rw-r--r--arch/sh/kernel/cpu/init.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/arch/sh/kernel/cpu/init.c b/arch/sh/kernel/cpu/init.c
index 4b339a640b13..726acfcb9b77 100644
--- a/arch/sh/kernel/cpu/init.c
+++ b/arch/sh/kernel/cpu/init.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * CPU init code 4 * CPU init code
5 * 5 *
6 * Copyright (C) 2002 - 2006 Paul Mundt 6 * Copyright (C) 2002 - 2007 Paul Mundt
7 * Copyright (C) 2003 Richard Curnow 7 * Copyright (C) 2003 Richard Curnow
8 * 8 *
9 * This file is subject to the terms and conditions of the GNU General Public 9 * This file is subject to the terms and conditions of the GNU General Public
@@ -48,8 +48,19 @@ static void __init cache_init(void)
48{ 48{
49 unsigned long ccr, flags; 49 unsigned long ccr, flags;
50 50
51 if (current_cpu_data.type == CPU_SH_NONE) 51 /* First setup the rest of the I-cache info */
52 panic("Unknown CPU"); 52 current_cpu_data.icache.entry_mask = current_cpu_data.icache.way_incr -
53 current_cpu_data.icache.linesz;
54
55 current_cpu_data.icache.way_size = current_cpu_data.icache.sets *
56 current_cpu_data.icache.linesz;
57
58 /* And the D-cache too */
59 current_cpu_data.dcache.entry_mask = current_cpu_data.dcache.way_incr -
60 current_cpu_data.dcache.linesz;
61
62 current_cpu_data.dcache.way_size = current_cpu_data.dcache.sets *
63 current_cpu_data.dcache.linesz;
53 64
54 jump_to_P2(); 65 jump_to_P2();
55 ccr = ctrl_inl(CCR); 66 ccr = ctrl_inl(CCR);
@@ -200,6 +211,9 @@ asmlinkage void __init sh_cpu_init(void)
200 /* First, probe the CPU */ 211 /* First, probe the CPU */
201 detect_cpu_and_cache_system(); 212 detect_cpu_and_cache_system();
202 213
214 if (current_cpu_data.type == CPU_SH_NONE)
215 panic("Unknown CPU");
216
203 /* Init the cache */ 217 /* Init the cache */
204 cache_init(); 218 cache_init();
205 219