From d72f5f17478dfef3df817339a0f02cfdb77a1dc1 Mon Sep 17 00:00:00 2001 From: Himanshu Chauhan Date: Wed, 12 Jul 2023 10:04:31 +0530 Subject: lib: utils: Add detection of Smepmp from ISA string in FDT - Add function to parse ISA string in FDT. - Set Smepmp feature bit in extensions if "smepmp" string is found in ISA string. Signed-off-by: Himanshu Chauhan Reviewed-by: Anup Patel --- platform/generic/platform.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'platform') diff --git a/platform/generic/platform.c b/platform/generic/platform.c index 86811e6b..34b87f74 100644 --- a/platform/generic/platform.c +++ b/platform/generic/platform.c @@ -211,6 +211,15 @@ static void generic_final_exit(void) static int generic_extensions_init(struct sbi_hart_features *hfeatures) { + int rc; + + /* Parse the ISA string from FDT and enable the listed extensions */ + rc = fdt_parse_isa_extensions(fdt_get_address(), current_hartid(), + &hfeatures->extensions); + + if (rc) + return rc; + if (generic_plat && generic_plat->extensions_init) return generic_plat->extensions_init(generic_plat_match, hfeatures); -- cgit v1.3.1