Merge branch 'drm-forlinus' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied...
[pandora-kernel.git] / arch / arm / kernel / setup.c
index 9fed5fa..c45d10d 100644 (file)
@@ -26,8 +26,6 @@
 
 #include <asm/cpu.h>
 #include <asm/elf.h>
-#include <asm/hardware.h>
-#include <asm/io.h>
 #include <asm/procinfo.h>
 #include <asm/setup.h>
 #include <asm/mach-types.h>
@@ -207,7 +205,7 @@ static const char *proc_arch[] = {
        "5TE",
        "5TEJ",
        "6TEJ",
-       "?(10)",
+       "7",
        "?(11)",
        "?(12)",
        "?(13)",
@@ -260,14 +258,17 @@ int cpu_architecture(void)
 {
        int cpu_arch;
 
-       if ((processor_id & 0x0000f000) == 0) {
+       if ((processor_id & 0x0008f000) == 0) {
                cpu_arch = CPU_ARCH_UNKNOWN;
-       } else if ((processor_id & 0x0000f000) == 0x00007000) {
+       } else if ((processor_id & 0x0008f000) == 0x00007000) {
                cpu_arch = (processor_id & (1 << 23)) ? CPU_ARCH_ARMv4T : CPU_ARCH_ARMv3;
-       } else {
+       } else if ((processor_id & 0x00080000) == 0x00000000) {
                cpu_arch = (processor_id >> 16) & 7;
                if (cpu_arch)
                        cpu_arch += CPU_ARCH_ARMv3;
+       } else {
+               /* the revised CPUID */
+               cpu_arch = ((processor_id >> 12) & 0xf) - 0xb + CPU_ARCH_ARMv6;
        }
 
        return cpu_arch;
@@ -338,7 +339,8 @@ void cpu_init(void)
                BUG();
        }
 
-       dump_cpu_info(cpu);
+       if (system_state == SYSTEM_BOOTING)
+               dump_cpu_info(cpu);
 
        /*
         * setup stacks for re-entrant exception handlers
@@ -359,7 +361,8 @@ void cpu_init(void)
              "I" (offsetof(struct stack, abt[0])),
              "I" (PSR_F_BIT | PSR_I_BIT | UND_MODE),
              "I" (offsetof(struct stack, und[0])),
-             "I" (PSR_F_BIT | PSR_I_BIT | SVC_MODE));
+             "I" (PSR_F_BIT | PSR_I_BIT | SVC_MODE)
+           : "r14");
 }
 
 static struct machine_desc * __init setup_machine(unsigned int nr)
@@ -395,6 +398,20 @@ static void __init early_initrd(char **p)
 }
 __early_param("initrd=", early_initrd);
 
+static void __init add_memory(unsigned long start, unsigned long size)
+{
+       /*
+        * Ensure that start/size are aligned to a page boundary.
+        * Size is appropriately rounded down, start is rounded up.
+        */
+       size -= start & ~PAGE_MASK;
+
+       meminfo.bank[meminfo.nr_banks].start = PAGE_ALIGN(start);
+       meminfo.bank[meminfo.nr_banks].size  = size & PAGE_MASK;
+       meminfo.bank[meminfo.nr_banks].node  = PHYS_TO_NID(start);
+       meminfo.nr_banks += 1;
+}
+
 /*
  * Pick out the memory size.  We look for mem=size@start,
  * where start and size are "size[KkMm]"
@@ -419,10 +436,7 @@ static void __init early_mem(char **p)
        if (**p == '@')
                start = memparse(*p + 1, p);
 
-       meminfo.bank[meminfo.nr_banks].start = start;
-       meminfo.bank[meminfo.nr_banks].size  = size;
-       meminfo.bank[meminfo.nr_banks].node  = PHYS_TO_NID(start);
-       meminfo.nr_banks += 1;
+       add_memory(start, size);
 }
 __early_param("mem=", early_mem);
 
@@ -564,11 +578,7 @@ static int __init parse_tag_mem32(const struct tag *tag)
                        tag->u.mem.start, tag->u.mem.size / 1024);
                return -EINVAL;
        }
-       meminfo.bank[meminfo.nr_banks].start = tag->u.mem.start;
-       meminfo.bank[meminfo.nr_banks].size  = tag->u.mem.size;
-       meminfo.bank[meminfo.nr_banks].node  = PHYS_TO_NID(tag->u.mem.start);
-       meminfo.nr_banks += 1;
-
+       add_memory(tag->u.mem.start, tag->u.mem.size);
        return 0;
 }
 
@@ -729,8 +739,8 @@ void __init setup_arch(char **cmdline_p)
        if (mdesc->soft_reboot)
                reboot_setup("s");
 
-       if (mdesc->param_offset)
-               tags = phys_to_virt(mdesc->param_offset);
+       if (mdesc->boot_params)
+               tags = phys_to_virt(mdesc->boot_params);
 
        /*
         * If we have the old style parameters, convert them to
@@ -830,7 +840,12 @@ static int c_show(struct seq_file *m, void *v)
 
 #if defined(CONFIG_SMP)
        for_each_online_cpu(i) {
-               seq_printf(m, "Processor\t: %d\n", i);
+               /*
+                * glibc reads /proc/cpuinfo to determine the number of
+                * online processors, looking for lines beginning with
+                * "processor".  Give glibc what it expects.
+                */
+               seq_printf(m, "processor\t: %d\n", i);
                seq_printf(m, "BogoMIPS\t: %lu.%02lu\n\n",
                           per_cpu(cpu_data, i).loops_per_jiffy / (500000UL/HZ),
                           (per_cpu(cpu_data, i).loops_per_jiffy / (5000UL/HZ)) % 100);
@@ -851,11 +866,11 @@ static int c_show(struct seq_file *m, void *v)
        seq_printf(m, "\nCPU implementer\t: 0x%02x\n", processor_id >> 24);
        seq_printf(m, "CPU architecture: %s\n", proc_arch[cpu_architecture()]);
 
-       if ((processor_id & 0x0000f000) == 0x00000000) {
+       if ((processor_id & 0x0008f000) == 0x00000000) {
                /* pre-ARM7 */
                seq_printf(m, "CPU part\t\t: %07x\n", processor_id >> 4);
        } else {
-               if ((processor_id & 0x0000f000) == 0x00007000) {
+               if ((processor_id & 0x0008f000) == 0x00007000) {
                        /* ARM7 */
                        seq_printf(m, "CPU variant\t: 0x%02x\n",
                                   (processor_id >> 16) & 127);