mirror of
https://xff.cz/git/u-boot/
synced 2025-09-01 00:32:04 +02:00
cmd: provide command sbi
Provide a command to display information about the SBI implementation. The output might look like: => sbi SBI 0.2 OpenSBI Extensions: sbi_set_timer sbi_console_putchar sbi_console_getchar sbi_clear_ipi sbi_send_ipi sbi_remote_fence_i sbi_remote_sfence_vma sbi_remote_sfence_vma_asid sbi_shutdown SBI Base Functionality Timer Extension IPI Extension RFENCE Extension Hart State Management Extension The command can be used to construct a unit test checking that the communication with the SEE is working. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de> Reviewed-by: Atish Patra <atish.patra@wdc.com> Reviewed-by: Bin Meng <bin.meng@windriver.com> Tested-by: Bin Meng <bin.meng@windriver.com> Reviewed-by: Pragnesh Patel <pragnesh.patel@openfive.com> Tested-by: Pragnesh Patel <pragnesh.patel@openfive.com> Reviewed-by: Rick Chen <rick@andestech.com> Tested-by: Rick Chen <rick@andestech.com>
This commit is contained in:
committed by
Andes
parent
27cef4e4a3
commit
c92b50a44b
@@ -115,6 +115,8 @@ void sbi_remote_sfence_vma_asid(const unsigned long *hart_mask,
|
||||
unsigned long asid);
|
||||
#endif
|
||||
void sbi_set_timer(uint64_t stime_value);
|
||||
long sbi_get_spec_version(void);
|
||||
int sbi_get_impl_id(void);
|
||||
int sbi_probe_extension(int ext);
|
||||
|
||||
#endif
|
||||
|
@@ -53,6 +53,42 @@ void sbi_set_timer(uint64_t stime_value)
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* sbi_get_spec_version() - get current SBI specification version
|
||||
*
|
||||
* Return: version id
|
||||
*/
|
||||
long sbi_get_spec_version(void)
|
||||
{
|
||||
struct sbiret ret;
|
||||
|
||||
ret = sbi_ecall(SBI_EXT_BASE, SBI_EXT_BASE_GET_SPEC_VERSION,
|
||||
0, 0, 0, 0, 0, 0);
|
||||
if (!ret.error)
|
||||
if (ret.value)
|
||||
return ret.value;
|
||||
|
||||
return -ENOTSUPP;
|
||||
}
|
||||
|
||||
/**
|
||||
* sbi_get_impl_id() - get SBI implementation ID
|
||||
*
|
||||
* Return: implementation ID
|
||||
*/
|
||||
int sbi_get_impl_id(void)
|
||||
{
|
||||
struct sbiret ret;
|
||||
|
||||
ret = sbi_ecall(SBI_EXT_BASE, SBI_EXT_BASE_GET_IMP_ID,
|
||||
0, 0, 0, 0, 0, 0);
|
||||
if (!ret.error)
|
||||
if (ret.value)
|
||||
return ret.value;
|
||||
|
||||
return -ENOTSUPP;
|
||||
}
|
||||
|
||||
/**
|
||||
* sbi_probe_extension() - Check if an SBI extension ID is supported or not.
|
||||
* @extid: The extension ID to be probed.
|
||||
|
Reference in New Issue
Block a user