|
@@ -353,6 +353,23 @@ void __init early_print(const char *str, ...)
|
|
|
printk("%s", buf);
|
|
|
}
|
|
|
|
|
|
+static void __init cpuid_init_hwcaps(void)
|
|
|
+{
|
|
|
+ unsigned int divide_instrs;
|
|
|
+
|
|
|
+ if (cpu_architecture() < CPU_ARCH_ARMv7)
|
|
|
+ return;
|
|
|
+
|
|
|
+ divide_instrs = (read_cpuid_ext(CPUID_EXT_ISAR0) & 0x0f000000) >> 24;
|
|
|
+
|
|
|
+ switch (divide_instrs) {
|
|
|
+ case 2:
|
|
|
+ elf_hwcap |= HWCAP_IDIVA;
|
|
|
+ case 1:
|
|
|
+ elf_hwcap |= HWCAP_IDIVT;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
static void __init feat_v6_fixup(void)
|
|
|
{
|
|
|
int id = read_cpuid_id();
|
|
@@ -483,6 +500,9 @@ static void __init setup_processor(void)
|
|
|
snprintf(elf_platform, ELF_PLATFORM_SIZE, "%s%c",
|
|
|
list->elf_name, ENDIANNESS);
|
|
|
elf_hwcap = list->elf_hwcap;
|
|
|
+
|
|
|
+ cpuid_init_hwcaps();
|
|
|
+
|
|
|
#ifndef CONFIG_ARM_THUMB
|
|
|
elf_hwcap &= ~(HWCAP_THUMB | HWCAP_IDIVT);
|
|
|
#endif
|