aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/kernel/setup.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/kernel/setup.c')
-rw-r--r--arch/arm/kernel/setup.c58
1 files changed, 35 insertions, 23 deletions
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c
index 6a1b8a81b1ae..061cea820e3f 100644
--- a/arch/arm/kernel/setup.c
+++ b/arch/arm/kernel/setup.c
@@ -334,7 +334,7 @@ static void __init cacheid_init(void)
334 cacheid = CACHEID_VIVT; 334 cacheid = CACHEID_VIVT;
335 } 335 }
336 336
337 printk("CPU: %s data cache, %s instruction cache\n", 337 pr_info("CPU: %s data cache, %s instruction cache\n",
338 cache_is_vivt() ? "VIVT" : 338 cache_is_vivt() ? "VIVT" :
339 cache_is_vipt_aliasing() ? "VIPT aliasing" : 339 cache_is_vipt_aliasing() ? "VIPT aliasing" :
340 cache_is_vipt_nonaliasing() ? "PIPT / VIPT nonaliasing" : "unknown", 340 cache_is_vipt_nonaliasing() ? "PIPT / VIPT nonaliasing" : "unknown",
@@ -416,7 +416,7 @@ void notrace cpu_init(void)
416 struct stack *stk = &stacks[cpu]; 416 struct stack *stk = &stacks[cpu];
417 417
418 if (cpu >= NR_CPUS) { 418 if (cpu >= NR_CPUS) {
419 printk(KERN_CRIT "CPU%u: bad primary CPU number\n", cpu); 419 pr_crit("CPU%u: bad primary CPU number\n", cpu);
420 BUG(); 420 BUG();
421 } 421 }
422 422
@@ -484,7 +484,7 @@ void __init smp_setup_processor_id(void)
484 */ 484 */
485 set_my_cpu_offset(0); 485 set_my_cpu_offset(0);
486 486
487 printk(KERN_INFO "Booting Linux on physical CPU 0x%x\n", mpidr); 487 pr_info("Booting Linux on physical CPU 0x%x\n", mpidr);
488} 488}
489 489
490struct mpidr_hash mpidr_hash; 490struct mpidr_hash mpidr_hash;
@@ -564,8 +564,8 @@ static void __init setup_processor(void)
564 */ 564 */
565 list = lookup_processor_type(read_cpuid_id()); 565 list = lookup_processor_type(read_cpuid_id());
566 if (!list) { 566 if (!list) {
567 printk("CPU configuration botched (ID %08x), unable " 567 pr_err("CPU configuration botched (ID %08x), unable to continue.\n",
568 "to continue.\n", read_cpuid_id()); 568 read_cpuid_id());
569 while (1); 569 while (1);
570 } 570 }
571 571
@@ -585,9 +585,9 @@ static void __init setup_processor(void)
585 cpu_cache = *list->cache; 585 cpu_cache = *list->cache;
586#endif 586#endif
587 587
588 printk("CPU: %s [%08x] revision %d (ARMv%s), cr=%08lx\n", 588 pr_info("CPU: %s [%08x] revision %d (ARMv%s), cr=%08lx\n",
589 cpu_name, read_cpuid_id(), read_cpuid_id() & 15, 589 cpu_name, read_cpuid_id(), read_cpuid_id() & 15,
590 proc_arch[cpu_architecture()], cr_alignment); 590 proc_arch[cpu_architecture()], cr_alignment);
591 591
592 snprintf(init_utsname()->machine, __NEW_UTS_LEN + 1, "%s%c", 592 snprintf(init_utsname()->machine, __NEW_UTS_LEN + 1, "%s%c",
593 list->arch_name, ENDIANNESS); 593 list->arch_name, ENDIANNESS);
@@ -629,8 +629,8 @@ int __init arm_add_memory(u64 start, u64 size)
629 u64 aligned_start; 629 u64 aligned_start;
630 630
631 if (meminfo.nr_banks >= NR_BANKS) { 631 if (meminfo.nr_banks >= NR_BANKS) {
632 printk(KERN_CRIT "NR_BANKS too low, " 632 pr_crit("NR_BANKS too low, ignoring memory at 0x%08llx\n",
633 "ignoring memory at 0x%08llx\n", (long long)start); 633 (long long)start);
634 return -EINVAL; 634 return -EINVAL;
635 } 635 }
636 636
@@ -643,14 +643,14 @@ int __init arm_add_memory(u64 start, u64 size)
643 643
644#ifndef CONFIG_ARCH_PHYS_ADDR_T_64BIT 644#ifndef CONFIG_ARCH_PHYS_ADDR_T_64BIT
645 if (aligned_start > ULONG_MAX) { 645 if (aligned_start > ULONG_MAX) {
646 printk(KERN_CRIT "Ignoring memory at 0x%08llx outside " 646 pr_crit("Ignoring memory at 0x%08llx outside 32-bit physical address space\n",
647 "32-bit physical address space\n", (long long)start); 647 (long long)start);
648 return -EINVAL; 648 return -EINVAL;
649 } 649 }
650 650
651 if (aligned_start + size > ULONG_MAX) { 651 if (aligned_start + size > ULONG_MAX) {
652 printk(KERN_CRIT "Truncating memory at 0x%08llx to fit in " 652 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); 653 (long long)start);
654 /* 654 /*
655 * To ensure bank->start + bank->size is representable in 655 * To ensure bank->start + bank->size is representable in
656 * 32 bits, we use ULONG_MAX as the upper limit rather than 4GB. 656 * 32 bits, we use ULONG_MAX as the upper limit rather than 4GB.
@@ -660,6 +660,20 @@ int __init arm_add_memory(u64 start, u64 size)
660 } 660 }
661#endif 661#endif
662 662
663 if (aligned_start < PHYS_OFFSET) {
664 if (aligned_start + size <= PHYS_OFFSET) {
665 pr_info("Ignoring memory below PHYS_OFFSET: 0x%08llx-0x%08llx\n",
666 aligned_start, aligned_start + size);
667 return -EINVAL;
668 }
669
670 pr_info("Ignoring memory below PHYS_OFFSET: 0x%08llx-0x%08llx\n",
671 aligned_start, (u64)PHYS_OFFSET);
672
673 size -= PHYS_OFFSET - aligned_start;
674 aligned_start = PHYS_OFFSET;
675 }
676
663 bank->start = aligned_start; 677 bank->start = aligned_start;
664 bank->size = size & ~(phys_addr_t)(PAGE_SIZE - 1); 678 bank->size = size & ~(phys_addr_t)(PAGE_SIZE - 1);
665 679
@@ -819,16 +833,15 @@ static void __init reserve_crashkernel(void)
819 833
820 ret = reserve_bootmem(crash_base, crash_size, BOOTMEM_EXCLUSIVE); 834 ret = reserve_bootmem(crash_base, crash_size, BOOTMEM_EXCLUSIVE);
821 if (ret < 0) { 835 if (ret < 0) {
822 printk(KERN_WARNING "crashkernel reservation failed - " 836 pr_warn("crashkernel reservation failed - memory is in use (0x%lx)\n",
823 "memory is in use (0x%lx)\n", (unsigned long)crash_base); 837 (unsigned long)crash_base);
824 return; 838 return;
825 } 839 }
826 840
827 printk(KERN_INFO "Reserving %ldMB of memory at %ldMB " 841 pr_info("Reserving %ldMB of memory at %ldMB for crashkernel (System RAM: %ldMB)\n",
828 "for crashkernel (System RAM: %ldMB)\n", 842 (unsigned long)(crash_size >> 20),
829 (unsigned long)(crash_size >> 20), 843 (unsigned long)(crash_base >> 20),
830 (unsigned long)(crash_base >> 20), 844 (unsigned long)(total_mem >> 20));
831 (unsigned long)(total_mem >> 20));
832 845
833 crashk_res.start = crash_base; 846 crashk_res.start = crash_base;
834 crashk_res.end = crash_base + crash_size - 1; 847 crashk_res.end = crash_base + crash_size - 1;
@@ -873,8 +886,6 @@ void __init setup_arch(char **cmdline_p)
873 machine_desc = mdesc; 886 machine_desc = mdesc;
874 machine_name = mdesc->name; 887 machine_name = mdesc->name;
875 888
876 setup_dma_zone(mdesc);
877
878 if (mdesc->reboot_mode != REBOOT_HARD) 889 if (mdesc->reboot_mode != REBOOT_HARD)
879 reboot_mode = mdesc->reboot_mode; 890 reboot_mode = mdesc->reboot_mode;
880 891
@@ -892,6 +903,7 @@ void __init setup_arch(char **cmdline_p)
892 sort(&meminfo.bank, meminfo.nr_banks, sizeof(meminfo.bank[0]), meminfo_cmp, NULL); 903 sort(&meminfo.bank, meminfo.nr_banks, sizeof(meminfo.bank[0]), meminfo_cmp, NULL);
893 904
894 early_paging_init(mdesc, lookup_processor_type(read_cpuid_id())); 905 early_paging_init(mdesc, lookup_processor_type(read_cpuid_id()));
906 setup_dma_zone(mdesc);
895 sanity_check_meminfo(); 907 sanity_check_meminfo();
896 arm_memblock_init(&meminfo, mdesc); 908 arm_memblock_init(&meminfo, mdesc);
897 909