lib: fdt_domain: Default boot-hart to coldboot HART for multi-domain boot

When "boot-hart" is not specified, dom->boot_hartid was left as -1U,
causing domain context switching to fail. Default it to the coldboot
HART to enable SMP boot in multi-domain setups, consistent with how
next-arg1 is handled.

Also update its description in domain_support.md.

Signed-off-by: Yu-Chien Peter Lin <peter.lin@sifive.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
Link: https://lore.kernel.org/r/20260327054936.3462935-1-peter.lin@sifive.com
Signed-off-by: Anup Patel <anup@brainfault.org>
This commit is contained in:
Yu-Chien Peter Lin
2026-03-27 13:49:36 +08:00
committed by Anup Patel
parent ae8f28a868
commit 8cd279e321
2 changed files with 4 additions and 7 deletions
+1 -4
View File
@@ -396,16 +396,13 @@ static int __fdt_parse_domain(const void *fdt, int domain_offset, void *opaque)
dom->fw_region_inited = root.fw_region_inited;
/* Read "boot-hart" DT property */
val32 = -1U;
val32 = current_hartid();
val = fdt_getprop(fdt, domain_offset, "boot-hart", &len);
if (val && len >= 4) {
cpu_offset = fdt_node_offset_by_phandle(fdt,
fdt32_to_cpu(*val));
if (cpu_offset >= 0 && fdt_node_is_enabled(fdt, cpu_offset))
fdt_parse_hart_id(fdt, cpu_offset, &val32);
} else {
if (domain_offset == *cold_domain_offset)
val32 = current_hartid();
}
dom->boot_hartid = val32;