From 3eea7c0d77695a94f15b171ec14cdc3a65bdc86f Mon Sep 17 00:00:00 2001 From: Axel Heider Date: Wed, 13 Mar 2024 16:13:52 +0100 Subject: [PATCH] elfloader/riscv: always pass hart/core information Align the SMP and non-SMP ABI for kernel entry and pass on the hard ID obtained from the previous bootloader unconditionally. This allows the kernel to use the ID, e.g. when setting up the PLIC, so there is no need to require defining a platform specific hard-coded value. Furthermore, this change allows running a single core kernel in SMP configuration also. Signed-off-by: Axel Heider --- elfloader-tool/include/arch-riscv/elfloader.h | 8 ++------ elfloader-tool/src/arch-riscv/boot.c | 8 ++------ 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/elfloader-tool/include/arch-riscv/elfloader.h b/elfloader-tool/include/arch-riscv/elfloader.h index 8be726d0..3b9697a0 100644 --- a/elfloader-tool/include/arch-riscv/elfloader.h +++ b/elfloader-tool/include/arch-riscv/elfloader.h @@ -18,10 +18,6 @@ typedef void (*init_riscv_kernel_t)(word_t ui_p_reg_start, word_t pv_offset, word_t v_entry, word_t dtb_addr_p, - word_t dtb_size -#if CONFIG_MAX_NUM_NODES > 1 - , + word_t dtb_size, word_t hart_id, - word_t core_id -#endif - ); + word_t core_id); diff --git a/elfloader-tool/src/arch-riscv/boot.c b/elfloader-tool/src/arch-riscv/boot.c index f485594a..e636fc60 100644 --- a/elfloader-tool/src/arch-riscv/boot.c +++ b/elfloader-tool/src/arch-riscv/boot.c @@ -244,13 +244,9 @@ static int run_elfloader(UNUSED int hart_id, void *bootloader_dtb) user_info.phys_virt_offset, user_info.virt_entry, (word_t)dtb, - dtb_size -#if CONFIG_MAX_NUM_NODES > 1 - , + dtb_size, hart_id, - 0 -#endif - ); + 0); /* We should never get here. */ printf("ERROR: Kernel returned back to the ELF Loader\n");