aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/kernel/setup.c
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2011-06-21 13:57:31 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2011-06-24 03:47:12 -0400
commitb69874e4f530b0103e507f695c010d00cb85a4df (patch)
treefbb34a24796eab26046ea54138ef14a244d920bc /arch/arm/kernel/setup.c
parent111b20d01346b9635b3223c7af4e40e43bee8dc6 (diff)
ARM: pm: arrange for cpu_proc_init() to be called on resume
cpu_proc_init() does processor specific initialization, which we do at boot time. We have been omitting to do this on resume, which causes some of this initialization to be skipped. We've also been skipping this on SMP initialization too. Ensure that cpu_proc_init() is always called appropriately by moving it into cpu_init(), and move cpu_init() to a more appropriate point in the boot initialization. Tested-by: Kevin Hilman <khilman@ti.com> Acked-by: Jean Pihet <j-pihet@ti.com> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/kernel/setup.c')
-rw-r--r--arch/arm/kernel/setup.c99
1 files changed, 50 insertions, 49 deletions
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index ed11fb08b05a..edcab02be64c 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -342,54 +342,6 @@ static void __init feat_v6_fixup(void)
342 elf_hwcap &= ~HWCAP_TLS; 342 elf_hwcap &= ~HWCAP_TLS;
343} 343}
344 344
345static void __init setup_processor(void)
346{
347 struct proc_info_list *list;
348
349 /*
350 * locate processor in the list of supported processor
351 * types. The linker builds this table for us from the
352 * entries in arch/arm/mm/proc-*.S
353 */
354 list = lookup_processor_type(read_cpuid_id());
355 if (!list) {
356 printk("CPU configuration botched (ID %08x), unable "
357 "to continue.\n", read_cpuid_id());
358 while (1);
359 }
360
361 cpu_name = list->cpu_name;
362
363#ifdef MULTI_CPU
364 processor = *list->proc;
365#endif
366#ifdef MULTI_TLB
367 cpu_tlb = *list->tlb;
368#endif
369#ifdef MULTI_USER
370 cpu_user = *list->user;
371#endif
372#ifdef MULTI_CACHE
373 cpu_cache = *list->cache;
374#endif
375
376 printk("CPU: %s [%08x] revision %d (ARMv%s), cr=%08lx\n",
377 cpu_name, read_cpuid_id(), read_cpuid_id() & 15,
378 proc_arch[cpu_architecture()], cr_alignment);
379
380 sprintf(init_utsname()->machine, "%s%c", list->arch_name, ENDIANNESS);
381 sprintf(elf_platform, "%s%c", list->elf_name, ENDIANNESS);
382 elf_hwcap = list->elf_hwcap;
383#ifndef CONFIG_ARM_THUMB
384 elf_hwcap &= ~HWCAP_THUMB;
385#endif
386
387 feat_v6_fixup();
388
389 cacheid_init();
390 cpu_proc_init();
391}
392
393/* 345/*
394 * cpu_init - initialise one CPU. 346 * cpu_init - initialise one CPU.
395 * 347 *
@@ -405,6 +357,8 @@ void cpu_init(void)
405 BUG(); 357 BUG();
406 } 358 }
407 359
360 cpu_proc_init();
361
408 /* 362 /*
409 * Define the placement constraint for the inline asm directive below. 363 * Define the placement constraint for the inline asm directive below.
410 * In Thumb-2, msr with an immediate value is not allowed. 364 * In Thumb-2, msr with an immediate value is not allowed.
@@ -441,6 +395,54 @@ void cpu_init(void)
441 : "r14"); 395 : "r14");
442} 396}
443 397
398static void __init setup_processor(void)
399{
400 struct proc_info_list *list;
401
402 /*
403 * locate processor in the list of supported processor
404 * types. The linker builds this table for us from the
405 * entries in arch/arm/mm/proc-*.S
406 */
407 list = lookup_processor_type(read_cpuid_id());
408 if (!list) {
409 printk("CPU configuration botched (ID %08x), unable "
410 "to continue.\n", read_cpuid_id());
411 while (1);
412 }
413
414 cpu_name = list->cpu_name;
415
416#ifdef MULTI_CPU
417 processor = *list->proc;
418#endif
419#ifdef MULTI_TLB
420 cpu_tlb = *list->tlb;
421#endif
422#ifdef MULTI_USER
423 cpu_user = *list->user;
424#endif
425#ifdef MULTI_CACHE
426 cpu_cache = *list->cache;
427#endif
428
429 printk("CPU: %s [%08x] revision %d (ARMv%s), cr=%08lx\n",
430 cpu_name, read_cpuid_id(), read_cpuid_id() & 15,
431 proc_arch[cpu_architecture()], cr_alignment);
432
433 sprintf(init_utsname()->machine, "%s%c", list->arch_name, ENDIANNESS);
434 sprintf(elf_platform, "%s%c", list->elf_name, ENDIANNESS);
435 elf_hwcap = list->elf_hwcap;
436#ifndef CONFIG_ARM_THUMB
437 elf_hwcap &= ~HWCAP_THUMB;
438#endif
439
440 feat_v6_fixup();
441
442 cacheid_init();
443 cpu_init();
444}
445
444void __init dump_machine_table(void) 446void __init dump_machine_table(void)
445{ 447{
446 struct machine_desc *p; 448 struct machine_desc *p;
@@ -913,7 +915,6 @@ void __init setup_arch(char **cmdline_p)
913#endif 915#endif
914 reserve_crashkernel(); 916 reserve_crashkernel();
915 917
916 cpu_init();
917 tcm_init(); 918 tcm_init();
918 919
919#ifdef CONFIG_MULTI_IRQ_HANDLER 920#ifdef CONFIG_MULTI_IRQ_HANDLER