Skip to content

Commit

Permalink
openrisc: Flush i-tlb and d-tlb seperately
Browse files Browse the repository at this point in the history
  • Loading branch information
stffrdhrn committed Jun 23, 2020
1 parent 78b7af1 commit 2864e21
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions arch/openrisc/mm/tlb.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

#define NO_CONTEXT -1

#define NUM_DTLB_SETS (1 << ((mfspr(SPR_IMMUCFGR) & SPR_IMMUCFGR_NTS) >> \
#define NUM_DTLB_SETS (1 << ((mfspr(SPR_DMMUCFGR) & SPR_DMMUCFGR_NTS) >> \
SPR_DMMUCFGR_NTS_OFF))
#define NUM_ITLB_SETS (1 << ((mfspr(SPR_IMMUCFGR) & SPR_IMMUCFGR_NTS) >> \
SPR_IMMUCFGR_NTS_OFF))
Expand All @@ -49,13 +49,16 @@ void local_flush_tlb_all(void)
unsigned long num_tlb_sets;

/* Determine number of sets for IMMU. */
/* FIXME: Assumption is I & D nsets equal. */
num_tlb_sets = NUM_ITLB_SETS;

for (i = 0; i < num_tlb_sets; i++) {
mtspr_off(SPR_DTLBMR_BASE(0), i, 0);
mtspr_off(SPR_ITLBMR_BASE(0), i, 0);
}

num_tlb_sets = NUM_DTLB_SETS;
for (i = 0; i < num_tlb_sets; i++) {
mtspr_off(SPR_DTLBMR_BASE(0), i, 0);
}
}

#define have_dtlbeir (mfspr(SPR_DMMUCFGR) & SPR_DMMUCFGR_TEIRI)
Expand Down

0 comments on commit 2864e21

Please sign in to comment.