mirror of
https://github.com/Fishwaldo/opensbi.git
synced 2025-03-15 19:31:32 +00:00
lib: sbi: enable seed access in S-mode
If ISA extension Zkr is available, set mseccfg.sseed=1 mseccfg.useed=0 This enables access to the seed CSR in S-mode but not in U-mode. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com> Reviewed-by: Anup Patel <anup@brainfault.org>
This commit is contained in:
parent
efcac338bd
commit
6e5b0cfb45
1 changed files with 6 additions and 0 deletions
|
@ -160,6 +160,12 @@ static void mstatus_init(struct sbi_scratch *scratch)
|
|||
}
|
||||
|
||||
csr_write(CSR_MENVCFG, menvcfg_val);
|
||||
|
||||
/* Enable S-mode access to seed CSR */
|
||||
if (sbi_hart_has_extension(scratch, SBI_HART_EXT_ZKR)) {
|
||||
csr_set(CSR_MSECCFG, MSECCFG_SSEED);
|
||||
csr_clear(CSR_MSECCFG, MSECCFG_USEED);
|
||||
}
|
||||
}
|
||||
|
||||
/* Disable all interrupts */
|
||||
|
|
Loading…
Add table
Reference in a new issue