From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 784E47803D8 for ; Wed, 20 Dec 2023 17:02:04 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=sYulG7Eu5AureRhyQNbk6DcwoI8BMBtt71HZM4R6m88=; 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=Stk5F9N16gD8qCdLUfAdb9dnqc/WrjWqWyPsIPC+jPCzlXmNhv4d3N2ROUZO6m3ELZC4Pi36 SwnSoYhwUdqWLzOuRLC/VszBjGlsR/JJ8dzCcwVWxq01amqBRTtbY5ERNYKe/OaxLhAlWHmHVfG mc7mG6/lozdozTgaMrV+nMNo= X-Received: by 127.0.0.2 with SMTP id HD3PYY7687511xWxtjYJGdWi; 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: PlLKApmCVFOix20uKWb8whwZx7686176AA= Content-Transfer-Encoding: 8bit X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b=Stk5F9N1; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io 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/BmcAcpiSwChild/BmcAcpiSwChildStandaloneMm.c create mode 100644 Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcAcpiSwChild/BmcAcpiSwChildStandaloneMm.inf create mode 100644 Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcAcpiSwChild/BmcAcpiSwChildTraditionalMm.c diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcAcpiSwChild/BmcAcpiSwChild.c b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcAcpiSwChild/BmcAcpiSwChild.c index ba134db8d50d..2a058fe687f9 100644 --- a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcAcpiSwChild/BmcAcpiSwChild.c +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcAcpiSwChild/BmcAcpiSwChild.c @@ -15,21 +15,15 @@ SPDX-License-Identifier: BSD-2-Clause-Patent EFI_BMC_ACPI_SW_CHILD_POLICY_PROTOCOL mBmcAcpiSwChild; /** - 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. @retval EFI_SUCCESS - If all services discovered. @retval Other - Failure in constructor. **/ 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 = NULL; - Status = gSmst->SmmInstallProtocolInterface ( + Status = gMmst->MmInstallProtocolInterface ( &Handle, &gEfiBmcAcpiSwChildPolicyProtocolGuid, EFI_NATIVE_INTERFACE, diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcAcpiSwChild/BmcAcpiSwChild.h b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcAcpiSwChild/BmcAcpiSwChild.h index 10d687ed2b84..7eb839483879 100644 --- a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcAcpiSwChild/BmcAcpiSwChild.h +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcAcpiSwChild/BmcAcpiSwChild.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 #include "ServerManagement.h" @@ -33,21 +32,15 @@ SPDX-License-Identifier: BSD-2-Clause-Patent // /** - 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. @retval EFI_SUCCESS - If all services discovered. @retval Other - Failure in constructor. **/ EFI_STATUS -EFIAPI InitializeBmcAcpiSwChild ( - IN EFI_HANDLE ImageHandle, - IN EFI_SYSTEM_TABLE *SystemTable + VOID ); /** diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcAcpiSwChild/BmcAcpiSwChild.inf b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcAcpiSwChild/BmcAcpiSwChild.inf index 59a9f77d9f10..c2de4a1c82a9 100644 --- a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcAcpiSwChild/BmcAcpiSwChild.inf +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcAcpiSwChild/BmcAcpiSwChild.inf @@ -14,11 +14,12 @@ MODULE_TYPE = DXE_SMM_DRIVER PI_SPECIFICATION_VERSION = 0x0001000A VERSION_STRING = 1.0 - ENTRY_POINT = InitializeBmcAcpiSwChild + ENTRY_POINT = BmcAcpiSwChildSmmEntry [Sources] BmcAcpiSwChild.c BmcAcpiSwChild.h + BmcAcpiSwChildTraditionalMm.c [Packages] IpmiFeaturePkg/IpmiFeaturePkg.dec @@ -28,7 +29,7 @@ [LibraryClasses] UefiDriverEntryPoint DebugLib - SmmServicesTableLib + MmServicesTableLib ServerManagementLib IpmiBaseLib diff --git a/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcAcpiSwChild/BmcAcpiSwChildStandaloneMm.c b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcAcpiSwChild/BmcAcpiSwChildStandaloneMm.c new file mode 100644 index 000000000000..f302f9976565 --- /dev/null +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcAcpiSwChild/BmcAcpiSwChildStandaloneMm.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/BmcAcpiSwChild/BmcAcpiSwChildStandaloneMm.inf b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcAcpiSwChild/BmcAcpiSwChildStandaloneMm.inf new file mode 100644 index 000000000000..cf8a715bd9e4 --- /dev/null +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcAcpiSwChild/BmcAcpiSwChildStandaloneMm.inf @@ -0,0 +1,40 @@ +### @file +# +# Copyright (c) 2023, Intel Corporation. All rights reserved.
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +### + + +[Defines] + INF_VERSION = 0x00010005 + BASE_NAME = BmcAcpiSwChild + FILE_GUID = 81657b09-61ea-4f4a-ac6a-9f7f4cdd7450 + MODULE_TYPE = MM_STANDALONE + PI_SPECIFICATION_VERSION = 0x00010032 + VERSION_STRING = 1.0 + ENTRY_POINT = 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/BmcAcpiSwChild/BmcAcpiSwChildTraditionalMm.c b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcAcpiSwChild/BmcAcpiSwChildTraditionalMm.c new file mode 100644 index 000000000000..f1acee932214 --- /dev/null +++ b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/BmcAcpiSwChild/BmcAcpiSwChildTraditionalMm.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/IpmiFeature.dsc b/Features/Intel/OutOfBandManagement/IpmiFeaturePkg/Include/IpmiFeature.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 -- 2.29.2.windows.2 -=-=-=-=-=-=-=-=-=-=-=- 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/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-