summaryrefslogtreecommitdiff
path: root/arch/riscv/lib/sbi.c
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2020-06-04 13:50:39 -0400
committerTom Rini <trini@konsulko.com>2020-06-04 13:50:39 -0400
commit07d90d8bd451b9595fb0369c51f90ee2dccd5d9f (patch)
tree97560956a7738893dd4cc972e3a1b463623033bb /arch/riscv/lib/sbi.c
parentc27178ba3649f539c9f1890ea147f4c5415f63b5 (diff)
parent0a94007e829876c7ebd49daebfaa90eea25801b8 (diff)
Merge https://gitlab.denx.de/u-boot/custodians/u-boot-riscv
- Fixes 7e249bc13aaf: ("riscv: Move all SMP related SBI calls to SBI_v01") Move sbi_probe_extension() out of CONFIG_SBI_V01. - SiFive FU540 support SPL.
Diffstat (limited to 'arch/riscv/lib/sbi.c')
-rw-r--r--arch/riscv/lib/sbi.c40
1 files changed, 19 insertions, 21 deletions
diff --git a/arch/riscv/lib/sbi.c b/arch/riscv/lib/sbi.c
index 993597e33db..8fbc23839dd 100644
--- a/arch/riscv/lib/sbi.c
+++ b/arch/riscv/lib/sbi.c
@@ -11,9 +11,6 @@
#include <asm/encoding.h>
#include <asm/sbi.h>
-/* default SBI version is 0.1 */
-unsigned long sbi_spec_version = SBI_SPEC_VERSION_DEFAULT;
-
struct sbiret sbi_ecall(int ext, int fid, unsigned long arg0,
unsigned long arg1, unsigned long arg2,
unsigned long arg3, unsigned long arg4,
@@ -56,6 +53,25 @@ void sbi_set_timer(uint64_t stime_value)
#endif
}
+/**
+ * sbi_probe_extension() - Check if an SBI extension ID is supported or not.
+ * @extid: The extension ID to be probed.
+ *
+ * Return: Extension specific nonzero value f yes, -ENOTSUPP otherwise.
+ */
+int sbi_probe_extension(int extid)
+{
+ struct sbiret ret;
+
+ ret = sbi_ecall(SBI_EXT_BASE, SBI_EXT_BASE_PROBE_EXT, extid,
+ 0, 0, 0, 0, 0);
+ if (!ret.error)
+ if (ret.value)
+ return ret.value;
+
+ return -ENOTSUPP;
+}
+
#ifdef CONFIG_SBI_V01
/**
@@ -165,22 +181,4 @@ void sbi_remote_sfence_vma_asid(const unsigned long *hart_mask,
(unsigned long)hart_mask, start, size, asid, 0, 0);
}
-/**
- * sbi_probe_extension() - Check if an SBI extension ID is supported or not.
- * @extid: The extension ID to be probed.
- *
- * Return: Extension specific nonzero value f yes, -ENOTSUPP otherwise.
- */
-int sbi_probe_extension(int extid)
-{
- struct sbiret ret;
-
- ret = sbi_ecall(SBI_EXT_BASE, SBI_EXT_BASE_PROBE_EXT, extid,
- 0, 0, 0, 0, 0);
- if (!ret.error)
- if (ret.value)
- return ret.value;
-
- return -ENOTSUPP;
-}
#endif /* CONFIG_SBI_V01 */