SG2044: add t-head c9xx jtlb errta
Signed-off-by: Chao Wei <chao.wei@sophgo.com>
This commit is contained in:
@@ -79,12 +79,15 @@ static void sbi_tlb_local_hfence_gvma(struct sbi_tlb_info *tinfo)
|
||||
|
||||
static void sbi_tlb_local_sfence_vma(struct sbi_tlb_info *tinfo)
|
||||
{
|
||||
#ifndef CONFIG_THEAD_C9XX_ERRATA_JTLB
|
||||
unsigned long start = tinfo->start;
|
||||
unsigned long size = tinfo->size;
|
||||
unsigned long i;
|
||||
#endif
|
||||
|
||||
sbi_pmu_ctr_incr_fw(SBI_PMU_FW_SFENCE_VMA_RCVD);
|
||||
|
||||
#ifndef CONFIG_THEAD_C9XX_ERRATA_JTLB
|
||||
if ((start == 0 && size == 0) || (size == SBI_TLB_FLUSH_ALL)) {
|
||||
tlb_flush_all();
|
||||
return;
|
||||
@@ -96,6 +99,10 @@ static void sbi_tlb_local_sfence_vma(struct sbi_tlb_info *tinfo)
|
||||
: "r"(start + i)
|
||||
: "memory");
|
||||
}
|
||||
#else
|
||||
tlb_flush_all();
|
||||
return;
|
||||
#endif
|
||||
}
|
||||
|
||||
static void sbi_tlb_local_hfence_vvma_asid(struct sbi_tlb_info *tinfo)
|
||||
@@ -148,7 +155,9 @@ static void sbi_tlb_local_sfence_vma_asid(struct sbi_tlb_info *tinfo)
|
||||
unsigned long start = tinfo->start;
|
||||
unsigned long size = tinfo->size;
|
||||
unsigned long asid = tinfo->asid;
|
||||
#ifndef CONFIG_THEAD_C9XX_ERRATA_JTLB
|
||||
unsigned long i;
|
||||
#endif
|
||||
|
||||
sbi_pmu_ctr_incr_fw(SBI_PMU_FW_SFENCE_VMA_ASID_RCVD);
|
||||
|
||||
@@ -161,12 +170,20 @@ static void sbi_tlb_local_sfence_vma_asid(struct sbi_tlb_info *tinfo)
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
#ifndef CONFIG_THEAD_C9XX_ERRATA_JTLB
|
||||
for (i = 0; i < size; i += PAGE_SIZE) {
|
||||
__asm__ __volatile__("sfence.vma %0, %1"
|
||||
:
|
||||
: "r"(start + i), "r"(asid)
|
||||
: "memory");
|
||||
}
|
||||
#else
|
||||
__asm__ __volatile__("sfence.vma x0, %0"
|
||||
:
|
||||
: "r"(asid)
|
||||
: "memory");
|
||||
#endif
|
||||
}
|
||||
|
||||
static void sbi_tlb_local_fence_i(struct sbi_tlb_info *tinfo)
|
||||
|
||||
Reference in New Issue
Block a user