Re: [RFC PATCH 09/12] platform: generic: parse root domain WID config from DT
Pawandeep Oza <[email protected]> Wed, 8 Jul 2026 17:39:34 -0700
| Newsgroups | org.infradead.lists.opensbi |
|---|---|
| Message-ID | <CAAVgOk+==we31kXGJxG0XQeRY4B0e9rR3e_4PLT22WwVy-e-dQ@mail.gmail.com> |
On Fri, Jun 26, 2026 at 3:17 AM Yu-Chien Peter Lin <[email protected]> wrote: > > Parse root-domain-next-wid (32-bit) and root-domain-next-widlist > (64-bit) properties from /chosen/opensbi,config node during > generic_domains_init(). Sets root.next_wid/has_next_wid and > root.next_widlist. > > Signed-off-by: Yu-Chien Peter Lin <[email protected]> > --- > platform/generic/platform.c | 20 +++++++++++++++++++- > 1 file changed, 19 insertions(+), 1 deletion(-) > > diff --git a/platform/generic/platform.c b/platform/generic/platform.c > index 51e9f342..de12deb5 100644 > --- a/platform/generic/platform.c > +++ b/platform/generic/platform.c > @@ -11,6 +11,7 @@ > #include <platform_override.h> > #include <sbi/riscv_asm.h> > #include <sbi/sbi_bitops.h> > +#include <sbi/sbi_domain.h> > #include <sbi/sbi_hartmask.h> > #include <sbi/sbi_heap.h> > #include <sbi/sbi_platform.h> > @@ -276,7 +277,9 @@ int generic_extensions_init(bool cold_boot) > int generic_domains_init(void) > { > const void *fdt = fdt_get_address(); > - int offset, ret; > + const fdt32_t *val; > + int len, offset, ret; > + u64 val64; > > ret = fdt_domains_populate(fdt); > if (ret < 0) > @@ -290,6 +293,21 @@ int generic_domains_init(void) > if (offset >= 0 && > fdt_get_property(fdt, offset, "system-suspend-test", NULL)) > sbi_system_suspend_test_enable(); > + > + if (offset >= 0) { > + val = fdt_getprop(fdt, offset, "root-domain-next-wid", &len); > + if (val && len == sizeof(fdt32_t)) { > + root.next_wid = fdt32_to_cpu(val[0]); > + root.has_next_wid = true; > + } > + > + val = fdt_getprop(fdt, offset, "root-domain-next-widlist", &len); Oza: Root domain WID config is semantically identical to per-domain WID config but lives in a completely different DT location root can be another default domain under chosen { opensbi-domains { > + if (val && (len == (2 * sizeof(fdt32_t)))) { > + val64 = fdt32_to_cpu(val[0]); > + val64 = (val64 << 32) | fdt32_to_cpu(val[1]); > + root.next_widlist = val64; > + } > + } > } > > return 0; > -- > 2.43.7 > > > -- > opensbi mailing list > [email protected] > http://lists.infradead.org/mailman/listinfo/opensbi -- opensbi mailing list [email protected] http://lists.infradead.org/mailman/listinfo/opensbi