Skip to content

Commit

Permalink
StandaloneMmPkg: move core entry point lib and cpu driver to ArmPkg
Browse files Browse the repository at this point in the history
StandaloneMmCpu driver is only used for Arm architecture and
StandaloneMmCoreEntryPointLib for Arm has specific implementation with
StandaloneMmCpu driver.

Move StandaloneMmCpu Driver and StandaloneMmCoreEntryPointLib for Arm
to ArmPkg.

Continuous-integration-options: PatchCheck.ignore-multi-package
Signed-off-by: Levi Yun <[email protected]>
  • Loading branch information
LeviYeoReum committed Dec 12, 2024
1 parent 734b795 commit b0e1cf6
Show file tree
Hide file tree
Showing 17 changed files with 106 additions and 45 deletions.
3 changes: 2 additions & 1 deletion ArmPkg/ArmPkg.ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@
"EmbeddedPkg/EmbeddedPkg.dec",
"MdeModulePkg/MdeModulePkg.dec",
"MdePkg/MdePkg.dec",
"ShellPkg/ShellPkg.dec"
"ShellPkg/ShellPkg.dec",
"StandaloneMmPkg/StandaloneMmPkg.dec"
],
# For host based unit tests
"AcceptableDependencies-HOST_APPLICATION":[
Expand Down
6 changes: 6 additions & 0 deletions ArmPkg/ArmPkg.dec
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@
#
ArmFfaLib|Include/Library/ArmFfaLib.h

## @libraryclass Defines a set of interfaces for the MM core entrypoint for
## AArch64 and ARM.
StandaloneMmCoreEntryPoint|Include/Library/ArmStandaloneMmCoreEntryPoint.h

[Guids.common]
gArmTokenSpaceGuid = { 0xBB11ECFE, 0x820F, 0x4968, { 0xBB, 0xA6, 0xF7, 0x6A, 0xFE, 0x30, 0x25, 0x96 } }

Expand All @@ -126,6 +130,8 @@
## ArmPkg/Include/Protocol/ArmScmiPerformanceProtocol.h
gArmScmiPerformanceProtocolGuid = { 0x9b8ba84, 0x3dd3, 0x49a6, { 0xa0, 0x5a, 0x31, 0x34, 0xa5, 0xf0, 0x7b, 0xad } }

gEdkiiPiMmCpuDriverEpProtocolGuid = { 0x6ecbd5a1, 0xc0f8, 0x4702, { 0x83, 0x01, 0x4f, 0xc2, 0xc5, 0x47, 0x0a, 0x51 }}

[Ppis]
## Include/Ppi/ArmMpCoreInfo.h
gArmMpCoreInfoPpiGuid = { 0x6847cc74, 0xe9ec, 0x4f8f, {0xa2, 0x9d, 0xab, 0x44, 0xe7, 0x54, 0xa8, 0xfc} }
Expand Down
15 changes: 15 additions & 0 deletions ArmPkg/ArmPkg.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,15 @@
PeiServicesTablePointerLib|MdePkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointerLib.inf
ArmFfaLib|ArmPkg/Library/ArmFfaLib/ArmFfaPeiLib.inf

[LibraryClasses.common.MM_CORE_STANDALONE]
StandaloneMmCoreEntryPoint|ArmPkg/Library/ArmStandaloneMmCoreEntryPoint/ArmStandaloneMmCoreEntryPoint.inf
HobLib|StandaloneMmPkg/Library/StandaloneMmHobLib/StandaloneMmHobLib.inf

[LibraryClasses.common.MM_STANDALONE]
StandaloneMmDriverEntryPoint|MdePkg/Library/StandaloneMmDriverEntryPoint/StandaloneMmDriverEntryPoint.inf
HobLib|StandaloneMmPkg/Library/StandaloneMmHobLib/StandaloneMmHobLib.inf
MmServicesTableLib|MdePkg/Library/StandaloneMmServicesTableLib/StandaloneMmServicesTableLib.inf

[Components.common]
ArmPkg/Library/ArmCacheMaintenanceLib/ArmCacheMaintenanceLib.inf
ArmPkg/Library/ArmDisassemblerLib/ArmDisassemblerLib.inf
Expand Down Expand Up @@ -166,6 +175,12 @@

ArmPkg/Drivers/MmCommunicationPei/MmCommunicationPei.inf

[Components.common.MM_CORE_STANALONE]
ArmPkg/Library/ArmStandaloneMmCoreEntryPoint/ArmStandaloneMmCoreEntryPoint.inf

[Components.common.MM_STANDALONE]
ArmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.inf

[Components.AARCH64]
ArmPkg/Drivers/ArmCrashDumpDxe/ArmCrashDumpDxe.inf
ArmPkg/Drivers/ArmPsciMpServicesDxe/ArmPsciMpServicesDxe.inf
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@
ENTRY_POINT = StandaloneMmCpuInitialize

[Sources]
StandaloneMmCpu.c
EventHandle.c
StandaloneMmCpu.c
StandaloneMmCpu.h

[Packages]
ArmPkg/ArmPkg.dec
MdePkg/MdePkg.dec
MdeModulePkg/MdeModulePkg.dec
StandaloneMmPkg/StandaloneMmPkg.dec
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,11 @@

#include <PiMm.h>

#include <Library/Arm/StandaloneMmCoreEntryPoint.h>

#include <PiPei.h>
#include <Guid/MmramMemoryReserve.h>

#include <Library/ArmLib.h>
#include <Library/ArmStandaloneMmCoreEntryPoint.h>
#include <Library/ArmSvcLib.h>
#include <Library/ArmFfaLib.h>
#include <Library/ArmTransferListLib.h>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
## @file
# Module entry point library for DXE core.
#
# Copyright (c) 2024, Arm Ltd. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-2-Clause-Patent
#
#
##

[Defines]
INF_VERSION = 0x0001001A
BASE_NAME = ArmStandaloneMmCoreEntryPoint
FILE_GUID = 16d7b2e4-a025-11ef-8931-6b032fa329a6
MODULE_TYPE = MM_CORE_STANDALONE
VERSION_STRING = 1.0
PI_SPECIFICATION_VERSION = 0x00010032
LIBRARY_CLASS = StandaloneMmCoreEntryPoint|MM_CORE_STANDALONE

#
# VALID_ARCHITECTURES = ARM AARCH64
#

[Sources]
ArmStandaloneMmCoreEntryPoint.c
SetPermissions.c

[Sources.AARCH64]
AArch64/ModuleEntryPoint.S

[Sources.ARM]
Arm/ModuleEntryPoint.S

[Packages]
ArmPkg/ArmPkg.dec
MdePkg/MdePkg.dec
MdeModulePkg/MdeModulePkg.dec
StandaloneMmPkg/StandaloneMmPkg.dec

[Packages]
ArmPkg/ArmPkg.dec

[LibraryClasses]
BaseLib
DebugLib
StandaloneMmMmuLib
ArmSvcLib
ArmTransferListLib
ArmFfaLib

[Guids]
gMpInformationHobGuid
gEfiMmPeiMmramMemoryReserveGuid
gEfiStandaloneMmNonSecureBufferGuid
gEfiHobListGuid

[Protocols]
gEdkiiPiMmCpuDriverEpProtocolGuid
gEfiMmCommunication2ProtocolGuid

[Pcd]
gArmTokenSpaceGuid.PcdStMmStackSize

#
# This configuration fails for CLANGPDB, which does not support PIE in the GCC
# sense. Such however is required for ARM family StandaloneMmCore
# self-relocation, and thus the CLANGPDB toolchain is unsupported for ARM and
# AARCH64 for this module.
#
[BuildOptions]
GCC:*_*_ARM_CC_FLAGS = -fpie
GCC:*_*_AARCH64_CC_FLAGS = -fpie
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#include <Guid/MmramMemoryReserve.h>
#include <Guid/MpInformation.h>

#include <Library/Arm/StandaloneMmCoreEntryPoint.h>
#include <Library/ArmStandaloneMmCoreEntryPoint.h>
#include <Library/ArmMmuLib.h>
#include <Library/ArmSvcLib.h>
#include <Library/DebugLib.h>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,6 @@
# VALID_ARCHITECTURES = IA32 X64 IPF EBC (EBC is for build only)
#

[Sources.AARCH64, Sources.ARM]
Arm/StandaloneMmCoreEntryPoint.c
Arm/SetPermissions.c

[Sources.AARCH64]
Arm/ModuleEntryPoint64.S

[Sources.ARM]
Arm/ModuleEntryPoint32.S

[Sources.X64]
X64/StandaloneMmCoreEntryPoint.c

Expand All @@ -39,34 +29,15 @@
MdeModulePkg/MdeModulePkg.dec
StandaloneMmPkg/StandaloneMmPkg.dec

[Packages.ARM, Packages.AARCH64]
ArmPkg/ArmPkg.dec

[LibraryClasses]
BaseLib
DebugLib

[LibraryClasses.ARM, LibraryClasses.AARCH64]
StandaloneMmMmuLib
ArmSvcLib
ArmTransferListLib
ArmFfaLib

[Guids]
gMpInformationHobGuid
gEfiMmPeiMmramMemoryReserveGuid
gEfiStandaloneMmNonSecureBufferGuid

[Guids.ARM, Guids.AARCH64]
gEfiHobListGuid

[Protocols.ARM, Protocols.AARCH64]
gEdkiiPiMmCpuDriverEpProtocolGuid
gEfiMmCommunication2ProtocolGuid

[FixedPcd.ARM, FixedPcd.AARCH64]
gArmTokenSpaceGuid.PcdStMmStackSize

#
# This configuration fails for CLANGPDB, which does not support PIE in the GCC
# sense. Such however is required for ARM family StandaloneMmCore
Expand Down
8 changes: 0 additions & 8 deletions StandaloneMmPkg/StandaloneMmPkg.dec
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,6 @@
[LibraryClasses.X64.PEIM]
MmPlatformHobProducerLib|Include/Library/MmPlatformHobProducerLib.h

[LibraryClasses.AArch64, LibraryClasses.ARM]
## @libraryclass Defines a set of interfaces for the MM core entrypoint for
## AArch64 and ARM.
StandaloneMmCoreEntryPoint|Include/Library/Arm/StandaloneMmCoreEntryPoint.h

[Guids]
gStandaloneMmPkgTokenSpaceGuid = { 0x18fe7632, 0xf5c8, 0x4e63, { 0x8d, 0xe8, 0x17, 0xa5, 0x5c, 0x59, 0x13, 0xbd }}
gMpInformationHobGuid = { 0xba33f15d, 0x4000, 0x45c1, { 0x8e, 0x88, 0xf9, 0x16, 0x92, 0xd4, 0x57, 0xe3 }}
Expand All @@ -51,9 +46,6 @@

gEventMmDispatchGuid = { 0x7e6efffa, 0x69b4, 0x4c1b, { 0xa4, 0xc7, 0xaf, 0xf9, 0xc9, 0x24, 0x4f, 0xee }}

[Protocols]
gEdkiiPiMmCpuDriverEpProtocolGuid = { 0x6ecbd5a1, 0xc0f8, 0x4702, { 0x83, 0x01, 0x4f, 0xc2, 0xc5, 0x47, 0x0a, 0x51 }}

[PcdsFixedAtBuild, PcdsPatchableInModule]
## Maximum permitted encapsulation levels of sections in a firmware volume,
# in the MM phase. Minimum value is 1. Sections nested more deeply are rejected.
Expand Down
9 changes: 6 additions & 3 deletions StandaloneMmPkg/StandaloneMmPkg.dsc
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
PeCoffLib|MdePkg/Library/BasePeCoffLib/BasePeCoffLib.inf
PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
ReportStatusCodeLib|MdePkg/Library/BaseReportStatusCodeLibNull/BaseReportStatusCodeLibNull.inf
StandaloneMmCoreEntryPoint|StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf
StandaloneMmDriverEntryPoint|MdePkg/Library/StandaloneMmDriverEntryPoint/StandaloneMmDriverEntryPoint.inf
VariableMmDependency|StandaloneMmPkg/Library/VariableMmDependency/VariableMmDependency.inf
HobPrintLib|MdeModulePkg/Library/HobPrintLib/HobPrintLib.inf
Expand All @@ -72,8 +71,12 @@
PeiServicesTablePointerLib|MdePkg/Library/PeiServicesTablePointerLib/PeiServicesTablePointerLib.inf
MmUnblockMemoryLib|MdePkg/Library/MmUnblockMemoryLib/MmUnblockMemoryLibNull.inf

[LibraryClasses.X64]
StandaloneMmCoreEntryPoint|StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf

[LibraryClasses.AARCH64, LibraryClasses.ARM]
ArmLib|ArmPkg/Library/ArmLib/ArmBaseLib.inf
StandaloneMmCoreEntryPoint|ArmPkg/Library/ArmStandaloneMmCoreEntryPoint/ArmStandaloneMmCoreEntryPoint.inf
StandaloneMmMmuLib|ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.inf
ArmSmcLib|ArmPkg/Library/ArmSmcLib/ArmSmcLib.inf
ArmSvcLib|ArmPkg/Library/ArmSvcLib/ArmSvcLib.inf
Expand Down Expand Up @@ -135,7 +138,6 @@
#
StandaloneMmPkg/Core/StandaloneMmCore.inf
StandaloneMmPkg/Library/FvLib/FvLib.inf
StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf
StandaloneMmPkg/Library/StandaloneMmCoreHobLib/StandaloneMmCoreHobLib.inf
StandaloneMmPkg/Library/StandaloneMmCoreMemoryAllocationLib/StandaloneMmCoreMemoryAllocationLib.inf
StandaloneMmPkg/Library/StandaloneMmHobLib/StandaloneMmHobLib.inf
Expand All @@ -148,10 +150,11 @@
StandaloneMmPkg/Library/StandaloneMmExtractGuidedSectionLib/StandaloneMmExtractGuidedSectionLib.inf

[Components.AARCH64, Components.ARM]
StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.inf
ArmPkg/Library/ArmStandaloneMmCoreEntryPoint/ArmStandaloneMmCoreEntryPoint.inf
StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/StandaloneMmPeCoffExtraActionLib.inf

[Components.X64]
StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf
StandaloneMmPkg/Drivers/StandaloneMmIplPei/StandaloneMmIplPei.inf

###################################################################################################
Expand Down

0 comments on commit b0e1cf6

Please sign in to comment.