mirror of
https://github.com/riscv-software-src/opensbi.git
synced 2026-09-08 18:21:29 +01:00
Some T-Head based processors, for example the Sophgo SG2044, have a JTLB errata that requires special handling of certain TLB maintenance instructions (sfence.vma). Introduce a sbi_tlb_local_operations structure so platforms can provide custom local TLB flush implementations. Use it to implement the JTLB workaround on affected SoCs (currently Sophgo SG2044). Signed-off-by: Xiang W <wangxiang@iscas.ac.cn> Signed-off-by: Han Gao <gaohan@iscas.ac.cn> Reviewed-by: Anup Patel <anup@brainfault.org> Link: https://lore.kernel.org/r/20260617112925.1144190-2-wangxiang@iscas.ac.cn Signed-off-by: Anup Patel <anup@brainfault.org>
16 lines
430 B
C
16 lines
430 B
C
|
|
#ifndef __RISCV_THEAD_C9XX_ERRATA_H____
|
|
#define __RISCV_THEAD_C9XX_ERRATA_H____
|
|
|
|
/**
|
|
* T-HEAD board with this quirk need to execute sfence.vma to flush
|
|
* stale entrie avoid incorrect memory access.
|
|
*/
|
|
#define THEAD_QUIRK_ERRATA_TLB_FLUSH BIT(0)
|
|
#define THEAD_QUIRK_ERRATA_THEAD_PMU BIT(1)
|
|
#define THEAD_QUIRK_ERRATA_JTLB BIT(2)
|
|
|
|
void thead_register_tlb_flush_trap_handler(void);
|
|
|
|
#endif // __RISCV_THEAD_C9XX_ERRATA_H____
|