Skip to content

Commit 619f301

Browse files
committed
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>
1 parent 2ce7598 commit 619f301

5 files changed

Lines changed: 13 additions & 16 deletions

File tree

‎arch/arc/include/asm/smp.h‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,15 @@ struct plat_smp_ops {
5959
/* TBD: stop exporting it for direct population by platform */
6060
extern struct plat_smp_ops plat_smp_ops;
6161

62-
#endif /* CONFIG_SMP */
62+
#else /* CONFIG_SMP */
63+
64+
static inline void smp_init_cpus(void) {}
65+
static inline const char *arc_platform_smp_cpuinfo(void)
66+
{
67+
return "";
68+
}
69+
70+
#endif /* !CONFIG_SMP */
6371

6472
/*
6573
* ARC700 doesn't support atomic Read-Modify-Write ops.

‎arch/arc/kernel/setup.c‎

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include <asm/unwind.h>
2525
#include <asm/clk.h>
2626
#include <asm/mach_desc.h>
27+
#include <asm/smp.h>
2728

2829
#define FIX_PTR(x) __asm__ __volatile__(";" : "+r"(x))
2930

@@ -306,10 +307,7 @@ void setup_processor(void)
306307
arc_chk_ccms();
307308

308309
printk(arc_extn_mumbojumbo(cpu_id, str, sizeof(str)));
309-
310-
#ifdef CONFIG_SMP
311310
printk(arc_platform_smp_cpuinfo());
312-
#endif
313311

314312
arc_chk_fpu();
315313
}
@@ -360,11 +358,7 @@ void __init setup_arch(char **cmdline_p)
360358
machine_desc->init_early();
361359

362360
setup_processor();
363-
364-
#ifdef CONFIG_SMP
365361
smp_init_cpus();
366-
#endif
367-
368362
setup_arch_memory();
369363

370364
/* copy flat DT out of .init and then unflatten it */
@@ -424,14 +418,9 @@ static int show_cpuinfo(struct seq_file *m, void *v)
424418
(loops_per_jiffy / (5000 / HZ)) % 100);
425419

426420
seq_printf(m, arc_mmu_mumbojumbo(cpu_id, str, PAGE_SIZE));
427-
428421
seq_printf(m, arc_cache_mumbojumbo(cpu_id, str, PAGE_SIZE));
429-
430422
seq_printf(m, arc_extn_mumbojumbo(cpu_id, str, PAGE_SIZE));
431-
432-
#ifdef CONFIG_SMP
433423
seq_printf(m, arc_platform_smp_cpuinfo());
434-
#endif
435424

436425
free_page((unsigned long)str);
437426
done:

‎arch/arc/kernel/smp.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ void __weak arc_platform_smp_wait_to_boot(int cpu)
101101

102102
const char *arc_platform_smp_cpuinfo(void)
103103
{
104-
return plat_smp_ops.info;
104+
return plat_smp_ops.info ? : "";
105105
}
106106

107107
/*

‎arch/arc/plat-arcfpga/Kconfig‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
menuconfig ARC_PLAT_FPGA_LEGACY
1010
bool "\"Legacy\" ARC FPGA dev Boards"
11-
select ISS_SMP_EXTN if SMP
11+
select ARC_HAS_COH_CACHES if SMP
1212
help
1313
Support for ARC development boards, provided by Synopsys.
1414
These are based on FPGA or ISS. e.g.

‎arch/arc/plat-arcfpga/platform.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ MACHINE_START(ML509, "ml509")
7171
.dt_compat = ml509_compat,
7272
.init_early = plat_fpga_early_init,
7373
.init_machine = plat_fpga_populate_dev,
74-
#ifdef CONFIG_SMP
74+
#ifdef CONFIG_ISS_SMP_EXTN
7575
.init_smp = iss_model_init_smp,
7676
#endif
7777
MACHINE_END

0 commit comments

Comments
 (0)