diff options
Diffstat (limited to 'arch/arm/kernel/setup.c')
-rw-r--r-- | arch/arm/kernel/setup.c | 101 |
1 files changed, 52 insertions, 49 deletions
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c index ed11fb08b05a..9c3278f37796 100644 --- a/arch/arm/kernel/setup.c +++ b/arch/arm/kernel/setup.c | |||
@@ -73,6 +73,7 @@ __setup("fpe=", fpe_setup); | |||
73 | #endif | 73 | #endif |
74 | 74 | ||
75 | extern void paging_init(struct machine_desc *desc); | 75 | extern void paging_init(struct machine_desc *desc); |
76 | extern void sanity_check_meminfo(void); | ||
76 | extern void reboot_setup(char *str); | 77 | extern void reboot_setup(char *str); |
77 | 78 | ||
78 | unsigned int processor_id; | 79 | unsigned int processor_id; |
@@ -342,54 +343,6 @@ static void __init feat_v6_fixup(void) | |||
342 | elf_hwcap &= ~HWCAP_TLS; | 343 | elf_hwcap &= ~HWCAP_TLS; |
343 | } | 344 | } |
344 | 345 | ||
345 | static 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 | /* | 346 | /* |
394 | * cpu_init - initialise one CPU. | 347 | * cpu_init - initialise one CPU. |
395 | * | 348 | * |
@@ -405,6 +358,8 @@ void cpu_init(void) | |||
405 | BUG(); | 358 | BUG(); |
406 | } | 359 | } |
407 | 360 | ||
361 | cpu_proc_init(); | ||
362 | |||
408 | /* | 363 | /* |
409 | * Define the placement constraint for the inline asm directive below. | 364 | * Define the placement constraint for the inline asm directive below. |
410 | * In Thumb-2, msr with an immediate value is not allowed. | 365 | * In Thumb-2, msr with an immediate value is not allowed. |
@@ -441,6 +396,54 @@ void cpu_init(void) | |||
441 | : "r14"); | 396 | : "r14"); |
442 | } | 397 | } |
443 | 398 | ||
399 | static void __init setup_processor(void) | ||
400 | { | ||
401 | struct proc_info_list *list; | ||
402 | |||
403 | /* | ||
404 | * locate processor in the list of supported processor | ||
405 | * types. The linker builds this table for us from the | ||
406 | * entries in arch/arm/mm/proc-*.S | ||
407 | */ | ||
408 | list = lookup_processor_type(read_cpuid_id()); | ||
409 | if (!list) { | ||
410 | printk("CPU configuration botched (ID %08x), unable " | ||
411 | "to continue.\n", read_cpuid_id()); | ||
412 | while (1); | ||
413 | } | ||
414 | |||
415 | cpu_name = list->cpu_name; | ||
416 | |||
417 | #ifdef MULTI_CPU | ||
418 | processor = *list->proc; | ||
419 | #endif | ||
420 | #ifdef MULTI_TLB | ||
421 | cpu_tlb = *list->tlb; | ||
422 | #endif | ||
423 | #ifdef MULTI_USER | ||
424 | cpu_user = *list->user; | ||
425 | #endif | ||
426 | #ifdef MULTI_CACHE | ||
427 | cpu_cache = *list->cache; | ||
428 | #endif | ||
429 | |||
430 | printk("CPU: %s [%08x] revision %d (ARMv%s), cr=%08lx\n", | ||
431 | cpu_name, read_cpuid_id(), read_cpuid_id() & 15, | ||
432 | proc_arch[cpu_architecture()], cr_alignment); | ||
433 | |||
434 | sprintf(init_utsname()->machine, "%s%c", list->arch_name, ENDIANNESS); | ||
435 | sprintf(elf_platform, "%s%c", list->elf_name, ENDIANNESS); | ||
436 | elf_hwcap = list->elf_hwcap; | ||
437 | #ifndef CONFIG_ARM_THUMB | ||
438 | elf_hwcap &= ~HWCAP_THUMB; | ||
439 | #endif | ||
440 | |||
441 | feat_v6_fixup(); | ||
442 | |||
443 | cacheid_init(); | ||
444 | cpu_init(); | ||
445 | } | ||
446 | |||
444 | void __init dump_machine_table(void) | 447 | void __init dump_machine_table(void) |
445 | { | 448 | { |
446 | struct machine_desc *p; | 449 | struct machine_desc *p; |
@@ -900,6 +903,7 @@ void __init setup_arch(char **cmdline_p) | |||
900 | 903 | ||
901 | parse_early_param(); | 904 | parse_early_param(); |
902 | 905 | ||
906 | sanity_check_meminfo(); | ||
903 | arm_memblock_init(&meminfo, mdesc); | 907 | arm_memblock_init(&meminfo, mdesc); |
904 | 908 | ||
905 | paging_init(mdesc); | 909 | paging_init(mdesc); |
@@ -913,7 +917,6 @@ void __init setup_arch(char **cmdline_p) | |||
913 | #endif | 917 | #endif |
914 | reserve_crashkernel(); | 918 | reserve_crashkernel(); |
915 | 919 | ||
916 | cpu_init(); | ||
917 | tcm_init(); | 920 | tcm_init(); |
918 | 921 | ||
919 | #ifdef CONFIG_MULTI_IRQ_HANDLER | 922 | #ifdef CONFIG_MULTI_IRQ_HANDLER |