diff options
| author | Cheng Yang <yangcheng.work@foxmail.com> | 2024-02-08 11:14:32 +0800 |
|---|---|---|
| committer | Anup Patel <anup@brainfault.org> | 2024-02-20 15:49:36 +0530 |
| commit | 67ce5a763cfbcfb2edca7eab3d383e15d1a7330f (patch) | |
| tree | d933291b720378392f778e7f45db9ed5b62eef44 /lib | |
| parent | 9c8b18eb01b80f4a29d9c7be463b645b41fc6664 (diff) | |
| download | opensbi-67ce5a763cfbcfb2edca7eab3d383e15d1a7330f.tar.gz opensbi-67ce5a763cfbcfb2edca7eab3d383e15d1a7330f.tar.bz2 opensbi-67ce5a763cfbcfb2edca7eab3d383e15d1a7330f.zip | |
platform: generic: Add support for specify coldboot harts in DT
Added support for the generic platform to specify the set of coldboot
hart in DT. If not specified in DT, all harts are allowed to coldboot
as before.
The functions related to sbi_hartmask are not available before coldboot,
so I used bitmap, and added a new bitmap_test() function to test whether
a certain bit of the bitmap is set.
Signed-off-by: Cheng Yang <yangcheng.work@foxmail.com>
Reviewed-by: Anup Patel <anup@brainfault.org>
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/utils/fdt/fdt_fixup.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/utils/fdt/fdt_fixup.c b/lib/utils/fdt/fdt_fixup.c index 5fc76738..194e55b3 100644 --- a/lib/utils/fdt/fdt_fixup.c +++ b/lib/utils/fdt/fdt_fixup.c @@ -385,6 +385,21 @@ int fdt_reserved_memory_fixup(void *fdt) return 0; } +void fdt_config_fixup(void *fdt) +{ + int chosen_offset, config_offset; + + chosen_offset = fdt_path_offset(fdt, "/chosen"); + if (chosen_offset < 0) + return; + + config_offset = fdt_node_offset_by_compatible(fdt, chosen_offset, "opensbi,config"); + if (chosen_offset < 0) + return; + + fdt_nop_node(fdt, config_offset); +} + void fdt_fixups(void *fdt) { fdt_aplic_fixup(fdt); @@ -398,4 +413,6 @@ void fdt_fixups(void *fdt) #ifndef CONFIG_FDT_FIXUPS_PRESERVE_PMU_NODE fdt_pmu_fixup(fdt); #endif + + fdt_config_fixup(fdt); } |
