diff options
author | Vincent Chen <vincent.chen@sifive.com> | 2021-03-22 22:26:02 +0800 |
---|---|---|
committer | Palmer Dabbelt <palmerdabbelt@google.com> | 2021-04-26 08:24:54 -0700 |
commit | 183787c6fcc2c793ec96e946a4fdd8cd0e6d7aa0 (patch) | |
tree | 4ff6143f4e427f5990a6a5d9c6e43867dce1b117 /arch/riscv/kernel | |
parent | 7d0bc44bd0ea163a251d4aa778d1b6fcf6174d22 (diff) |
riscv: Add 3 SBI wrapper functions to get cpu manufacturer information
Add 3 wrapper functions to get vendor id, architecture id and implement id
from M-mode
Signed-off-by: Vincent Chen <vincent.chen@sifive.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
Diffstat (limited to 'arch/riscv/kernel')
-rw-r--r-- | arch/riscv/kernel/sbi.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/arch/riscv/kernel/sbi.c b/arch/riscv/kernel/sbi.c index c0dcebdd30ec..fa0dd881fc5e 100644 --- a/arch/riscv/kernel/sbi.c +++ b/arch/riscv/kernel/sbi.c @@ -547,6 +547,21 @@ static inline long sbi_get_firmware_version(void) return __sbi_base_ecall(SBI_EXT_BASE_GET_IMP_VERSION); } +long sbi_get_mvendorid(void) +{ + return __sbi_base_ecall(SBI_EXT_BASE_GET_MVENDORID); +} + +long sbi_get_marchid(void) +{ + return __sbi_base_ecall(SBI_EXT_BASE_GET_MARCHID); +} + +long sbi_get_mimpid(void) +{ + return __sbi_base_ecall(SBI_EXT_BASE_GET_MIMPID); +} + static void sbi_send_cpumask_ipi(const struct cpumask *target) { struct cpumask hartid_mask; |