From: Bin Meng <bmeng.cn@gmail.com>
To: qemu-devel@nongnu.org
Cc: Bin Meng <bin.meng@windriver.com>
Subject: [PATCH 2/2] hw/core: loader: Setting is_linux to true for VxWorks uImage
Date: Thu, 24 Mar 2022 16:22:43 +0800 [thread overview]
Message-ID: <20220324082243.451107-2-bmeng.cn@gmail.com> (raw)
In-Reply-To: <20220324082243.451107-1-bmeng.cn@gmail.com>
From: Bin Meng <bin.meng@windriver.com>
VxWorks 7 now uses the same boot interface as the Linux kernel on
Arm64, PowerPC and RISC-V architectures, except Arm. Add logic to
set is_linux to true for VxWorks uImage for these architectures in
load_uboot_image().
Signed-off-by: Bin Meng <bin.meng@windriver.com>
---
hw/core/loader.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/hw/core/loader.c b/hw/core/loader.c
index ca2f2431fb..af14b377f1 100644
--- a/hw/core/loader.c
+++ b/hw/core/loader.c
@@ -697,6 +697,21 @@ static int load_uboot_image(const char *filename, hwaddr *ep, hwaddr *loadaddr,
if (is_linux) {
if (hdr->ih_os == IH_OS_LINUX) {
*is_linux = 1;
+ } else if (hdr->ih_os == IH_OS_VXWORKS) {
+ /*
+ * VxWorks 7 uses the same boot interface as the Linux kernel
+ * on Arm64, PowerPC and RISC-V architectures, except Arm.
+ */
+ switch (hdr->ih_arch) {
+ case IH_ARCH_ARM64:
+ case IH_ARCH_PPC:
+ case IH_ARCH_RISCV:
+ *is_linux = 1;
+ break;
+ default:
+ *is_linux = 0;
+ break;
+ }
} else {
*is_linux = 0;
}
--
2.25.1
next prev parent reply other threads:[~2022-03-24 8:36 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-24 8:22 [PATCH 1/2] hw/core: Sync uboot_image.h from U-Boot v2022.01 Bin Meng
2022-03-24 8:22 ` Bin Meng [this message]
2022-03-24 11:50 ` [PATCH 2/2] hw/core: loader: Setting is_linux to true for VxWorks uImage Philippe Mathieu-Daudé
2022-03-24 13:11 ` Peter Maydell
2022-03-28 0:36 ` [PATCH 1/2] hw/core: Sync uboot_image.h from U-Boot v2022.01 Alistair Francis
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=20220324082243.451107-2-bmeng.cn@gmail.com \
--to=bmeng.cn@gmail.com \
--cc=bin.meng@windriver.com \
--cc=qemu-devel@nongnu.org \
/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).