summaryrefslogtreecommitdiff
path: root/arch/riscv/lib/sbi.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2021-11-08 21:44:02 -0500
committerTom Rini <trini@konsulko.com>2021-11-08 21:44:02 -0500
commitb842340a108f463e66aaaca75c0831a224612190 (patch)
treef4f49ea253d1ec7fc7f62bb7f5ee342bb91bef0a /arch/riscv/lib/sbi.c
parentf8ed9059001d803b0eae4b49178789aa0e29edec (diff)
parent990e1e4beae546ddc9c50854c0588d1bea494cd2 (diff)
Merge https://source.denx.de/u-boot/custodians/u-boot-riscv
Diffstat (limited to 'arch/riscv/lib/sbi.c')
-rw-r--r--arch/riscv/lib/sbi.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/arch/riscv/lib/sbi.c b/arch/riscv/lib/sbi.c
index 2b53896b8a3..d427d1b29ea 100644
--- a/arch/riscv/lib/sbi.c
+++ b/arch/riscv/lib/sbi.c
@@ -90,6 +90,25 @@ int sbi_get_impl_id(void)
}
/**
+ * sbi_get_impl_version() - get SBI implementation version
+ *
+ * @version: pointer to receive version
+ * Return: 0 on success, -ENOTSUPP otherwise
+ */
+int sbi_get_impl_version(long *version)
+{
+ struct sbiret ret;
+
+ ret = sbi_ecall(SBI_EXT_BASE, SBI_EXT_BASE_GET_IMP_VERSION,
+ 0, 0, 0, 0, 0, 0);
+ if (ret.error)
+ return -ENOTSUPP;
+ if (version)
+ *version = ret.value;
+ return 0;
+}
+
+/**
* sbi_probe_extension() - Check if an SBI extension ID is supported or not.
* @extid: The extension ID to be probed.
*