diff options
| author | Mayuresh Chitale <[email protected]> | 2022-04-11 08:34:17 +0530 |
|---|---|---|
| committer | Anup Patel <[email protected]> | 2022-04-11 08:34:17 +0530 |
| commit | 3383d6a4d1461bb029b21fa53417382e34ae4906 (patch) | |
| tree | 4d58aa3375bdaba9f0b1f3e23b2a72f4272b0505 | |
| parent | d44568a0f2e6301d3ad77a48370b0bfef4bfe5a0 (diff) | |
lib: irqchip/imsic: configure mstateen
When mstateen registers are implemented, the AIA related
configurations need to be done in mstateen for the IMSIC
initialization to succeed.
Signed-off-by: Mayuresh Chitale <[email protected]>
Reviewed-by: Xiang W <[email protected]>
Reviewed-by: Anup Patel <[email protected]>
| -rw-r--r-- | lib/sbi/sbi_hart.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/sbi/sbi_hart.c b/lib/sbi/sbi_hart.c index b0edf382..7b602c30 100644 --- a/lib/sbi/sbi_hart.c +++ b/lib/sbi/sbi_hart.c @@ -98,6 +98,12 @@ static void mstatus_init(struct sbi_scratch *scratch) mstateen_val |= SMSTATEEN0_HSENVCFG; else mstateen_val &= ~SMSTATEEN0_HSENVCFG; + if (sbi_hart_has_feature(scratch, SBI_HART_HAS_AIA)) + mstateen_val |= (SMSTATEEN0_AIA | SMSTATEEN0_SVSLCT | + SMSTATEEN0_IMSIC); + else + mstateen_val &= ~(SMSTATEEN0_AIA | SMSTATEEN0_SVSLCT | + SMSTATEEN0_IMSIC); csr_write(CSR_MSTATEEN0, mstateen_val); #if __riscv_xlen == 32 csr_write(CSR_MSTATEEN0H, mstateen_val >> 32); |
