Detect extensions from $menvcfg
Opened this issue · 2 comments
yong-xuan commented
Hi @avpatel,
Currently "Boot HART ISA Extensions" only shows extensions which can be detected by test and set their CSR. Maybe we can detect more extensions from $menvcfg?
static int hart_detect_features(struct sbi_scratch *scratch)
{
...
if (hfeatures->priv_version >= SBI_HART_PRIV_VER_1_12) {
csr_write(CSR_MENVCFG, ~0);
csr_read(CSR_MENVCFG, menvcfg_val);
if (menvcfg_val | ENVCFG_CBZE)
__sbi_hart_update_extension(hfeatures,
SBI_HART_EXT_ZICBOZ, true);
...
}
...
}
atishp04 commented
Generally, we should move away from WARL based detection mechanism as it will be unmanageable in the future with more number of extensions.