summaryrefslogtreecommitdiff
path: root/arch/riscv/kernel/cpu_ops.c
diff options
context:
space:
mode:
authorAtish Patra <atishp@rivosinc.com>2022-01-20 01:09:17 -0800
committerPalmer Dabbelt <palmer@rivosinc.com>2022-01-20 09:27:16 -0800
commit2ffc48fc7071da4b2d881b0f21d37ed05feb697b (patch)
treefa6687a62f494303c5baf45bcb05aefe9ba1526d /arch/riscv/kernel/cpu_ops.c
parent0b39eb38f85908e039ce8c9f09868438e029757b (diff)
RISC-V: Move spinwait booting method to its own config
The spinwait booting method should only be used for platforms with older firmware without SBI HSM extension or M-mode firmware because spinwait method can't support cpu hotplug, kexec or sparse hartid. It is better to move the entire spinwait implementation to its own config which can be disabled if required. It is enabled by default to maintain backward compatibility and M-mode Linux. Reviewed-by: Anup Patel <anup@brainfault.org> Signed-off-by: Atish Patra <atishp@rivosinc.com> Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Diffstat (limited to 'arch/riscv/kernel/cpu_ops.c')
-rw-r--r--arch/riscv/kernel/cpu_ops.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/arch/riscv/kernel/cpu_ops.c b/arch/riscv/kernel/cpu_ops.c
index c1e30f403c3b..170d07e57721 100644
--- a/arch/riscv/kernel/cpu_ops.c
+++ b/arch/riscv/kernel/cpu_ops.c
@@ -15,7 +15,15 @@
const struct cpu_operations *cpu_ops[NR_CPUS] __ro_after_init;
extern const struct cpu_operations cpu_ops_sbi;
+#ifdef CONFIG_RISCV_BOOT_SPINWAIT
extern const struct cpu_operations cpu_ops_spinwait;
+#else
+const struct cpu_operations cpu_ops_spinwait = {
+ .name = "",
+ .cpu_prepare = NULL,
+ .cpu_start = NULL,
+};
+#endif
void __init cpu_set_ops(int cpuid)
{