From nobody Sun Feb 8 22:18:19 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+112766+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+112766+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1703091723; cv=none; d=zohomail.com; s=zohoarc; b=dKHaxDfuQlxPmo3Z2ixRLuGJTHX+xvyXK+Afh2p56nXvcARjwq4WNW6Rcg5/anpNZ86fTwlKkpq2NjOab6BrQqmyuXei9c+Rf20NUX2SU0A5uWbS6SggyAnTdlgaDyuxTtJcvKA3mkg5V3eH+6uCD2YKj3oCcAuYj56H1MHLwFY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1703091723; h=Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Reply-To:References:Sender:Subject:Subject:To:To:Message-Id; bh=mjMa98O/mGQTURSRXy9fGLnxv9nFMyoaNfpOBSeV76Y=; b=fdNJ6WFcHOqcpcw2/VzaTYzN2cw5f7dX2MdM8GCPAQrnUylnsR11AeAWB/V6EFJKujVqxck9q+GGQ2pzrzE95zdhfa7iuJaxvmk8V2jUf3ni9mV9AlasTBEUEKt1Cnc2bC8ewO3gFSkfnulgGb5Ph2JO4EHt1j0qaBG/FhGIt7s= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+112766+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1703091723535906.2955266151512; Wed, 20 Dec 2023 09:02:03 -0800 (PST) Return-Path: DKIM-Signature: a=rsa-sha256; bh=WlPe55ETC72uzfwqPkNKxTYBJBSfOINt8Egkh5CV2+k=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20140610; t=1703091723; v=1; b=iDNIZsYaDe8zaU8599BZpKbSketIB8RSFF8qi7EcUpOJXmlMM7IBwa3xbZZ1Nktt8OyAjsGz R3erwvilXUxweGyHYWSiuVAvKpyZo4GvScy8n0hNPbovACDXXtWkip2u5SLDn1QNMzwdAWPFJ34 Ck3VdNEGLYu+y8TSfzKnFSlc= X-Received: by 127.0.0.2 with SMTP id XLZXYY1788612xpthVcEAjYj; Wed, 20 Dec 2023 09:02:03 -0800 X-Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.11]) by mx.groups.io with SMTP id smtpd.web10.26890.1703091715141496173 for ; Wed, 20 Dec 2023 09:02:02 -0800 X-IronPort-AV: E=McAfee;i="6600,9927,10930"; a="2671099" X-IronPort-AV: E=Sophos;i="6.04,291,1695711600"; d="scan'208";a="2671099" X-Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmvoesa105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Dec 2023 09:02:03 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10930"; a="920029690" X-IronPort-AV: E=Sophos;i="6.04,291,1695711600"; d="scan'208";a="920029690" X-Received: from shpfwdbuild003.ccr.corp.intel.com ([10.239.56.82]) by fmsmga001.fm.intel.com with ESMTP; 20 Dec 2023 09:02:00 -0800 From: "Xu, Wei6" To: devel@edk2.groups.io Cc: Wei6 Xu , Abner Chang , Nate DeSimone Subject: [edk2-devel] [PATCH edk2-platforms 2/4] IpmiFeaturePkg/BmcAcpiSwChild: Support Standalone MM Date: Thu, 21 Dec 2023 01:01:43 +0800 Message-Id: In-Reply-To: References: MIME-Version: 1.0 Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,wei6.xu@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: baCE33cb271v3VlNFJAw6f0Vx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1703091725088100002 Content-Type: text/plain; charset="utf-8" Refactor BmcAcpiSwChild to support Standalone MM. Cc: Abner Chang Cc: Nate DeSimone Signed-off-by: Wei6 Xu --- .../BmcAcpiSwChild/BmcAcpiSwChild.c | 12 ++---- .../BmcAcpiSwChild/BmcAcpiSwChild.h | 15 ++----- .../BmcAcpiSwChild/BmcAcpiSwChild.inf | 5 ++- .../BmcAcpiSwChildStandaloneMm.c | 31 ++++++++++++++ .../BmcAcpiSwChildStandaloneMm.inf | 40 +++++++++++++++++++ .../BmcAcpiSwChildTraditionalMm.c | 31 ++++++++++++++ .../IpmiFeaturePkg/Include/IpmiFeature.dsc | 1 + 7 files changed, 113 insertions(+), 22 deletions(-) create mode 100644 Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcAc= piSwChild/BmcAcpiSwChildStandaloneMm.c create mode 100644 Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcAc= piSwChild/BmcAcpiSwChildStandaloneMm.inf create mode 100644 Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcAc= piSwChild/BmcAcpiSwChildTraditionalMm.c diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcAcpiSwChi= ld/BmcAcpiSwChild.c b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Bmc= AcpiSwChild/BmcAcpiSwChild.c index ba134db8d50d..2a058fe687f9 100644 --- a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcAcpiSwChild/BmcA= cpiSwChild.c +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcAcpiSwChild/BmcA= cpiSwChild.c @@ -15,21 +15,15 @@ SPDX-License-Identifier: BSD-2-Clause-Patent EFI_BMC_ACPI_SW_CHILD_POLICY_PROTOCOL mBmcAcpiSwChild; =20 /** - This is the standard EFI driver entrypoint. This function initializes - the BMC ACPI SW Child protocol. - - @param ImageHandle - ImageHandle of the loaded driver - @param SystemTable - Pointer to the System Table + This function initializes the BMC ACPI SW Child protocol. =20 @retval EFI_SUCCESS - If all services discovered. @retval Other - Failure in constructor. =20 **/ EFI_STATUS -EFIAPI InitializeBmcAcpiSwChild ( - IN EFI_HANDLE ImageHandle, - IN EFI_SYSTEM_TABLE *SystemTable + VOID ) { EFI_STATUS Status; @@ -43,7 +37,7 @@ InitializeBmcAcpiSwChild ( // Install protocol // Handle =3D NULL; - Status =3D gSmst->SmmInstallProtocolInterface ( + Status =3D gMmst->MmInstallProtocolInterface ( &Handle, &gEfiBmcAcpiSwChildPolicyProtocolGuid, EFI_NATIVE_INTERFACE, diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcAcpiSwChi= ld/BmcAcpiSwChild.h b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Bmc= AcpiSwChild/BmcAcpiSwChild.h index 10d687ed2b84..7eb839483879 100644 --- a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcAcpiSwChild/BmcA= cpiSwChild.h +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcAcpiSwChild/BmcA= cpiSwChild.h @@ -12,12 +12,11 @@ SPDX-License-Identifier: BSD-2-Clause-Patent // // Statements that include other files // -#include +#include #include -#include #include #include -#include +#include #include =20 #include "ServerManagement.h" @@ -33,21 +32,15 @@ SPDX-License-Identifier: BSD-2-Clause-Patent // =20 /** - This is the standard EFI driver entrypoint. This function initializes - the BMC ACPI SW Child protocol. - - @param ImageHandle - ImageHandle of the loaded driver - @param SystemTable - Pointer to the System Table + This function initializes the BMC ACPI SW Child protocol. =20 @retval EFI_SUCCESS - If all services discovered. @retval Other - Failure in constructor. =20 **/ EFI_STATUS -EFIAPI InitializeBmcAcpiSwChild ( - IN EFI_HANDLE ImageHandle, - IN EFI_SYSTEM_TABLE *SystemTable + VOID ); =20 /** diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcAcpiSwChi= ld/BmcAcpiSwChild.inf b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/B= mcAcpiSwChild/BmcAcpiSwChild.inf index 59a9f77d9f10..c2de4a1c82a9 100644 --- a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcAcpiSwChild/BmcA= cpiSwChild.inf +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcAcpiSwChild/BmcA= cpiSwChild.inf @@ -14,11 +14,12 @@ MODULE_TYPE =3D DXE_SMM_DRIVER PI_SPECIFICATION_VERSION =3D 0x0001000A VERSION_STRING =3D 1.0 - ENTRY_POINT =3D InitializeBmcAcpiSwChild + ENTRY_POINT =3D BmcAcpiSwChildSmmEntry =20 [Sources] BmcAcpiSwChild.c BmcAcpiSwChild.h + BmcAcpiSwChildTraditionalMm.c =20 [Packages] IpmiFeaturePkg/IpmiFeaturePkg.dec @@ -28,7 +29,7 @@ [LibraryClasses] UefiDriverEntryPoint DebugLib - SmmServicesTableLib + MmServicesTableLib ServerManagementLib IpmiBaseLib =20 diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcAcpiSwChi= ld/BmcAcpiSwChildStandaloneMm.c b/Features/Intel/OutOfBandManagement/IpmiFe= aturePkg/BmcAcpiSwChild/BmcAcpiSwChildStandaloneMm.c new file mode 100644 index 000000000000..f302f9976565 --- /dev/null +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcAcpiSwChild/BmcA= cpiSwChildStandaloneMm.c @@ -0,0 +1,31 @@ +/** @file + This driver publishes a protocol that is used by the ACPI SMM Platform + driver to notify the BMC of Power State transitions. + +Copyright (c) 2023, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include "BmcAcpiSwChild.h" + +/** + This is the Stanalone MM driver entrypoint. This function intitializes + the BMC ACPI SW Child protocol. + + @param[in] ImageHandle ImageHandle of the loaded driver + @param[in] SystemTable Pointer to the System Table + + @retval EFI_SUCCESS If all services discovered. + @retval Other Failure in constructor. + +**/ +EFI_STATUS +EFIAPI +BmcAcpiSwChildMmEntry ( + IN EFI_HANDLE ImageHandle, + IN EFI_MM_SYSTEM_TABLE *SystemTable + ) +{ + return InitializeBmcAcpiSwChild (); +} diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcAcpiSwChi= ld/BmcAcpiSwChildStandaloneMm.inf b/Features/Intel/OutOfBandManagement/Ipmi= FeaturePkg/BmcAcpiSwChild/BmcAcpiSwChildStandaloneMm.inf new file mode 100644 index 000000000000..cf8a715bd9e4 --- /dev/null +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcAcpiSwChild/BmcA= cpiSwChildStandaloneMm.inf @@ -0,0 +1,40 @@ +### @file +# +# Copyright (c) 2023, Intel Corporation. All rights reserved.
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +### + + +[Defines] + INF_VERSION =3D 0x00010005 + BASE_NAME =3D BmcAcpiSwChild + FILE_GUID =3D 81657b09-61ea-4f4a-ac6a-9f7f4cdd7450 + MODULE_TYPE =3D MM_STANDALONE + PI_SPECIFICATION_VERSION =3D 0x00010032 + VERSION_STRING =3D 1.0 + ENTRY_POINT =3D BmcAcpiSwChildMmEntry + +[Sources] + BmcAcpiSwChild.c + BmcAcpiSwChild.h + BmcAcpiSwChildStandaloneMm.c + +[Packages] + IpmiFeaturePkg/IpmiFeaturePkg.dec + MdePkg/MdePkg.dec + MdeModulePkg/MdeModulePkg.dec + +[LibraryClasses] + StandaloneMmDriverEntryPoint + DebugLib + MmServicesTableLib + ServerManagementLib + IpmiBaseLib + +[Protocols] + gEfiBmcAcpiSwChildPolicyProtocolGuid # PROTOCOL ALWAYS_PRODUCED + +[Depex] + gSmmIpmiTransportProtocolGuid diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcAcpiSwChi= ld/BmcAcpiSwChildTraditionalMm.c b/Features/Intel/OutOfBandManagement/IpmiF= eaturePkg/BmcAcpiSwChild/BmcAcpiSwChildTraditionalMm.c new file mode 100644 index 000000000000..f1acee932214 --- /dev/null +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcAcpiSwChild/BmcA= cpiSwChildTraditionalMm.c @@ -0,0 +1,31 @@ +/** @file + This driver publishes a protocol that is used by the ACPI SMM Platform + driver to notify the BMC of Power State transitions. + +Copyright (c) 2023, Intel Corporation. All rights reserved.
+SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include "BmcAcpiSwChild.h" + +/** + This is the standard EFI driver entrypoint. This function intitializes + the BMC ACPI SW Child protocol. + + @param[in] ImageHandle ImageHandle of the loaded driver + @param[in] SystemTable Pointer to the System Table + + @retval EFI_SUCCESS If all services discovered. + @retval Other Failure in constructor. + +**/ +EFI_STATUS +EFIAPI +BmcAcpiSwChildSmmEntry ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +{ + return InitializeBmcAcpiSwChild (); +} diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/Ipmi= Feature.dsc b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/Ipm= iFeature.dsc index 45439f92eaac..1192c6e9739c 100644 --- a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/IpmiFeature= .dsc +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/IpmiFeature= .dsc @@ -127,6 +127,7 @@ IpmiFeaturePkg/BmcAcpi/BmcAcpi.inf IpmiFeaturePkg/BmcAcpiState/BmcAcpiState.inf IpmiFeaturePkg/BmcAcpiSwChild/BmcAcpiSwChild.inf + IpmiFeaturePkg/BmcAcpiSwChild/BmcAcpiSwChildStandaloneMm.inf IpmiFeaturePkg/BmcElog/DxeBmcElog.inf IpmiFeaturePkg/BmcElog/SmmBmcElog.inf IpmiFeaturePkg/GenericElog/Dxe/GenericElog.inf --=20 2.29.2.windows.2 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#112766): https://edk2.groups.io/g/devel/message/112766 Mute This Topic: https://groups.io/mt/103284562/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-