aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arc
diff options
context:
space:
mode:
authorVineet Gupta <vgupta@synopsys.com>2014-09-04 01:27:33 -0400
committerVineet Gupta <vgupta@synopsys.com>2014-09-27 05:19:01 -0400
commit619f30188ff0d10fccc3cd952a79cb56ff62db54 (patch)
tree9bf015ba703fdd05d781b370792c0bba1f98d373 /arch/arc
parent2ce7598c9a453e0acd0e07be7be3f5eb39608ebd (diff)
ARC: Allow SMP kernel to build/boot on UP-only infrastructure
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>
Diffstat (limited to 'arch/arc')
-rw-r--r--arch/arc/include/asm/smp.h10
-rw-r--r--arch/arc/kernel/setup.c13
-rw-r--r--arch/arc/kernel/smp.c2
-rw-r--r--arch/arc/plat-arcfpga/Kconfig2
-rw-r--r--arch/arc/plat-arcfpga/platform.c2
5 files changed, 13 insertions, 16 deletions
diff --git a/arch/arc/include/asm/smp.h b/arch/arc/include/asm/smp.h
index 5d06eee43ea9..3845b9e94f69 100644
--- a/arch/arc/include/asm/smp.h
+++ b/arch/arc/include/asm/smp.h
@@ -59,7 +59,15 @@ struct plat_smp_ops {
59/* TBD: stop exporting it for direct population by platform */ 59/* TBD: stop exporting it for direct population by platform */
60extern struct plat_smp_ops plat_smp_ops; 60extern struct plat_smp_ops plat_smp_ops;
61 61
62#endif /* CONFIG_SMP */ 62#else /* CONFIG_SMP */
63
64static inline void smp_init_cpus(void) {}
65static inline const char *arc_platform_smp_cpuinfo(void)
66{
67 return "";
68}
69
70#endif /* !CONFIG_SMP */
63 71
64/* 72/*
65 * ARC700 doesn't support atomic Read-Modify-Write ops. 73 * ARC700 doesn't support atomic Read-Modify-Write ops.
diff --git a/arch/arc/kernel/setup.c b/arch/arc/kernel/setup.c
index 119dddb752b2..da61f2205dc5 100644
--- a/arch/arc/kernel/setup.c
+++ b/arch/arc/kernel/setup.c
@@ -24,6 +24,7 @@
24#include <asm/unwind.h> 24#include <asm/unwind.h>
25#include <asm/clk.h> 25#include <asm/clk.h>
26#include <asm/mach_desc.h> 26#include <asm/mach_desc.h>
27#include <asm/smp.h>
27 28
28#define FIX_PTR(x) __asm__ __volatile__(";" : "+r"(x)) 29#define FIX_PTR(x) __asm__ __volatile__(";" : "+r"(x))
29 30
@@ -306,10 +307,7 @@ void setup_processor(void)
306 arc_chk_ccms(); 307 arc_chk_ccms();
307 308
308 printk(arc_extn_mumbojumbo(cpu_id, str, sizeof(str))); 309 printk(arc_extn_mumbojumbo(cpu_id, str, sizeof(str)));
309
310#ifdef CONFIG_SMP
311 printk(arc_platform_smp_cpuinfo()); 310 printk(arc_platform_smp_cpuinfo());
312#endif
313 311
314 arc_chk_fpu(); 312 arc_chk_fpu();
315} 313}
@@ -360,11 +358,7 @@ void __init setup_arch(char **cmdline_p)
360 machine_desc->init_early(); 358 machine_desc->init_early();
361 359
362 setup_processor(); 360 setup_processor();
363
364#ifdef CONFIG_SMP
365 smp_init_cpus(); 361 smp_init_cpus();
366#endif
367
368 setup_arch_memory(); 362 setup_arch_memory();
369 363
370 /* copy flat DT out of .init and then unflatten it */ 364 /* copy flat DT out of .init and then unflatten it */
@@ -424,14 +418,9 @@ static int show_cpuinfo(struct seq_file *m, void *v)
424 (loops_per_jiffy / (5000 / HZ)) % 100); 418 (loops_per_jiffy / (5000 / HZ)) % 100);
425 419
426 seq_printf(m, arc_mmu_mumbojumbo(cpu_id, str, PAGE_SIZE)); 420 seq_printf(m, arc_mmu_mumbojumbo(cpu_id, str, PAGE_SIZE));
427
428 seq_printf(m, arc_cache_mumbojumbo(cpu_id, str, PAGE_SIZE)); 421 seq_printf(m, arc_cache_mumbojumbo(cpu_id, str, PAGE_SIZE));
429
430 seq_printf(m, arc_extn_mumbojumbo(cpu_id, str, PAGE_SIZE)); 422 seq_printf(m, arc_extn_mumbojumbo(cpu_id, str, PAGE_SIZE));
431
432#ifdef CONFIG_SMP
433 seq_printf(m, arc_platform_smp_cpuinfo()); 423 seq_printf(m, arc_platform_smp_cpuinfo());
434#endif
435 424
436 free_page((unsigned long)str); 425 free_page((unsigned long)str);
437done: 426done:
diff --git a/arch/arc/kernel/smp.c b/arch/arc/kernel/smp.c
index dcd317c47d09..d01df0c517a2 100644
--- a/arch/arc/kernel/smp.c
+++ b/arch/arc/kernel/smp.c
@@ -101,7 +101,7 @@ void __weak arc_platform_smp_wait_to_boot(int cpu)
101 101
102const char *arc_platform_smp_cpuinfo(void) 102const char *arc_platform_smp_cpuinfo(void)
103{ 103{
104 return plat_smp_ops.info; 104 return plat_smp_ops.info ? : "";
105} 105}
106 106
107/* 107/*
diff --git a/arch/arc/plat-arcfpga/Kconfig b/arch/arc/plat-arcfpga/Kconfig
index b9f34cf55acf..4965f9f4ffdc 100644
--- a/arch/arc/plat-arcfpga/Kconfig
+++ b/arch/arc/plat-arcfpga/Kconfig
@@ -8,7 +8,7 @@
8 8
9menuconfig ARC_PLAT_FPGA_LEGACY 9menuconfig ARC_PLAT_FPGA_LEGACY
10 bool "\"Legacy\" ARC FPGA dev Boards" 10 bool "\"Legacy\" ARC FPGA dev Boards"
11 select ISS_SMP_EXTN if SMP 11 select ARC_HAS_COH_CACHES if SMP
12 help 12 help
13 Support for ARC development boards, provided by Synopsys. 13 Support for ARC development boards, provided by Synopsys.
14 These are based on FPGA or ISS. e.g. 14 These are based on FPGA or ISS. e.g.
diff --git a/arch/arc/plat-arcfpga/platform.c b/arch/arc/plat-arcfpga/platform.c
index 1038949a99a1..6abc341e276d 100644
--- a/arch/arc/plat-arcfpga/platform.c
+++ b/arch/arc/plat-arcfpga/platform.c
@@ -71,7 +71,7 @@ MACHINE_START(ML509, "ml509")
71 .dt_compat = ml509_compat, 71 .dt_compat = ml509_compat,
72 .init_early = plat_fpga_early_init, 72 .init_early = plat_fpga_early_init,
73 .init_machine = plat_fpga_populate_dev, 73 .init_machine = plat_fpga_populate_dev,
74#ifdef CONFIG_SMP 74#ifdef CONFIG_ISS_SMP_EXTN
75 .init_smp = iss_model_init_smp, 75 .init_smp = iss_model_init_smp,
76#endif 76#endif
77MACHINE_END 77MACHINE_END