From nobody Tue Feb 10 23:27:04 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1691653451608936.5277350916389; Thu, 10 Aug 2023 00:44:11 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qU0KJ-0005MM-IX; Thu, 10 Aug 2023 03:43:23 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qU0KH-0005ME-Km for qemu-devel@nongnu.org; Thu, 10 Aug 2023 03:43:21 -0400 Received: from mail.loongson.cn ([114.242.206.163]) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qU0KD-0003V3-HG for qemu-devel@nongnu.org; Thu, 10 Aug 2023 03:43:21 -0400 Received: from loongson.cn (unknown [10.2.5.185]) by gateway (Coremail) with SMTP id _____8AxZ+gGldRks3oUAA--.8434S3; Thu, 10 Aug 2023 15:43:03 +0800 (CST) Received: from localhost.localdomain (unknown [10.2.5.185]) by localhost.localdomain (Coremail) with SMTP id AQAAf8CxbSMDldRk9bhSAA--.26845S2; Thu, 10 Aug 2023 15:42:59 +0800 (CST) From: xianglai li To: qemu-devel@nongnu.org Cc: Paolo Bonzini , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Thomas Huth , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Gerd Hoffmann , Xiaojuan Yang , Song Gao , Bibo Mao Subject: [PATCH] roms: Support compile the efi bios for loongarch Date: Thu, 10 Aug 2023 15:42:58 +0800 Message-Id: <260307952ffe5382a55d66a4999034490e04f7df.1691653307.git.lixianglai@loongson.cn> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-CM-TRANSID: AQAAf8CxbSMDldRk9bhSAA--.26845S2 X-CM-SenderInfo: 5ol0xt5qjotxo6or00hjvr0hdfq/ X-Coremail-Antispam: 1Uk129KBjDUn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7KY7 ZEXasCq-sGcSsGvfJ3UbIjqfuFe4nvWSU5nxnvy29KBjDU0xBIdaVrnUUvcSsGvfC2Kfnx nUUI43ZEXa7xR_UUUUUUUUU== Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=114.242.206.163; envelope-from=lixianglai@loongson.cn; helo=mail.loongson.cn X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZM-MESSAGEID: 1691653454233100001 1.Add edk2-platform submodule 2.Added loongarch UEFI BIOS support to compiled scripts. 3.The cross-compilation toolchain on x86 can be obtained from the link belo= w: https://github.com/loongson/build-tools/tree/2022.09.06 Cc: Paolo Bonzini Cc: "Marc-Andr=C3=A9 Lureau" Cc: "Daniel P. Berrang=C3=A9" Cc: Thomas Huth Cc: "Philippe Mathieu-Daud=C3=A9" Cc: Gerd Hoffmann Cc: Xiaojuan Yang Cc: Song Gao Cc: Bibo Mao Signed-off-by: xianglai li --- .gitmodules | 3 +++ meson.build | 2 +- pc-bios/meson.build | 2 ++ roms/edk2-build.config | 14 ++++++++++++++ roms/edk2-build.py | 4 ++-- roms/edk2-platforms | 1 + 6 files changed, 23 insertions(+), 3 deletions(-) create mode 160000 roms/edk2-platforms diff --git a/.gitmodules b/.gitmodules index 73cae4cd4d..0cb57123fa 100644 --- a/.gitmodules +++ b/.gitmodules @@ -43,3 +43,6 @@ [submodule "tests/lcitool/libvirt-ci"] path =3D tests/lcitool/libvirt-ci url =3D https://gitlab.com/libvirt/libvirt-ci.git +[submodule "roms/edk2-platforms"] + path =3D roms/edk2-platforms + url =3D https://github.com/tianocore/edk2-platforms.git diff --git a/meson.build b/meson.build index 98e68ef0b1..b398caf2ce 100644 --- a/meson.build +++ b/meson.build @@ -153,7 +153,7 @@ if targetos !=3D 'darwin' modular_tcg =3D ['i386-softmmu', 'x86_64-softmmu'] endif =20 -edk2_targets =3D [ 'arm-softmmu', 'aarch64-softmmu', 'i386-softmmu', 'x86_= 64-softmmu' ] +edk2_targets =3D [ 'arm-softmmu', 'aarch64-softmmu', 'i386-softmmu', 'x86_= 64-softmmu', 'loongarch64-softmmu' ] unpack_edk2_blobs =3D false foreach target : edk2_targets if target in target_dirs diff --git a/pc-bios/meson.build b/pc-bios/meson.build index a7224ef469..fc73222b6c 100644 --- a/pc-bios/meson.build +++ b/pc-bios/meson.build @@ -9,6 +9,8 @@ if unpack_edk2_blobs 'edk2-i386-vars.fd', 'edk2-x86_64-code.fd', 'edk2-x86_64-secure-code.fd', + 'edk2-loongarch64-code.fd', + 'edk2-loongarch64-vars.fd', ] =20 foreach f : fds diff --git a/roms/edk2-build.config b/roms/edk2-build.config index 66ef9ffcb9..7960c4c2c5 100644 --- a/roms/edk2-build.config +++ b/roms/edk2-build.config @@ -1,5 +1,6 @@ [global] core =3D edk2 +pkgs =3D edk2-platforms =20 ##########################################################################= ########## # options @@ -122,3 +123,16 @@ plat =3D RiscVVirtQemu dest =3D ../pc-bios cpy1 =3D FV/RISCV_VIRT.fd edk2-riscv.fd pad1 =3D edk2-riscv.fd 32m + +##########################################################################= ########## +# LoongArch64 + +[build.loongach64.qemu] +conf =3D Platform/Loongson/LoongArchQemuPkg/Loongson.dsc +arch =3D LOONGARCH64 +plat =3D LoongArchQemu +dest =3D ../pc-bios +cpy1 =3D FV/QEMU_EFI.fd edk2-loongarch64-code.fd +pad1 =3D edk2-loongarch64-code.fd 4m +cpy2 =3D FV/QEMU_VARS.fd edk2-loongarch64-vars.fd +pad2 =3D edk2-loongarch64-vars.fd 16m diff --git a/roms/edk2-build.py b/roms/edk2-build.py index 870893f7c8..dbd641e51e 100755 --- a/roms/edk2-build.py +++ b/roms/edk2-build.py @@ -269,8 +269,8 @@ def prepare_env(cfg): # for cross builds if binary_exists('arm-linux-gnu-gcc'): os.environ['GCC5_ARM_PREFIX'] =3D 'arm-linux-gnu-' - if binary_exists('loongarch64-linux-gnu-gcc'): - os.environ['GCC5_LOONGARCH64_PREFIX'] =3D 'loongarch64-linux-gnu-' + if binary_exists('loongarch64-unknown-linux-gnu-gcc'): + os.environ['GCC5_LOONGARCH64_PREFIX'] =3D 'loongarch64-unknown-lin= ux-gnu-' =20 hostarch =3D os.uname().machine if binary_exists('aarch64-linux-gnu-gcc') and hostarch !=3D 'aarch64': diff --git a/roms/edk2-platforms b/roms/edk2-platforms new file mode 160000 index 0000000000..84ccada592 --- /dev/null +++ b/roms/edk2-platforms @@ -0,0 +1 @@ +Subproject commit 84ccada59257a8151a592a416017fbb03b8ed3cf --=20 2.39.1