From 69524784bf9c19494de62b8eef4db7975a5db438 Mon Sep 17 00:00:00 2001 From: Marc Chen Date: Tue, 12 Nov 2024 17:57:33 +0800 Subject: [PATCH 1/9] Implement StandaloneMmGenericIpmi driver --- .../StandaloneMm/StandaloneMmGenericIpmi.c | 115 ++++++++++++++++++ .../StandaloneMm/StandaloneMmGenericIpmi.inf | 59 +++++++++ 2 files changed, 174 insertions(+) create mode 100644 IpmiFeaturePkg/GenericIpmi/StandaloneMm/StandaloneMmGenericIpmi.c create mode 100644 IpmiFeaturePkg/GenericIpmi/StandaloneMm/StandaloneMmGenericIpmi.inf diff --git a/IpmiFeaturePkg/GenericIpmi/StandaloneMm/StandaloneMmGenericIpmi.c b/IpmiFeaturePkg/GenericIpmi/StandaloneMm/StandaloneMmGenericIpmi.c new file mode 100644 index 0000000..d3775a4 --- /dev/null +++ b/IpmiFeaturePkg/GenericIpmi/StandaloneMm/StandaloneMmGenericIpmi.c @@ -0,0 +1,115 @@ +/** @file + Generic Standalone MM IPMI stack driver + + @copyright + Copyright 1999 - 2021 Intel Corporation.
+ Copyright (c) Microsoft Corporation. + SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +// +// Statements that include other files +// +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#include + +IPMI_BMC_INSTANCE_DATA *mIpmiInstance; +EFI_HANDLE mImageHandle; + +/** + Setup and initialize the BMC for the Standalone MM phase. In order to verify the BMC is functioning + as expected, the BMC Selftest is performed. The results are then checked and any errors are + reported to the error manager. Errors are collected throughout this routine and reported + just prior to installing the driver. If there are more errors than MAX_SOFT_COUNT, then they + will be ignored. + + @param[in] ImageHandle A handle to driver image. + @param[in] SystemTable A pointer to system table. + + @retval EFI_SUCCESS Successful driver initialization. +**/ +EFI_STATUS +EFIAPI +InitializeStandaloneMmGenericIpmi ( + IN EFI_HANDLE ImageHandle, + IN EFI_MM_SYSTEM_TABLE *SystemTable + ) +{ + EFI_STATUS Status; + EFI_HANDLE Handle; + IPMI_BMC_HOB *BmcHob; + EFI_HOB_GUID_TYPE *GuidHob; + + DEBUG ((DEBUG_INFO, "InitializeStandaloneMmGenericIpmi entry\n")); + mImageHandle = ImageHandle; + + mIpmiInstance = AllocateZeroPool (sizeof (IPMI_BMC_INSTANCE_DATA)); + ASSERT (mIpmiInstance != NULL); + if (mIpmiInstance == NULL) { + DEBUG ((EFI_D_ERROR, "ERROR!! Null Pointer returned by AllocateZeroPool ()\n")); + ASSERT_EFI_ERROR (EFI_OUT_OF_RESOURCES); + return EFI_OUT_OF_RESOURCES; + } + + // + // Initialize the KCS transaction timeout. Assume delay unit is 1000 us. + // + mIpmiInstance->IpmiTimeoutPeriod = + (PcdGet8 (PcdIpmiCommandTimeoutSeconds) * 1000 * 1000) / IPMI_DELAY_UNIT; + + // + // Initialize IPMI IO Base, we still use SMS IO base to get device ID and + // Self-test result since MM IF may have different cmds supported. + // + + mIpmiInstance->Signature = SM_IPMI_BMC_SIGNATURE; + mIpmiInstance->SlaveAddress = BMC_SLAVE_ADDRESS; + mIpmiInstance->BmcStatus = BMC_NOTREADY; + mIpmiInstance->IpmiTransport.IpmiSubmitCommand = IpmiSendCommand; + mIpmiInstance->IpmiTransport.GetBmcStatus = IpmiGetBmcStatus; + + // + // Check if PEI already initialized the BMC connection. + // + + GuidHob = GetFirstGuidHob (&gIpmiBmcHobGuid); + if (GuidHob == NULL) { + // + // PEI did not create a BMC HOB, initialize the BMC now. + // + + Status = IpmiInitializeBmc (mIpmiInstance); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "[IPMI] Failed to initialize BMC. %r\n", Status)); + return Status; + } + } else { + BmcHob = (IPMI_BMC_HOB *)GET_GUID_HOB_DATA (GuidHob); + mIpmiInstance->BmcStatus = BmcHob->BmcStatus; + DEBUG ((DEBUG_INFO, "[IPMI] Found IPMI BMC HOB. BMC Status = 0x%d\n", BmcHob->BmcStatus)); + } + + Handle = NULL; + DEBUG ((DEBUG_INFO, "[IPMI] Installing MM protocol!\n")); + Status = gMmst->MmInstallProtocolInterface ( + &Handle, + &gSmmIpmiTransportProtocolGuid, + EFI_NATIVE_INTERFACE, + &mIpmiInstance->IpmiTransport + ); + ASSERT_EFI_ERROR (Status); + + return EFI_SUCCESS; +} diff --git a/IpmiFeaturePkg/GenericIpmi/StandaloneMm/StandaloneMmGenericIpmi.inf b/IpmiFeaturePkg/GenericIpmi/StandaloneMm/StandaloneMmGenericIpmi.inf new file mode 100644 index 0000000..0d5b702 --- /dev/null +++ b/IpmiFeaturePkg/GenericIpmi/StandaloneMm/StandaloneMmGenericIpmi.inf @@ -0,0 +1,59 @@ +## @file +# Generic IPMI StandaloneMm Driver. +# +# @copyright +# Copyright 2010 - 2021 Intel Corporation.
+# Copyright (c) Microsoft Corporation. +# SPDX-License-Identifier: BSD-2-Clause-Patent +## + +[Defines] + INF_VERSION = 0x00010017 + BASE_NAME = StandaloneMmGenericIpmi + FILE_GUID = CE919FB2-87DE-4583-A878-CEEAF6098A35 + MODULE_TYPE = MM_STANDALONE + PI_SPECIFICATION_VERSION = 0x00010032 + VERSION_STRING = 1.0 + ENTRY_POINT = InitializeStandaloneMmGenericIpmi + +[Sources] + ../Common/IpmiHooks.h + ../Common/IpmiHooks.c + ../Common/GenericIpmi.c + ../Common/IpmiInitialize.c + ../Common/GenericIpmi.h + StandaloneMmGenericIpmi.c #GenericIpmi.c+IpmiBmcInitialize.c + +[Packages] + MdePkg/MdePkg.dec + IpmiFeaturePkg/IpmiFeaturePkg.dec + +[LibraryClasses] + MemoryAllocationLib + BaseLib + MmServicesTableLib + DebugLib + StandaloneMmDriverEntryPoint + IoLib + ReportStatusCodeLib + TimerLib + HobLib + IpmiTransportLib + IpmiPlatformLib + +[Protocols] + gSmmIpmiTransportProtocolGuid # PROTOCOL ALWAYS_PRODUCED + +[Guids] + gIpmiBmcHobGuid + +[Pcd] + gIpmiFeaturePkgTokenSpaceGuid.PcdIpmiIoBaseAddress + gIpmiFeaturePkgTokenSpaceGuid.PcdIpmiBmcReadyDelayTimer + gIpmiFeaturePkgTokenSpaceGuid.PcdIpmiCommandTimeoutSeconds + gIpmiFeaturePkgTokenSpaceGuid.PcdIpmiCommandMaxReties + gIpmiFeaturePkgTokenSpaceGuid.PcdBmcTimeoutSeconds + gIpmiFeaturePkgTokenSpaceGuid.PcdIpmiCheckSelfTestResults + +[Depex] + TRUE From 422128ae35a38079dbf2e50537b2d1d1e0a53f74 Mon Sep 17 00:00:00 2001 From: Marc Chen Date: Tue, 12 Nov 2024 18:33:22 +0800 Subject: [PATCH 2/9] Implement MM version of IpmiBaseLib --- IpmiFeaturePkg/IpmiCoreLibs.dsc.inc | 3 + IpmiFeaturePkg/IpmiFeaturePkg.ci.yaml | 3 +- IpmiFeaturePkg/IpmiFeaturePkg.dsc | 7 ++ .../Library/IpmiBaseLibMm/IpmiBaseLibMm.c | 98 +++++++++++++++++++ .../Library/IpmiBaseLibMm/IpmiBaseLibMm.inf | 33 +++++++ 5 files changed, 143 insertions(+), 1 deletion(-) create mode 100644 IpmiFeaturePkg/Library/IpmiBaseLibMm/IpmiBaseLibMm.c create mode 100644 IpmiFeaturePkg/Library/IpmiBaseLibMm/IpmiBaseLibMm.inf diff --git a/IpmiFeaturePkg/IpmiCoreLibs.dsc.inc b/IpmiFeaturePkg/IpmiCoreLibs.dsc.inc index c6b359b..0689d75 100644 --- a/IpmiFeaturePkg/IpmiCoreLibs.dsc.inc +++ b/IpmiFeaturePkg/IpmiCoreLibs.dsc.inc @@ -22,3 +22,6 @@ [LibraryClasses.common.DXE_SMM_DRIVER,LibraryClasses.common.SMM_CORE] IpmiBaseLib|IpmiFeaturePkg/Library/IpmiBaseLibSmm/IpmiBaseLibSmm.inf + +[LibraryClasses.common.MM_STANDALONE,LibraryClasses.common.MM_CORE_STANDALONE] + IpmiBaseLib|IpmiFeaturePkg/Library/IpmiBaseLibMm/IpmiBaseLibMm.inf diff --git a/IpmiFeaturePkg/IpmiFeaturePkg.ci.yaml b/IpmiFeaturePkg/IpmiFeaturePkg.ci.yaml index c4acc52..a5c2759 100644 --- a/IpmiFeaturePkg/IpmiFeaturePkg.ci.yaml +++ b/IpmiFeaturePkg/IpmiFeaturePkg.ci.yaml @@ -39,7 +39,8 @@ "MdePkg/MdePkg.dec", "MdeModulePkg/MdeModulePkg.dec", "PolicyServicePkg/PolicyServicePkg.dec", - "IpmiFeaturePkg/IpmiFeaturePkg.dec" + "IpmiFeaturePkg/IpmiFeaturePkg.dec", + "StandaloneMmPkg/StandaloneMmPkg.dec" ], # For host based unit tests "AcceptableDependencies-HOST_APPLICATION":[ diff --git a/IpmiFeaturePkg/IpmiFeaturePkg.dsc b/IpmiFeaturePkg/IpmiFeaturePkg.dsc index 81dc08d..6b30717 100644 --- a/IpmiFeaturePkg/IpmiFeaturePkg.dsc +++ b/IpmiFeaturePkg/IpmiFeaturePkg.dsc @@ -88,15 +88,22 @@ ReportStatusCodeLib|MdeModulePkg/Library/SmmReportStatusCodeLib/SmmReportStatusCodeLib.inf HobLib|MdePkg/Library/DxeHobLib/DxeHobLib.inf +[LibraryClasses.common.MM_STANDALONE] + MemoryAllocationLib|StandaloneMmPkg/Library/StandaloneMmMemoryAllocationLib/StandaloneMmMemoryAllocationLib.inf + ReportStatusCodeLib|MdeModulePkg/Library/SmmReportStatusCodeLib/StandaloneMmReportStatusCodeLib.inf + HobLib|StandaloneMmPkg/Library/StandaloneMmHobLib/StandaloneMmHobLib.inf + [Components] IpmiFeaturePkg/Library/IpmiCommandLib/IpmiCommandLib.inf IpmiFeaturePkg/Library/IpmiBaseLibNull/IpmiBaseLibNull.inf IpmiFeaturePkg/Library/IpmiBaseLibDxe/IpmiBaseLibDxe.inf IpmiFeaturePkg/Library/IpmiBaseLibPei/IpmiBaseLibPei.inf IpmiFeaturePkg/Library/IpmiBaseLibSmm/IpmiBaseLibSmm.inf + IpmiFeaturePkg/Library/IpmiBaseLibMm/IpmiBaseLibMm.inf IpmiFeaturePkg/Library/BmcSmbusLibNull/BmcSmbusLibNull.inf IpmiFeaturePkg/GenericIpmi/Pei/PeiGenericIpmi.inf IpmiFeaturePkg/GenericIpmi/Dxe/DxeGenericIpmi.inf + IpmiFeaturePkg/GenericIpmi/StandaloneMm/StandaloneMmGenericIpmi.inf IpmiFeaturePkg/BmcAcpi/BmcAcpi.inf IpmiFeaturePkg/BmcAcpiPowerState/BmcAcpiPowerStateSmm.inf IpmiFeaturePkg/SpmiTable/SpmiTable.inf diff --git a/IpmiFeaturePkg/Library/IpmiBaseLibMm/IpmiBaseLibMm.c b/IpmiFeaturePkg/Library/IpmiBaseLibMm/IpmiBaseLibMm.c new file mode 100644 index 0000000..7cb9028 --- /dev/null +++ b/IpmiFeaturePkg/Library/IpmiBaseLibMm/IpmiBaseLibMm.c @@ -0,0 +1,98 @@ +/** @file + A Library to support all BMC access via IPMI command during MM Phase. + + @copyright + Copyright 1999 - 2021 Intel Corporation.
+ Copyright (c) Microsoft Corporation + SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#include +#include +#include +#include +#include + +STATIC IPMI_TRANSPORT *mIpmiTransport = NULL; + +/** + Sends a IPMI command to the BMC and returns the response. + + @param[in] NetFunction Net function of the command. + @param[in] Command IPMI command number. + @param[in] CommandData Command data buffer. + @param[in] CommandDataSize Size of command data. + @param[out] ResponseData Response Data buffer. + @param[in,out] ResponseDataSize Response data buffer size on input, size of + read data or required size on return. + + @retval EFI_SUCCESS Successfully send IPMI command. + @retval EFI_NOT_AVAILABLE_YET Ipmi interface is not installed yet. +**/ +EFI_STATUS +EFIAPI +IpmiSubmitCommand ( + IN UINT8 NetFunction, + IN UINT8 Command, + IN UINT8 *CommandData, + IN UINT32 CommandDataSize, + OUT UINT8 *ResponseData, + IN OUT UINT32 *ResponseDataSize + ) +{ + EFI_STATUS Status; + + if (mIpmiTransport == NULL) { + Status = gMmst->MmLocateProtocol (&gSmmIpmiTransportProtocolGuid, NULL, (VOID **)&mIpmiTransport); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "%a: Failed to locate IPMI protocol. %r\n", __FUNCTION__, Status)); + return Status; + } + } + + Status = mIpmiTransport->IpmiSubmitCommand ( + mIpmiTransport, + NetFunction, + 0, + Command, + CommandData, + CommandDataSize, + ResponseData, + ResponseDataSize + ); + return Status; +} + +/** + Gets the current status of the BMC from the IPMI module. + + @param[out] BmcStatus The current status of the BMC. + @param[out] ComAddress The address of the BMC. + + @retval EFI_SUCCESS Successfully retrieved BMC status + @retval EFI_NOT_FOUND Ipmi interface is not installed yet. +**/ +EFI_STATUS +EFIAPI +GetBmcStatus ( + OUT BMC_STATUS *BmcStatus, + OUT SM_COM_ADDRESS *ComAddress + ) +{ + EFI_STATUS Status; + + if (mIpmiTransport == NULL) { + Status = gMmst->MmLocateProtocol (&gSmmIpmiTransportProtocolGuid, NULL, (VOID **)&mIpmiTransport); + if (EFI_ERROR (Status)) { + DEBUG ((DEBUG_ERROR, "%a: Failed to locate IPMI protocol. %r\n", __FUNCTION__, Status)); + return Status; + } + } + + Status = mIpmiTransport->GetBmcStatus ( + mIpmiTransport, + BmcStatus, + ComAddress + ); + return Status; +} diff --git a/IpmiFeaturePkg/Library/IpmiBaseLibMm/IpmiBaseLibMm.inf b/IpmiFeaturePkg/Library/IpmiBaseLibMm/IpmiBaseLibMm.inf new file mode 100644 index 0000000..e518367 --- /dev/null +++ b/IpmiFeaturePkg/Library/IpmiBaseLibMm/IpmiBaseLibMm.inf @@ -0,0 +1,33 @@ +## @file +# +# @copyright +# Copyright 2010 - 2021 Intel Corporation.
+# Copyright (c) Microsoft Corporation +# SPDX-License-Identifier: BSD-2-Clause-Patent +## + +[Defines] + INF_VERSION = 1.26 + PI_SPECIFICATION_VERSION = 0x00010032 + BASE_NAME = IpmiBaseLibMm + FILE_GUID = 06C28B6D-F15F-42C3-8316-01BD3E93D2DE + MODULE_TYPE = MM_STANDALONE + VERSION_STRING = 1.0 + LIBRARY_CLASS = IpmiBaseLib|MM_STANDALONE MM_CORE_STANDALONE + +[sources] + IpmiBaseLibMm.c + +[Packages] + MdePkg/MdePkg.dec + IpmiFeaturePkg/IpmiFeaturePkg.dec + +[LibraryClasses] + DebugLib + MmServicesTableLib + +[Protocols] + gSmmIpmiTransportProtocolGuid + +[Depex] + TRUE From b222d41064e39f0f7d6f67d78add98c241cb48e2 Mon Sep 17 00:00:00 2001 From: Marc Chen Date: Tue, 12 Nov 2024 21:50:10 +0800 Subject: [PATCH 3/9] Fix CI build error --- IpmiFeaturePkg/IpmiFeaturePkg.dsc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/IpmiFeaturePkg/IpmiFeaturePkg.dsc b/IpmiFeaturePkg/IpmiFeaturePkg.dsc index 6b30717..a1d1612 100644 --- a/IpmiFeaturePkg/IpmiFeaturePkg.dsc +++ b/IpmiFeaturePkg/IpmiFeaturePkg.dsc @@ -41,7 +41,9 @@ OemHookStatusCodeLib|MdeModulePkg/Library/OemHookStatusCodeLibNull/OemHookStatusCodeLibNull.inf UefiBootServicesTableLib|MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf SmmServicesTableLib|MdePkg/Library/SmmServicesTableLib/SmmServicesTableLib.inf + MmServicesTableLib|MdePkg/Library/StandaloneMmServicesTableLib/StandaloneMmServicesTableLib.inf UefiDriverEntryPoint|MdePkg/Library/UefiDriverEntryPoint/UefiDriverEntryPoint.inf + StandaloneMmDriverEntryPoint|MdePkg/Library/StandaloneMmDriverEntryPoint/StandaloneMmDriverEntryPoint.inf PcdLib|MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf DxeServicesTableLib|MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.inf UefiLib|MdePkg/Library/UefiLib/UefiLib.inf From 62f7276ab11f5d38662a39cdc9dce3f12d9d10d6 Mon Sep 17 00:00:00 2001 From: Marc Chen Date: Wed, 13 Nov 2024 10:40:48 +0800 Subject: [PATCH 4/9] Add ArmCompilerIntrinsicsLib for AARCH64 build --- IpmiFeaturePkg/IpmiFeaturePkg.dsc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/IpmiFeaturePkg/IpmiFeaturePkg.dsc b/IpmiFeaturePkg/IpmiFeaturePkg.dsc index a1d1612..950672f 100644 --- a/IpmiFeaturePkg/IpmiFeaturePkg.dsc +++ b/IpmiFeaturePkg/IpmiFeaturePkg.dsc @@ -58,6 +58,9 @@ IpmiPlatformLib|IpmiFeaturePkg/Library/IpmiPlatformLibNull/IpmiPlatformLibNull.inf PlatformCmosClearLib|IpmiFeaturePkg/Library/PlatformCmosClearLibNull/PlatformCmosClearLibNull.inf +[LibraryClasses.AARCH64] + NULL|MdePkg/Library/CompilerIntrinsicsLib/ArmCompilerIntrinsicsLib.inf + [LibraryClasses.common.PEI_CORE,LibraryClasses.common.PEIM] ####################################### # BaseCore Packages From 7b85b28aa3fd7922cac08c76e20303eff9da4329 Mon Sep 17 00:00:00 2001 From: Marc Chen Date: Wed, 13 Nov 2024 15:00:47 +0800 Subject: [PATCH 5/9] Update feedbacks from PR --- .../GenericIpmi/StandaloneMm/StandaloneMmGenericIpmi.c | 4 ++-- IpmiFeaturePkg/Library/IpmiBaseLibMm/IpmiBaseLibMm.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/IpmiFeaturePkg/GenericIpmi/StandaloneMm/StandaloneMmGenericIpmi.c b/IpmiFeaturePkg/GenericIpmi/StandaloneMm/StandaloneMmGenericIpmi.c index d3775a4..f93f30a 100644 --- a/IpmiFeaturePkg/GenericIpmi/StandaloneMm/StandaloneMmGenericIpmi.c +++ b/IpmiFeaturePkg/GenericIpmi/StandaloneMm/StandaloneMmGenericIpmi.c @@ -58,7 +58,7 @@ InitializeStandaloneMmGenericIpmi ( mIpmiInstance = AllocateZeroPool (sizeof (IPMI_BMC_INSTANCE_DATA)); ASSERT (mIpmiInstance != NULL); if (mIpmiInstance == NULL) { - DEBUG ((EFI_D_ERROR, "ERROR!! Null Pointer returned by AllocateZeroPool ()\n")); + DEBUG ((DEBUG_ERROR, "ERROR!! Null Pointer returned by AllocateZeroPool ()\n")); ASSERT_EFI_ERROR (EFI_OUT_OF_RESOURCES); return EFI_OUT_OF_RESOURCES; } @@ -111,5 +111,5 @@ InitializeStandaloneMmGenericIpmi ( ); ASSERT_EFI_ERROR (Status); - return EFI_SUCCESS; + return Status; } diff --git a/IpmiFeaturePkg/Library/IpmiBaseLibMm/IpmiBaseLibMm.c b/IpmiFeaturePkg/Library/IpmiBaseLibMm/IpmiBaseLibMm.c index 7cb9028..dc9ac3f 100644 --- a/IpmiFeaturePkg/Library/IpmiBaseLibMm/IpmiBaseLibMm.c +++ b/IpmiFeaturePkg/Library/IpmiBaseLibMm/IpmiBaseLibMm.c @@ -45,7 +45,7 @@ IpmiSubmitCommand ( if (mIpmiTransport == NULL) { Status = gMmst->MmLocateProtocol (&gSmmIpmiTransportProtocolGuid, NULL, (VOID **)&mIpmiTransport); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a: Failed to locate IPMI protocol. %r\n", __FUNCTION__, Status)); + DEBUG ((DEBUG_ERROR, "%a: Failed to locate IPMI protocol. %r\n", __func__, Status)); return Status; } } @@ -84,7 +84,7 @@ GetBmcStatus ( if (mIpmiTransport == NULL) { Status = gMmst->MmLocateProtocol (&gSmmIpmiTransportProtocolGuid, NULL, (VOID **)&mIpmiTransport); if (EFI_ERROR (Status)) { - DEBUG ((DEBUG_ERROR, "%a: Failed to locate IPMI protocol. %r\n", __FUNCTION__, Status)); + DEBUG ((DEBUG_ERROR, "%a: Failed to locate IPMI protocol. %r\n", __func__, Status)); return Status; } } From 9b24c6eea8bf69bd7342de16483b886b1ca6694d Mon Sep 17 00:00:00 2001 From: Marc Chen Date: Wed, 13 Nov 2024 16:44:13 +0800 Subject: [PATCH 6/9] Update the IpmiFeaturePkg.dsc to compile library with all archs and only IA32 and X64 for drivers --- IpmiFeaturePkg/IpmiFeaturePkg.dsc | 49 ++++++++++++++++--------------- 1 file changed, 26 insertions(+), 23 deletions(-) diff --git a/IpmiFeaturePkg/IpmiFeaturePkg.dsc b/IpmiFeaturePkg/IpmiFeaturePkg.dsc index 950672f..59a1aed 100644 --- a/IpmiFeaturePkg/IpmiFeaturePkg.dsc +++ b/IpmiFeaturePkg/IpmiFeaturePkg.dsc @@ -60,6 +60,7 @@ [LibraryClasses.AARCH64] NULL|MdePkg/Library/CompilerIntrinsicsLib/ArmCompilerIntrinsicsLib.inf + NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf [LibraryClasses.common.PEI_CORE,LibraryClasses.common.PEIM] ####################################### @@ -106,27 +107,18 @@ IpmiFeaturePkg/Library/IpmiBaseLibSmm/IpmiBaseLibSmm.inf IpmiFeaturePkg/Library/IpmiBaseLibMm/IpmiBaseLibMm.inf IpmiFeaturePkg/Library/BmcSmbusLibNull/BmcSmbusLibNull.inf - IpmiFeaturePkg/GenericIpmi/Pei/PeiGenericIpmi.inf - IpmiFeaturePkg/GenericIpmi/Dxe/DxeGenericIpmi.inf - IpmiFeaturePkg/GenericIpmi/StandaloneMm/StandaloneMmGenericIpmi.inf - IpmiFeaturePkg/BmcAcpi/BmcAcpi.inf - IpmiFeaturePkg/BmcAcpiPowerState/BmcAcpiPowerStateSmm.inf - IpmiFeaturePkg/SpmiTable/SpmiTable.inf - IpmiFeaturePkg/IpmiSmbios/IpmiSmbios.inf - IpmiFeaturePkg/IpmiFru/IpmiFru.inf - IpmiFeaturePkg/IpmiPowerRestorePolicy/IpmiPowerRestorePolicy.inf - IpmiFeaturePkg/SolStatus/SolStatus.inf + IpmiFeaturePkg/Library/IpmiCommandLib/IpmiCommandLib.inf + IpmiFeaturePkg/Library/IpmiBaseLibNull/IpmiBaseLibNull.inf + IpmiFeaturePkg/Library/IpmiBaseLibDxe/IpmiBaseLibDxe.inf + IpmiFeaturePkg/Library/IpmiBaseLibPei/IpmiBaseLibPei.inf + IpmiFeaturePkg/Library/IpmiBaseLibSmm/IpmiBaseLibSmm.inf + IpmiFeaturePkg/Library/IpmiBaseLibMm/IpmiBaseLibMm.inf + IpmiFeaturePkg/Library/BmcSmbusLibNull/BmcSmbusLibNull.inf IpmiFeaturePkg/Library/IpmiSelLib/IpmiSelLib.inf - IpmiFeaturePkg/IpmiWatchdog/Pei/IpmiWatchdogPei.inf - IpmiFeaturePkg/IpmiWatchdog/Dxe/IpmiWatchdogDxe.inf IpmiFeaturePkg/Library/IpmiPlatformLibNull/IpmiPlatformLibNull.inf IpmiFeaturePkg/Library/IpmiWatchdogLib/IpmiWatchdogLib.inf IpmiFeaturePkg/Library/IpmiBootOptionLib/IpmiBootOptionLib.inf - IpmiFeaturePkg/IpmiCmosClear/IpmiCmosClear.inf IpmiFeaturePkg/Library/PlatformCmosClearLibNull/PlatformCmosClearLibNull.inf - IpmiFeaturePkg/PlatformPowerRestorePolicyDefault/PlatformPowerRestorePolicyDefault.inf - IpmiFeaturePkg/IpmiSel/IpmiSel.inf - # Transport Libraries IpmiFeaturePkg/Library/IpmiTransportLibNull/IpmiTransportLibNull.inf IpmiFeaturePkg/Library/IpmiTransportLibKcs/KcsIpmiTransportLib.inf @@ -139,6 +131,24 @@ IpmiFeaturePkg/Library/MockIpmi/IpmiTransportLibMock.inf IpmiFeaturePkg/Library/MockIpmi/IpmiBaseLibMock.inf +[Components.IA32, Components.X64] + IpmiFeaturePkg/GenericIpmi/Pei/PeiGenericIpmi.inf + IpmiFeaturePkg/GenericIpmi/Dxe/DxeGenericIpmi.inf + IpmiFeaturePkg/GenericIpmi/Smm/SmmGenericIpmi.inf + IpmiFeaturePkg/GenericIpmi/StandaloneMm/StandaloneMmGenericIpmi.inf + IpmiFeaturePkg/BmcAcpi/BmcAcpi.inf + IpmiFeaturePkg/BmcAcpiPowerState/BmcAcpiPowerStateSmm.inf + IpmiFeaturePkg/SpmiTable/SpmiTable.inf + IpmiFeaturePkg/IpmiSmbios/IpmiSmbios.inf + IpmiFeaturePkg/IpmiFru/IpmiFru.inf + IpmiFeaturePkg/IpmiPowerRestorePolicy/IpmiPowerRestorePolicy.inf + IpmiFeaturePkg/SolStatus/SolStatus.inf + IpmiFeaturePkg/IpmiWatchdog/Pei/IpmiWatchdogPei.inf + IpmiFeaturePkg/IpmiWatchdog/Dxe/IpmiWatchdogDxe.inf + IpmiFeaturePkg/IpmiCmosClear/IpmiCmosClear.inf + IpmiFeaturePkg/PlatformPowerRestorePolicyDefault/PlatformPowerRestorePolicyDefault.inf + IpmiFeaturePkg/IpmiSel/IpmiSel.inf + # Functional Tests IpmiFeaturePkg/Test/FunctionalTest/IpmiShellTest/IpmiShellTest.inf { @@ -161,10 +171,3 @@ # Sample modules IpmiFeaturePkg/Samples/IpmiStatusReporter/Dxe/IpmiStatusReporterDxe.inf - -[Components.IA32, Components.X64] - IpmiFeaturePkg/GenericIpmi/Smm/SmmGenericIpmi.inf - -[LibraryClasses.ARM, LibraryClasses.AARCH64] - NULL|MdePkg/Library/CompilerIntrinsicsLib/ArmCompilerIntrinsicsLib.inf - NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf From ee3c1f7569af4b66581841399dd20767085f8dea Mon Sep 17 00:00:00 2001 From: Marc Chen Date: Thu, 14 Nov 2024 09:21:57 +0800 Subject: [PATCH 7/9] Revert "Update the IpmiFeaturePkg.dsc to compile library with all archs and only IA32 and X64 for drivers" This reverts commit 9b24c6eea8bf69bd7342de16483b886b1ca6694d. --- IpmiFeaturePkg/IpmiFeaturePkg.dsc | 49 +++++++++++++++---------------- 1 file changed, 23 insertions(+), 26 deletions(-) diff --git a/IpmiFeaturePkg/IpmiFeaturePkg.dsc b/IpmiFeaturePkg/IpmiFeaturePkg.dsc index 59a1aed..950672f 100644 --- a/IpmiFeaturePkg/IpmiFeaturePkg.dsc +++ b/IpmiFeaturePkg/IpmiFeaturePkg.dsc @@ -60,7 +60,6 @@ [LibraryClasses.AARCH64] NULL|MdePkg/Library/CompilerIntrinsicsLib/ArmCompilerIntrinsicsLib.inf - NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf [LibraryClasses.common.PEI_CORE,LibraryClasses.common.PEIM] ####################################### @@ -107,18 +106,27 @@ IpmiFeaturePkg/Library/IpmiBaseLibSmm/IpmiBaseLibSmm.inf IpmiFeaturePkg/Library/IpmiBaseLibMm/IpmiBaseLibMm.inf IpmiFeaturePkg/Library/BmcSmbusLibNull/BmcSmbusLibNull.inf - IpmiFeaturePkg/Library/IpmiCommandLib/IpmiCommandLib.inf - IpmiFeaturePkg/Library/IpmiBaseLibNull/IpmiBaseLibNull.inf - IpmiFeaturePkg/Library/IpmiBaseLibDxe/IpmiBaseLibDxe.inf - IpmiFeaturePkg/Library/IpmiBaseLibPei/IpmiBaseLibPei.inf - IpmiFeaturePkg/Library/IpmiBaseLibSmm/IpmiBaseLibSmm.inf - IpmiFeaturePkg/Library/IpmiBaseLibMm/IpmiBaseLibMm.inf - IpmiFeaturePkg/Library/BmcSmbusLibNull/BmcSmbusLibNull.inf + IpmiFeaturePkg/GenericIpmi/Pei/PeiGenericIpmi.inf + IpmiFeaturePkg/GenericIpmi/Dxe/DxeGenericIpmi.inf + IpmiFeaturePkg/GenericIpmi/StandaloneMm/StandaloneMmGenericIpmi.inf + IpmiFeaturePkg/BmcAcpi/BmcAcpi.inf + IpmiFeaturePkg/BmcAcpiPowerState/BmcAcpiPowerStateSmm.inf + IpmiFeaturePkg/SpmiTable/SpmiTable.inf + IpmiFeaturePkg/IpmiSmbios/IpmiSmbios.inf + IpmiFeaturePkg/IpmiFru/IpmiFru.inf + IpmiFeaturePkg/IpmiPowerRestorePolicy/IpmiPowerRestorePolicy.inf + IpmiFeaturePkg/SolStatus/SolStatus.inf IpmiFeaturePkg/Library/IpmiSelLib/IpmiSelLib.inf + IpmiFeaturePkg/IpmiWatchdog/Pei/IpmiWatchdogPei.inf + IpmiFeaturePkg/IpmiWatchdog/Dxe/IpmiWatchdogDxe.inf IpmiFeaturePkg/Library/IpmiPlatformLibNull/IpmiPlatformLibNull.inf IpmiFeaturePkg/Library/IpmiWatchdogLib/IpmiWatchdogLib.inf IpmiFeaturePkg/Library/IpmiBootOptionLib/IpmiBootOptionLib.inf + IpmiFeaturePkg/IpmiCmosClear/IpmiCmosClear.inf IpmiFeaturePkg/Library/PlatformCmosClearLibNull/PlatformCmosClearLibNull.inf + IpmiFeaturePkg/PlatformPowerRestorePolicyDefault/PlatformPowerRestorePolicyDefault.inf + IpmiFeaturePkg/IpmiSel/IpmiSel.inf + # Transport Libraries IpmiFeaturePkg/Library/IpmiTransportLibNull/IpmiTransportLibNull.inf IpmiFeaturePkg/Library/IpmiTransportLibKcs/KcsIpmiTransportLib.inf @@ -131,24 +139,6 @@ IpmiFeaturePkg/Library/MockIpmi/IpmiTransportLibMock.inf IpmiFeaturePkg/Library/MockIpmi/IpmiBaseLibMock.inf -[Components.IA32, Components.X64] - IpmiFeaturePkg/GenericIpmi/Pei/PeiGenericIpmi.inf - IpmiFeaturePkg/GenericIpmi/Dxe/DxeGenericIpmi.inf - IpmiFeaturePkg/GenericIpmi/Smm/SmmGenericIpmi.inf - IpmiFeaturePkg/GenericIpmi/StandaloneMm/StandaloneMmGenericIpmi.inf - IpmiFeaturePkg/BmcAcpi/BmcAcpi.inf - IpmiFeaturePkg/BmcAcpiPowerState/BmcAcpiPowerStateSmm.inf - IpmiFeaturePkg/SpmiTable/SpmiTable.inf - IpmiFeaturePkg/IpmiSmbios/IpmiSmbios.inf - IpmiFeaturePkg/IpmiFru/IpmiFru.inf - IpmiFeaturePkg/IpmiPowerRestorePolicy/IpmiPowerRestorePolicy.inf - IpmiFeaturePkg/SolStatus/SolStatus.inf - IpmiFeaturePkg/IpmiWatchdog/Pei/IpmiWatchdogPei.inf - IpmiFeaturePkg/IpmiWatchdog/Dxe/IpmiWatchdogDxe.inf - IpmiFeaturePkg/IpmiCmosClear/IpmiCmosClear.inf - IpmiFeaturePkg/PlatformPowerRestorePolicyDefault/PlatformPowerRestorePolicyDefault.inf - IpmiFeaturePkg/IpmiSel/IpmiSel.inf - # Functional Tests IpmiFeaturePkg/Test/FunctionalTest/IpmiShellTest/IpmiShellTest.inf { @@ -171,3 +161,10 @@ # Sample modules IpmiFeaturePkg/Samples/IpmiStatusReporter/Dxe/IpmiStatusReporterDxe.inf + +[Components.IA32, Components.X64] + IpmiFeaturePkg/GenericIpmi/Smm/SmmGenericIpmi.inf + +[LibraryClasses.ARM, LibraryClasses.AARCH64] + NULL|MdePkg/Library/CompilerIntrinsicsLib/ArmCompilerIntrinsicsLib.inf + NULL|MdePkg/Library/BaseStackCheckLib/BaseStackCheckLib.inf From 598bc65b1c1eac809b7ad864e4e8581454da8a9f Mon Sep 17 00:00:00 2001 From: Marc Chen Date: Thu, 14 Nov 2024 09:22:02 +0800 Subject: [PATCH 8/9] Revert "Add ArmCompilerIntrinsicsLib for AARCH64 build" This reverts commit 62f7276ab11f5d38662a39cdc9dce3f12d9d10d6. --- IpmiFeaturePkg/IpmiFeaturePkg.dsc | 3 --- 1 file changed, 3 deletions(-) diff --git a/IpmiFeaturePkg/IpmiFeaturePkg.dsc b/IpmiFeaturePkg/IpmiFeaturePkg.dsc index 950672f..a1d1612 100644 --- a/IpmiFeaturePkg/IpmiFeaturePkg.dsc +++ b/IpmiFeaturePkg/IpmiFeaturePkg.dsc @@ -58,9 +58,6 @@ IpmiPlatformLib|IpmiFeaturePkg/Library/IpmiPlatformLibNull/IpmiPlatformLibNull.inf PlatformCmosClearLib|IpmiFeaturePkg/Library/PlatformCmosClearLibNull/PlatformCmosClearLibNull.inf -[LibraryClasses.AARCH64] - NULL|MdePkg/Library/CompilerIntrinsicsLib/ArmCompilerIntrinsicsLib.inf - [LibraryClasses.common.PEI_CORE,LibraryClasses.common.PEIM] ####################################### # BaseCore Packages From 9b5e2cf03a9b1454830739c1f303f1a0fb4e55a4 Mon Sep 17 00:00:00 2001 From: Marc Chen Date: Thu, 14 Nov 2024 13:39:05 +0800 Subject: [PATCH 9/9] Remove non-required library and header files. --- .../GenericIpmi/StandaloneMm/StandaloneMmGenericIpmi.c | 2 -- .../GenericIpmi/StandaloneMm/StandaloneMmGenericIpmi.inf | 1 - 2 files changed, 3 deletions(-) diff --git a/IpmiFeaturePkg/GenericIpmi/StandaloneMm/StandaloneMmGenericIpmi.c b/IpmiFeaturePkg/GenericIpmi/StandaloneMm/StandaloneMmGenericIpmi.c index f93f30a..6876b6c 100644 --- a/IpmiFeaturePkg/GenericIpmi/StandaloneMm/StandaloneMmGenericIpmi.c +++ b/IpmiFeaturePkg/GenericIpmi/StandaloneMm/StandaloneMmGenericIpmi.c @@ -13,11 +13,9 @@ #include #include #include -#include #include #include #include -#include #include #include diff --git a/IpmiFeaturePkg/GenericIpmi/StandaloneMm/StandaloneMmGenericIpmi.inf b/IpmiFeaturePkg/GenericIpmi/StandaloneMm/StandaloneMmGenericIpmi.inf index 0d5b702..bfde88a 100644 --- a/IpmiFeaturePkg/GenericIpmi/StandaloneMm/StandaloneMmGenericIpmi.inf +++ b/IpmiFeaturePkg/GenericIpmi/StandaloneMm/StandaloneMmGenericIpmi.inf @@ -34,7 +34,6 @@ MmServicesTableLib DebugLib StandaloneMmDriverEntryPoint - IoLib ReportStatusCodeLib TimerLib HobLib