Skip to content

Commit

Permalink
hw/core: loader: Set is_linux to true for VxWorks uImage
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
lbmeng authored and alistair23 committed May 24, 2022
1 parent d616889 commit 8fe63fe
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions hw/core/loader.c
Expand Up @@ -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;
}
Expand Down

0 comments on commit 8fe63fe

Please sign in to comment.