diff options
Diffstat (limited to 'arch/arm/kernel/setup.c')
-rw-r--r-- | arch/arm/kernel/setup.c | 78 |
1 files changed, 53 insertions, 25 deletions
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c index 6a1b8a81b1ae..50e198c1e9c8 100644 --- a/arch/arm/kernel/setup.c +++ b/arch/arm/kernel/setup.c | |||
@@ -100,6 +100,9 @@ EXPORT_SYMBOL(system_serial_high); | |||
100 | unsigned int elf_hwcap __read_mostly; | 100 | unsigned int elf_hwcap __read_mostly; |
101 | EXPORT_SYMBOL(elf_hwcap); | 101 | EXPORT_SYMBOL(elf_hwcap); |
102 | 102 | ||
103 | unsigned int elf_hwcap2 __read_mostly; | ||
104 | EXPORT_SYMBOL(elf_hwcap2); | ||
105 | |||
103 | 106 | ||
104 | #ifdef MULTI_CPU | 107 | #ifdef MULTI_CPU |
105 | struct processor processor __read_mostly; | 108 | struct processor processor __read_mostly; |
@@ -334,7 +337,7 @@ static void __init cacheid_init(void) | |||
334 | cacheid = CACHEID_VIVT; | 337 | cacheid = CACHEID_VIVT; |
335 | } | 338 | } |
336 | 339 | ||
337 | printk("CPU: %s data cache, %s instruction cache\n", | 340 | pr_info("CPU: %s data cache, %s instruction cache\n", |
338 | cache_is_vivt() ? "VIVT" : | 341 | cache_is_vivt() ? "VIVT" : |
339 | cache_is_vipt_aliasing() ? "VIPT aliasing" : | 342 | cache_is_vipt_aliasing() ? "VIPT aliasing" : |
340 | cache_is_vipt_nonaliasing() ? "PIPT / VIPT nonaliasing" : "unknown", | 343 | cache_is_vipt_nonaliasing() ? "PIPT / VIPT nonaliasing" : "unknown", |
@@ -416,7 +419,7 @@ void notrace cpu_init(void) | |||
416 | struct stack *stk = &stacks[cpu]; | 419 | struct stack *stk = &stacks[cpu]; |
417 | 420 | ||
418 | if (cpu >= NR_CPUS) { | 421 | if (cpu >= NR_CPUS) { |
419 | printk(KERN_CRIT "CPU%u: bad primary CPU number\n", cpu); | 422 | pr_crit("CPU%u: bad primary CPU number\n", cpu); |
420 | BUG(); | 423 | BUG(); |
421 | } | 424 | } |
422 | 425 | ||
@@ -484,7 +487,7 @@ void __init smp_setup_processor_id(void) | |||
484 | */ | 487 | */ |
485 | set_my_cpu_offset(0); | 488 | set_my_cpu_offset(0); |
486 | 489 | ||
487 | printk(KERN_INFO "Booting Linux on physical CPU 0x%x\n", mpidr); | 490 | pr_info("Booting Linux on physical CPU 0x%x\n", mpidr); |
488 | } | 491 | } |
489 | 492 | ||
490 | struct mpidr_hash mpidr_hash; | 493 | struct mpidr_hash mpidr_hash; |
@@ -564,8 +567,8 @@ static void __init setup_processor(void) | |||
564 | */ | 567 | */ |
565 | list = lookup_processor_type(read_cpuid_id()); | 568 | list = lookup_processor_type(read_cpuid_id()); |
566 | if (!list) { | 569 | if (!list) { |
567 | printk("CPU configuration botched (ID %08x), unable " | 570 | pr_err("CPU configuration botched (ID %08x), unable to continue.\n", |
568 | "to continue.\n", read_cpuid_id()); | 571 | read_cpuid_id()); |
569 | while (1); | 572 | while (1); |
570 | } | 573 | } |
571 | 574 | ||
@@ -585,9 +588,9 @@ static void __init setup_processor(void) | |||
585 | cpu_cache = *list->cache; | 588 | cpu_cache = *list->cache; |
586 | #endif | 589 | #endif |
587 | 590 | ||
588 | printk("CPU: %s [%08x] revision %d (ARMv%s), cr=%08lx\n", | 591 | pr_info("CPU: %s [%08x] revision %d (ARMv%s), cr=%08lx\n", |
589 | cpu_name, read_cpuid_id(), read_cpuid_id() & 15, | 592 | cpu_name, read_cpuid_id(), read_cpuid_id() & 15, |
590 | proc_arch[cpu_architecture()], cr_alignment); | 593 | proc_arch[cpu_architecture()], cr_alignment); |
591 | 594 | ||
592 | snprintf(init_utsname()->machine, __NEW_UTS_LEN + 1, "%s%c", | 595 | snprintf(init_utsname()->machine, __NEW_UTS_LEN + 1, "%s%c", |
593 | list->arch_name, ENDIANNESS); | 596 | list->arch_name, ENDIANNESS); |
@@ -629,8 +632,8 @@ int __init arm_add_memory(u64 start, u64 size) | |||
629 | u64 aligned_start; | 632 | u64 aligned_start; |
630 | 633 | ||
631 | if (meminfo.nr_banks >= NR_BANKS) { | 634 | if (meminfo.nr_banks >= NR_BANKS) { |
632 | printk(KERN_CRIT "NR_BANKS too low, " | 635 | pr_crit("NR_BANKS too low, ignoring memory at 0x%08llx\n", |
633 | "ignoring memory at 0x%08llx\n", (long long)start); | 636 | (long long)start); |
634 | return -EINVAL; | 637 | return -EINVAL; |
635 | } | 638 | } |
636 | 639 | ||
@@ -643,14 +646,14 @@ int __init arm_add_memory(u64 start, u64 size) | |||
643 | 646 | ||
644 | #ifndef CONFIG_ARCH_PHYS_ADDR_T_64BIT | 647 | #ifndef CONFIG_ARCH_PHYS_ADDR_T_64BIT |
645 | if (aligned_start > ULONG_MAX) { | 648 | if (aligned_start > ULONG_MAX) { |
646 | printk(KERN_CRIT "Ignoring memory at 0x%08llx outside " | 649 | pr_crit("Ignoring memory at 0x%08llx outside 32-bit physical address space\n", |
647 | "32-bit physical address space\n", (long long)start); | 650 | (long long)start); |
648 | return -EINVAL; | 651 | return -EINVAL; |
649 | } | 652 | } |
650 | 653 | ||
651 | if (aligned_start + size > ULONG_MAX) { | 654 | if (aligned_start + size > ULONG_MAX) { |
652 | printk(KERN_CRIT "Truncating memory at 0x%08llx to fit in " | 655 | pr_crit("Truncating memory at 0x%08llx to fit in 32-bit physical address space\n", |
653 | "32-bit physical address space\n", (long long)start); | 656 | (long long)start); |
654 | /* | 657 | /* |
655 | * To ensure bank->start + bank->size is representable in | 658 | * To ensure bank->start + bank->size is representable in |
656 | * 32 bits, we use ULONG_MAX as the upper limit rather than 4GB. | 659 | * 32 bits, we use ULONG_MAX as the upper limit rather than 4GB. |
@@ -660,6 +663,20 @@ int __init arm_add_memory(u64 start, u64 size) | |||
660 | } | 663 | } |
661 | #endif | 664 | #endif |
662 | 665 | ||
666 | if (aligned_start < PHYS_OFFSET) { | ||
667 | if (aligned_start + size <= PHYS_OFFSET) { | ||
668 | pr_info("Ignoring memory below PHYS_OFFSET: 0x%08llx-0x%08llx\n", | ||
669 | aligned_start, aligned_start + size); | ||
670 | return -EINVAL; | ||
671 | } | ||
672 | |||
673 | pr_info("Ignoring memory below PHYS_OFFSET: 0x%08llx-0x%08llx\n", | ||
674 | aligned_start, (u64)PHYS_OFFSET); | ||
675 | |||
676 | size -= PHYS_OFFSET - aligned_start; | ||
677 | aligned_start = PHYS_OFFSET; | ||
678 | } | ||
679 | |||
663 | bank->start = aligned_start; | 680 | bank->start = aligned_start; |
664 | bank->size = size & ~(phys_addr_t)(PAGE_SIZE - 1); | 681 | bank->size = size & ~(phys_addr_t)(PAGE_SIZE - 1); |
665 | 682 | ||
@@ -717,7 +734,7 @@ static void __init request_standard_resources(const struct machine_desc *mdesc) | |||
717 | kernel_data.end = virt_to_phys(_end - 1); | 734 | kernel_data.end = virt_to_phys(_end - 1); |
718 | 735 | ||
719 | for_each_memblock(memory, region) { | 736 | for_each_memblock(memory, region) { |
720 | res = alloc_bootmem_low(sizeof(*res)); | 737 | res = memblock_virt_alloc(sizeof(*res), 0); |
721 | res->name = "System RAM"; | 738 | res->name = "System RAM"; |
722 | res->start = __pfn_to_phys(memblock_region_memory_base_pfn(region)); | 739 | res->start = __pfn_to_phys(memblock_region_memory_base_pfn(region)); |
723 | res->end = __pfn_to_phys(memblock_region_memory_end_pfn(region)) - 1; | 740 | res->end = __pfn_to_phys(memblock_region_memory_end_pfn(region)) - 1; |
@@ -817,18 +834,17 @@ static void __init reserve_crashkernel(void) | |||
817 | if (ret) | 834 | if (ret) |
818 | return; | 835 | return; |
819 | 836 | ||
820 | ret = reserve_bootmem(crash_base, crash_size, BOOTMEM_EXCLUSIVE); | 837 | ret = memblock_reserve(crash_base, crash_size); |
821 | if (ret < 0) { | 838 | if (ret < 0) { |
822 | printk(KERN_WARNING "crashkernel reservation failed - " | 839 | pr_warn("crashkernel reservation failed - memory is in use (0x%lx)\n", |
823 | "memory is in use (0x%lx)\n", (unsigned long)crash_base); | 840 | (unsigned long)crash_base); |
824 | return; | 841 | return; |
825 | } | 842 | } |
826 | 843 | ||
827 | printk(KERN_INFO "Reserving %ldMB of memory at %ldMB " | 844 | pr_info("Reserving %ldMB of memory at %ldMB for crashkernel (System RAM: %ldMB)\n", |
828 | "for crashkernel (System RAM: %ldMB)\n", | 845 | (unsigned long)(crash_size >> 20), |
829 | (unsigned long)(crash_size >> 20), | 846 | (unsigned long)(crash_base >> 20), |
830 | (unsigned long)(crash_base >> 20), | 847 | (unsigned long)(total_mem >> 20)); |
831 | (unsigned long)(total_mem >> 20)); | ||
832 | 848 | ||
833 | crashk_res.start = crash_base; | 849 | crashk_res.start = crash_base; |
834 | crashk_res.end = crash_base + crash_size - 1; | 850 | crashk_res.end = crash_base + crash_size - 1; |
@@ -873,8 +889,6 @@ void __init setup_arch(char **cmdline_p) | |||
873 | machine_desc = mdesc; | 889 | machine_desc = mdesc; |
874 | machine_name = mdesc->name; | 890 | machine_name = mdesc->name; |
875 | 891 | ||
876 | setup_dma_zone(mdesc); | ||
877 | |||
878 | if (mdesc->reboot_mode != REBOOT_HARD) | 892 | if (mdesc->reboot_mode != REBOOT_HARD) |
879 | reboot_mode = mdesc->reboot_mode; | 893 | reboot_mode = mdesc->reboot_mode; |
880 | 894 | ||
@@ -892,6 +906,7 @@ void __init setup_arch(char **cmdline_p) | |||
892 | sort(&meminfo.bank, meminfo.nr_banks, sizeof(meminfo.bank[0]), meminfo_cmp, NULL); | 906 | sort(&meminfo.bank, meminfo.nr_banks, sizeof(meminfo.bank[0]), meminfo_cmp, NULL); |
893 | 907 | ||
894 | early_paging_init(mdesc, lookup_processor_type(read_cpuid_id())); | 908 | early_paging_init(mdesc, lookup_processor_type(read_cpuid_id())); |
909 | setup_dma_zone(mdesc); | ||
895 | sanity_check_meminfo(); | 910 | sanity_check_meminfo(); |
896 | arm_memblock_init(&meminfo, mdesc); | 911 | arm_memblock_init(&meminfo, mdesc); |
897 | 912 | ||
@@ -993,6 +1008,15 @@ static const char *hwcap_str[] = { | |||
993 | NULL | 1008 | NULL |
994 | }; | 1009 | }; |
995 | 1010 | ||
1011 | static const char *hwcap2_str[] = { | ||
1012 | "aes", | ||
1013 | "pmull", | ||
1014 | "sha1", | ||
1015 | "sha2", | ||
1016 | "crc32", | ||
1017 | NULL | ||
1018 | }; | ||
1019 | |||
996 | static int c_show(struct seq_file *m, void *v) | 1020 | static int c_show(struct seq_file *m, void *v) |
997 | { | 1021 | { |
998 | int i, j; | 1022 | int i, j; |
@@ -1016,6 +1040,10 @@ static int c_show(struct seq_file *m, void *v) | |||
1016 | if (elf_hwcap & (1 << j)) | 1040 | if (elf_hwcap & (1 << j)) |
1017 | seq_printf(m, "%s ", hwcap_str[j]); | 1041 | seq_printf(m, "%s ", hwcap_str[j]); |
1018 | 1042 | ||
1043 | for (j = 0; hwcap2_str[j]; j++) | ||
1044 | if (elf_hwcap2 & (1 << j)) | ||
1045 | seq_printf(m, "%s ", hwcap2_str[j]); | ||
1046 | |||
1019 | seq_printf(m, "\nCPU implementer\t: 0x%02x\n", cpuid >> 24); | 1047 | seq_printf(m, "\nCPU implementer\t: 0x%02x\n", cpuid >> 24); |
1020 | seq_printf(m, "CPU architecture: %s\n", | 1048 | seq_printf(m, "CPU architecture: %s\n", |
1021 | proc_arch[cpu_architecture()]); | 1049 | proc_arch[cpu_architecture()]); |