Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# KCS instance of Manageability Transport Library
#
# Copyright (C) 2025 Advanced Micro Devices, Inc. All rights reserved.<BR>
# Copyright (c) Microsoft Corporation. All rights reserved.
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##
Expand All @@ -13,7 +14,7 @@
FILE_GUID = 1D13D1F8-82DC-408D-9979-9E7D7CDFCD04
MODULE_TYPE = BASE
VERSION_STRING = 1.0
LIBRARY_CLASS = ManageabilityTransportLib|PEIM DXE_DRIVER
LIBRARY_CLASS = ManageabilityTransportLib|PEIM DXE_DRIVER DXE_SMM_DRIVER MM_STANDALONE

#
# VALID_ARCHITECTURES = IA32 X64 AARCH64
Expand Down Expand Up @@ -42,4 +43,3 @@
[FixedPcd]
gEfiMdePkgTokenSpaceGuid.PcdIpmiKcsIoBaseAddress # Used as default KCS I/O base adddress
gManageabilityPkgTokenSpaceGuid.PcdKcsStatusCheckTimeout # Use the predefined timeout value in micro seconds

5 changes: 5 additions & 0 deletions ManageabilityPkg/Manageability.dsc.inc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#
# Copyright (C) 2023-2026 Advanced Micro Devices, Inc. All rights reserved.<BR>
# Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# Copyright (c) Microsoft Corporation. All rights reserved.
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##
Expand Down Expand Up @@ -37,6 +38,10 @@
ManageabilityPkg/Universal/IpmiBlobTransferDxe/IpmiBlobTransferDxe.inf
!endif

!if gManageabilityPkgTokenSpaceGuid.PcdManageabilityStandaloneMmIpmiEnable == TRUE
ManageabilityPkg/Universal/IpmiProtocol/Smm/IpmiProtocolStandaloneMm.inf
!endif

!if gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxeIpmiSmbiosTransferEnable == TRUE
ManageabilityPkg/Universal/IpmiSmbiosTransferDxe/IpmiSmbiosTransferDxe.inf
!endif
Expand Down
2 changes: 2 additions & 0 deletions ManageabilityPkg/ManageabilityPkg.dec
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
# Copyright (C) 2023-2026 Advanced Micro Devices, Inc. All rights reserved.<BR>
# Copyright (c) 2024, Ampere Computing LLC. All rights reserved.<BR>
# Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# Copyright (c) Microsoft Corporation. All rights reserved.
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##
Expand Down Expand Up @@ -108,6 +109,7 @@
[PcdsFeatureFlag]
gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxeIpmiEnable|FALSE|BOOLEAN|0x10000001
gManageabilityPkgTokenSpaceGuid.PcdManageabilitySmmIpmiEnable|FALSE|BOOLEAN|0x10000002
gManageabilityPkgTokenSpaceGuid.PcdManageabilityStandaloneMmIpmiEnable|FALSE|BOOLEAN|0x1000000F
gManageabilityPkgTokenSpaceGuid.PcdManageabilityPeiIpmiEnable|FALSE|BOOLEAN|0x10000003
gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxePldmEnable|FALSE|BOOLEAN|0x10000004
gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxeMctpEnable|FALSE|BOOLEAN|0x10000005
Expand Down
8 changes: 8 additions & 0 deletions ManageabilityPkg/ManageabilityPkg.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
# Copyright (C) 2023-2026 Advanced Micro Devices, Inc. All rights reserved.<BR>
# Copyright (c) 2024, Ampere Computing LLC. All rights reserved.<BR>
# Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# Copyright (c) Microsoft Corporation. All rights reserved.
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
##
Expand All @@ -27,6 +28,7 @@
#
gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxeIpmiEnable |TRUE
gManageabilityPkgTokenSpaceGuid.PcdManageabilitySmmIpmiEnable |TRUE
gManageabilityPkgTokenSpaceGuid.PcdManageabilityStandaloneMmIpmiEnable |TRUE
gManageabilityPkgTokenSpaceGuid.PcdManageabilityPeiIpmiEnable |TRUE
gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxePldmEnable |TRUE
gManageabilityPkgTokenSpaceGuid.PcdManageabilityDxeMctpEnable |TRUE
Expand Down Expand Up @@ -109,6 +111,12 @@
ReportStatusCodeLib|MdeModulePkg/Library/SmmReportStatusCodeLib/SmmReportStatusCodeLib.inf
MemoryAllocationLib|MdePkg/Library/SmmMemoryAllocationLib/SmmMemoryAllocationLib.inf

[LibraryClasses.common.MM_STANDALONE]
ManageabilityTransportLib|ManageabilityPkg/Library/ManageabilityTransportKcsLib/BaseManageabilityTransportKcs.inf
MemoryAllocationLib|StandaloneMmPkg/Library/StandaloneMmMemoryAllocationLib/StandaloneMmMemoryAllocationLib.inf
MmServicesTableLib|MdePkg/Library/StandaloneMmServicesTableLib/StandaloneMmServicesTableLib.inf
StandaloneMmDriverEntryPoint|MdePkg/Library/StandaloneMmDriverEntryPoint/StandaloneMmDriverEntryPoint.inf

[LibraryClasses.common.SEC, LibraryClasses.common.PEI_CORE, LibraryClasses.common.PEIM]
S3BootScriptLib|MdePkg/Library/BaseS3BootScriptLibNull/BaseS3BootScriptLibNull.inf
PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf
Expand Down
22 changes: 9 additions & 13 deletions ManageabilityPkg/Universal/IpmiProtocol/Smm/IpmiProtocol.c
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
/** @file
This file provides IPMI SMM Protocol implementation.
This file provides the shared IPMI MM Protocol implementation.

Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.<BR>
Copyright (c) Microsoft Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
**/

#include <PiDxe.h>
#include <PiMm.h>
#include <Library/DebugLib.h>
#include <Library/BaseMemoryLib.h>
#include <Library/ManageabilityTransportLib.h>
#include <Library/ManageabilityTransportIpmiLib.h>
#include <Library/ManageabilityTransportHelperLib.h>
#include <Library/SmmServicesTableLib.h>
#include <Library/UefiBootServicesTableLib.h>
#include <Library/MmServicesTableLib.h>

#include <Protocol/IpmiProtocol.h>

#include "IpmiProtocolCommon.h"
#include "IpmiProtocol.h"

MANAGEABILITY_TRANSPORT_TOKEN *mTransportToken = NULL;
CHAR16 *mTransportName;
Expand Down Expand Up @@ -73,19 +74,14 @@ static IPMI_PROTOCOL mIpmiProtocol = {
};

/**
The entry point of the Ipmi DXE driver.

@param[in] ImageHandle - Handle of this driver image
@param[in] SystemTable - Table containing standard EFI services
Initialize the IPMI protocol for either Traditional MM or Standalone MM.

@retval EFI_SUCCESS - IPMI Protocol is installed successfully.
@retval Otherwise - Other errors.
**/
EFI_STATUS
EFIAPI
SmmIpmiEntry (
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
IpmiProtocolInitialize (
VOID
)
{
EFI_STATUS Status;
Expand Down Expand Up @@ -145,7 +141,7 @@ SmmIpmiEntry (
}

Handle = NULL;
Status = gSmst->SmmInstallProtocolInterface (
Status = gMmst->MmInstallProtocolInterface (
&Handle,
&gSmmIpmiProtocolGuid,
EFI_NATIVE_INTERFACE,
Expand Down
13 changes: 13 additions & 0 deletions ManageabilityPkg/Universal/IpmiProtocol/Smm/IpmiProtocol.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/** @file
Shared definitions for the IPMI MM Protocol implementation.

Copyright (c) Microsoft Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
**/

#pragma once

EFI_STATUS
IpmiProtocolInitialize (
VOID
);
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#
# Copyright (C) 2023 Advanced Micro Devices, Inc. All rights reserved.<BR>
# Copyright (c) 2024, NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# Copyright (c) Microsoft Corporation. All rights reserved.
# SPDX-License-Identifier: BSD-2-Clause-Patent
##

Expand All @@ -22,6 +23,8 @@

[Sources]
IpmiProtocol.c
IpmiProtocol.h
IpmiProtocolTraditionalMm.c
../Common/IpmiProtocolCommon.c
../Common/IpmiProtocolCommon.h

Expand All @@ -35,9 +38,8 @@
DebugLib
ManageabilityTransportHelperLib
ManageabilityTransportLib
SmmServicesTableLib
MmServicesTableLib
UefiDriverEntryPoint
UefiBootServicesTableLib

[Protocols]
gSmmIpmiProtocolGuid # PROTOCOL ALWAYS_PRODUCED
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/** @file
Standalone MM entry point for the IPMI Protocol driver.

Copyright (c) Microsoft Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
**/

#include <PiMm.h>

#include "IpmiProtocol.h"

/**
The entry point of the IPMI Standalone MM driver.

@param[in] ImageHandle Handle of this driver image.
@param[in] MmSystemTable Pointer to the MM system table.

@retval EFI_SUCCESS The IPMI Protocol was installed successfully.
@retval Others An error occurred while initializing the driver.
**/
EFI_STATUS
EFIAPI
StandaloneMmIpmiEntry (
IN EFI_HANDLE ImageHandle,
IN EFI_MM_SYSTEM_TABLE *MmSystemTable
)
{
return IpmiProtocolInitialize ();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
## @file
# IPMI Protocol Standalone MM Driver.
#
# Copyright (c) Microsoft Corporation. All rights reserved.
# SPDX-License-Identifier: BSD-2-Clause-Patent
##

[Defines]
INF_VERSION = 0x0001001d
BASE_NAME = IpmiStandaloneMm
FILE_GUID = EDF71BB4-D08F-4107-AA98-CAC7682BD372
MODULE_TYPE = MM_STANDALONE
PI_SPECIFICATION_VERSION = 0x00010032
VERSION_STRING = 1.0
ENTRY_POINT = StandaloneMmIpmiEntry

#
# VALID_ARCHITECTURES = X64 AARCH64
#

[Sources]
IpmiProtocolStandaloneMm.c
IpmiProtocol.c
IpmiProtocol.h
../Common/IpmiProtocolCommon.c
../Common/IpmiProtocolCommon.h

[Packages]
MdePkg/MdePkg.dec
MdeModulePkg/MdeModulePkg.dec
ManageabilityPkg/ManageabilityPkg.dec

[LibraryClasses]
BaseMemoryLib
DebugLib
ManageabilityTransportHelperLib
ManageabilityTransportLib
MemoryAllocationLib
MmServicesTableLib
StandaloneMmDriverEntryPoint

[Protocols]
gSmmIpmiProtocolGuid # PROTOCOL ALWAYS_PRODUCED

[Guids]
gManageabilityProtocolIpmiGuid
gManageabilityTransportKcsGuid
gManageabilityTransportSmbusI2cGuid
gManageabilityTransportSerialGuid

[FixedPcd]
gEfiMdePkgTokenSpaceGuid.PcdIpmiKcsIoBaseAddress
gEfiMdePkgTokenSpaceGuid.PcdIpmiSsifSmbusSlaveAddr
gEfiMdePkgTokenSpaceGuid.PcdIpmiSerialRequesterAddress
gEfiMdePkgTokenSpaceGuid.PcdIpmiSerialResponderAddress
gEfiMdePkgTokenSpaceGuid.PcdIpmiSerialRequesterLun
gEfiMdePkgTokenSpaceGuid.PcdIpmiSerialResponderLun

[Depex]
TRUE
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
/** @file
Traditional MM entry point for the IPMI Protocol driver.

Copyright (c) Microsoft Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
**/

#include <PiSmm.h>

#include "IpmiProtocol.h"

/**
The entry point of the IPMI Traditional MM driver.

@param[in] ImageHandle Handle of this driver image.
@param[in] SystemTable Pointer to the EFI system table.

@retval EFI_SUCCESS The IPMI Protocol was installed successfully.
@retval Others An error occurred while initializing the driver.
**/
EFI_STATUS
EFIAPI
SmmIpmiEntry (
IN EFI_HANDLE ImageHandle,
IN EFI_SYSTEM_TABLE *SystemTable
)
{
return IpmiProtocolInitialize ();
}
Loading