diff options
author | Anup Patel <apatel@ventanamicro.com> | 2023-07-05 12:15:56 +0530 |
---|---|---|
committer | Anup Patel <anup@brainfault.org> | 2023-07-09 11:06:26 +0530 |
commit | 669089c5f291f5543db1c46e8d6b04ffe49e9576 (patch) | |
tree | 8533263747d763c904c3091982243e1e865c4cbc /lib/sbi/sbi_hart.c | |
parent | 1a398d9faa60ac0341614f59b864340fc5e49a35 (diff) | |
download | opensbi-669089c5f291f5543db1c46e8d6b04ffe49e9576.zip opensbi-669089c5f291f5543db1c46e8d6b04ffe49e9576.tar.gz opensbi-669089c5f291f5543db1c46e8d6b04ffe49e9576.tar.bz2 |
lib: sbi: Add Zihpm as a HART ISA extension
Recently ratified Zihpm ISA extension covers all [m]hpm* CSRs
so we add Zihpm as a HART ISA extension in OpenSBI.
Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Reviewed-by: Xiang W <wxjstz@126.com>
Diffstat (limited to 'lib/sbi/sbi_hart.c')
-rw-r--r-- | lib/sbi/sbi_hart.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/sbi/sbi_hart.c b/lib/sbi/sbi_hart.c index c470482..ff6f582 100644 --- a/lib/sbi/sbi_hart.c +++ b/lib/sbi/sbi_hart.c @@ -453,6 +453,9 @@ static inline char *sbi_hart_extension_id2string(int ext) case SBI_HART_EXT_SMSTATEEN: estr = "smstateen"; break; + case SBI_HART_EXT_ZIHPM: + estr = "zihpm"; + break; default: break; } @@ -706,6 +709,11 @@ __mhpm_skip: if (rc) return rc; + /* Extensions implied by other extensions and features */ + if (hfeatures->mhpm_count) + __sbi_hart_update_extension(hfeatures, + SBI_HART_EXT_ZIHPM, true); + /* Mark hart feature detection done */ hfeatures->detected = true; |