Received: from list by lists.gnu.org with archive (Exim 4.90_1) id 1lP4xU-0006zY-5s for mharc-grub-devel@gnu.org; Wed, 24 Mar 2021 10:58:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59100) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lP4xQ-0006oy-1y for grub-devel@gnu.org; Wed, 24 Mar 2021 10:58:04 -0400 Received: from [193.43.10.250] (port=50516 helo=arei.office.basealt.ru) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lP4xN-0005mV-GO for grub-devel@gnu.org; Wed, 24 Mar 2021 10:58:03 -0400 Received: by arei.office.basealt.ru (Postfix, from userid 500) id 59324443FA1; Wed, 24 Mar 2021 17:50:41 +0300 (MSK) From: Nikita Ermakov To: grub-devel@gnu.org Cc: Nikita Ermakov Subject: [PATCH 0/2] Linux loader for riscv64 Date: Wed, 24 Mar 2021 17:50:26 +0300 Message-Id: <20210324145028.2867714-1-arei@altlinux.org> X-Mailer: git-send-email 2.25.4 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 193.43.10.250 (failed) Received-SPF: none client-ip=193.43.10.250; envelope-from=arei@arei.office.basealt.ru; helo=arei.office.basealt.ru X-Spam_score_int: -8 X-Spam_score: -0.9 X-Spam_bar: / X-Spam_report: (-0.9 / 5.0 requ) BAYES_00=-1.9, HEADER_FROM_DIFFERENT_DOMAINS=0.249, NO_DNS_FOR_FROM=0.001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Mar 2021 14:58:04 -0000 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 -- 2.25.4