summaryrefslogtreecommitdiff
path: root/lib/utils/fdt/fdt_domain.c
AgeCommit message (Collapse)AuthorFilesLines
2022-05-14lib: utils: check if CPU node is enabledJan Remes1-1/+13
Ignore CPU nodes in FDT that are not enabled. Signed-off-by: Jan Remes <jan.remes@codasip.com> Reviewed-by: Anup Patel <anup@brainfault.org>
2021-05-19lib: utils/fdt: Replace strcmp with strncmpDaniel Schaefer1-1/+1
Use strncmp() instead of strcmp() in __fixup_find_domain_offset() so that it compiles fine when linking with external firmware (such as EDK2). Signed-off-by: Daniel Schaefer <daniel.schaefer@hpe.com> Reviewed-by: Xiang W <wxjstz@126.com> Reviewed-by: Abner Chang <abner.chang@hpe.com> Reviewed-by: Anup Patel <anup.patel@wdc.com>
2021-05-19lib: utils/fdt: Don't use sbi_string functionsDaniel Schaefer1-4/+5
When SBI is built by external firmware, we need to use their functions, defined in libfdt_env.h. Just like 2cfd2fc9048806353298a1b967abf985901e36e8 Signed-off-by: Daniel Schaefer <daniel.schaefer@hpe.com> Reviewed-by: Abner Chang <abner.chang@hpe.com> Reviewed-by: Xiang W <wxjstz@126.com> Reviewed-by: Anup Patel <anup.patel@wdc.com>
2021-04-13lib: utils: Copy over restricted root domain memregions to FDT domainsAnup Patel1-4/+22
We should copy over all restricted memregions from the root domain to the domains populated from FDT. These restricted root memregions are typically firmware memregion and M-mode only mmio memregions. Signed-off-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Xiang W <wxjstz@126.com> Reviewed-by: Alistair Francis <alistair.francis@wdc.com>
2020-12-16lib: utils: Remove fdt_domain_get() functionAnup Patel1-47/+36
The fdt_domain_get() function is now redundant because the fdt_domains_populate() function can explicitly register new domains using the sbi_domain_register() function. Signed-off-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Reviewed-by: Atish Patra <atish.patra@wdc.com>
2020-12-16lib: utils: Allow FDT domain iteration functions to failAnup Patel1-47/+68
We extend fdt_iterate_each_domain() and fdt_iterate_each_memregion() functions to allow underlying iteration function to fail. This will help us catch more domain misconfiguration issues at boot time. Signed-off-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Reviewed-by: Atish Patra <atish.patra@wdc.com>
2020-12-04lib: utils: Add helper routines to populate domains from FDTAnup Patel1-0/+445
We add various helper routines to populate domains, iterate domains, iterate domain memregions, and parse HART to domain assignment from the FDT. These helper routines can be used by platform support code and FDT fixup code. Signed-off-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Atish Patra <atish.patra@wdc.com>