diff --git a/arch/risc-v/src/mpfs/mpfs_opensbi.c b/arch/risc-v/src/mpfs/mpfs_opensbi.c index 178f1af465..ba374ab48d 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 =