diff options
author | Richard Curnow <richard.curnow@st.com> | 2006-09-27 01:09:26 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2006-09-27 01:09:26 -0400 |
commit | b638d0b921dc95229af0dfd09cd24850336a2f75 (patch) | |
tree | 0ef34527a47b22421fb92ba2141052fecfe36482 /arch/sh/kernel/cpu/sh4 | |
parent | fdfc74f9fcebdda14609159d5010b758a9409acf (diff) |
sh: Optimized cache handling for SH-4/SH-4A caches.
This reworks some of the SH-4 cache handling code to more easily
accomodate newer-style caches (particularly for the > direct-mapped
case), as well as optimizing some of the old code.
Signed-off-by: Richard Curnow <richard.curnow@st.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'arch/sh/kernel/cpu/sh4')
-rw-r--r-- | arch/sh/kernel/cpu/sh4/probe.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/arch/sh/kernel/cpu/sh4/probe.c b/arch/sh/kernel/cpu/sh4/probe.c index 42427b79697b..1208da8fe5db 100644 --- a/arch/sh/kernel/cpu/sh4/probe.c +++ b/arch/sh/kernel/cpu/sh4/probe.c | |||
@@ -113,6 +113,11 @@ int __init detect_cpu_and_cache_system(void) | |||
113 | break; | 113 | break; |
114 | } | 114 | } |
115 | 115 | ||
116 | #ifdef CONFIG_SH_DIRECT_MAPPED | ||
117 | cpu_data->icache.ways = 1; | ||
118 | cpu_data->dcache.ways = 1; | ||
119 | #endif | ||
120 | |||
116 | /* | 121 | /* |
117 | * On anything that's not a direct-mapped cache, look to the CVR | 122 | * On anything that's not a direct-mapped cache, look to the CVR |
118 | * for I/D-cache specifics. | 123 | * for I/D-cache specifics. |
@@ -125,6 +130,9 @@ int __init detect_cpu_and_cache_system(void) | |||
125 | (cpu_data->icache.way_incr - (1 << 5)); | 130 | (cpu_data->icache.way_incr - (1 << 5)); |
126 | } | 131 | } |
127 | 132 | ||
133 | cpu_data->icache.way_size = cpu_data->icache.sets * | ||
134 | cpu_data->icache.linesz; | ||
135 | |||
128 | if (cpu_data->dcache.ways > 1) { | 136 | if (cpu_data->dcache.ways > 1) { |
129 | size = sizes[(cvr >> 16) & 0xf]; | 137 | size = sizes[(cvr >> 16) & 0xf]; |
130 | cpu_data->dcache.way_incr = (size >> 1); | 138 | cpu_data->dcache.way_incr = (size >> 1); |
@@ -133,6 +141,9 @@ int __init detect_cpu_and_cache_system(void) | |||
133 | (cpu_data->dcache.way_incr - (1 << 5)); | 141 | (cpu_data->dcache.way_incr - (1 << 5)); |
134 | } | 142 | } |
135 | 143 | ||
144 | cpu_data->dcache.way_size = cpu_data->dcache.sets * | ||
145 | cpu_data->dcache.linesz; | ||
146 | |||
136 | return 0; | 147 | return 0; |
137 | } | 148 | } |
138 | 149 | ||