From: Rick Chen <rick@andestech.com>
To: <sjg@chromium.org>
Cc: <u-boot@lists.denx.de>, <bmeng.cn@gmail.com>,
<ycliang@andestech.com>, <rick@andestech.com>,
<rickchen36@gmail.com>
Subject: [PATCH] riscv: Support riscv64 image type
Date: Mon, 10 Apr 2023 15:27:18 +0800 [thread overview]
Message-ID: <20230410072718.3484-1-rick@andestech.com> (raw)
Allow U-Boot to load 32 or 64 bits RISC-V Kernel Image
distinguishly. It helps to avoid someone maybe make a mistake
to run 32-bit U-Boot to load 64-bit kernel.
Signed-off-by: Rick Chen <rick@andestech.com>
---
The patchset is based on Simon's patch:
riscv: Add a 64-bit image type
---
---
arch/riscv/include/asm/u-boot.h | 4 ++++
cmd/booti.c | 2 +-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/arch/riscv/include/asm/u-boot.h b/arch/riscv/include/asm/u-boot.h
index d5e1d5f323..e3b4a0357c 100644
--- a/arch/riscv/include/asm/u-boot.h
+++ b/arch/riscv/include/asm/u-boot.h
@@ -23,6 +23,10 @@
#include <asm/u-boot-riscv.h>
/* For image.h:image_check_target_arch() */
+#ifdef CONFIG_ARCH_RV64I
+#define IH_ARCH_DEFAULT IH_ARCH_RISCV64
+#else
#define IH_ARCH_DEFAULT IH_ARCH_RISCV
+#endif
#endif /* _U_BOOT_H_ */
diff --git a/cmd/booti.c b/cmd/booti.c
index 6ac39193db..dc0b0ae41c 100644
--- a/cmd/booti.c
+++ b/cmd/booti.c
@@ -119,7 +119,7 @@ int do_booti(struct cmd_tbl *cmdtp, int flag, int argc, char *const argv[])
images.os.os = IH_OS_LINUX;
#ifdef CONFIG_RISCV_SMODE
- images.os.arch = IH_ARCH_RISCV;
+ images.os.arch = IH_ARCH_DEFAULT;
#elif CONFIG_ARM64
images.os.arch = IH_ARCH_ARM64;
#endif
--
2.17.1
next reply other threads:[~2023-04-10 7:26 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-10 7:27 Rick Chen [this message]
2023-04-19 1:46 ` [PATCH] riscv: Support riscv64 image type Simon Glass
2023-04-19 6:56 ` Rick Chen
2023-07-26 21:33 ` Simon Glass
2023-07-27 1:27 ` Rick Chen
2023-07-27 1:39 ` Leo Liang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230410072718.3484-1-rick@andestech.com \
--to=rick@andestech.com \
--cc=bmeng.cn@gmail.com \
--cc=rickchen36@gmail.com \
--cc=sjg@chromium.org \
--cc=u-boot@lists.denx.de \
--cc=ycliang@andestech.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).