diff options
author | Andrew Jones <ajones@ventanamicro.com> | 2023-02-27 13:31:03 +0300 |
---|---|---|
committer | Anup Patel <anup@brainfault.org> | 2023-02-27 17:15:28 +0300 |
commit | c9917b610871e4f9a0142e5c37c2b698177c3291 (patch) | |
tree | 5685156890cc43ed70304ed61080e251a299fd87 /lib/utils/fdt | |
parent | 73623a0acac7f62646757cdd5a03b325eba3e0c9 (diff) | |
download | opensbi-c9917b610871e4f9a0142e5c37c2b698177c3291.tar.xz |
lib: sbi: Add system_suspend_allowed domain property
Only privileged domains should be allowed to suspend the entire
system. Give the root domain this property by default and allow
other domains to be given the property by specifying it in the
DT.
Signed-off-by: Andrew Jones <ajones@ventanamicro.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
Diffstat (limited to 'lib/utils/fdt')
-rw-r--r-- | lib/utils/fdt/fdt_domain.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/utils/fdt/fdt_domain.c b/lib/utils/fdt/fdt_domain.c index bc30010..adcb94b 100644 --- a/lib/utils/fdt/fdt_domain.c +++ b/lib/utils/fdt/fdt_domain.c @@ -417,6 +417,13 @@ static int __fdt_parse_domain(void *fdt, int domain_offset, void *opaque) else dom->system_reset_allowed = false; + /* Read "system-suspend-allowed" DT property */ + if (fdt_get_property(fdt, domain_offset, + "system-suspend-allowed", NULL)) + dom->system_suspend_allowed = true; + else + dom->system_suspend_allowed = false; + /* Find /cpus DT node */ cpus_offset = fdt_path_offset(fdt, "/cpus"); if (cpus_offset < 0) |