mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2025-11-28 22:21:49 +01:00
riscv: function to retrieve SBI implementation version
Provide function sbi_get_impl_version() to retrieve the SBI implementation version. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Leo Yu-Chi Liang <ycliang@andestech.com> Reviewed-by: Rick Chen <rick@andestech.com>
This commit is contained in:
parent
52207514ba
commit
afb8e1f067
@ -152,6 +152,7 @@ void sbi_remote_sfence_vma_asid(const unsigned long *hart_mask,
|
|||||||
void sbi_set_timer(uint64_t stime_value);
|
void sbi_set_timer(uint64_t stime_value);
|
||||||
long sbi_get_spec_version(void);
|
long sbi_get_spec_version(void);
|
||||||
int sbi_get_impl_id(void);
|
int sbi_get_impl_id(void);
|
||||||
|
int sbi_get_impl_version(long *version);
|
||||||
int sbi_probe_extension(int ext);
|
int sbi_probe_extension(int ext);
|
||||||
void sbi_srst_reset(unsigned long type, unsigned long reason);
|
void sbi_srst_reset(unsigned long type, unsigned long reason);
|
||||||
|
|
||||||
|
|||||||
@ -89,6 +89,25 @@ int sbi_get_impl_id(void)
|
|||||||
return -ENOTSUPP;
|
return -ENOTSUPP;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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.
|
* sbi_probe_extension() - Check if an SBI extension ID is supported or not.
|
||||||
* @extid: The extension ID to be probed.
|
* @extid: The extension ID to be probed.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user