Skip to content

Linux loader for riscv64

Nikita Ermakov grub-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 2 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2RISC-V: Update magic numberinclude/grub/riscv32/linux.h include/grub/riscv64/linux.h+4 -40 replies
2/2RISC-V: Allow to boot Linux with EFI stub on riscv64grub-core/Makefile.core.def grub-core/loader/riscv32/linux.c grub-core/loader/riscv64/linux.c+382 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] Linux loader for riscv64

Hello.

In this patch series I would like to add a possibility to load Linux kernel with a EFI stub on riscv64 platform.

The first patch updates a RISC-V magic number as it was changed [1] in the kernel.

The second patch splits the grub-core/loader/riscv/linux.c to two parts -- riscv32 and riscv64. The first part, riscv32, is just a stub that informs about unsupported feature. This part is just a copy of the current grub-core/loader/riscv/linux.c. The second part is a loader for the kernel with the EFI stub. The loader is based on the arm64 linux loader with a few changes.

I tested these patches on a qemu-system-riscv64 with virt machine. A boot sequence was as follows:
OpenSBI (v0.9) -> U-Boot (v2021.04-rc4) -> grub -> Linux (v5.12-rc4)

[root@localhost ~]# uname -a
Linux localhost 5.12.0-rc4 #5 SMP Wed Mar 24 16:46:30 MSK 2021 riscv64 GNU/Linux

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=474efecb65dceb15f793b6e2f2b226e952f0f8e9

Nikita Ermakov (2):
RISC-V: Update magic number
RISC-V: Allow to boot Linux with EFI stub on riscv64

 grub-core/Makefile.core.def                 |   4 +-
 grub-core/loader/{riscv => riscv32}/linux.c |   0
 grub-core/loader/riscv64/linux.c            | 380 ++++++++++++++++++++
 include/grub/riscv32/linux.h                |   4 +-
 include/grub/riscv64/linux.h                |   4 +-
 5 files changed, 386 insertions(+), 6 deletions(-)
 rename grub-core/loader/{riscv => riscv32}/linux.c (100%)
 create mode 100644 grub-core/loader/riscv64/linux.c
Signature · 1 line
2.25.4