summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnup Patel <anup.patel@wdc.com>2020-09-22 12:10:08 +0300
committerAnup Patel <anup@brainfault.org>2020-10-20 11:34:51 +0300
commit5fd99dbdaa39238ebed45df3ea7dc6b47424a583 (patch)
tree9205cba5d2b3f023171f25379d155e9a164e50b9
parent5edbb7cda1849b3d05e33256cafb7708c36f3020 (diff)
downloadopensbi-5fd99dbdaa39238ebed45df3ea7dc6b47424a583.tar.xz
lib: utils: Update fdt_cpu_fixup() to use current domain
The fdt_cpu_fixup() should disable a HART in DT if the HART is not assigned to the current HART domain. This patch updates fdt_cpu_fixup() accordingly. Signed-off-by: Anup Patel <anup.patel@wdc.com> Reviewed-by: Atish Patra <atish.patra@wdc.com>
-rw-r--r--lib/utils/fdt/fdt_fixup.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/utils/fdt/fdt_fixup.c b/lib/utils/fdt/fdt_fixup.c
index e9e1dff..eea450d 100644
--- a/lib/utils/fdt/fdt_fixup.c
+++ b/lib/utils/fdt/fdt_fixup.c
@@ -12,7 +12,6 @@
#include <sbi/sbi_domain.h>
#include <sbi/sbi_math.h>
#include <sbi/sbi_hart.h>
-#include <sbi/sbi_platform.h>
#include <sbi/sbi_scratch.h>
#include <sbi/sbi_string.h>
#include <sbi_utils/fdt/fdt_fixup.h>
@@ -20,8 +19,7 @@
void fdt_cpu_fixup(void *fdt)
{
- struct sbi_scratch *scratch = sbi_scratch_thishart_ptr();
- const struct sbi_platform *plat = sbi_platform_ptr(scratch);
+ struct sbi_domain *dom = sbi_domain_thishart_ptr();
int err, cpu_offset, cpus_offset, len;
const char *mmu_type;
u32 hartid;
@@ -41,12 +39,12 @@ void fdt_cpu_fixup(void *fdt)
/*
* Disable a HART DT node if one of the following is true:
- * 1. The HART is marked invalid by platform support
+ * 1. The HART is not assigned to the current domain
* 2. MMU is not available for the HART
*/
mmu_type = fdt_getprop(fdt, cpu_offset, "mmu-type", &len);
- if (sbi_platform_hart_invalid(plat, hartid) ||
+ if (!sbi_domain_is_assigned_hart(dom, hartid) ||
!mmu_type || !len)
fdt_setprop_string(fdt, cpu_offset, "status",
"disabled");