aboutsummaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorBin Meng2018-09-26 06:55:16 -0700
committerAndes2018-10-03 17:48:08 +0800
commited49ba4dcccb21cee1c32427cf5bbf09521cd8dd (patch)
tree3c94246484207dcd2ed50c1706ae5d79344bfce1 /arch
parente5ea1e586076b6c130e16e4a45749fc65679663d (diff)
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>
Diffstat (limited to 'arch')
-rw-r--r--arch/riscv/lib/bootm.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/arch/riscv/lib/bootm.c b/arch/riscv/lib/bootm.c
index 6893108fe32..a7a9fb921b6 100644
--- a/arch/riscv/lib/bootm.c
+++ b/arch/riscv/lib/bootm.c
@@ -11,6 +11,7 @@
#include <image.h>
#include <u-boot/zlib.h>
#include <asm/byteorder.h>
+#include <asm/csr.h>
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 */