Merge branches 'amba', 'fixes', 'misc', 'mmci', 'unstable/omap-dma' and 'unstable...
[linux-2.6-block.git] / arch / arm / kernel / setup.c
index 6a1b8a81b1ae448168572a9558aaf026f9e7e47e..50e198c1e9c8a16f1b4e06563682e6046f564951 100644 (file)
@@ -100,6 +100,9 @@ EXPORT_SYMBOL(system_serial_high);
 unsigned int elf_hwcap __read_mostly;
 EXPORT_SYMBOL(elf_hwcap);
 
+unsigned int elf_hwcap2 __read_mostly;
+EXPORT_SYMBOL(elf_hwcap2);
+
 
 #ifdef MULTI_CPU
 struct processor processor __read_mostly;
@@ -334,7 +337,7 @@ static void __init cacheid_init(void)
                cacheid = CACHEID_VIVT;
        }
 
-       printk("CPU: %s data cache, %s instruction cache\n",
+       pr_info("CPU: %s data cache, %s instruction cache\n",
                cache_is_vivt() ? "VIVT" :
                cache_is_vipt_aliasing() ? "VIPT aliasing" :
                cache_is_vipt_nonaliasing() ? "PIPT / VIPT nonaliasing" : "unknown",
@@ -416,7 +419,7 @@ void notrace cpu_init(void)
        struct stack *stk = &stacks[cpu];
 
        if (cpu >= NR_CPUS) {
-               printk(KERN_CRIT "CPU%u: bad primary CPU number\n", cpu);
+               pr_crit("CPU%u: bad primary CPU number\n", cpu);
                BUG();
        }
 
@@ -484,7 +487,7 @@ void __init smp_setup_processor_id(void)
         */
        set_my_cpu_offset(0);
 
-       printk(KERN_INFO "Booting Linux on physical CPU 0x%x\n", mpidr);
+       pr_info("Booting Linux on physical CPU 0x%x\n", mpidr);
 }
 
 struct mpidr_hash mpidr_hash;
@@ -564,8 +567,8 @@ static void __init setup_processor(void)
         */
        list = lookup_processor_type(read_cpuid_id());
        if (!list) {
-               printk("CPU configuration botched (ID %08x), unable "
-                      "to continue.\n", read_cpuid_id());
+               pr_err("CPU configuration botched (ID %08x), unable to continue.\n",
+                      read_cpuid_id());
                while (1);
        }
 
@@ -585,9 +588,9 @@ static void __init setup_processor(void)
        cpu_cache = *list->cache;
 #endif
 
-       printk("CPU: %s [%08x] revision %d (ARMv%s), cr=%08lx\n",
-              cpu_name, read_cpuid_id(), read_cpuid_id() & 15,
-              proc_arch[cpu_architecture()], cr_alignment);
+       pr_info("CPU: %s [%08x] revision %d (ARMv%s), cr=%08lx\n",
+               cpu_name, read_cpuid_id(), read_cpuid_id() & 15,
+               proc_arch[cpu_architecture()], cr_alignment);
 
        snprintf(init_utsname()->machine, __NEW_UTS_LEN + 1, "%s%c",
                 list->arch_name, ENDIANNESS);
@@ -629,8 +632,8 @@ int __init arm_add_memory(u64 start, u64 size)
        u64 aligned_start;
 
        if (meminfo.nr_banks >= NR_BANKS) {
-               printk(KERN_CRIT "NR_BANKS too low, "
-                       "ignoring memory at 0x%08llx\n", (long long)start);
+               pr_crit("NR_BANKS too low, ignoring memory at 0x%08llx\n",
+                       (long long)start);
                return -EINVAL;
        }
 
@@ -643,14 +646,14 @@ int __init arm_add_memory(u64 start, u64 size)
 
 #ifndef CONFIG_ARCH_PHYS_ADDR_T_64BIT
        if (aligned_start > ULONG_MAX) {
-               printk(KERN_CRIT "Ignoring memory at 0x%08llx outside "
-                      "32-bit physical address space\n", (long long)start);
+               pr_crit("Ignoring memory at 0x%08llx outside 32-bit physical address space\n",
+                       (long long)start);
                return -EINVAL;
        }
 
        if (aligned_start + size > ULONG_MAX) {
-               printk(KERN_CRIT "Truncating memory at 0x%08llx to fit in "
-                       "32-bit physical address space\n", (long long)start);
+               pr_crit("Truncating memory at 0x%08llx to fit in 32-bit physical address space\n",
+                       (long long)start);
                /*
                 * To ensure bank->start + bank->size is representable in
                 * 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)
        }
 #endif
 
+       if (aligned_start < PHYS_OFFSET) {
+               if (aligned_start + size <= PHYS_OFFSET) {
+                       pr_info("Ignoring memory below PHYS_OFFSET: 0x%08llx-0x%08llx\n",
+                               aligned_start, aligned_start + size);
+                       return -EINVAL;
+               }
+
+               pr_info("Ignoring memory below PHYS_OFFSET: 0x%08llx-0x%08llx\n",
+                       aligned_start, (u64)PHYS_OFFSET);
+
+               size -= PHYS_OFFSET - aligned_start;
+               aligned_start = PHYS_OFFSET;
+       }
+
        bank->start = aligned_start;
        bank->size = size & ~(phys_addr_t)(PAGE_SIZE - 1);
 
@@ -717,7 +734,7 @@ static void __init request_standard_resources(const struct machine_desc *mdesc)
        kernel_data.end     = virt_to_phys(_end - 1);
 
        for_each_memblock(memory, region) {
-               res = alloc_bootmem_low(sizeof(*res));
+               res = memblock_virt_alloc(sizeof(*res), 0);
                res->name  = "System RAM";
                res->start = __pfn_to_phys(memblock_region_memory_base_pfn(region));
                res->end = __pfn_to_phys(memblock_region_memory_end_pfn(region)) - 1;
@@ -817,18 +834,17 @@ static void __init reserve_crashkernel(void)
        if (ret)
                return;
 
-       ret = reserve_bootmem(crash_base, crash_size, BOOTMEM_EXCLUSIVE);
+       ret = memblock_reserve(crash_base, crash_size);
        if (ret < 0) {
-               printk(KERN_WARNING "crashkernel reservation failed - "
-                      "memory is in use (0x%lx)\n", (unsigned long)crash_base);
+               pr_warn("crashkernel reservation failed - memory is in use (0x%lx)\n",
+                       (unsigned long)crash_base);
                return;
        }
 
-       printk(KERN_INFO "Reserving %ldMB of memory at %ldMB "
-              "for crashkernel (System RAM: %ldMB)\n",
-              (unsigned long)(crash_size >> 20),
-              (unsigned long)(crash_base >> 20),
-              (unsigned long)(total_mem >> 20));
+       pr_info("Reserving %ldMB of memory at %ldMB for crashkernel (System RAM: %ldMB)\n",
+               (unsigned long)(crash_size >> 20),
+               (unsigned long)(crash_base >> 20),
+               (unsigned long)(total_mem >> 20));
 
        crashk_res.start = crash_base;
        crashk_res.end = crash_base + crash_size - 1;
@@ -873,8 +889,6 @@ void __init setup_arch(char **cmdline_p)
        machine_desc = mdesc;
        machine_name = mdesc->name;
 
-       setup_dma_zone(mdesc);
-
        if (mdesc->reboot_mode != REBOOT_HARD)
                reboot_mode = mdesc->reboot_mode;
 
@@ -892,6 +906,7 @@ void __init setup_arch(char **cmdline_p)
        sort(&meminfo.bank, meminfo.nr_banks, sizeof(meminfo.bank[0]), meminfo_cmp, NULL);
 
        early_paging_init(mdesc, lookup_processor_type(read_cpuid_id()));
+       setup_dma_zone(mdesc);
        sanity_check_meminfo();
        arm_memblock_init(&meminfo, mdesc);
 
@@ -993,6 +1008,15 @@ static const char *hwcap_str[] = {
        NULL
 };
 
+static const char *hwcap2_str[] = {
+       "aes",
+       "pmull",
+       "sha1",
+       "sha2",
+       "crc32",
+       NULL
+};
+
 static int c_show(struct seq_file *m, void *v)
 {
        int i, j;
@@ -1016,6 +1040,10 @@ static int c_show(struct seq_file *m, void *v)
                        if (elf_hwcap & (1 << j))
                                seq_printf(m, "%s ", hwcap_str[j]);
 
+               for (j = 0; hwcap2_str[j]; j++)
+                       if (elf_hwcap2 & (1 << j))
+                               seq_printf(m, "%s ", hwcap2_str[j]);
+
                seq_printf(m, "\nCPU implementer\t: 0x%02x\n", cpuid >> 24);
                seq_printf(m, "CPU architecture: %s\n",
                           proc_arch[cpu_architecture()]);