From nobody Tue Nov 18 00:09:07 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; 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; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1726562300; cv=none; d=zohomail.com; s=zohoarc; b=CKE+Mf+SzE5ztwPu86Ox5GdyvdNJR69lj8DbJIsWVYppi90uJ6aRbB3PRnJhfiu/Yv9/6lqCMAamPapW5xVtZtWpLwnfEHVj/yXU3bGBW1JkNiK73d8NAbSYT8zKsX/DdCOGTtFJv87vO5NIHaXhawquKmBeao73biEkYkqMgJ8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1726562300; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=lW1PonsFY500RWAU7k13QdM3gVsAiiFu/6fGBSj3E7E=; b=QA6H8Hd3It1jWZT/owCnmQGn/z/6u/fkjcHNf/Q5GI1auN7NfHfUg609sR2FZgJM8yvjtq5p8kPWGjcqXkMYos/UO4ZA4UjCwlKLSp4GXTceHe8vBhYUk9Q9PpZSVYdil3c+IgBsdjjmZje5csSaiJV2n99aD0VBsIaZUT27eYk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; 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; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 17265623008931002.6086385642524; Tue, 17 Sep 2024 01:38:20 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sqTiF-0007Ir-8r; Tue, 17 Sep 2024 04:37:31 -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 1sqTiE-0007Ed-AJ for qemu-devel@nongnu.org; Tue, 17 Sep 2024 04:37:30 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1sqTiC-0006DV-HJ for qemu-devel@nongnu.org; Tue, 17 Sep 2024 04:37:30 -0400 Received: from mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-256-gFugUfzQNcu9zvRwfN5ENQ-1; Tue, 17 Sep 2024 04:37:22 -0400 Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-03.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 006EF19560BF; Tue, 17 Sep 2024 08:37:21 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.193.72]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 22F0219560A0; Tue, 17 Sep 2024 08:37:19 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 9378518009A5; Tue, 17 Sep 2024 10:37:17 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1726562248; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=lW1PonsFY500RWAU7k13QdM3gVsAiiFu/6fGBSj3E7E=; b=SKzkw6k9WqBwhGmfetoXvswThts+aZHGKG1reSphR42hDumWZGhVHY/zni6L3eyxzT27nU HOSBtMZ4GM/avbdkVWR0YQ73AFLrCioCDMNYLPqr/QWyGDiJeQNTGMfe5XRjx8hSR1R5q9 ng+nq6aRSzBr5pCF+ffmTY4yT22p4JI= X-MC-Unique: gFugUfzQNcu9zvRwfN5ENQ-1 From: Gerd Hoffmann To: qemu-devel@nongnu.org Cc: "Michael S. Tsirkin" , Igor Mammedov , Song Gao , Gerd Hoffmann , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Jiaxun Yang , Paolo Bonzini , Ani Sinha , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Xianglai Li Subject: [PULL 4/7] roms: Support compile the efi bios for loongarch Date: Tue, 17 Sep 2024 10:36:58 +0200 Message-ID: <20240917083709.571436-5-kraxel@redhat.com> In-Reply-To: <20240917083709.571436-1-kraxel@redhat.com> References: <20240917083709.571436-1-kraxel@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 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=170.10.133.124; envelope-from=kraxel@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, 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-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1726562301811116600 Content-Type: text/plain; charset="utf-8" From: Xianglai Li Added loongarch UEFI BIOS support to compiled scripts. UEFI code images require 16M alignment, flash images require 16M alignment, under the loongarch architecture.This is agreed upon when the firmware is loaded in QEMU under Loongarch. The naming of UEFI under loongarch refers to the x86 and arm naming metho= ds, and the UEFI image names in x86 and arm are: edk2-i386-code.fd edk2-i386-vars.fd edk2-arm-code.fd edk2-arm-vars.fd So on loongarch, we named it: edk2-loongarch64-code.fd edk2-loongarch64-vars.fd Signed-off-by: Xianglai Li Message-ID: <20240724022245.1317884-1-lixianglai@loongson.cn> Signed-off-by: Gerd Hoffmann --- docs/system/loongarch/virt.rst | 2 +- meson.build | 2 +- pc-bios/descriptors/60-edk2-loongarch64.json | 31 ++++++++++++++++++++ pc-bios/descriptors/meson.build | 3 +- pc-bios/meson.build | 2 ++ roms/edk2-build.config | 13 ++++++++ 6 files changed, 50 insertions(+), 3 deletions(-) create mode 100644 pc-bios/descriptors/60-edk2-loongarch64.json diff --git a/docs/system/loongarch/virt.rst b/docs/system/loongarch/virt.rst index 06d034b8ef28..172fba079e9d 100644 --- a/docs/system/loongarch/virt.rst +++ b/docs/system/loongarch/virt.rst @@ -64,7 +64,7 @@ Note: You need get the latest cross-tools at https://gith= ub.com/loongson/build-t =20 (3) Build BIOS: =20 - See: https://github.com/tianocore/edk2-platforms/tree/master/Platform/= Loongson/LoongArchQemuPkg#readme + See: https://github.com/tianocore/edk2/tree/master/OvmfPkg/LoongArchVi= rt#readme =20 Note: To build the release version of the bios, set --buildtarget=3DRELEA= SE, the bios file path: Build/LoongArchQemu/RELEASE_GCC5/FV/QEMU_EFI.fd diff --git a/meson.build b/meson.build index 2d4bf71b24ef..10464466ff39 100644 --- a/meson.build +++ b/meson.build @@ -93,7 +93,7 @@ else iasl =3D find_program(get_option('iasl'), required: true) endif =20 -edk2_targets =3D [ 'arm-softmmu', 'aarch64-softmmu', 'i386-softmmu', 'x86_= 64-softmmu', 'riscv64-softmmu' ] +edk2_targets =3D [ 'arm-softmmu', 'aarch64-softmmu', 'i386-softmmu', 'x86_= 64-softmmu', 'riscv64-softmmu', 'loongarch64-softmmu' ] unpack_edk2_blobs =3D false foreach target : edk2_targets if target in target_dirs diff --git a/pc-bios/descriptors/60-edk2-loongarch64.json b/pc-bios/descrip= tors/60-edk2-loongarch64.json new file mode 100644 index 000000000000..f174a1fc9b27 --- /dev/null +++ b/pc-bios/descriptors/60-edk2-loongarch64.json @@ -0,0 +1,31 @@ +{ + "description": "UEFI firmware for loongarch64", + "interface-types": [ + "uefi" + ], + "mapping": { + "device": "flash", + "executable": { + "filename": "@DATADIR@/edk2-loongarch64-code.fd", + "format": "raw" + }, + "nvram-template": { + "filename": "@DATADIR@/edk2-loongarch64-vars.fd", + "format": "raw" + } + }, + "targets": [ + { + "architecture": "loongarch64", + "machines": [ + "virt*" + ] + } + ], + "features": [ + + ], + "tags": [ + + ] +} diff --git a/pc-bios/descriptors/meson.build b/pc-bios/descriptors/meson.bu= ild index 66f85d01c427..afb5a959ccf4 100644 --- a/pc-bios/descriptors/meson.build +++ b/pc-bios/descriptors/meson.build @@ -5,7 +5,8 @@ if unpack_edk2_blobs and get_option('install_blobs') '60-edk2-aarch64.json', '60-edk2-arm.json', '60-edk2-i386.json', - '60-edk2-x86_64.json' + '60-edk2-x86_64.json', + '60-edk2-loongarch64.json' ] configure_file(input: files(f), output: f, diff --git a/pc-bios/meson.build b/pc-bios/meson.build index 8602b45b9b32..090379763e76 100644 --- a/pc-bios/meson.build +++ b/pc-bios/meson.build @@ -11,6 +11,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 cc9b21154205..9e45361fb445 100644 --- a/roms/edk2-build.config +++ b/roms/edk2-build.config @@ -131,3 +131,16 @@ cpy1 =3D FV/RISCV_VIRT_CODE.fd edk2-riscv-code.fd cpy2 =3D FV/RISCV_VIRT_VARS.fd edk2-riscv-vars.fd pad1 =3D edk2-riscv-code.fd 32m pad2 =3D edk2-riscv-vars.fd 32m + +##########################################################################= ########## +# LoongArch64 + +[build.loongarch64.qemu] +conf =3D OvmfPkg/LoongArchVirt/LoongArchVirtQemu.dsc +arch =3D LOONGARCH64 +plat =3D LoongArchVirtQemu +dest =3D ../pc-bios +cpy1 =3D FV/QEMU_EFI.fd edk2-loongarch64-code.fd +pad1 =3D edk2-loongarch64-code.fd 16m +cpy2 =3D FV/QEMU_VARS.fd edk2-loongarch64-vars.fd +pad2 =3D edk2-loongarch64-vars.fd 16m --=20 2.46.0