Merge tag 'renesas-soc-cleanups-for-v3.19' of git://git.kernel.org/pub/scm/linux...
[cascardo/linux.git] / arch / sparc / kernel / setup_64.c
index e629b83..c38d19f 100644 (file)
@@ -30,6 +30,7 @@
 #include <linux/cpu.h>
 #include <linux/initrd.h>
 #include <linux/module.h>
+#include <linux/start_kernel.h>
 
 #include <asm/io.h>
 #include <asm/processor.h>
@@ -162,7 +163,7 @@ char reboot_command[COMMAND_LINE_SIZE];
 
 static struct pt_regs fake_swapper_regs = { { 0, }, 0, 0, 0, 0 };
 
-void __init per_cpu_patch(void)
+static void __init per_cpu_patch(void)
 {
        struct cpuid_patch_entry *p;
        unsigned long ver;
@@ -254,7 +255,7 @@ void sun4v_patch_2insn_range(struct sun4v_2insn_patch_entry *start,
        }
 }
 
-void __init sun4v_patch(void)
+static void __init sun4v_patch(void)
 {
        extern void sun4v_hvapi_init(void);
 
@@ -323,14 +324,25 @@ static void __init pause_patch(void)
        }
 }
 
-#ifdef CONFIG_SMP
-void __init boot_cpu_id_too_large(int cpu)
+void __init start_early_boot(void)
 {
-       prom_printf("Serious problem, boot cpu id (%d) >= NR_CPUS (%d)\n",
-                   cpu, NR_CPUS);
-       prom_halt();
+       int cpu;
+
+       check_if_starfire();
+       per_cpu_patch();
+       sun4v_patch();
+
+       cpu = hard_smp_processor_id();
+       if (cpu >= NR_CPUS) {
+               prom_printf("Serious problem, boot cpu id (%d) >= NR_CPUS (%d)\n",
+                           cpu, NR_CPUS);
+               prom_halt();
+       }
+       current_thread_info()->cpu = cpu;
+
+       prom_init_report();
+       start_kernel();
 }
-#endif
 
 /* On Ultra, we support all of the v8 capabilities. */
 unsigned long sparc64_elf_hwcap = (HWCAP_SPARC_FLUSH | HWCAP_SPARC_STBAR |