kboot: Only try to parse actual CPUs in /cpus

Signed-off-by: Hector Martin <marcan@marcan.st>
This commit is contained in:
Hector Martin 2021-10-03 00:28:08 +09:00
parent 2736f0dd07
commit b9f1eb29e9
2 changed files with 5 additions and 1 deletions

View file

@ -206,6 +206,10 @@ static int dt_set_cpus(void)
int node, cpu = 0;
fdt_for_each_subnode(node, dt, cpus)
{
const char *name = fdt_get_name(dt, node, NULL);
if (strncmp(name, "cpu@", 4))
continue;
const fdt64_t *prop = fdt_getprop(dt, node, "reg", NULL);
if (!prop)
bail("FDT: failed to get reg property of CPU\n");

View file

@ -177,7 +177,7 @@ int payload_run(void)
smp_start_secondaries();
if (kboot_prepare_dt(fdt)) {
printf("Failed to prepare FDT!");
printf("Failed to prepare FDT!\n");
return -1;
}