From nobody Sat May 4 04:36:24 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1490709046299332.3739751268846; Tue, 28 Mar 2017 06:50:46 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 10D3421DFA7BB; Tue, 28 Mar 2017 06:50:44 -0700 (PDT) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 0172421DFA7BB for ; Tue, 28 Mar 2017 06:50:41 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 6C61AC04BD55; Tue, 28 Mar 2017 13:50:40 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-89.phx2.redhat.com [10.3.116.89]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5F86A17D9F; Tue, 28 Mar 2017 13:50:39 +0000 (UTC) X-Original-To: edk2-devel@lists.01.org DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 6C61AC04BD55 Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=lersek@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 6C61AC04BD55 From: Laszlo Ersek To: edk2-devel-01 Date: Tue, 28 Mar 2017 15:50:22 +0200 Message-Id: <20170328135033.24238-2-lersek@redhat.com> In-Reply-To: <20170328135033.24238-1-lersek@redhat.com> References: <20170328135033.24238-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Tue, 28 Mar 2017 13:50:40 +0000 (UTC) Subject: [edk2] [PATCH v4 01/12] Revert "ArmVirtPkg/FdtClientDxe: make DT table installation !ACPI dependent" X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Leif Lindholm , Ard Biesheuvel MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This reverts commit 78c41ff519b187d8979cda7074f007a6323f9acd. We realized that DXE drivers that are independent of AcpiPlatformDxe (that is, independent of QEMU's ACPI generation), such as RamDiskDxe and BootGraphicsResourceTableDxe, may produce and/or manipulate ACPI tables, at driver dispatch or even at Ready To Boot. This makes it unsafe for us to check for ACPI presence in the UEFI system config table in a Ready To Boot callback, in order to decide about exposing the DT. Cc: Ard Biesheuvel Cc: Leif Lindholm Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel --- Notes: v3: - pick up Ard's R-b ArmVirtPkg/ArmVirtPkg.dec | 10 ++++++++++ ArmVirtPkg/ArmVirtQemu.dsc | 5 +++++ ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf | 5 +++-- ArmVirtPkg/FdtClientDxe/FdtClientDxe.c | 16 +++++----------- 4 files changed, 23 insertions(+), 13 deletions(-) diff --git a/ArmVirtPkg/ArmVirtPkg.dec b/ArmVirtPkg/ArmVirtPkg.dec index efe83a383d55..a5ec42166445 100644 --- a/ArmVirtPkg/ArmVirtPkg.dec +++ b/ArmVirtPkg/ArmVirtPkg.dec @@ -58,3 +58,13 @@ [PcdsFixedAtBuild, PcdsPatchableInModule] # EFI_VT_100_GUID. # gArmVirtTokenSpaceGuid.PcdTerminalTypeGuidBuffer|{0x65, 0x60, 0xA6, 0xDF= , 0x19, 0xB4, 0xD3, 0x11, 0x9A, 0x2D, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D}|V= OID*|0x00000007 + +[PcdsFeatureFlag] + # + # Pure ACPI boot + # + # Inhibit installation of the FDT as a configuration table if this featu= re + # PCD is TRUE. Otherwise, the OS is presented with both a DT and an ACPI + # description of the platform, and it is up to the OS to choose. + # + gArmVirtTokenSpaceGuid.PcdPureAcpiBoot|FALSE|BOOLEAN|0x0000000a diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc index 4f686faa559c..4b556f309a6c 100644 --- a/ArmVirtPkg/ArmVirtQemu.dsc +++ b/ArmVirtPkg/ArmVirtQemu.dsc @@ -34,6 +34,7 @@ [Defines] # -D FLAG=3DVALUE # DEFINE SECURE_BOOT_ENABLE =3D FALSE + DEFINE PURE_ACPI_BOOT_ENABLE =3D FALSE =20 !include ArmVirtPkg/ArmVirt.dsc.inc =20 @@ -94,6 +95,10 @@ [PcdsFeatureFlag.common] gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE =20 +!if $(PURE_ACPI_BOOT_ENABLE) =3D=3D TRUE + gArmVirtTokenSpaceGuid.PcdPureAcpiBoot|TRUE +!endif + [PcdsFixedAtBuild.common] gArmPlatformTokenSpaceGuid.PcdCoreCount|1 !if $(ARCH) =3D=3D AARCH64 diff --git a/ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf b/ArmVirtPkg/FdtClien= tDxe/FdtClientDxe.inf index 9861f41e968b..00017727c32c 100644 --- a/ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf +++ b/ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf @@ -37,16 +37,17 @@ [LibraryClasses] HobLib UefiBootServicesTableLib UefiDriverEntryPoint - UefiLib =20 [Protocols] gFdtClientProtocolGuid ## PRODUCES =20 [Guids] - gEfiAcpi20TableGuid gEfiEventReadyToBootGuid gFdtHobGuid gFdtTableGuid =20 +[FeaturePcd] + gArmVirtTokenSpaceGuid.PcdPureAcpiBoot + [Depex] TRUE diff --git a/ArmVirtPkg/FdtClientDxe/FdtClientDxe.c b/ArmVirtPkg/FdtClientD= xe/FdtClientDxe.c index 21c1074e331c..4cf79f70cb2a 100644 --- a/ArmVirtPkg/FdtClientDxe/FdtClientDxe.c +++ b/ArmVirtPkg/FdtClientDxe/FdtClientDxe.c @@ -17,11 +17,9 @@ #include #include #include -#include #include #include =20 -#include #include #include #include @@ -318,16 +316,12 @@ OnReadyToBoot ( ) { EFI_STATUS Status; - VOID *Table; =20 - // - // Only install the FDT as a configuration table if we are not exposing - // ACPI 2.0 (or later) tables. Note that the legacy ACPI table GUID has - // no meaning on ARM since we need at least ACPI 5.0 support, and the - // 64-bit ACPI 2.0 table GUID is mandatory in that case. - // - Status =3D EfiGetSystemConfigurationTable (&gEfiAcpi20TableGuid, &Table); - if (EFI_ERROR (Status) || Table =3D=3D NULL) { + if (!FeaturePcdGet (PcdPureAcpiBoot)) { + // + // Only install the FDT as a configuration table if we want to leave i= t up + // to the OS to decide whether it prefers ACPI over DT. + // Status =3D gBS->InstallConfigurationTable (&gFdtTableGuid, mDeviceTree= Base); ASSERT_EFI_ERROR (Status); } --=20 2.9.3 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Sat May 4 04:36:24 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1490709049117336.09387502449465; Tue, 28 Mar 2017 06:50:49 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 4438620D2C3BA; Tue, 28 Mar 2017 06:50:47 -0700 (PDT) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 6930121DFA7A9 for ; Tue, 28 Mar 2017 06:50:43 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D3F6E81243; Tue, 28 Mar 2017 13:50:42 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-89.phx2.redhat.com [10.3.116.89]) by smtp.corp.redhat.com (Postfix) with ESMTP id C2F737F6BB; Tue, 28 Mar 2017 13:50:41 +0000 (UTC) X-Original-To: edk2-devel@lists.01.org DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com D3F6E81243 Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=lersek@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com D3F6E81243 From: Laszlo Ersek To: edk2-devel-01 Date: Tue, 28 Mar 2017 15:50:23 +0200 Message-Id: <20170328135033.24238-3-lersek@redhat.com> In-Reply-To: <20170328135033.24238-1-lersek@redhat.com> References: <20170328135033.24238-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Tue, 28 Mar 2017 13:50:43 +0000 (UTC) Subject: [edk2] [PATCH v4 02/12] Revert "ArmVirtPkg/FdtClientDxe: install DT configuration table at ReadyToBoot" X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Leif Lindholm , Ard Biesheuvel MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This reverts commit 18f6d4df9ece8b91b86511bcdd1cf7da478c3627. We realized that DXE drivers that are independent of AcpiPlatformDxe (that is, independent of QEMU's ACPI generation), such as RamDiskDxe and BootGraphicsResourceTableDxe, may produce and/or manipulate ACPI tables, at driver dispatch or even at Ready To Boot. This makes it unsafe for us to check for ACPI presence in the UEFI system config table in a Ready To Boot callback, in order to decide about exposing the DT. Cc: Ard Biesheuvel Cc: Leif Lindholm Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel --- Notes: v3: - pick up Ard's R-b ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf | 1 - ArmVirtPkg/FdtClientDxe/FdtClientDxe.c | 49 ++++---------------- 2 files changed, 9 insertions(+), 41 deletions(-) diff --git a/ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf b/ArmVirtPkg/FdtClien= tDxe/FdtClientDxe.inf index 00017727c32c..3a0cd37040eb 100644 --- a/ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf +++ b/ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf @@ -42,7 +42,6 @@ [Protocols] gFdtClientProtocolGuid ## PRODUCES =20 [Guids] - gEfiEventReadyToBootGuid gFdtHobGuid gFdtTableGuid =20 diff --git a/ArmVirtPkg/FdtClientDxe/FdtClientDxe.c b/ArmVirtPkg/FdtClientD= xe/FdtClientDxe.c index 4cf79f70cb2a..547a29fce62c 100644 --- a/ArmVirtPkg/FdtClientDxe/FdtClientDxe.c +++ b/ArmVirtPkg/FdtClientDxe/FdtClientDxe.c @@ -20,7 +20,6 @@ #include #include =20 -#include #include #include =20 @@ -307,30 +306,6 @@ STATIC FDT_CLIENT_PROTOCOL mFdtClientProtocol =3D { GetOrInsertChosenNode, }; =20 -STATIC -VOID -EFIAPI -OnReadyToBoot ( - EFI_EVENT Event, - VOID *Context - ) -{ - EFI_STATUS Status; - - if (!FeaturePcdGet (PcdPureAcpiBoot)) { - // - // Only install the FDT as a configuration table if we want to leave i= t up - // to the OS to decide whether it prefers ACPI over DT. - // - Status =3D gBS->InstallConfigurationTable (&gFdtTableGuid, mDeviceTree= Base); - ASSERT_EFI_ERROR (Status); - } - - gBS->CloseEvent (Event); -} - -STATIC EFI_EVENT mReadyToBootEvent; - EFI_STATUS EFIAPI InitializeFdtClientDxe ( @@ -358,21 +333,15 @@ InitializeFdtClientDxe ( =20 DEBUG ((EFI_D_INFO, "%a: DTB @ 0x%p\n", __FUNCTION__, mDeviceTreeBase)); =20 - Status =3D gBS->InstallProtocolInterface (&ImageHandle, &gFdtClientProto= colGuid, - EFI_NATIVE_INTERFACE, &mFdtClientProtocol); - if (EFI_ERROR (Status)) { - return Status; + if (!FeaturePcdGet (PcdPureAcpiBoot)) { + // + // Only install the FDT as a configuration table if we want to leave i= t up + // to the OS to decide whether it prefers ACPI over DT. + // + Status =3D gBS->InstallConfigurationTable (&gFdtTableGuid, DeviceTreeB= ase); + ASSERT_EFI_ERROR (Status); } =20 - Status =3D gBS->CreateEventEx ( - EVT_NOTIFY_SIGNAL, - TPL_CALLBACK, - OnReadyToBoot, - NULL, - &gEfiEventReadyToBootGuid, - &mReadyToBootEvent - ); - ASSERT_EFI_ERROR (Status); - - return EFI_SUCCESS; + return gBS->InstallProtocolInterface (&ImageHandle, &gFdtClientProtocolG= uid, + EFI_NATIVE_INTERFACE, &mFdtClientProtocol); } --=20 2.9.3 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Sat May 4 04:36:24 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1490709051180455.8699482620176; Tue, 28 Mar 2017 06:50:51 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 74C33200840E1; Tue, 28 Mar 2017 06:50:47 -0700 (PDT) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id DE13121DFA917 for ; Tue, 28 Mar 2017 06:50:44 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4F60B67BC8; Tue, 28 Mar 2017 13:50:44 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-89.phx2.redhat.com [10.3.116.89]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3C6D717D9F; Tue, 28 Mar 2017 13:50:43 +0000 (UTC) X-Original-To: edk2-devel@lists.01.org DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 4F60B67BC8 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=lersek@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 4F60B67BC8 From: Laszlo Ersek To: edk2-devel-01 Date: Tue, 28 Mar 2017 15:50:24 +0200 Message-Id: <20170328135033.24238-4-lersek@redhat.com> In-Reply-To: <20170328135033.24238-1-lersek@redhat.com> References: <20170328135033.24238-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 28 Mar 2017 13:50:44 +0000 (UTC) Subject: [edk2] [PATCH v4 03/12] ArmVirtPkg/XenAcpiPlatformDxe: don't cast UINT64 to pointer directly X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Leif Lindholm , Ard Biesheuvel MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Because that breaks the (potential) 32-bit build of the driver. Cc: Ard Biesheuvel Cc: Leif Lindholm Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel --- Notes: v3: - modify commit message (s/upcoming/potential/ build) to reflect that we won't actually include the ACPI stuff in the 32-bit builds [Ard] - pick up Ard's R-b ArmVirtPkg/XenAcpiPlatformDxe/XenAcpiPlatformDxe.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ArmVirtPkg/XenAcpiPlatformDxe/XenAcpiPlatformDxe.c b/ArmVirtPk= g/XenAcpiPlatformDxe/XenAcpiPlatformDxe.c index 203946f97bf8..49f9b5d2822a 100644 --- a/ArmVirtPkg/XenAcpiPlatformDxe/XenAcpiPlatformDxe.c +++ b/ArmVirtPkg/XenAcpiPlatformDxe/XenAcpiPlatformDxe.c @@ -73,7 +73,8 @@ GetXenArmAcpiRsdp ( ASSERT (RegSize =3D=3D 2 * sizeof (UINT64)); =20 RegBase =3D SwapBytes64(Reg[0]); - RsdpStructurePtr =3D (EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER *)Reg= Base; + RsdpStructurePtr =3D + (EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER *)(UINTN)RegBase; =20 if (RsdpStructurePtr && RsdpStructurePtr->Revision >=3D 2) { Sum =3D CalculateSum8 ((CONST UINT8 *)RsdpStructurePtr, --=20 2.9.3 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Sat May 4 04:36:24 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1490709053494297.3118398245309; Tue, 28 Mar 2017 06:50:53 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id A7AB8200840E6; Tue, 28 Mar 2017 06:50:49 -0700 (PDT) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 54EB121DFA917 for ; Tue, 28 Mar 2017 06:50:46 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BAA987F3F5; Tue, 28 Mar 2017 13:50:45 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-89.phx2.redhat.com [10.3.116.89]) by smtp.corp.redhat.com (Postfix) with ESMTP id A9A3C800D0; Tue, 28 Mar 2017 13:50:44 +0000 (UTC) X-Original-To: edk2-devel@lists.01.org DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com BAA987F3F5 Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=lersek@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com BAA987F3F5 From: Laszlo Ersek To: edk2-devel-01 Date: Tue, 28 Mar 2017 15:50:25 +0200 Message-Id: <20170328135033.24238-5-lersek@redhat.com> In-Reply-To: <20170328135033.24238-1-lersek@redhat.com> References: <20170328135033.24238-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Tue, 28 Mar 2017 13:50:45 +0000 (UTC) Subject: [edk2] [PATCH v4 04/12] EmbeddedPkg: introduce EDKII Platform Has ACPI GUID X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Leif Lindholm , Ard Biesheuvel MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The presence of this GUID in the PPI database, and/or in the DXE protocol database (as dictated by the platform's needs in these firmware phases) implies that the platform provides the operating system with an ACPI-based hardware description. This is not necessarily exclusive with other types of hardware description (for example, a Device Tree-based one). A platform PEIM and/or DXE driver is supposed to produce a single instance of the PPI and/or protocol (with NULL contents), if appropriate. The decision to produce the PPI and/or protocol is platform specific; for example, in the DXE phase, it could depend on an HII checkbox / underlying non-volatile UEFI variable. In the DXE phase, the protocol is meant to be depended-upon by "MdeModulePkg/Universal/Acpi/AcpiTableDxe", indirectly: * In the long term, interested platforms will establish this dependency by hooking an (upcoming) NULL-class DepexLib instance into AcpiTableDxe in their DSC files, pointing DepexLib's DEPEX through a FixedAtBuild PCD to the GUID introduced here. (For the prerequisite BaseTools feature, refer to ). * In the short term, an interested platform may hook a private NULL-class library instance (called e.g. "PlatformHasAcpiLib") into AcpiTableDxe. Such a library instance would be a specialization of the above described generic DepexLib, with the DEPEX open-coded on the GUID introduced here. Either way, the platform makes EFI_ACPI_TABLE_PROTOCOL and (if enabled) EFI_ACPI_SDT_PROTOCOL dependent on the platform's dynamic decision to produce or not to produce a NULL protocol instance with this GUID. In turn, other (platform and universal) DXE drivers that produce ACPI tables will wait for EFI_ACPI_TABLE_PROTOCOL / EFI_ACPI_SDT_PROTOCOL, via DEPEX, protocol notify, or a simple gBS->LocateProtocol() in a "late enough" callback (such as Ready To Boot). Because this GUID is not standard, it is prefixed with EDKII / Edkii, as seen elsewhere in MdeModulePkg and SecurityPkg. In addition, an effort is made to avoid the phrase "AcpiPlatform", as that belongs to drivers / libraries that produce platform specific ACPI content (as opposed to deciding whether the entire firmware will have access to EFI_ACPI_TABLE_PROTOCOL, or any similar facilities in the PEI phase). Cc: Ard Biesheuvel Cc: Leif Lindholm Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel --- Notes: v4: - move to EmbeddedPkg [Ard, Laszlo] - fix BZ reference (#444 is for docs, #443 is BaseTools code) [Laszlo] - pick up Ard's R-b =20 v3: - rename gEdkiiPlatformHasAcpiProtocolGuid to gEdkiiPlatformHasAcpiGuid [Star] - update commit message and code comments to reflect possible use as a PPI as well [Star] - move GUID from ArmPkg to MdeModulePkg [Leif, Ard] - split PlatformHasAcpiLib to a separate patch [Star] EmbeddedPkg/EmbeddedPkg.dec | 3 ++ EmbeddedPkg/Include/Guid/PlatformHasAcpi.h | 35 ++++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/EmbeddedPkg/EmbeddedPkg.dec b/EmbeddedPkg/EmbeddedPkg.dec index 2c2cf41103c2..d078bf794a79 100644 --- a/EmbeddedPkg/EmbeddedPkg.dec +++ b/EmbeddedPkg/EmbeddedPkg.dec @@ -56,6 +56,9 @@ [Guids.common] gFdtHobGuid =3D { 0x16958446, 0x19B7, 0x480B, { 0xB0, 0x47, 0x74, 0x85= , 0xAD, 0x3F, 0x71, 0x6D } } gFdtVariableGuid =3D { 0x25a4fd4a, 0x9703, 0x4ba9, { 0xa1, 0x90, 0xb7, 0= xc8, 0x4e, 0xfb, 0x3e, 0x57 } } =20 + ## Include/Guid/PlatformHasAcpi.h + gEdkiiPlatformHasAcpiGuid =3D { 0xf0966b41, 0xc23f, 0x41b9, { 0x96, 0x04= , 0x0f, 0xf7, 0xe1, 0x11, 0x96, 0x5a } } + [Protocols.common] gHardwareInterruptProtocolGuid =3D { 0x2890B3EA, 0x053D, 0x1643, { 0xAD= , 0x0C, 0xD6, 0x48, 0x08, 0xDA, 0x3F, 0xF1 } } gEfiDebugSupportPeriodicCallbackProtocolGuid =3D { 0x9546e07c, 0x2cbb, 0= x4c88, { 0x98, 0x6c, 0xcd, 0x34, 0x10, 0x86, 0xf0, 0x44 } } diff --git a/EmbeddedPkg/Include/Guid/PlatformHasAcpi.h b/EmbeddedPkg/Inclu= de/Guid/PlatformHasAcpi.h new file mode 100644 index 000000000000..ad517821375d --- /dev/null +++ b/EmbeddedPkg/Include/Guid/PlatformHasAcpi.h @@ -0,0 +1,35 @@ +/** @file + EDKII Platform Has ACPI GUID + + A NULL protocol instance with this GUID in the DXE protocol database, an= d/or + a NULL PPI with this GUID in the PPI database, implies that the platform + provides the operating system with an ACPI-based hardware description. N= ote + that this is not necessarily exclusive with different kinds of hardware + description (for example, a Device Tree-based one). A platform driver an= d/or + PEIM is supposed to produce a single instance of the protocol and/or PPI + (with NULL contents), if appropriate. + + Copyright (C) 2017, Red Hat, Inc. + + This program and the accompanying materials are licensed and made availa= ble + under the terms and conditions of the BSD License that accompanies this + distribution. The full text of the license may be found at + http://opensource.org/licenses/bsd-license.php. + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WI= THOUT + WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +**/ + + +#ifndef __EDKII_PLATFORM_HAS_ACPI_H__ +#define __EDKII_PLATFORM_HAS_ACPI_H__ + +#define EDKII_PLATFORM_HAS_ACPI_GUID \ + { \ + 0xf0966b41, 0xc23f, 0x41b9, \ + { 0x96, 0x04, 0x0f, 0xf7, 0xe1, 0x11, 0x96, 0x5a } \ + } + +extern EFI_GUID gEdkiiPlatformHasAcpiGuid; + +#endif --=20 2.9.3 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Sat May 4 04:36:24 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1490709055919129.78188532604315; Tue, 28 Mar 2017 06:50:55 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id DABA0200840E8; Tue, 28 Mar 2017 06:50:49 -0700 (PDT) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id B79EB200840DC for ; Tue, 28 Mar 2017 06:50:47 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 3341C7E9EE; Tue, 28 Mar 2017 13:50:47 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-89.phx2.redhat.com [10.3.116.89]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2047A7FBC1; Tue, 28 Mar 2017 13:50:45 +0000 (UTC) X-Original-To: edk2-devel@lists.01.org DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 3341C7E9EE Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=lersek@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 3341C7E9EE From: Laszlo Ersek To: edk2-devel-01 Date: Tue, 28 Mar 2017 15:50:26 +0200 Message-Id: <20170328135033.24238-6-lersek@redhat.com> In-Reply-To: <20170328135033.24238-1-lersek@redhat.com> References: <20170328135033.24238-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 28 Mar 2017 13:50:47 +0000 (UTC) Subject: [edk2] [PATCH v4 05/12] EmbeddedPkg: introduce PlatformHasAcpiLib X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Leif Lindholm , Ard Biesheuvel MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Add the shorter-term library instance outlined in the previous patch to EmbeddedPkg, so that we can imbue AcpiTableDxe with a protocol dependency on EDKII_PLATFORM_HAS_ACPI_GUID. Cc: Ard Biesheuvel Cc: Leif Lindholm Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel --- Notes: v4: - move to EmbeddedPkg [Ard, Laszlo] - refresh commit message - redirect INF / LibraryClasses to EmbeddedPkg.dec - pick up Ard's R-b =20 v3: - move GUID to MdeModulePkg (see previous patch) [Leif, Ard] - replace ArmPkg.dec package dependency with MdeModulePkg.dec in INF file - rename gEdkiiPlatformHasAcpiProtocolGuid to gEdkiiPlatformHasAcpiGuid [Star] - update comment in empty constructor function accordingly EmbeddedPkg/Library/PlatformHasAcpiLib/PlatformHasAcpiLib.inf | 40 +++++++= +++++++++++++ EmbeddedPkg/Library/PlatformHasAcpiLib/PlatformHasAcpiLib.c | 36 +++++++= +++++++++++ 2 files changed, 76 insertions(+) diff --git a/EmbeddedPkg/Library/PlatformHasAcpiLib/PlatformHasAcpiLib.inf = b/EmbeddedPkg/Library/PlatformHasAcpiLib/PlatformHasAcpiLib.inf new file mode 100644 index 000000000000..6268293ca97b --- /dev/null +++ b/EmbeddedPkg/Library/PlatformHasAcpiLib/PlatformHasAcpiLib.inf @@ -0,0 +1,40 @@ +## @file +# A hook-in library for MdeModulePkg/Universal/Acpi/AcpiTableDxe. +# +# Plugging this library instance into AcpiTableDxe makes +# EFI_ACPI_TABLE_PROTOCOL and (if enabled) EFI_ACPI_SDT_PROTOCOL depend on= the +# platform's dynamic decision whether to expose an ACPI-based hardware +# description to the operating system. +# +# Universal and platform specific DXE drivers that produce ACPI tables dep= end +# on EFI_ACPI_TABLE_PROTOCOL / EFI_ACPI_SDT_PROTOCOL in turn. +# +# Copyright (C) 2017, Red Hat, Inc. +# +# This program and the accompanying materials are licensed and made availa= ble +# under the terms and conditions of the BSD License which accompanies this +# distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WI= THOUT +# WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +## + +[Defines] + INF_VERSION =3D 1.25 + BASE_NAME =3D PlatformHasAcpiLib + FILE_GUID =3D 29beb028-0958-447b-be0a-12229235d77d + MODULE_TYPE =3D BASE + VERSION_STRING =3D 1.0 + LIBRARY_CLASS =3D PlatformHasAcpiLib|DXE_DRIVER + CONSTRUCTOR =3D PlatformHasAcpiInitialize + +[Sources] + PlatformHasAcpiLib.c + +[Packages] + EmbeddedPkg/EmbeddedPkg.dec + MdePkg/MdePkg.dec + +[Depex] + gEdkiiPlatformHasAcpiGuid diff --git a/EmbeddedPkg/Library/PlatformHasAcpiLib/PlatformHasAcpiLib.c b/= EmbeddedPkg/Library/PlatformHasAcpiLib/PlatformHasAcpiLib.c new file mode 100644 index 000000000000..2c73e71769eb --- /dev/null +++ b/EmbeddedPkg/Library/PlatformHasAcpiLib/PlatformHasAcpiLib.c @@ -0,0 +1,36 @@ +/** @file + A hook-in library for MdeModulePkg/Universal/Acpi/AcpiTableDxe. + + Plugging this library instance into AcpiTableDxe makes + EFI_ACPI_TABLE_PROTOCOL and (if enabled) EFI_ACPI_SDT_PROTOCOL depend on= the + platform's dynamic decision whether to expose an ACPI-based hardware + description to the operating system. + + Universal and platform specific DXE drivers that produce ACPI tables dep= end + on EFI_ACPI_TABLE_PROTOCOL / EFI_ACPI_SDT_PROTOCOL in turn. + + Copyright (C) 2017, Red Hat, Inc. + + This program and the accompanying materials are licensed and made availa= ble + under the terms and conditions of the BSD License which accompanies this + distribution. The full text of the license may be found at + http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WI= THOUT + WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +**/ + +#include + +RETURN_STATUS +EFIAPI +PlatformHasAcpiInitialize ( + VOID + ) +{ + // + // Do nothing, just imbue AcpiTableDxe with a protocol dependency on + // EDKII_PLATFORM_HAS_ACPI_GUID. + // + return RETURN_SUCCESS; +} --=20 2.9.3 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Sat May 4 04:36:24 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1490709057996558.2798564160308; Tue, 28 Mar 2017 06:50:57 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 17EF8200840ED; Tue, 28 Mar 2017 06:50:54 -0700 (PDT) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 307F821A18AA9 for ; Tue, 28 Mar 2017 06:50:49 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 99196C04BD34; Tue, 28 Mar 2017 13:50:48 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-89.phx2.redhat.com [10.3.116.89]) by smtp.corp.redhat.com (Postfix) with ESMTP id 89ECA17D9F; Tue, 28 Mar 2017 13:50:47 +0000 (UTC) X-Original-To: edk2-devel@lists.01.org DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 99196C04BD34 Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=lersek@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 99196C04BD34 From: Laszlo Ersek To: edk2-devel-01 Date: Tue, 28 Mar 2017 15:50:27 +0200 Message-Id: <20170328135033.24238-7-lersek@redhat.com> In-Reply-To: <20170328135033.24238-1-lersek@redhat.com> References: <20170328135033.24238-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Tue, 28 Mar 2017 13:50:48 +0000 (UTC) Subject: [edk2] [PATCH v4 06/12] EmbeddedPkg: introduce EDKII Platform Has Device Tree GUID X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Leif Lindholm , Ard Biesheuvel MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The presence of this GUID in the PPI database, and/or in the DXE protocol database (as dictated by the platform's needs in these firmware phases) implies that the platform provides the operating system with a Device Tree-based hardware description. This is not necessarily exclusive with other types of hardware description (for example, an ACPI-based one). A platform PEIM and/or DXE driver is supposed to produce a single instance of the PPI and/or protocol (with NULL contents), if appropriate. The decision to produce the PPI and/or protocol is platform specific; for example, in the DXE phase, it could depend on an HII checkbox / underlying non-volatile UEFI variable. In the DXE phase, the protocol is meant to be consumed by the platform driver that - owns the Device Tree description of the hardware, and - is responsible for installing it as a system configuration table. Said FDT-owner driver can wait for the protocol via DEPEX or protocol notify. Because this GUID is not standard, it is prefixed with EDKII / Edkii, as seen elsewhere (for example in MdeModulePkg and SecurityPkg). Cc: Ard Biesheuvel Cc: Leif Lindholm Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel --- Notes: v4: - pick up Ard's R-b =20 v3: - move GUID from ArmPkg to EmbeddedPkg [Leif] - apply the protocol -> generic GUID changes to naming, comments, and the commit message, that were suggested by Star for the MdeModulePkg / ACPI counterpart EmbeddedPkg/EmbeddedPkg.dec | 3 ++ EmbeddedPkg/Include/Guid/PlatformHasDeviceTree.h | 35 ++++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/EmbeddedPkg/EmbeddedPkg.dec b/EmbeddedPkg/EmbeddedPkg.dec index d078bf794a79..29736fb4a71d 100644 --- a/EmbeddedPkg/EmbeddedPkg.dec +++ b/EmbeddedPkg/EmbeddedPkg.dec @@ -59,6 +59,9 @@ [Guids.common] ## Include/Guid/PlatformHasAcpi.h gEdkiiPlatformHasAcpiGuid =3D { 0xf0966b41, 0xc23f, 0x41b9, { 0x96, 0x04= , 0x0f, 0xf7, 0xe1, 0x11, 0x96, 0x5a } } =20 + ## Include/Guid/PlatformHasDeviceTree.h + gEdkiiPlatformHasDeviceTreeGuid =3D { 0x7ebb920d, 0x1aaf, 0x46d9, { 0xb2= , 0xaf, 0x54, 0x1e, 0x1d, 0xce, 0x14, 0x8b } } + [Protocols.common] gHardwareInterruptProtocolGuid =3D { 0x2890B3EA, 0x053D, 0x1643, { 0xAD= , 0x0C, 0xD6, 0x48, 0x08, 0xDA, 0x3F, 0xF1 } } gEfiDebugSupportPeriodicCallbackProtocolGuid =3D { 0x9546e07c, 0x2cbb, 0= x4c88, { 0x98, 0x6c, 0xcd, 0x34, 0x10, 0x86, 0xf0, 0x44 } } diff --git a/EmbeddedPkg/Include/Guid/PlatformHasDeviceTree.h b/EmbeddedPkg= /Include/Guid/PlatformHasDeviceTree.h new file mode 100644 index 000000000000..a9bc51270cda --- /dev/null +++ b/EmbeddedPkg/Include/Guid/PlatformHasDeviceTree.h @@ -0,0 +1,35 @@ +/** @file + EDKII Platform Has Device Tree GUID + + A NULL protocol instance with this GUID in the DXE protocol database, an= d/or + a NULL PPI with this GUID in the PPI database, implies that the platform + provides the operating system with a Device Tree-based hardware descript= ion. + Note that this is not necessarily exclusive with different kinds of hard= ware + description (for example, an ACPI-based one). A platform driver and/or P= EIM + is supposed to produce a single instance of the protocol and/or PPI (with + NULL contents), if appropriate. + + Copyright (C) 2017, Red Hat, Inc. + + This program and the accompanying materials are licensed and made availa= ble + under the terms and conditions of the BSD License that accompanies this + distribution. The full text of the license may be found at + http://opensource.org/licenses/bsd-license.php. + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WI= THOUT + WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +**/ + + +#ifndef __EDKII_PLATFORM_HAS_DEVICE_TREE_H__ +#define __EDKII_PLATFORM_HAS_DEVICE_TREE_H__ + +#define EDKII_PLATFORM_HAS_DEVICE_TREE_GUID \ + { \ + 0x7ebb920d, 0x1aaf, 0x46d9, \ + { 0xb2, 0xaf, 0x54, 0x1e, 0x1d, 0xce, 0x14, 0x8b } \ + } + +extern EFI_GUID gEdkiiPlatformHasDeviceTreeGuid; + +#endif --=20 2.9.3 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Sat May 4 04:36:24 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1490709060755874.3987891652366; Tue, 28 Mar 2017 06:51:00 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 49FA9200840EF; Tue, 28 Mar 2017 06:50:54 -0700 (PDT) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 95D15200840EB for ; Tue, 28 Mar 2017 06:50:50 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0E7E18C546; Tue, 28 Mar 2017 13:50:50 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-89.phx2.redhat.com [10.3.116.89]) by smtp.corp.redhat.com (Postfix) with ESMTP id F3025179C0; Tue, 28 Mar 2017 13:50:48 +0000 (UTC) X-Original-To: edk2-devel@lists.01.org DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 0E7E18C546 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=lersek@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 0E7E18C546 From: Laszlo Ersek To: edk2-devel-01 Date: Tue, 28 Mar 2017 15:50:28 +0200 Message-Id: <20170328135033.24238-8-lersek@redhat.com> In-Reply-To: <20170328135033.24238-1-lersek@redhat.com> References: <20170328135033.24238-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 28 Mar 2017 13:50:50 +0000 (UTC) Subject: [edk2] [PATCH v4 07/12] ArmVirtPkg: add PlatformHasAcpiDtDxe X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Leif Lindholm , Ard Biesheuvel MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This driver produces the EDKII Platform Has ACPI and Platform Has Device Tree protocols, exactly matching the current ACPI / DT exposure on QEMU, according to ARM vs. AARCH64, and (in the latter case) to PcdPureAcpiBoot. Cc: Ard Biesheuvel Cc: Leif Lindholm Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel --- Notes: v4: - drop MdeModulePkg/MdeModulePkg.dec dependency =20 v3: - update package dependencies in INF file according to the GUID relocations in prior patches (replace ArmPkg.dec with EmbeddedPkg.dec and MdeModulePkg.dec) - rename gEdkiiPlatformHasAcpiProtocolGuid -> gEdkiiPlatformHasAcpiGuid - rename gEdkiiPlatformHasDeviceTreeProtocolGuid -> gEdkiiPlatformHasDeviceTreeGuid - adapt include paths and INF sections to protocol -> general GUID change - pick up Ard's R-b ArmVirtPkg/PlatformHasAcpiDtDxe/PlatformHasAcpiDtDxe.inf | 47 ++++++++++++ ArmVirtPkg/PlatformHasAcpiDtDxe/PlatformHasAcpiDtDxe.c | 77 ++++++++++++= ++++++++ 2 files changed, 124 insertions(+) diff --git a/ArmVirtPkg/PlatformHasAcpiDtDxe/PlatformHasAcpiDtDxe.inf b/Arm= VirtPkg/PlatformHasAcpiDtDxe/PlatformHasAcpiDtDxe.inf new file mode 100644 index 000000000000..2450500b3f0e --- /dev/null +++ b/ArmVirtPkg/PlatformHasAcpiDtDxe/PlatformHasAcpiDtDxe.inf @@ -0,0 +1,47 @@ +## @file +# Decide whether the firmware should expose an ACPI- and/or a Device Tree-= based +# hardware description to the operating system. +# +# Copyright (c) 2017, Red Hat, Inc. +# +# This program and the accompanying materials are licensed and made availa= ble +# under the terms and conditions of the BSD License which accompanies this +# distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WI= THOUT +# WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +## + +[Defines] + INF_VERSION =3D 1.25 + BASE_NAME =3D PlatformHasAcpiDtDxe + FILE_GUID =3D 9d1dd27f-6d7f-427b-aec4-b62f6279c2f1 + MODULE_TYPE =3D DXE_DRIVER + VERSION_STRING =3D 1.0 + ENTRY_POINT =3D PlatformHasAcpiDt + +[Sources] + PlatformHasAcpiDtDxe.c + +[Packages] + ArmVirtPkg/ArmVirtPkg.dec + EmbeddedPkg/EmbeddedPkg.dec + MdePkg/MdePkg.dec + +[LibraryClasses] + BaseLib + DebugLib + PcdLib + UefiBootServicesTableLib + UefiDriverEntryPoint + +[Guids] + gEdkiiPlatformHasAcpiGuid ## SOMETIMES_PRODUCES ## PROTOCOL + gEdkiiPlatformHasDeviceTreeGuid ## SOMETIMES_PRODUCES ## PROTOCOL + +[FeaturePcd] + gArmVirtTokenSpaceGuid.PcdPureAcpiBoot ## CONSUMES + +[Depex] + TRUE diff --git a/ArmVirtPkg/PlatformHasAcpiDtDxe/PlatformHasAcpiDtDxe.c b/ArmVi= rtPkg/PlatformHasAcpiDtDxe/PlatformHasAcpiDtDxe.c new file mode 100644 index 000000000000..a718ce1b5a7b --- /dev/null +++ b/ArmVirtPkg/PlatformHasAcpiDtDxe/PlatformHasAcpiDtDxe.c @@ -0,0 +1,77 @@ +/** @file + Decide whether the firmware should expose an ACPI- and/or a Device Tree-= based + hardware description to the operating system. + + Copyright (c) 2017, Red Hat, Inc. + + This program and the accompanying materials are licensed and made availa= ble + under the terms and conditions of the BSD License which accompanies this + distribution. The full text of the license may be found at + http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WI= THOUT + WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +**/ + +#include +#include +#include +#include +#include +#include + +EFI_STATUS +EFIAPI +PlatformHasAcpiDt ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +{ + EFI_STATUS Status; + + Status =3D EFI_SUCCESS; + + // + // If we fail to install any of the necessary protocols below, the OS wi= ll be + // unbootable anyway (due to lacking hardware description), so tolerate = no + // errors here. + // + // Always make ACPI available on 64-bit systems. + // + if (MAX_UINTN =3D=3D MAX_UINT64) { + Status =3D gBS->InstallProtocolInterface ( + &ImageHandle, + &gEdkiiPlatformHasAcpiGuid, + EFI_NATIVE_INTERFACE, + NULL + ); + if (EFI_ERROR (Status)) { + goto Failed; + } + } + + // + // Expose the Device Tree unless PcdPureAcpiBoot is set. + // + if (!FeaturePcdGet (PcdPureAcpiBoot)) { + Status =3D gBS->InstallProtocolInterface ( + &ImageHandle, + &gEdkiiPlatformHasDeviceTreeGuid, + EFI_NATIVE_INTERFACE, + NULL + ); + if (EFI_ERROR (Status)) { + goto Failed; + } + } + + return Status; + +Failed: + ASSERT_EFI_ERROR (Status); + CpuDeadLoop (); + // + // Keep compilers happy. + // + return Status; +} --=20 2.9.3 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Sat May 4 04:36:24 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1490709063617779.0897597819143; Tue, 28 Mar 2017 06:51:03 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 7BCA8200840F2; Tue, 28 Mar 2017 06:50:54 -0700 (PDT) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 77DAB200840DC for ; Tue, 28 Mar 2017 06:50:52 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D139C6364C; Tue, 28 Mar 2017 13:50:51 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-89.phx2.redhat.com [10.3.116.89]) by smtp.corp.redhat.com (Postfix) with ESMTP id 71C157DB71; Tue, 28 Mar 2017 13:50:50 +0000 (UTC) X-Original-To: edk2-devel@lists.01.org DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com D139C6364C Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=lersek@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com D139C6364C From: Laszlo Ersek To: edk2-devel-01 Date: Tue, 28 Mar 2017 15:50:29 +0200 Message-Id: <20170328135033.24238-9-lersek@redhat.com> In-Reply-To: <20170328135033.24238-1-lersek@redhat.com> References: <20170328135033.24238-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 28 Mar 2017 13:50:52 +0000 (UTC) Subject: [edk2] [PATCH v4 08/12] ArmVirtPkg: add XenPlatformHasAcpiDtDxe X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Leif Lindholm , Ard Biesheuvel MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This driver produces the EDKII Platform Has ACPI and Platform Has Device Tree protocols, exactly matching the current ACPI / DT exposure on Xen, according to ARM vs. AARCH64. At this point it differs from the QEMU driver PlatformHasAcpiDtDxe in that this one always installs the DT. Cc: Ard Biesheuvel Cc: Leif Lindholm Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel --- Notes: v4: - drop MdeModulePkg/MdeModulePkg.dec dependency =20 v3: - update package dependencies in INF file according to the GUID relocations in prior patches (replace ArmPkg.dec with EmbeddedPkg.dec and MdeModulePkg.dec) - drop superfluous ArmVirtPkg.dec package dependency - rename gEdkiiPlatformHasAcpiProtocolGuid -> gEdkiiPlatformHasAcpiGuid - rename gEdkiiPlatformHasDeviceTreeProtocolGuid -> gEdkiiPlatformHasDeviceTreeGuid - adapt include paths and INF sections to protocol -> general GUID change - pick up Ard's R-b ArmVirtPkg/XenPlatformHasAcpiDtDxe/XenPlatformHasAcpiDtDxe.inf | 42 ++++++= ++++++ ArmVirtPkg/XenPlatformHasAcpiDtDxe/XenPlatformHasAcpiDtDxe.c | 72 ++++++= ++++++++++++++ 2 files changed, 114 insertions(+) diff --git a/ArmVirtPkg/XenPlatformHasAcpiDtDxe/XenPlatformHasAcpiDtDxe.inf= b/ArmVirtPkg/XenPlatformHasAcpiDtDxe/XenPlatformHasAcpiDtDxe.inf new file mode 100644 index 000000000000..2833075f65c9 --- /dev/null +++ b/ArmVirtPkg/XenPlatformHasAcpiDtDxe/XenPlatformHasAcpiDtDxe.inf @@ -0,0 +1,42 @@ +## @file +# Decide whether the firmware should expose an ACPI- and/or a Device Tree-= based +# hardware description to the operating system. +# +# Copyright (c) 2017, Red Hat, Inc. +# +# This program and the accompanying materials are licensed and made availa= ble +# under the terms and conditions of the BSD License which accompanies this +# distribution. The full text of the license may be found at +# http://opensource.org/licenses/bsd-license.php +# +# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WI= THOUT +# WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +## + +[Defines] + INF_VERSION =3D 1.25 + BASE_NAME =3D XenPlatformHasAcpiDtDxe + FILE_GUID =3D 6914c46f-d46e-48dc-9998-8a5f64f02553 + MODULE_TYPE =3D DXE_DRIVER + VERSION_STRING =3D 1.0 + ENTRY_POINT =3D XenPlatformHasAcpiDt + +[Sources] + XenPlatformHasAcpiDtDxe.c + +[Packages] + EmbeddedPkg/EmbeddedPkg.dec + MdePkg/MdePkg.dec + +[LibraryClasses] + BaseLib + DebugLib + UefiBootServicesTableLib + UefiDriverEntryPoint + +[Guids] + gEdkiiPlatformHasAcpiGuid ## SOMETIMES_PRODUCES ## PROTOCOL + gEdkiiPlatformHasDeviceTreeGuid ## PRODUCES ## PROTOCOL + +[Depex] + TRUE diff --git a/ArmVirtPkg/XenPlatformHasAcpiDtDxe/XenPlatformHasAcpiDtDxe.c b= /ArmVirtPkg/XenPlatformHasAcpiDtDxe/XenPlatformHasAcpiDtDxe.c new file mode 100644 index 000000000000..596f4ea8ddca --- /dev/null +++ b/ArmVirtPkg/XenPlatformHasAcpiDtDxe/XenPlatformHasAcpiDtDxe.c @@ -0,0 +1,72 @@ +/** @file + Decide whether the firmware should expose an ACPI- and/or a Device Tree-= based + hardware description to the operating system. + + Copyright (c) 2017, Red Hat, Inc. + + This program and the accompanying materials are licensed and made availa= ble + under the terms and conditions of the BSD License which accompanies this + distribution. The full text of the license may be found at + http://opensource.org/licenses/bsd-license.php + + THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WI= THOUT + WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. +**/ + +#include +#include +#include +#include +#include + +EFI_STATUS +EFIAPI +XenPlatformHasAcpiDt ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +{ + EFI_STATUS Status; + + // + // If we fail to install any of the necessary protocols below, the OS wi= ll be + // unbootable anyway (due to lacking hardware description), so tolerate = no + // errors here. + // + // Always make ACPI available on 64-bit systems. + // + if (MAX_UINTN =3D=3D MAX_UINT64) { + Status =3D gBS->InstallProtocolInterface ( + &ImageHandle, + &gEdkiiPlatformHasAcpiGuid, + EFI_NATIVE_INTERFACE, + NULL + ); + if (EFI_ERROR (Status)) { + goto Failed; + } + } + + // + // Expose the Device Tree unconditionally. + // + Status =3D gBS->InstallProtocolInterface ( + &ImageHandle, + &gEdkiiPlatformHasDeviceTreeGuid, + EFI_NATIVE_INTERFACE, + NULL + ); + if (EFI_ERROR (Status)) { + goto Failed; + } + + return Status; + +Failed: + ASSERT_EFI_ERROR (Status); + CpuDeadLoop (); + // + // Keep compilers happy. + // + return Status; +} --=20 2.9.3 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Sat May 4 04:36:24 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1490709066472140.82468649036332; Tue, 28 Mar 2017 06:51:06 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id A9ABC200840EB; Tue, 28 Mar 2017 06:50:57 -0700 (PDT) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id CB43821A18AA9 for ; Tue, 28 Mar 2017 06:50:53 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 435794E4C7; Tue, 28 Mar 2017 13:50:53 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-89.phx2.redhat.com [10.3.116.89]) by smtp.corp.redhat.com (Postfix) with ESMTP id 374AA7DB71; Tue, 28 Mar 2017 13:50:52 +0000 (UTC) X-Original-To: edk2-devel@lists.01.org DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 435794E4C7 Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=lersek@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 435794E4C7 From: Laszlo Ersek To: edk2-devel-01 Date: Tue, 28 Mar 2017 15:50:30 +0200 Message-Id: <20170328135033.24238-10-lersek@redhat.com> In-Reply-To: <20170328135033.24238-1-lersek@redhat.com> References: <20170328135033.24238-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 28 Mar 2017 13:50:53 +0000 (UTC) Subject: [edk2] [PATCH v4 09/12] ArmVirtPkg: enable AcpiTableDxe and EFI_ACPI_TABLE_PROTOCOL dynamically X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Leif Lindholm , Ard Biesheuvel MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" In this patch, the ACPI protocol / driver chain is enabled dynamically, when appropriate. This is being done in one larger patch, because ArmVirt.dsc.inc, where AcpiTableDxe is built, is used by all the platform DSCs. No change in behavior should be observable after this patch on any ArmVirtPkg platform. Cc: Ard Biesheuvel Cc: Leif Lindholm Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel --- Notes: v4: - update pathname of plugin lib instance in dsc.inc to EmbeddedPkg - pick up Ard's R-b =20 v3: - don't enable dynamism for 32-bit (ARM) [Ard] ArmVirtPkg/ArmVirt.dsc.inc | 9 ++++++++- ArmVirtPkg/ArmVirtQemu.dsc | 1 + ArmVirtPkg/ArmVirtQemuKernel.dsc | 1 + ArmVirtPkg/ArmVirtXen.dsc | 1 + ArmVirtPkg/ArmVirtXen.fdf | 1 + ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc | 1 + 6 files changed, 13 insertions(+), 1 deletion(-) diff --git a/ArmVirtPkg/ArmVirt.dsc.inc b/ArmVirtPkg/ArmVirt.dsc.inc index f61fd0680612..e74eaf16e7ab 100644 --- a/ArmVirtPkg/ArmVirt.dsc.inc +++ b/ArmVirtPkg/ArmVirt.dsc.inc @@ -443,5 +443,12 @@ [Components.AARCH64] # # ACPI Support # - MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf + MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf { + + NULL|EmbeddedPkg/Library/PlatformHasAcpiLib/PlatformHasAcpiLib.inf + } + + # + # EBC support + # MdeModulePkg/Universal/EbcDxe/EbcDxe.inf diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc index 4b556f309a6c..c2427a6fcea2 100644 --- a/ArmVirtPkg/ArmVirtQemu.dsc +++ b/ArmVirtPkg/ArmVirtQemu.dsc @@ -382,6 +382,7 @@ [Components.AARCH64] # # ACPI Support # + ArmVirtPkg/PlatformHasAcpiDtDxe/PlatformHasAcpiDtDxe.inf MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsRes= ourceTableDxe.inf OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf { diff --git a/ArmVirtPkg/ArmVirtQemuKernel.dsc b/ArmVirtPkg/ArmVirtQemuKerne= l.dsc index 6b6555c889a3..c7317a056c0e 100644 --- a/ArmVirtPkg/ArmVirtQemuKernel.dsc +++ b/ArmVirtPkg/ArmVirtQemuKernel.dsc @@ -371,6 +371,7 @@ [Components.AARCH64] # # ACPI Support # + ArmVirtPkg/PlatformHasAcpiDtDxe/PlatformHasAcpiDtDxe.inf MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsRes= ourceTableDxe.inf OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf { diff --git a/ArmVirtPkg/ArmVirtXen.dsc b/ArmVirtPkg/ArmVirtXen.dsc index 3422d1e5d996..679ca67ffa0f 100644 --- a/ArmVirtPkg/ArmVirtXen.dsc +++ b/ArmVirtPkg/ArmVirtXen.dsc @@ -222,5 +222,6 @@ [Components.common] # ACPI support # !if $(ARCH) =3D=3D AARCH64 + ArmVirtPkg/XenPlatformHasAcpiDtDxe/XenPlatformHasAcpiDtDxe.inf ArmVirtPkg/XenAcpiPlatformDxe/XenAcpiPlatformDxe.inf !endif diff --git a/ArmVirtPkg/ArmVirtXen.fdf b/ArmVirtPkg/ArmVirtXen.fdf index c997251b12b8..aaae9755cd53 100644 --- a/ArmVirtPkg/ArmVirtXen.fdf +++ b/ArmVirtPkg/ArmVirtXen.fdf @@ -184,6 +184,7 @@ [FV.FvMain] # ACPI support # !if $(ARCH) =3D=3D AARCH64 + INF ArmVirtPkg/XenPlatformHasAcpiDtDxe/XenPlatformHasAcpiDtDxe.inf INF MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf INF ArmVirtPkg/XenAcpiPlatformDxe/XenAcpiPlatformDxe.inf =20 diff --git a/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc b/ArmVirtPkg/ArmVirtQemuF= vMain.fdf.inc index cc5d12aaefea..b4381132c864 100644 --- a/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc +++ b/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc @@ -144,6 +144,7 @@ [FV.FvMain] # # ACPI Support # + INF ArmVirtPkg/PlatformHasAcpiDtDxe/PlatformHasAcpiDtDxe.inf INF MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf INF MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphic= sResourceTableDxe.inf INF OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf --=20 2.9.3 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Sat May 4 04:36:24 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1490709069616590.0418332996657; Tue, 28 Mar 2017 06:51:09 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id DBFDD21BC6ADB; Tue, 28 Mar 2017 06:50:57 -0700 (PDT) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 44CCB200840E5 for ; Tue, 28 Mar 2017 06:50:55 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AF2A421731; Tue, 28 Mar 2017 13:50:54 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-89.phx2.redhat.com [10.3.116.89]) by smtp.corp.redhat.com (Postfix) with ESMTP id A02867DB71; Tue, 28 Mar 2017 13:50:53 +0000 (UTC) X-Original-To: edk2-devel@lists.01.org DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com AF2A421731 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=lersek@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com AF2A421731 From: Laszlo Ersek To: edk2-devel-01 Date: Tue, 28 Mar 2017 15:50:31 +0200 Message-Id: <20170328135033.24238-11-lersek@redhat.com> In-Reply-To: <20170328135033.24238-1-lersek@redhat.com> References: <20170328135033.24238-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 28 Mar 2017 13:50:54 +0000 (UTC) Subject: [edk2] [PATCH v4 10/12] ArmVirtPkg/FdtClientDxe: install DT as sysconfig table in protocol notify X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Leif Lindholm , Ard Biesheuvel MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Replace the dependency on PcdPureAcpiBoot with a Platform Has Device Tree notification callback. Move the sysconfig table installation from the entry point function to the callback. Cc: Ard Biesheuvel Cc: Leif Lindholm Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel --- Notes: v3: - replace gEdkiiPlatformHasDeviceTreeProtocolGuid with gEdkiiPlatformHasDeviceTreeGuid - adapt Protocols / Guids sections in INF file - drop now superfluous ArmPkg.dec dependency in INF file - adapt include paths - pick up Ard's R-b ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf | 4 +- ArmVirtPkg/FdtClientDxe/FdtClientDxe.c | 105 ++++++++++++++++++-- 2 files changed, 97 insertions(+), 12 deletions(-) diff --git a/ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf b/ArmVirtPkg/FdtClien= tDxe/FdtClientDxe.inf index 3a0cd37040eb..8a5182a3ce99 100644 --- a/ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf +++ b/ArmVirtPkg/FdtClientDxe/FdtClientDxe.inf @@ -42,11 +42,9 @@ [Protocols] gFdtClientProtocolGuid ## PRODUCES =20 [Guids] + gEdkiiPlatformHasDeviceTreeGuid ## CONSUMES ## PROTOCOL gFdtHobGuid gFdtTableGuid =20 -[FeaturePcd] - gArmVirtTokenSpaceGuid.PcdPureAcpiBoot - [Depex] TRUE diff --git a/ArmVirtPkg/FdtClientDxe/FdtClientDxe.c b/ArmVirtPkg/FdtClientD= xe/FdtClientDxe.c index 547a29fce62c..2d867b16fda8 100644 --- a/ArmVirtPkg/FdtClientDxe/FdtClientDxe.c +++ b/ArmVirtPkg/FdtClientDxe/FdtClientDxe.c @@ -22,6 +22,7 @@ =20 #include #include +#include =20 #include =20 @@ -306,6 +307,40 @@ STATIC FDT_CLIENT_PROTOCOL mFdtClientProtocol =3D { GetOrInsertChosenNode, }; =20 +STATIC +VOID +EFIAPI +OnPlatformHasDeviceTree ( + IN EFI_EVENT Event, + IN VOID *Context + ) +{ + EFI_STATUS Status; + VOID *Interface; + VOID *DeviceTreeBase; + + Status =3D gBS->LocateProtocol ( + &gEdkiiPlatformHasDeviceTreeGuid, + NULL, // Registration + &Interface + ); + if (EFI_ERROR (Status)) { + return; + } + + DeviceTreeBase =3D Context; + DEBUG (( + DEBUG_INFO, + "%a: exposing DTB @ 0x%p to OS\n", + __FUNCTION__, + DeviceTreeBase + )); + Status =3D gBS->InstallConfigurationTable (&gFdtTableGuid, DeviceTreeBas= e); + ASSERT_EFI_ERROR (Status); + + gBS->CloseEvent (Event); +} + EFI_STATUS EFIAPI InitializeFdtClientDxe ( @@ -316,6 +351,8 @@ InitializeFdtClientDxe ( VOID *Hob; VOID *DeviceTreeBase; EFI_STATUS Status; + EFI_EVENT PlatformHasDeviceTreeEvent; + VOID *Registration; =20 Hob =3D GetFirstGuidHob (&gFdtHobGuid); if (Hob =3D=3D NULL || GET_GUID_HOB_DATA_SIZE (Hob) !=3D sizeof (UINT64)= ) { @@ -333,15 +370,65 @@ InitializeFdtClientDxe ( =20 DEBUG ((EFI_D_INFO, "%a: DTB @ 0x%p\n", __FUNCTION__, mDeviceTreeBase)); =20 - if (!FeaturePcdGet (PcdPureAcpiBoot)) { - // - // Only install the FDT as a configuration table if we want to leave i= t up - // to the OS to decide whether it prefers ACPI over DT. - // - Status =3D gBS->InstallConfigurationTable (&gFdtTableGuid, DeviceTreeB= ase); - ASSERT_EFI_ERROR (Status); + // + // Register a protocol notify for the EDKII Platform Has Device Tree + // Protocol. + // + Status =3D gBS->CreateEvent ( + EVT_NOTIFY_SIGNAL, + TPL_CALLBACK, + OnPlatformHasDeviceTree, + DeviceTreeBase, // Context + &PlatformHasDeviceTreeEvent + ); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "%a: CreateEvent(): %r\n", __FUNCTION__, Status)); + return Status; } =20 - return gBS->InstallProtocolInterface (&ImageHandle, &gFdtClientProtocolG= uid, - EFI_NATIVE_INTERFACE, &mFdtClientProtocol); + Status =3D gBS->RegisterProtocolNotify ( + &gEdkiiPlatformHasDeviceTreeGuid, + PlatformHasDeviceTreeEvent, + &Registration + ); + if (EFI_ERROR (Status)) { + DEBUG (( + DEBUG_ERROR, + "%a: RegisterProtocolNotify(): %r\n", + __FUNCTION__, + Status + )); + goto CloseEvent; + } + + // + // Kick the event; the protocol could be available already. + // + Status =3D gBS->SignalEvent (PlatformHasDeviceTreeEvent); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "%a: SignalEvent(): %r\n", __FUNCTION__, Status)); + goto CloseEvent; + } + + Status =3D gBS->InstallProtocolInterface ( + &ImageHandle, + &gFdtClientProtocolGuid, + EFI_NATIVE_INTERFACE, + &mFdtClientProtocol + ); + if (EFI_ERROR (Status)) { + DEBUG (( + DEBUG_ERROR, + "%a: InstallProtocolInterface(): %r\n", + __FUNCTION__, + Status + )); + goto CloseEvent; + } + + return Status; + +CloseEvent: + gBS->CloseEvent (PlatformHasDeviceTreeEvent); + return Status; } --=20 2.9.3 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Sat May 4 04:36:24 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1490709072673334.3801434288712; Tue, 28 Mar 2017 06:51:12 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 16F0421DFA91E; Tue, 28 Mar 2017 06:50:58 -0700 (PDT) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id ABA8D200840DC for ; Tue, 28 Mar 2017 06:50:56 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 2501E4DD5F; Tue, 28 Mar 2017 13:50:56 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-89.phx2.redhat.com [10.3.116.89]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1552F7DB71; Tue, 28 Mar 2017 13:50:54 +0000 (UTC) X-Original-To: edk2-devel@lists.01.org DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 2501E4DD5F Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=lersek@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 2501E4DD5F From: Laszlo Ersek To: edk2-devel-01 Date: Tue, 28 Mar 2017 15:50:32 +0200 Message-Id: <20170328135033.24238-12-lersek@redhat.com> In-Reply-To: <20170328135033.24238-1-lersek@redhat.com> References: <20170328135033.24238-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 28 Mar 2017 13:50:56 +0000 (UTC) Subject: [edk2] [PATCH v4 11/12] ArmVirtPkg/PlatformHasAcpiDtDxe: don't expose DT if QEMU provides ACPI X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Leif Lindholm , Ard Biesheuvel MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" This will let QEMU's "-no-acpi" option exclusively expose DT vs. ACPI to the guest. Showing both is never needed (it is actually detrimental to the adoption of standards, such as SBSA / SBBR). * Without "-no-acpi", the firmware logs (from PlatformHasAcpiDtDxe) > Found FwCfg @ 0x9020008/0x9020000 > Found FwCfg DMA @ 0x9020010 > InstallProtocolInterface: [EdkiiPlatformHasAcpi] 0 plus the usual messages. Later the guest kernel logs > [ 0.000000] efi: SMBIOS 3.0=3D0x13bdb0000 ACPI 2.0=3D0x138440000 > MEMATTR=3D0x13a675018 before it lists the ACPI tables one by one. In addition, in the guest, the "/sys/firmware/devicetree/*" shell pattern matches no files, while the "/sys/firmware/acpi/tables/*" pattern matches the ACPI tables. * With "-no-acpi", the firmware logs: > PlatformHasAcpiDtDxe | Found FwCfg @ 0x9020008/0x9020000 > PlatformHasAcpiDtDxe | Found FwCfg DMA @ 0x9020010 > PlatformHasAcpiDtDxe | InstallProtocolInterface: > PlatformHasAcpiDtDxe | [EdkiiPlatformHasDeviceTree] 0 > FdtClientDxe | OnPlatformHasDeviceTree: exposing DTB @ > FdtClientDxe | 0x13FFBF000 to OS > ... > DXE_CORE | Driver [AcpiTableDxe] was discovered but not > DXE_CORE | loaded!! > DXE_CORE | Driver [QemuFwCfgAcpiPlatform] was discovered but > DXE_CORE | not loaded!! > ... > RamDiskDxe | RamDiskAcpiCheck: Cannot locate the EFI ACPI > RamDiskDxe | Table Protocol, unable to publish RAM disks to > RamDiskDxe | NFIT. (BootGraphicsResourceTableDxe's ReadyToBoot callback -- InstallBootGraphicsResourceTable() -- handles the lack of EFI_ACPI_TABLE_PROTOCOL silently.) Later the guest kernel logs > [ 0.000000] efi: SMBIOS 3.0=3D0x13bdb0000 MEMATTR=3D0x138caa018 In addition, in the guest, the "/sys/firmware/devicetree/*" shell pattern matches the directory "/sys/firmware/devicetree/base", which contains a large number of DT nodes, while the "/sys/firmware/acpi/tables/*" pattern matches no files. Cc: Ard Biesheuvel Cc: Leif Lindholm Ref: https://bugzilla.redhat.com/show_bug.cgi?id=3D1430262 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel --- Notes: v3: - pick up MEMATTR log from repeated testing with Fedora guest (ACPI case) [Ard] - extend the commit message with "/sys/firmware/devicetree/*" and "/sys/firmware/acpi/tables/*" pattern matching in the guest - drop ArmVirtPkg.dec package dependency -- with the removal of the "pure ACPI boot" PCD dependency, ArmVirtPkg.dec actually becomes superfluous - adapt patch to protocol -> generic GUID renaming - pick up Ard's R-b ArmVirtPkg/PlatformHasAcpiDtDxe/PlatformHasAcpiDtDxe.inf | 7 +-- ArmVirtPkg/PlatformHasAcpiDtDxe/PlatformHasAcpiDtDxe.c | 45 ++++++++++++= -------- 2 files changed, 29 insertions(+), 23 deletions(-) diff --git a/ArmVirtPkg/PlatformHasAcpiDtDxe/PlatformHasAcpiDtDxe.inf b/Arm= VirtPkg/PlatformHasAcpiDtDxe/PlatformHasAcpiDtDxe.inf index 2450500b3f0e..4466bead57c2 100644 --- a/ArmVirtPkg/PlatformHasAcpiDtDxe/PlatformHasAcpiDtDxe.inf +++ b/ArmVirtPkg/PlatformHasAcpiDtDxe/PlatformHasAcpiDtDxe.inf @@ -25,14 +25,14 @@ [Sources] PlatformHasAcpiDtDxe.c =20 [Packages] - ArmVirtPkg/ArmVirtPkg.dec EmbeddedPkg/EmbeddedPkg.dec MdePkg/MdePkg.dec + OvmfPkg/OvmfPkg.dec =20 [LibraryClasses] BaseLib DebugLib - PcdLib + QemuFwCfgLib UefiBootServicesTableLib UefiDriverEntryPoint =20 @@ -40,8 +40,5 @@ [Guids] gEdkiiPlatformHasAcpiGuid ## SOMETIMES_PRODUCES ## PROTOCOL gEdkiiPlatformHasDeviceTreeGuid ## SOMETIMES_PRODUCES ## PROTOCOL =20 -[FeaturePcd] - gArmVirtTokenSpaceGuid.PcdPureAcpiBoot ## CONSUMES - [Depex] TRUE diff --git a/ArmVirtPkg/PlatformHasAcpiDtDxe/PlatformHasAcpiDtDxe.c b/ArmVi= rtPkg/PlatformHasAcpiDtDxe/PlatformHasAcpiDtDxe.c index a718ce1b5a7b..8932dacabec5 100644 --- a/ArmVirtPkg/PlatformHasAcpiDtDxe/PlatformHasAcpiDtDxe.c +++ b/ArmVirtPkg/PlatformHasAcpiDtDxe/PlatformHasAcpiDtDxe.c @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include =20 EFI_STATUS @@ -27,18 +27,27 @@ PlatformHasAcpiDt ( IN EFI_SYSTEM_TABLE *SystemTable ) { - EFI_STATUS Status; - - Status =3D EFI_SUCCESS; + EFI_STATUS Status; + FIRMWARE_CONFIG_ITEM FwCfgItem; + UINTN FwCfgSize; =20 // // If we fail to install any of the necessary protocols below, the OS wi= ll be // unbootable anyway (due to lacking hardware description), so tolerate = no // errors here. // - // Always make ACPI available on 64-bit systems. - // - if (MAX_UINTN =3D=3D MAX_UINT64) { + if (MAX_UINTN =3D=3D MAX_UINT64 && + !EFI_ERROR ( + QemuFwCfgFindFile ( + "etc/table-loader", + &FwCfgItem, + &FwCfgSize + ) + )) { + // + // Only make ACPI available on 64-bit systems, and only if QEMU genera= tes + // (a subset of) the ACPI tables. + // Status =3D gBS->InstallProtocolInterface ( &ImageHandle, &gEdkiiPlatformHasAcpiGuid, @@ -48,21 +57,21 @@ PlatformHasAcpiDt ( if (EFI_ERROR (Status)) { goto Failed; } + + return Status; } =20 // - // Expose the Device Tree unless PcdPureAcpiBoot is set. + // Expose the Device Tree otherwise. // - if (!FeaturePcdGet (PcdPureAcpiBoot)) { - Status =3D gBS->InstallProtocolInterface ( - &ImageHandle, - &gEdkiiPlatformHasDeviceTreeGuid, - EFI_NATIVE_INTERFACE, - NULL - ); - if (EFI_ERROR (Status)) { - goto Failed; - } + Status =3D gBS->InstallProtocolInterface ( + &ImageHandle, + &gEdkiiPlatformHasDeviceTreeGuid, + EFI_NATIVE_INTERFACE, + NULL + ); + if (EFI_ERROR (Status)) { + goto Failed; } =20 return Status; --=20 2.9.3 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Sat May 4 04:36:24 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1490709077152651.2886698327101; Tue, 28 Mar 2017 06:51:17 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 66418200840F8; Tue, 28 Mar 2017 06:51:02 -0700 (PDT) Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 1C213200840F8 for ; Tue, 28 Mar 2017 06:50:58 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 8D1CA104D8; Tue, 28 Mar 2017 13:50:57 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-116-89.phx2.redhat.com [10.3.116.89]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7F8CD17D9F; Tue, 28 Mar 2017 13:50:56 +0000 (UTC) X-Original-To: edk2-devel@lists.01.org DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 8D1CA104D8 Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=lersek@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 8D1CA104D8 From: Laszlo Ersek To: edk2-devel-01 Date: Tue, 28 Mar 2017 15:50:33 +0200 Message-Id: <20170328135033.24238-13-lersek@redhat.com> In-Reply-To: <20170328135033.24238-1-lersek@redhat.com> References: <20170328135033.24238-1-lersek@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 28 Mar 2017 13:50:57 +0000 (UTC) Subject: [edk2] [PATCH v4 12/12] ArmVirtPkg: remove PURE_ACPI_BOOT_ENABLE and PcdPureAcpiBoot X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Leif Lindholm , Ard Biesheuvel MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" The build flag and the FeaturePCD have no effect any longer, remove them. Cc: Ard Biesheuvel Cc: Leif Lindholm Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek Reviewed-by: Ard Biesheuvel --- Notes: v3: - pick up Ard's R-b ArmVirtPkg/ArmVirtPkg.dec | 10 ---------- ArmVirtPkg/ArmVirtQemu.dsc | 5 ----- 2 files changed, 15 deletions(-) diff --git a/ArmVirtPkg/ArmVirtPkg.dec b/ArmVirtPkg/ArmVirtPkg.dec index a5ec42166445..efe83a383d55 100644 --- a/ArmVirtPkg/ArmVirtPkg.dec +++ b/ArmVirtPkg/ArmVirtPkg.dec @@ -58,13 +58,3 @@ [PcdsFixedAtBuild, PcdsPatchableInModule] # EFI_VT_100_GUID. # gArmVirtTokenSpaceGuid.PcdTerminalTypeGuidBuffer|{0x65, 0x60, 0xA6, 0xDF= , 0x19, 0xB4, 0xD3, 0x11, 0x9A, 0x2D, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D}|V= OID*|0x00000007 - -[PcdsFeatureFlag] - # - # Pure ACPI boot - # - # Inhibit installation of the FDT as a configuration table if this featu= re - # PCD is TRUE. Otherwise, the OS is presented with both a DT and an ACPI - # description of the platform, and it is up to the OS to choose. - # - gArmVirtTokenSpaceGuid.PcdPureAcpiBoot|FALSE|BOOLEAN|0x0000000a diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc index c2427a6fcea2..4075b92aa2cb 100644 --- a/ArmVirtPkg/ArmVirtQemu.dsc +++ b/ArmVirtPkg/ArmVirtQemu.dsc @@ -34,7 +34,6 @@ [Defines] # -D FLAG=3DVALUE # DEFINE SECURE_BOOT_ENABLE =3D FALSE - DEFINE PURE_ACPI_BOOT_ENABLE =3D FALSE =20 !include ArmVirtPkg/ArmVirt.dsc.inc =20 @@ -95,10 +94,6 @@ [PcdsFeatureFlag.common] gEfiMdeModulePkgTokenSpaceGuid.PcdConOutGopSupport|TRUE gEfiMdeModulePkgTokenSpaceGuid.PcdConOutUgaSupport|FALSE =20 -!if $(PURE_ACPI_BOOT_ENABLE) =3D=3D TRUE - gArmVirtTokenSpaceGuid.PcdPureAcpiBoot|TRUE -!endif - [PcdsFixedAtBuild.common] gArmPlatformTokenSpaceGuid.PcdCoreCount|1 !if $(ARCH) =3D=3D AARCH64 --=20 2.9.3 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel