diff options
Diffstat (limited to 'arch/powerpc/kernel/setup_64.c')
-rw-r--r-- | arch/powerpc/kernel/setup_64.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c index ede77dbbd4df..3b1529c103ef 100644 --- a/arch/powerpc/kernel/setup_64.c +++ b/arch/powerpc/kernel/setup_64.c | |||
@@ -291,23 +291,16 @@ static void __init initialize_cache_info(void) | |||
291 | if ( num_cpus == 1 ) { | 291 | if ( num_cpus == 1 ) { |
292 | const u32 *sizep, *lsizep; | 292 | const u32 *sizep, *lsizep; |
293 | u32 size, lsize; | 293 | u32 size, lsize; |
294 | const char *dc, *ic; | ||
295 | |||
296 | /* Then read cache informations */ | ||
297 | if (machine_is(powermac)) { | ||
298 | dc = "d-cache-block-size"; | ||
299 | ic = "i-cache-block-size"; | ||
300 | } else { | ||
301 | dc = "d-cache-line-size"; | ||
302 | ic = "i-cache-line-size"; | ||
303 | } | ||
304 | 294 | ||
305 | size = 0; | 295 | size = 0; |
306 | lsize = cur_cpu_spec->dcache_bsize; | 296 | lsize = cur_cpu_spec->dcache_bsize; |
307 | sizep = of_get_property(np, "d-cache-size", NULL); | 297 | sizep = of_get_property(np, "d-cache-size", NULL); |
308 | if (sizep != NULL) | 298 | if (sizep != NULL) |
309 | size = *sizep; | 299 | size = *sizep; |
310 | lsizep = of_get_property(np, dc, NULL); | 300 | lsizep = of_get_property(np, "d-cache-block-size", NULL); |
301 | /* fallback if block size missing */ | ||
302 | if (lsizep == NULL) | ||
303 | lsizep = of_get_property(np, "d-cache-line-size", NULL); | ||
311 | if (lsizep != NULL) | 304 | if (lsizep != NULL) |
312 | lsize = *lsizep; | 305 | lsize = *lsizep; |
313 | if (sizep == 0 || lsizep == 0) | 306 | if (sizep == 0 || lsizep == 0) |
@@ -324,7 +317,9 @@ static void __init initialize_cache_info(void) | |||
324 | sizep = of_get_property(np, "i-cache-size", NULL); | 317 | sizep = of_get_property(np, "i-cache-size", NULL); |
325 | if (sizep != NULL) | 318 | if (sizep != NULL) |
326 | size = *sizep; | 319 | size = *sizep; |
327 | lsizep = of_get_property(np, ic, NULL); | 320 | lsizep = of_get_property(np, "i-cache-block-size", NULL); |
321 | if (lsizep == NULL) | ||
322 | lsizep = of_get_property(np, "i-cache-line-size", NULL); | ||
328 | if (lsizep != NULL) | 323 | if (lsizep != NULL) |
329 | lsize = *lsizep; | 324 | lsize = *lsizep; |
330 | if (sizep == 0 || lsizep == 0) | 325 | if (sizep == 0 || lsizep == 0) |