diff mbox series

[2/2] hw/core: loader: Setting is_linux to true for VxWorks uImage

Message ID 20220324082243.451107-2-bmeng.cn@gmail.com (mailing list archive)
State New, archived
Headers show
Series [1/2] hw/core: Sync uboot_image.h from U-Boot v2022.01 | expand

Commit Message

Bin Meng March 24, 2022, 8:22 a.m. UTC
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(+)

Comments

Philippe Mathieu-Daudé March 24, 2022, 11:50 a.m. UTC | #1
On 24/3/22 09:22, Bin Meng wrote:
> 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(+)

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Peter Maydell March 24, 2022, 1:11 p.m. UTC | #2
On Thu, 24 Mar 2022 at 08:38, Bin Meng <bmeng.cn@gmail.com> wrote:
>
> 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.

"on Arm (64-bit only), PowerPC and RISC-V architectures".

thanks
-- PMM
diff mbox series

Patch

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;
             }