diff options
Diffstat (limited to 'arch/arm/kernel/setup.c')
-rw-r--r-- | arch/arm/kernel/setup.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c index 3f6cbb2e3eda..d343a6c3a6d1 100644 --- a/arch/arm/kernel/setup.c +++ b/arch/arm/kernel/setup.c | |||
@@ -353,6 +353,23 @@ void __init early_print(const char *str, ...) | |||
353 | printk("%s", buf); | 353 | printk("%s", buf); |
354 | } | 354 | } |
355 | 355 | ||
356 | static void __init cpuid_init_hwcaps(void) | ||
357 | { | ||
358 | unsigned int divide_instrs; | ||
359 | |||
360 | if (cpu_architecture() < CPU_ARCH_ARMv7) | ||
361 | return; | ||
362 | |||
363 | divide_instrs = (read_cpuid_ext(CPUID_EXT_ISAR0) & 0x0f000000) >> 24; | ||
364 | |||
365 | switch (divide_instrs) { | ||
366 | case 2: | ||
367 | elf_hwcap |= HWCAP_IDIVA; | ||
368 | case 1: | ||
369 | elf_hwcap |= HWCAP_IDIVT; | ||
370 | } | ||
371 | } | ||
372 | |||
356 | static void __init feat_v6_fixup(void) | 373 | static void __init feat_v6_fixup(void) |
357 | { | 374 | { |
358 | int id = read_cpuid_id(); | 375 | int id = read_cpuid_id(); |
@@ -483,8 +500,11 @@ static void __init setup_processor(void) | |||
483 | snprintf(elf_platform, ELF_PLATFORM_SIZE, "%s%c", | 500 | snprintf(elf_platform, ELF_PLATFORM_SIZE, "%s%c", |
484 | list->elf_name, ENDIANNESS); | 501 | list->elf_name, ENDIANNESS); |
485 | elf_hwcap = list->elf_hwcap; | 502 | elf_hwcap = list->elf_hwcap; |
503 | |||
504 | cpuid_init_hwcaps(); | ||
505 | |||
486 | #ifndef CONFIG_ARM_THUMB | 506 | #ifndef CONFIG_ARM_THUMB |
487 | elf_hwcap &= ~HWCAP_THUMB; | 507 | elf_hwcap &= ~(HWCAP_THUMB | HWCAP_IDIVT); |
488 | #endif | 508 | #endif |
489 | 509 | ||
490 | feat_v6_fixup(); | 510 | feat_v6_fixup(); |
@@ -524,7 +544,7 @@ int __init arm_add_memory(phys_addr_t start, phys_addr_t size) | |||
524 | size -= start & ~PAGE_MASK; | 544 | size -= start & ~PAGE_MASK; |
525 | bank->start = PAGE_ALIGN(start); | 545 | bank->start = PAGE_ALIGN(start); |
526 | 546 | ||
527 | #ifndef CONFIG_LPAE | 547 | #ifndef CONFIG_ARM_LPAE |
528 | if (bank->start + size < bank->start) { | 548 | if (bank->start + size < bank->start) { |
529 | printk(KERN_CRIT "Truncating memory at 0x%08llx to fit in " | 549 | printk(KERN_CRIT "Truncating memory at 0x%08llx to fit in " |
530 | "32-bit physical address space\n", (long long)start); | 550 | "32-bit physical address space\n", (long long)start); |