Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions feature.c
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,17 @@ void setup_features(void)
while(1);
}
break;
case 0x9:
if(cpu_ver >= 0x0) {
csr_clear(CSR_MXSTATUS, 0x1);
csr_write(CSR_MISELECT,CSR_MNASTATUS);
csr_write(CSR_MIREG,0x1e);
csr_write(CSR_MISELECT, CSR_L2_TRA_CTRL);
csr_set(CSR_MIREG2, 0x1600);
} else {
while(1);
}
break;
default:
while(1);
}
Expand Down
2 changes: 2 additions & 0 deletions riscv_encoding.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#define CSR_MCOUNTERWEN 0x7c9
#define CSR_MSMPR 0x7f3
#define CSR_MNASTATUS 0x8000000000000210
#define CSR_L2_TRA_CTRL 0x8000000000001600

/* clang-format off */
#define MSTATUS_SIE _UL(0x00000002)
Expand Down Expand Up @@ -251,6 +252,7 @@
#define CSR_MTVAL2 0x34b
#define CSR_MISELECT 0x350
#define CSR_MIREG 0x351
#define CSR_MIREG2 0x352
#define CSR_PMPCFG0 0x3a0
#define CSR_PMPCFG1 0x3a1
#define CSR_PMPCFG2 0x3a2
Expand Down
Loading