lib: utils: check if CPU node is enabled

Ignore CPU nodes in FDT that are not enabled.

Signed-off-by: Jan Remes <jan.remes@codasip.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
This commit is contained in:
Jan Remes authored and Anup Patel committed 2022-05-14 10:16:50 +05:30
1 parent 90a9dd2b22
commit 616da52e18
3 files changed
+19 -1

No files matched your search

+3
View File
@@ -283,6 +283,9 @@ int fdt_parse_max_hart_id(void *fdt, u32 *max_hartid)
if (err)
continue;
if (!fdt_node_is_enabled(fdt, cpu_offset))
continue;
if (hartid > *max_hartid)
*max_hartid = hartid;
}