From: Bin Meng Date: Wed, 26 Sep 2018 13:55:16 +0000 (-0700) Subject: riscv: bootm: Pass mhartid CSR value to kernel X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=ed49ba4dcccb21cee1c32427cf5bbf09521cd8dd;p=u-boot.git 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 Signed-off-by: Bin Meng Reviewed-by: Lukas Auer Reviewed-by: Rick Chen --- diff --git a/arch/riscv/lib/bootm.c b/arch/riscv/lib/bootm.c index 6893108fe3..a7a9fb921b 100644 --- a/arch/riscv/lib/bootm.c +++ b/arch/riscv/lib/bootm.c @@ -11,6 +11,7 @@ #include #include #include +#include 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"); cleanup_before_linux(); - /* TODO: hardcode the hart id to zero for now */ + if (IMAGE_ENABLE_OF_LIBFDT && images->ft_len) - kernel(0, images->ft_addr); + kernel(csr_read(mhartid), images->ft_addr); /* does not return */