We should detect HART features in sbi_hart_init() before
mstatus_init(), delegate_traps() and pmp_init().
Signed-off-by: Anup Patel <anup.patel@wdc.com>
Reviewed-by: Atish Patra <atish.patra@wdc.com>
fstr = "pmp";
break;
case SBI_HART_HAS_SCOUNTEREN:
- fstr = "scountern";
+ fstr = "scounteren";
break;
case SBI_HART_HAS_MCOUNTEREN:
fstr = "mcounteren";
if (!hart_features_offset)
return SBI_ENOMEM;
}
+
hart_features = sbi_scratch_offset_ptr(scratch, hart_features_offset);
*hart_features = 0;
+ sbi_hart_detect_features(hartid);
mstatus_init(scratch, hartid);
if (rc)
return rc;
- sbi_hart_detect_features(hartid);
-
return pmp_init(scratch, hartid);
}