mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-04-01 03:51:31 +00:00
riscv: bootm: Pass mhartid CSR value to kernel
So far this is hardcoded to zero, and we should read the value from mhartid CSR and pass it to Linux kernel. Suggested-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de> Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de> Reviewed-by: Rick Chen <rick@andestech.com>
This commit is contained in:
parent
e5ea1e5860
commit
ed49ba4dcc
1 changed files with 3 additions and 2 deletions
|
@ -11,6 +11,7 @@
|
||||||
#include <image.h>
|
#include <image.h>
|
||||||
#include <u-boot/zlib.h>
|
#include <u-boot/zlib.h>
|
||||||
#include <asm/byteorder.h>
|
#include <asm/byteorder.h>
|
||||||
|
#include <asm/csr.h>
|
||||||
|
|
||||||
DECLARE_GLOBAL_DATA_PTR;
|
DECLARE_GLOBAL_DATA_PTR;
|
||||||
|
|
||||||
|
@ -57,9 +58,9 @@ int do_bootm_linux(int flag, int argc, char *argv[], bootm_headers_t *images)
|
||||||
printf("\nStarting kernel ...\n\n");
|
printf("\nStarting kernel ...\n\n");
|
||||||
|
|
||||||
cleanup_before_linux();
|
cleanup_before_linux();
|
||||||
/* TODO: hardcode the hart id to zero for now */
|
|
||||||
if (IMAGE_ENABLE_OF_LIBFDT && images->ft_len)
|
if (IMAGE_ENABLE_OF_LIBFDT && images->ft_len)
|
||||||
kernel(0, images->ft_addr);
|
kernel(csr_read(mhartid), images->ft_addr);
|
||||||
|
|
||||||
/* does not return */
|
/* does not return */
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue