diff options
author | Heinrich Schuchardt <heinrich.schuchardt@canonical.com> | 2021-09-12 21:11:46 +0200 |
---|---|---|
committer | Leo Yu-Chi Liang <ycliang@andestech.com> | 2021-10-07 16:08:23 +0800 |
commit | 24ed5317d427bfe278a1329abbf4522dba1025a3 (patch) | |
tree | 819a4d8ac328adbc91870b97c08e6385ec05ba6a /arch/riscv/lib | |
parent | 09d7cc3369fcb9a6c86996ae8a58ff5dc34b3798 (diff) | |
download | u-boot-24ed5317d427bfe278a1329abbf4522dba1025a3.zip u-boot-24ed5317d427bfe278a1329abbf4522dba1025a3.tar.gz u-boot-24ed5317d427bfe278a1329abbf4522dba1025a3.tar.bz2 |
sysreset: provide SBI based sysreset driver
Provide sysreset driver using the SBI system reset extension.
Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Sean Anderson <seanga2@gmail.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Tested-by: Samuel Holland <samuel@sholland.org>
Diffstat (limited to 'arch/riscv/lib')
-rw-r--r-- | arch/riscv/lib/sbi.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/arch/riscv/lib/sbi.c b/arch/riscv/lib/sbi.c index 77845a7..2b53896 100644 --- a/arch/riscv/lib/sbi.c +++ b/arch/riscv/lib/sbi.c @@ -108,6 +108,18 @@ int sbi_probe_extension(int extid) return -ENOTSUPP; } +/** + * sbi_srst_reset() - invoke system reset extension + * + * @type: type of reset + * @reason: reason for reset + */ +void sbi_srst_reset(unsigned long type, unsigned long reason) +{ + sbi_ecall(SBI_EXT_SRST, SBI_EXT_SRST_RESET, type, reason, + 0, 0, 0, 0); +} + #ifdef CONFIG_SBI_V01 /** |