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
2022-05-13 12:58:41 +02:00
committed by Anup Patel
parent 90a9dd2b22
commit 616da52e18
3 changed files with 19 additions and 1 deletions

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;
}