ARC: Allow SMP kernel to build/boot on UP-only infrastructure
authorVineet Gupta <vgupta@synopsys.com>
Thu, 4 Sep 2014 05:27:33 +0000 (10:57 +0530)
committerVineet Gupta <vgupta@synopsys.com>
Sat, 27 Sep 2014 09:19:01 +0000 (14:49 +0530)
In light of recent SNAFU with SMP build, allow simple platform to build
as SMP but run UP.

* Remove the dependence on simulation SMP extension to enable quick
  build/test iterations of SMP kernel.

* In absence of platform SMP registration, prevent the NULL smp feature
  name from borkign the system

Signed-off-by: Vineet Gupta <vgupta@synopsys.com>
arch/arc/include/asm/smp.h
arch/arc/kernel/setup.c
arch/arc/kernel/smp.c
arch/arc/plat-arcfpga/Kconfig
arch/arc/plat-arcfpga/platform.c

index 5d06eee43ea9a18ddd8876ac66c7c6d5fed29ec6..3845b9e94f69b0ee5dbda11fe9467c3d4b517aed 100644 (file)
@@ -59,7 +59,15 @@ struct plat_smp_ops {
 /* TBD: stop exporting it for direct population by platform */
 extern struct plat_smp_ops  plat_smp_ops;
 
 /* TBD: stop exporting it for direct population by platform */
 extern struct plat_smp_ops  plat_smp_ops;
 
-#endif  /* CONFIG_SMP */
+#else /* CONFIG_SMP */
+
+static inline void smp_init_cpus(void) {}
+static inline const char *arc_platform_smp_cpuinfo(void)
+{
+       return "";
+}
+
+#endif  /* !CONFIG_SMP */
 
 /*
  * ARC700 doesn't support atomic Read-Modify-Write ops.
 
 /*
  * ARC700 doesn't support atomic Read-Modify-Write ops.
index 119dddb752b2892ff81a7ab7ce43011eef056b35..da61f2205dc5645c9ff96e487a17216f71a70159 100644 (file)
@@ -24,6 +24,7 @@
 #include <asm/unwind.h>
 #include <asm/clk.h>
 #include <asm/mach_desc.h>
 #include <asm/unwind.h>
 #include <asm/clk.h>
 #include <asm/mach_desc.h>
+#include <asm/smp.h>
 
 #define FIX_PTR(x)  __asm__ __volatile__(";" : "+r"(x))
 
 
 #define FIX_PTR(x)  __asm__ __volatile__(";" : "+r"(x))
 
@@ -306,10 +307,7 @@ void setup_processor(void)
        arc_chk_ccms();
 
        printk(arc_extn_mumbojumbo(cpu_id, str, sizeof(str)));
        arc_chk_ccms();
 
        printk(arc_extn_mumbojumbo(cpu_id, str, sizeof(str)));
-
-#ifdef CONFIG_SMP
        printk(arc_platform_smp_cpuinfo());
        printk(arc_platform_smp_cpuinfo());
-#endif
 
        arc_chk_fpu();
 }
 
        arc_chk_fpu();
 }
@@ -360,11 +358,7 @@ void __init setup_arch(char **cmdline_p)
                machine_desc->init_early();
 
        setup_processor();
                machine_desc->init_early();
 
        setup_processor();
-
-#ifdef CONFIG_SMP
        smp_init_cpus();
        smp_init_cpus();
-#endif
-
        setup_arch_memory();
 
        /* copy flat DT out of .init and then unflatten it */
        setup_arch_memory();
 
        /* copy flat DT out of .init and then unflatten it */
@@ -424,14 +418,9 @@ static int show_cpuinfo(struct seq_file *m, void *v)
                   (loops_per_jiffy / (5000 / HZ)) % 100);
 
        seq_printf(m, arc_mmu_mumbojumbo(cpu_id, str, PAGE_SIZE));
                   (loops_per_jiffy / (5000 / HZ)) % 100);
 
        seq_printf(m, arc_mmu_mumbojumbo(cpu_id, str, PAGE_SIZE));
-
        seq_printf(m, arc_cache_mumbojumbo(cpu_id, str, PAGE_SIZE));
        seq_printf(m, arc_cache_mumbojumbo(cpu_id, str, PAGE_SIZE));
-
        seq_printf(m, arc_extn_mumbojumbo(cpu_id, str, PAGE_SIZE));
        seq_printf(m, arc_extn_mumbojumbo(cpu_id, str, PAGE_SIZE));
-
-#ifdef CONFIG_SMP
        seq_printf(m, arc_platform_smp_cpuinfo());
        seq_printf(m, arc_platform_smp_cpuinfo());
-#endif
 
        free_page((unsigned long)str);
 done:
 
        free_page((unsigned long)str);
 done:
index dcd317c47d098f0fef9391d8173cff82a1b96ba7..d01df0c517a2044ddc15f5fdb895303aa3de56bb 100644 (file)
@@ -101,7 +101,7 @@ void __weak arc_platform_smp_wait_to_boot(int cpu)
 
 const char *arc_platform_smp_cpuinfo(void)
 {
 
 const char *arc_platform_smp_cpuinfo(void)
 {
-       return plat_smp_ops.info;
+       return plat_smp_ops.info ? : "";
 }
 
 /*
 }
 
 /*
index b9f34cf55acf47c653d6d6b7e5c09adde2d9d324..4965f9f4ffdc6c976b30aa2e6294d8dbdeaaf29f 100644 (file)
@@ -8,7 +8,7 @@
 
 menuconfig ARC_PLAT_FPGA_LEGACY
        bool "\"Legacy\" ARC FPGA dev Boards"
 
 menuconfig ARC_PLAT_FPGA_LEGACY
        bool "\"Legacy\" ARC FPGA dev Boards"
-       select ISS_SMP_EXTN if SMP
+       select ARC_HAS_COH_CACHES if SMP
        help
          Support for ARC development boards, provided by Synopsys.
          These are based on FPGA or ISS. e.g.
        help
          Support for ARC development boards, provided by Synopsys.
          These are based on FPGA or ISS. e.g.
index 1038949a99a177a0c5e4429be113332268f20f29..6abc341e276d67253d205ca910cb7767e140a86d 100644 (file)
@@ -71,7 +71,7 @@ MACHINE_START(ML509, "ml509")
        .dt_compat      = ml509_compat,
        .init_early     = plat_fpga_early_init,
        .init_machine   = plat_fpga_populate_dev,
        .dt_compat      = ml509_compat,
        .init_early     = plat_fpga_early_init,
        .init_machine   = plat_fpga_populate_dev,
-#ifdef CONFIG_SMP
+#ifdef CONFIG_ISS_SMP_EXTN
        .init_smp       = iss_model_init_smp,
 #endif
 MACHINE_END
        .init_smp       = iss_model_init_smp,
 #endif
 MACHINE_END