From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rick Chen Date: Thu, 20 Sep 2018 11:22:04 +0800 Subject: [U-Boot] [RESEND PATCH v2 10/15] riscv: bootm: Pass mhartid CSR value to kernel In-Reply-To: <752D002CFF5D0F4FA35C0100F1D73F3FA2F93D92@ATCPCS16.andestech.com> References: <1536641694-4200-1-git-send-email-bmeng.cn@gmail.com> <1536641694-4200-11-git-send-email-bmeng.cn@gmail.com> <752D002CFF5D0F4FA35C0100F1D73F3FA2F93D92@ATCPCS16.andestech.com> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit To: u-boot@lists.denx.de > From: Bin Meng [mailto:bmeng.cn at gmail.com] > Sent: Tuesday, September 11, 2018 12:55 PM > To: Rick Jian-Zhi Chen(陳建志); U-Boot Mailing List > Cc: Lukas Auer > Subject: [RESEND PATCH v2 10/15] 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 > > --- > > Changes in v2: > - new patch to pass mhartid CSR value to kernel > > arch/riscv/lib/bootm.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > > diff --git a/arch/riscv/lib/bootm.c b/arch/riscv/lib/bootm.c index > 6893108..a7a9fb9 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 */ > Reviewed-by: Rick Chen > > -- > 2.7.4