From e363c0b7296be020e7fca753ac5e3af10dd7981f Mon Sep 17 00:00:00 2001 From: Hongbin1 Zhang Date: Sun, 28 Apr 2024 15:30:23 +0800 Subject: [PATCH] StandaloneMmPkg/MmIpl: StandaloneMmIplPei driver entrypoint StandaloneMmIplPei driver entrypoint for adding StandaloneMm Ipl feature code under PEI stage. Signed-off-by: Hongbin1 Zhang Cc: Jiewen Yao Cc: Ray Ni Cc: Star Zeng Cc: Jiaxin Wu Cc: Wei6 Xu Cc: Sami Mujawar Cc: Ard Biesheuvel Cc: Supreeth Venkatesh --- .../StandaloneMmIplPei/StandaloneMmIplPei.c | 31 +++++++++++++ .../StandaloneMmIplPei/StandaloneMmIplPei.h | 12 ++++++ .../StandaloneMmIplPei/StandaloneMmIplPei.inf | 43 +++++++++++++++++++ StandaloneMmPkg/StandaloneMmPkg.dsc | 6 +++ 4 files changed, 92 insertions(+) create mode 100644 StandaloneMmPkg/Drivers/StandaloneMmIplPei/StandaloneMmIplPei.c create mode 100644 StandaloneMmPkg/Drivers/StandaloneMmIplPei/StandaloneMmIplPei.h create mode 100644 StandaloneMmPkg/Drivers/StandaloneMmIplPei/StandaloneMmIplPei.inf diff --git a/StandaloneMmPkg/Drivers/StandaloneMmIplPei/StandaloneMmIplPei.c b/StandaloneMmPkg/Drivers/StandaloneMmIplPei/StandaloneMmIplPei.c new file mode 100644 index 0000000000..a3e371f6b9 --- /dev/null +++ b/StandaloneMmPkg/Drivers/StandaloneMmIplPei/StandaloneMmIplPei.c @@ -0,0 +1,31 @@ +/** @file + MM IPL that load the MM Core into MMRAM at PEI stage + + Copyright (c) 2024, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include "StandaloneMmIplPei.h" + +/** + The Entry Point for MM IPL at PEI stage. + + Load MM Core into MMRAM. + + @param FileHandle Handle of the file being invoked. + @param PeiServices Describes the list of possible PEI Services. + + @retval EFI_SUCCESS The entry point is executed successfully. + @retval Other Some error occurred when executing this entry point. + +**/ +EFI_STATUS +EFIAPI +StandaloneMmIplPeiEntry ( + IN EFI_PEI_FILE_HANDLE FileHandle, + IN CONST EFI_PEI_SERVICES **PeiServices + ) +{ + return EFI_SUCCESS; +} diff --git a/StandaloneMmPkg/Drivers/StandaloneMmIplPei/StandaloneMmIplPei.h b/StandaloneMmPkg/Drivers/StandaloneMmIplPei/StandaloneMmIplPei.h new file mode 100644 index 0000000000..1b2aef7062 --- /dev/null +++ b/StandaloneMmPkg/Drivers/StandaloneMmIplPei/StandaloneMmIplPei.h @@ -0,0 +1,12 @@ +/** @file + Standalone MM IPL Header file + + Copyright (c) 2024, Intel Corporation. All rights reserved.
+ SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef STANDALONE_MM_IPL_PEI_H_ +#define STANDALONE_MM_IPL_PEI_H_ + +#endif diff --git a/StandaloneMmPkg/Drivers/StandaloneMmIplPei/StandaloneMmIplPei.inf b/StandaloneMmPkg/Drivers/StandaloneMmIplPei/StandaloneMmIplPei.inf new file mode 100644 index 0000000000..d5c3c54ebd --- /dev/null +++ b/StandaloneMmPkg/Drivers/StandaloneMmIplPei/StandaloneMmIplPei.inf @@ -0,0 +1,43 @@ +## @file +# This module provide a Standalone MM compliant implementation of MM IPL PEIM. +# +# Copyright (c) 2024, Intel Corporation. All rights reserved.
+# +# SPDX-License-Identifier: BSD-2-Clause-Patent +# +## + +[Defines] + INF_VERSION = 0x00010005 + BASE_NAME = StandaloneMmIplPei + FILE_GUID = 578A0D17-2DC0-4C7D-A121-D8D771923BB0 + MODULE_TYPE = PEIM + VERSION_STRING = 1.0 + PI_SPECIFICATION_VERSION = 0x0001000A + ENTRY_POINT = StandaloneMmIplPeiEntry + +# +# The following information is for reference only and not required by the build tools. +# +# VALID_ARCHITECTURES = X64 +# + +[Sources] + StandaloneMmIplPei.c + StandaloneMmIplPei.h + +[Packages] + MdePkg/MdePkg.dec + MdeModulePkg/MdeModulePkg.dec + +[LibraryClasses] + PeimEntryPoint + +[Guids] + +[Ppis] + +[Pcd] + +[Depex] + TRUE diff --git a/StandaloneMmPkg/StandaloneMmPkg.dsc b/StandaloneMmPkg/StandaloneMmPkg.dsc index 20a05d0ebf..140e6eca74 100644 --- a/StandaloneMmPkg/StandaloneMmPkg.dsc +++ b/StandaloneMmPkg/StandaloneMmPkg.dsc @@ -62,6 +62,9 @@ HobPrintLib|MdeModulePkg/Library/HobPrintLib/HobPrintLib.inf MmPlatformHobProducerLib|StandaloneMmPkg/Library/MmPlatformHobProducerLibNull/MmPlatformHobProducerLibNull.inf +[LibraryClasses.common.PEIM] + PeimEntryPoint|MdePkg/Library/PeimEntryPoint/PeimEntryPoint.inf + [LibraryClasses.AARCH64, LibraryClasses.ARM] ArmLib|ArmPkg/Library/ArmLib/ArmBaseLib.inf StandaloneMmMmuLib|ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.inf @@ -137,6 +140,9 @@ StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.inf StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/StandaloneMmPeCoffExtraActionLib.inf +[Components.X64] + StandaloneMmPkg/Drivers/StandaloneMmIplPei/StandaloneMmIplPei.inf + ################################################################################################### # # BuildOptions Section - Define the module specific tool chain flags that should be used as