aboutsummaryrefslogtreecommitdiff
path: root/hw/core
diff options
context:
space:
mode:
authorBin Meng <bin.meng@windriver.com>2022-03-24 21:48:12 +0800
committerAlistair Francis <alistair.francis@wdc.com>2022-05-24 10:38:50 +1000
commit8fe63fe8e512d77583d6798acd2164f1fa1e40ab (patch)
treee4c22259d89d1d6359c093f200021716b1f99167 /hw/core
parentd616889ece83d006ff630c72eb5bb38ad3b86645 (diff)
downloadqemu-8fe63fe8e512d77583d6798acd2164f1fa1e40ab.zip
qemu-8fe63fe8e512d77583d6798acd2164f1fa1e40ab.tar.gz
qemu-8fe63fe8e512d77583d6798acd2164f1fa1e40ab.tar.bz2
hw/core: loader: Set is_linux to true for VxWorks uImage
VxWorks 7 uses the same boot interface as the Linux kernel on Arm (64-bit only), PowerPC and RISC-V architectures. 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> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Message-Id: <20220324134812.541274-2-bmeng.cn@gmail.com> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Diffstat (limited to 'hw/core')
-rw-r--r--hw/core/loader.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/hw/core/loader.c b/hw/core/loader.c
index 8167301..edde657 100644
--- a/hw/core/loader.c
+++ b/hw/core/loader.c
@@ -696,6 +696,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 Arm (64-bit only), PowerPC and RISC-V architectures.
+ */
+ 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;
}