Skip to content

Commit

Permalink
elfloader/riscv: always pass hart/core information
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Axel Heider committed Mar 14, 2024
1 parent 8c660fd commit 3eea7c0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
8 changes: 2 additions & 6 deletions elfloader-tool/include/arch-riscv/elfloader.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
8 changes: 2 additions & 6 deletions elfloader-tool/src/arch-riscv/boot.c
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down

0 comments on commit 3eea7c0

Please sign in to comment.