summaryrefslogtreecommitdiff
path: root/lib/utils/fdt
diff options
context:
space:
mode:
authorAnup Patel <anup.patel@wdc.com>2020-03-15 09:09:25 +0300
committerAnup Patel <anup@brainfault.org>2020-03-19 07:00:01 +0300
commitc51f02cf143b081c2a81717393a0e6cef2ce2521 (patch)
treeeeff8cd451d20bfa543df626e1713a59803e6fb4 /lib/utils/fdt
parent75eec9dd3f04febd7df8e5ee3fb90c236e50ded3 (diff)
downloadopensbi-c51f02cf143b081c2a81717393a0e6cef2ce2521.tar.xz
include: sbi_platform: Introduce HART index to HART id table
A platform can have discontinuous and/or sparse HART ids so we cannot always assume a set of HARTs with continuous HART ids. This patch adds support for discontinuous and sparse HART ids by introducing HART index to HART id table. This table has platform hart_count entries and it maps HART index to HART id. The HART index to HART id table has only two restrictions: 1. HART index < sbi_platform hart_count 2. HART id < SBI_HARTMASK_MAX_BITS Example1: Let's say we have a platform with 2 HART ids 11 and 22, for such a a platform: hart_count = 2 hart_index2id[0] = 11 hart_index2id[1] = 22 Example2: Let's say we have a platform with 5 HARTs ids 0, 1, 2, 3, and 4 but out of these HART with id 0 is not usable so for such a platform: hart_count = 5 hart_index2id[0] = -1U hart_index2id[1] = 1 hart_index2id[2] = 2 hart_index2id[3] = 3 hart_index2id[4] = 4 OR hart_count = 4 hart_index2id[0] = 1 hart_index2id[1] = 2 hart_index2id[2] = 3 hart_index2id[3] = 4 With HART index to HART id table in place, the hart_disabled() callback is now redundant so we remove it as well. Signed-off-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Atish Patra <atish.patra@wdc.com>
Diffstat (limited to 'lib/utils/fdt')
-rw-r--r--lib/utils/fdt/fdt_helper.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/utils/fdt/fdt_helper.c b/lib/utils/fdt/fdt_helper.c
index 47cd1d3..2ea52ca 100644
--- a/lib/utils/fdt/fdt_helper.c
+++ b/lib/utils/fdt/fdt_helper.c
@@ -30,7 +30,7 @@ void fdt_cpu_fixup(void *fdt)
sbi_sprintf(cpu_node, "/cpus/cpu@%d", i);
cpu_offset = fdt_path_offset(fdt, cpu_node);
- if (sbi_platform_hart_disabled(plat, i))
+ if (sbi_platform_hart_invalid(plat, i))
fdt_setprop_string(fdt, cpu_offset, "status",
"disabled");