From eb462a2eb30b2966caf2cfd8952c369cd3193892 Mon Sep 17 00:00:00 2001 From: Eero Nurkkala Date: Mon, 24 Jan 2022 15:17:38 +0200 Subject: [PATCH] risc-v/mpfs: configure harts according to CONFIG_MPFS_HART*_SBI The following options need to be taken in account while determining the proper hart_index2id -table: CONFIG_MPFS_HART1_SBI CONFIG_MPFS_HART1_SBI CONFIG_MPFS_HART3_SBI CONFIG_MPFS_HART4_SBI Unused harts should be marked with -1. Hart0 is never used so it stays at -1. Signed-off-by: Eero Nurkkala --- arch/risc-v/src/mpfs/mpfs_opensbi.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/arch/risc-v/src/mpfs/mpfs_opensbi.c b/arch/risc-v/src/mpfs/mpfs_opensbi.c index 178f1af4653..ba374ab48db 100644 --- a/arch/risc-v/src/mpfs/mpfs_opensbi.c +++ b/arch/risc-v/src/mpfs/mpfs_opensbi.c @@ -164,10 +164,26 @@ static struct aclint_mswi_data mpfs_mswi = static const u32 mpfs_hart_index2id[MPFS_HART_COUNT] = { [0] = -1, +#ifdef CONFIG_MPFS_HART1_SBI [1] = 1, +#else + [1] = -1, +#endif +#ifdef CONFIG_MPFS_HART2_SBI [2] = 2, +#else + [2] = -1, +#endif +#ifdef CONFIG_MPFS_HART3_SBI [3] = 3, +#else + [3] = -1, +#endif +#ifdef CONFIG_MPFS_HART4_SBI [4] = 4, +#else + [4] = -1, +#endif }; static const struct sbi_platform platform =