RISC-V: Use SBI SRST extension when available
authorAnup Patel <anup.patel@wdc.com>
Wed, 9 Jun 2021 12:13:22 +0000 (17:43 +0530)
committermason.huo <mason.huo@starfivetech.com>
Thu, 27 Oct 2022 05:54:44 +0000 (13:54 +0800)
commit957aad3596b52296124b5b3c6d4eb87f340d1f47
tree2ff6fd9fede2806c2a2f620ceef4b2b750487d78
parent2577c2b760ff5b7c394ece88e947229803cf9dff
RISC-V: Use SBI SRST extension when available

The SBI SRST extension provides a standard way to poweroff and
reboot the system irrespective to whether Linux RISC-V S-mode
is running natively (HS-mode) or inside Guest/VM (VS-mode).

The SBI SRST extension is available in the SBI v0.3 specification.
(Refer, https://github.com/riscv/riscv-sbi-doc/releases/tag/v0.3.0-rc1)

This patch extends Linux RISC-V SBI implementation to detect
and use SBI SRST extension.

Signed-off-by: Anup Patel <anup.patel@wdc.com>
Reviewed-by: Atish Patra <atish.patra@wdc.com>
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Signed-off-by: minda.chen <minda.chen@starfivetech.com>
arch/riscv/include/asm/sbi.h
arch/riscv/kernel/sbi.c