mirror of
https://github.com/riscv-software-src/opensbi.git
synced 2026-09-20 15:21:42 +01:00
lib: sbi_domain: Introduce domain intialization order
Currently, the domain initialization order is implied by the order in which domains are populated by sbi_platform_domains_init() from sbi_domain_finalize(). This is not documented anywhere and forces unecessary ordering between domain DT nodes. To address the above, introduce per-domain 32-bit integer to represent intialization order (aka "init_order") where domain with a lower initialization order will be booted first and two domains must not have same initialization order. For DT based domain creation, new "init-order" DT property can be used in domain DT node to specify the initialization order. The ROOT domain is assumed to have lowest initialization order (aka 0xffffffff). Signed-off-by: Anup Patel <anup.patel@oss.qualcomm.com> Reviewed-by: Pawandeep Oza <pawandeep.oza@oss.qualcomm.com> Tested-by: Pawandeep Oza <pawandeep.oza@oss.qualcomm.com> Reviewed-by: Yu-Chien Peter Lin <peter.lin@sifive.com> Link: https://lore.kernel.org/r/20260905131748.922920-4-anup.patel@oss.qualcomm.com Signed-off-by: Anup Patel <anup@brainfault.org>
This commit is contained in:
@@ -330,6 +330,14 @@ static int __fdt_parse_domain(const void *fdt, int domain_offset, void *opaque)
|
||||
sizeof(dom->name));
|
||||
dom->name[sizeof(dom->name) - 1] = '\0';
|
||||
|
||||
/* Read initalization order */
|
||||
val = fdt_getprop(fdt, domain_offset, "init-order", &len);
|
||||
len = len / sizeof(u32);
|
||||
if (val && len)
|
||||
dom->init_order = fdt32_to_cpu(val[0]);
|
||||
else
|
||||
dom->init_order = (u32)domain_offset;
|
||||
|
||||
/* Setup possible HARTs mask */
|
||||
SBI_HARTMASK_INIT(mask);
|
||||
dom->possible_harts = mask;
|
||||
|
||||
Reference in New Issue
Block a user