All of lore.kernel.org
 help / color / mirror / Atom feed
From: Heinrich Schuchardt <xypron.glpk@gmx.de>
To: Atish Patra <atish.patra@wdc.com>, grub-devel@gnu.org
Cc: Ard Biesheuvel <ardb@kernel.org>,
	David Abdurachmanov <david.abdurachmanov@sifive.com>,
	leif@nuviainc.com, Alexander Graf <agraf@csgraf.de>,
	Daniel Kiper <dkiper@net-space.pl>, Chester Lin <clin@suse.com>
Subject: Re: [PATCH RFC/RFT 1/3] loader: Move arm64 linux loader to common code
Date: Mon, 27 Apr 2020 01:01:42 +0200	[thread overview]
Message-ID: <4ec20579-6113-7264-3dff-6823a0915161@gmx.de> (raw)
In-Reply-To: <20200426194007.382925-2-atish.patra@wdc.com>

On 4/26/20 9:40 PM, Atish Patra wrote:
> ARM64 linux loader code is written in such a way that it can be reused
> across different architectures without much change. Move it to common
> code so that RISC-V doesn't have to define a separate loader.
>
> Signed-off-by: Atish Patra <atish.patra@wdc.com>

Tested on Odroid-C2 (ARMv8) using GRUB master c543d678105037a plus this
patch series booting from U-Boot via GRUB to Debian Bullseye successfully.

Tested-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

> ---
>  grub-core/Makefile.core.def             | 4 ++--
>  grub-core/loader/{arm64 => efi}/linux.c | 2 +-
>  include/grub/arm/linux.h                | 2 +-
>  include/grub/arm64/linux.h              | 2 +-
>  4 files changed, 5 insertions(+), 5 deletions(-)
>  rename grub-core/loader/{arm64 => efi}/linux.c (99%)
>
> diff --git a/grub-core/Makefile.core.def b/grub-core/Makefile.core.def
> index 48b82e76322f..57bb70d73764 100644
> --- a/grub-core/Makefile.core.def
> +++ b/grub-core/Makefile.core.def
> @@ -1813,9 +1813,9 @@ module = {
>    sparc64_ieee1275 = loader/sparc64/ieee1275/linux.c;
>    ia64_efi = loader/ia64/efi/linux.c;
>    arm_coreboot = loader/arm/linux.c;
> -  arm_efi = loader/arm64/linux.c;
> +  arm_efi = loader/efi/linux.c;
>    arm_uboot = loader/arm/linux.c;
> -  arm64 = loader/arm64/linux.c;
> +  arm64 = loader/efi/linux.c;
>    riscv32 = loader/riscv/linux.c;
>    riscv64 = loader/riscv/linux.c;
>    common = loader/linux.c;
> diff --git a/grub-core/loader/arm64/linux.c b/grub-core/loader/efi/linux.c
> similarity index 99%
> rename from grub-core/loader/arm64/linux.c
> rename to grub-core/loader/efi/linux.c
> index ef3e9f9444ca..8c7a4963f023 100644
> --- a/grub-core/loader/arm64/linux.c
> +++ b/grub-core/loader/efi/linux.c
> @@ -51,7 +51,7 @@ static grub_addr_t initrd_end;
>  grub_err_t
>  grub_arch_efi_linux_check_image (struct linux_arch_kernel_header * lh)
>  {
> -  if (lh->magic != GRUB_LINUX_ARMXX_MAGIC_SIGNATURE)
> +  if (lh->magic != GRUB_LINUX_ARCH_MAGIC_SIGNATURE)
>      return grub_error(GRUB_ERR_BAD_OS, "invalid magic number");
>
>    if ((lh->code0 & 0xffff) != GRUB_PE32_MAGIC)
> diff --git a/include/grub/arm/linux.h b/include/grub/arm/linux.h
> index 2e98a6689696..c924d15446af 100644
> --- a/include/grub/arm/linux.h
> +++ b/include/grub/arm/linux.h
> @@ -35,7 +35,7 @@ struct linux_arm_kernel_header {
>  };
>
>  #if defined(__arm__)
> -# define GRUB_LINUX_ARMXX_MAGIC_SIGNATURE GRUB_LINUX_ARM_MAGIC_SIGNATURE
> +# define GRUB_LINUX_ARCH_MAGIC_SIGNATURE GRUB_LINUX_ARM_MAGIC_SIGNATURE
>  # define linux_arch_kernel_header linux_arm_kernel_header
>  #endif
>
> diff --git a/include/grub/arm64/linux.h b/include/grub/arm64/linux.h
> index 4269adc6dae5..96aa3bae01ee 100644
> --- a/include/grub/arm64/linux.h
> +++ b/include/grub/arm64/linux.h
> @@ -37,7 +37,7 @@ struct linux_arm64_kernel_header
>  };
>
>  #if defined(__aarch64__)
> -# define GRUB_LINUX_ARMXX_MAGIC_SIGNATURE GRUB_LINUX_ARM64_MAGIC_SIGNATURE
> +# define GRUB_LINUX_ARCH_MAGIC_SIGNATURE GRUB_LINUX_ARM64_MAGIC_SIGNATURE
>  # define linux_arch_kernel_header linux_arm64_kernel_header
>  #endif
>
>



  reply	other threads:[~2020-04-26 23:02 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-26 19:40 [PATCH RFC/RFT 0/3] Add grub loader support for RISC-V Linux Atish Patra
2020-04-26 19:40 ` [PATCH RFC/RFT 1/3] loader: Move arm64 linux loader to common code Atish Patra
2020-04-26 23:01   ` Heinrich Schuchardt [this message]
2020-04-26 19:40 ` [PATCH RFC/RFT 2/3] RISC-V: Update image header Atish Patra
2020-04-26 23:02   ` Heinrich Schuchardt
2020-04-26 19:40 ` [PATCH RFC/RFT 3/3] RISC-V: Use common linux loader Atish Patra
2020-04-26 23:02   ` Heinrich Schuchardt
2020-04-27  6:15 ` [PATCH RFC/RFT 0/3] Add grub loader support for RISC-V Linux Ard Biesheuvel
2020-04-27 11:01   ` Daniel Kiper
2020-04-27 19:35     ` Heinrich Schuchardt
2020-04-27 19:39       ` Ard Biesheuvel
2020-04-27 20:47         ` Heinrich Schuchardt
2020-04-27 20:47           ` Ard Biesheuvel
2020-04-27 20:52             ` Ard Biesheuvel
2020-04-27 20:58               ` Heinrich Schuchardt
2020-04-27 21:15                 ` Heinrich Schuchardt
2020-04-27 22:10                   ` Ard Biesheuvel
2020-04-28 18:21                     ` Atish Patra
2020-04-29 11:22                       ` Leif Lindholm
2020-04-30  6:07                         ` Atish Patra
2020-04-27 20:54             ` Heinrich Schuchardt

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=4ec20579-6113-7264-3dff-6823a0915161@gmx.de \
    --to=xypron.glpk@gmx.de \
    --cc=agraf@csgraf.de \
    --cc=ardb@kernel.org \
    --cc=atish.patra@wdc.com \
    --cc=clin@suse.com \
    --cc=david.abdurachmanov@sifive.com \
    --cc=dkiper@net-space.pl \
    --cc=grub-devel@gnu.org \
    --cc=leif@nuviainc.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.