summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorHimanshu Chauhan <[email protected]>2024-01-09 22:30:16 +0530
committerAnup Patel <[email protected]>2024-01-10 09:43:37 +0530
commit40dac6bcfe7e01fb12915e0bbf8d175df06c8170 (patch)
treef6a0f7b7335dc166c4cbbbe7d50fc2cdc3091fdc /lib
parent24997697aed9856f2a7e6ea73802e4939010660e (diff)
lib: sbi: Detect support of debug triggers
Detect if debug triggers, sdtrig extension, is supported by the CPU. The support is detected by access traps and ISA string parsing. Signed-off-by: Himanshu Chauhan <[email protected]> Reviewed-by: Anup Patel <[email protected]>
Diffstat (limited to 'lib')
-rw-r--r--lib/sbi/sbi_hart.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/sbi/sbi_hart.c b/lib/sbi/sbi_hart.c
index 770fee07..a0ab0c64 100644
--- a/lib/sbi/sbi_hart.c
+++ b/lib/sbi/sbi_hart.c
@@ -657,6 +657,7 @@ const struct sbi_hart_ext_data sbi_hart_ext[] = {
__SBI_HART_EXT_DATA(zicboz, SBI_HART_EXT_ZICBOZ),
__SBI_HART_EXT_DATA(zicbom, SBI_HART_EXT_ZICBOM),
__SBI_HART_EXT_DATA(svpbmt, SBI_HART_EXT_SVPBMT),
+ __SBI_HART_EXT_DATA(sdtrig, SBI_HART_EXT_SDTRIG),
};
/**
@@ -898,6 +899,9 @@ __pmp_skip:
/* Detect if hart supports smcntrpmf */
__check_ext_csr(SBI_HART_PRIV_VER_1_12,
CSR_MCYCLECFG, SBI_HART_EXT_SMCNTRPMF);
+ /* Detect if hart support sdtrig (debug triggers) */
+ __check_ext_csr(SBI_HART_PRIV_VER_UNKNOWN,
+ CSR_TSELECT, SBI_HART_EXT_SDTRIG);
#undef __check_ext_csr