mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-23 13:44:33 +02:00
StandaloneMmPkg: build for 32bit arm machines
This change allows to build StandaloneMmPkg components for 32bit Arm StandaloneMm firmware. This change mainly moves AArch64/ source files to Arm/ side directory for several components: StandaloneMmCpu, StandaloneMmCoreEntryPoint and StandaloneMmMemLib. The source file is built for both 32b and 64b Arm targets. Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org> Reviewed-by: Ard Biesheuvel <ardb@kernel.org>
This commit is contained in:
parent
b7f0226a46
commit
a776bbabd9
@ -17,7 +17,7 @@
|
|||||||
PI_SPECIFICATION_VERSION = 0x00010032
|
PI_SPECIFICATION_VERSION = 0x00010032
|
||||||
ENTRY_POINT = StandaloneMmMain
|
ENTRY_POINT = StandaloneMmMain
|
||||||
|
|
||||||
# VALID_ARCHITECTURES = IA32 X64 AARCH64
|
# VALID_ARCHITECTURES = IA32 X64 AARCH64 ARM
|
||||||
|
|
||||||
[Sources]
|
[Sources]
|
||||||
StandaloneMmCore.c
|
StandaloneMmCore.c
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
Copyright (c) 2016 HP Development Company, L.P.
|
Copyright (c) 2016 HP Development Company, L.P.
|
||||||
Copyright (c) 2016 - 2021, Arm Limited. All rights reserved.
|
Copyright (c) 2016 - 2021, Arm Limited. All rights reserved.
|
||||||
|
Copyright (c) 2021, Linaro Limited
|
||||||
|
|
||||||
SPDX-License-Identifier: BSD-2-Clause-Patent
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
||||||
|
|
||||||
@ -92,8 +93,8 @@ PiMmStandaloneArmTfCpuDriverEntry (
|
|||||||
// receipt of a synchronous MM request. Use the Event ID to distinguish
|
// receipt of a synchronous MM request. Use the Event ID to distinguish
|
||||||
// between synchronous and asynchronous events.
|
// between synchronous and asynchronous events.
|
||||||
//
|
//
|
||||||
if ((ARM_SMC_ID_MM_COMMUNICATE_AARCH64 != EventId) &&
|
if ((ARM_SMC_ID_MM_COMMUNICATE != EventId) &&
|
||||||
(ARM_SVC_ID_FFA_MSG_SEND_DIRECT_REQ_AARCH64 != EventId)) {
|
(ARM_SVC_ID_FFA_MSG_SEND_DIRECT_REQ != EventId)) {
|
||||||
DEBUG ((DEBUG_INFO, "UnRecognized Event - 0x%x\n", EventId));
|
DEBUG ((DEBUG_INFO, "UnRecognized Event - 0x%x\n", EventId));
|
||||||
return EFI_INVALID_PARAMETER;
|
return EFI_INVALID_PARAMETER;
|
||||||
}
|
}
|
@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
#include <Base.h>
|
#include <Base.h>
|
||||||
#include <Pi/PiMmCis.h>
|
#include <Pi/PiMmCis.h>
|
||||||
#include <Library/AArch64/StandaloneMmCoreEntryPoint.h>
|
#include <Library/Arm/StandaloneMmCoreEntryPoint.h>
|
||||||
#include <Library/DebugLib.h>
|
#include <Library/DebugLib.h>
|
||||||
#include <Library/ArmSvcLib.h>
|
#include <Library/ArmSvcLib.h>
|
||||||
#include <Library/ArmLib.h>
|
#include <Library/ArmLib.h>
|
@ -14,7 +14,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
|
|||||||
#include <Guid/MmramMemoryReserve.h>
|
#include <Guid/MmramMemoryReserve.h>
|
||||||
#include <Guid/MpInformation.h>
|
#include <Guid/MpInformation.h>
|
||||||
|
|
||||||
#include <Library/AArch64/StandaloneMmCoreEntryPoint.h>
|
#include <Library/Arm/StandaloneMmCoreEntryPoint.h>
|
||||||
#include <Library/ArmMmuLib.h>
|
#include <Library/ArmMmuLib.h>
|
||||||
#include <Library/ArmSvcLib.h>
|
#include <Library/ArmSvcLib.h>
|
||||||
#include <Library/DebugLib.h>
|
#include <Library/DebugLib.h>
|
@ -14,7 +14,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
|
|||||||
#include <Guid/MmramMemoryReserve.h>
|
#include <Guid/MmramMemoryReserve.h>
|
||||||
#include <Guid/MpInformation.h>
|
#include <Guid/MpInformation.h>
|
||||||
|
|
||||||
#include <Library/AArch64/StandaloneMmCoreEntryPoint.h>
|
#include <Library/Arm/StandaloneMmCoreEntryPoint.h>
|
||||||
#include <Library/ArmMmuLib.h>
|
#include <Library/ArmMmuLib.h>
|
||||||
#include <Library/ArmSvcLib.h>
|
#include <Library/ArmSvcLib.h>
|
||||||
#include <Library/DebugLib.h>
|
#include <Library/DebugLib.h>
|
@ -10,7 +10,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
|
|||||||
|
|
||||||
#include <PiMm.h>
|
#include <PiMm.h>
|
||||||
|
|
||||||
#include <Library/AArch64/StandaloneMmCoreEntryPoint.h>
|
#include <Library/Arm/StandaloneMmCoreEntryPoint.h>
|
||||||
|
|
||||||
#include <PiPei.h>
|
#include <PiPei.h>
|
||||||
#include <Guid/MmramMemoryReserve.h>
|
#include <Guid/MmramMemoryReserve.h>
|
||||||
@ -182,13 +182,13 @@ DelegatedEventLoop (
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (FfaEnabled) {
|
if (FfaEnabled) {
|
||||||
EventCompleteSvcArgs->Arg0 = ARM_SVC_ID_FFA_MSG_SEND_DIRECT_RESP_AARCH64;
|
EventCompleteSvcArgs->Arg0 = ARM_SVC_ID_FFA_MSG_SEND_DIRECT_RESP;
|
||||||
EventCompleteSvcArgs->Arg1 = 0;
|
EventCompleteSvcArgs->Arg1 = 0;
|
||||||
EventCompleteSvcArgs->Arg2 = 0;
|
EventCompleteSvcArgs->Arg2 = 0;
|
||||||
EventCompleteSvcArgs->Arg3 = ARM_SVC_ID_SP_EVENT_COMPLETE_AARCH64;
|
EventCompleteSvcArgs->Arg3 = ARM_SVC_ID_SP_EVENT_COMPLETE;
|
||||||
EventCompleteSvcArgs->Arg4 = SvcStatus;
|
EventCompleteSvcArgs->Arg4 = SvcStatus;
|
||||||
} else {
|
} else {
|
||||||
EventCompleteSvcArgs->Arg0 = ARM_SVC_ID_SP_EVENT_COMPLETE_AARCH64;
|
EventCompleteSvcArgs->Arg0 = ARM_SVC_ID_SP_EVENT_COMPLETE;
|
||||||
EventCompleteSvcArgs->Arg1 = SvcStatus;
|
EventCompleteSvcArgs->Arg1 = SvcStatus;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -273,13 +273,13 @@ InitArmSvcArgs (
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
if (FeaturePcdGet (PcdFfaEnable)) {
|
if (FeaturePcdGet (PcdFfaEnable)) {
|
||||||
InitMmFoundationSvcArgs->Arg0 = ARM_SVC_ID_FFA_MSG_SEND_DIRECT_RESP_AARCH64;
|
InitMmFoundationSvcArgs->Arg0 = ARM_SVC_ID_FFA_MSG_SEND_DIRECT_RESP;
|
||||||
InitMmFoundationSvcArgs->Arg1 = 0;
|
InitMmFoundationSvcArgs->Arg1 = 0;
|
||||||
InitMmFoundationSvcArgs->Arg2 = 0;
|
InitMmFoundationSvcArgs->Arg2 = 0;
|
||||||
InitMmFoundationSvcArgs->Arg3 = ARM_SVC_ID_SP_EVENT_COMPLETE_AARCH64;
|
InitMmFoundationSvcArgs->Arg3 = ARM_SVC_ID_SP_EVENT_COMPLETE;
|
||||||
InitMmFoundationSvcArgs->Arg4 = *Ret;
|
InitMmFoundationSvcArgs->Arg4 = *Ret;
|
||||||
} else {
|
} else {
|
||||||
InitMmFoundationSvcArgs->Arg0 = ARM_SVC_ID_SP_EVENT_COMPLETE_AARCH64;
|
InitMmFoundationSvcArgs->Arg0 = ARM_SVC_ID_SP_EVENT_COMPLETE;
|
||||||
InitMmFoundationSvcArgs->Arg1 = *Ret;
|
InitMmFoundationSvcArgs->Arg1 = *Ret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -395,7 +395,7 @@ _ModuleEntryPoint (
|
|||||||
//
|
//
|
||||||
ProcessModuleEntryPointList (HobStart);
|
ProcessModuleEntryPointList (HobStart);
|
||||||
|
|
||||||
DEBUG ((DEBUG_INFO, "Shared Cpu Driver EP 0x%lx\n", (UINT64) CpuDriverEntryPoint));
|
DEBUG ((DEBUG_INFO, "Shared Cpu Driver EP %p\n", (VOID *) CpuDriverEntryPoint));
|
||||||
|
|
||||||
finish:
|
finish:
|
||||||
if (Status == RETURN_UNSUPPORTED) {
|
if (Status == RETURN_UNSUPPORTED) {
|
@ -21,10 +21,10 @@
|
|||||||
# VALID_ARCHITECTURES = IA32 X64 IPF EBC (EBC is for build only)
|
# VALID_ARCHITECTURES = IA32 X64 IPF EBC (EBC is for build only)
|
||||||
#
|
#
|
||||||
|
|
||||||
[Sources.AARCH64]
|
[Sources.AARCH64, Sources.ARM]
|
||||||
AArch64/StandaloneMmCoreEntryPoint.c
|
Arm/StandaloneMmCoreEntryPoint.c
|
||||||
AArch64/SetPermissions.c
|
Arm/SetPermissions.c
|
||||||
AArch64/CreateHobList.c
|
Arm/CreateHobList.c
|
||||||
|
|
||||||
[Sources.X64]
|
[Sources.X64]
|
||||||
X64/StandaloneMmCoreEntryPoint.c
|
X64/StandaloneMmCoreEntryPoint.c
|
||||||
@ -34,14 +34,14 @@
|
|||||||
MdeModulePkg/MdeModulePkg.dec
|
MdeModulePkg/MdeModulePkg.dec
|
||||||
StandaloneMmPkg/StandaloneMmPkg.dec
|
StandaloneMmPkg/StandaloneMmPkg.dec
|
||||||
|
|
||||||
[Packages.AARCH64]
|
[Packages.ARM, Packages.AARCH64]
|
||||||
ArmPkg/ArmPkg.dec
|
ArmPkg/ArmPkg.dec
|
||||||
|
|
||||||
[LibraryClasses]
|
[LibraryClasses]
|
||||||
BaseLib
|
BaseLib
|
||||||
DebugLib
|
DebugLib
|
||||||
|
|
||||||
[LibraryClasses.AARCH64]
|
[LibraryClasses.ARM, LibraryClasses.AARCH64]
|
||||||
StandaloneMmMmuLib
|
StandaloneMmMmuLib
|
||||||
ArmSvcLib
|
ArmSvcLib
|
||||||
|
|
||||||
@ -51,7 +51,7 @@
|
|||||||
gEfiStandaloneMmNonSecureBufferGuid
|
gEfiStandaloneMmNonSecureBufferGuid
|
||||||
gEfiArmTfCpuDriverEpDescriptorGuid
|
gEfiArmTfCpuDriverEpDescriptorGuid
|
||||||
|
|
||||||
[FeaturePcd.AARCH64]
|
[FeaturePcd.ARM, FeaturePcd.AARCH64]
|
||||||
gArmTokenSpaceGuid.PcdFfaEnable
|
gArmTokenSpaceGuid.PcdFfaEnable
|
||||||
|
|
||||||
[BuildOptions]
|
[BuildOptions]
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
LIBRARY_CLASS = HobLib|MM_CORE_STANDALONE
|
LIBRARY_CLASS = HobLib|MM_CORE_STANDALONE
|
||||||
|
|
||||||
#
|
#
|
||||||
# VALID_ARCHITECTURES = X64 AARCH64
|
# VALID_ARCHITECTURES = X64 AARCH64 ARM
|
||||||
#
|
#
|
||||||
[Sources.common]
|
[Sources.common]
|
||||||
Common.c
|
Common.c
|
||||||
@ -30,9 +30,9 @@
|
|||||||
[Sources.X64]
|
[Sources.X64]
|
||||||
X64/StandaloneMmCoreHobLib.c
|
X64/StandaloneMmCoreHobLib.c
|
||||||
|
|
||||||
[Sources.AARCH64]
|
[Sources.AARCH64, Sources.ARM]
|
||||||
AArch64/StandaloneMmCoreHobLib.c
|
Arm/StandaloneMmCoreHobLib.c
|
||||||
AArch64/StandaloneMmCoreHobLibInternal.c
|
Arm/StandaloneMmCoreHobLibInternal.c
|
||||||
|
|
||||||
[Packages]
|
[Packages]
|
||||||
MdePkg/MdePkg.dec
|
MdePkg/MdePkg.dec
|
||||||
|
@ -20,6 +20,13 @@
|
|||||||
//
|
//
|
||||||
extern EFI_PHYSICAL_ADDRESS mMmMemLibInternalMaximumSupportAddress;
|
extern EFI_PHYSICAL_ADDRESS mMmMemLibInternalMaximumSupportAddress;
|
||||||
|
|
||||||
|
#ifdef MDE_CPU_AARCH64
|
||||||
|
#define ARM_PHYSICAL_ADDRESS_BITS 36
|
||||||
|
#endif
|
||||||
|
#ifdef MDE_CPU_ARM
|
||||||
|
#define ARM_PHYSICAL_ADDRESS_BITS 32
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Calculate and save the maximum support address.
|
Calculate and save the maximum support address.
|
||||||
|
|
||||||
@ -31,7 +38,7 @@ MmMemLibInternalCalculateMaximumSupportAddress (
|
|||||||
{
|
{
|
||||||
UINT8 PhysicalAddressBits;
|
UINT8 PhysicalAddressBits;
|
||||||
|
|
||||||
PhysicalAddressBits = 36;
|
PhysicalAddressBits = ARM_PHYSICAL_ADDRESS_BITS;
|
||||||
|
|
||||||
//
|
//
|
||||||
// Save the maximum support address in one global variable
|
// Save the maximum support address in one global variable
|
@ -28,7 +28,7 @@
|
|||||||
#
|
#
|
||||||
# The following information is for reference only and not required by the build tools.
|
# The following information is for reference only and not required by the build tools.
|
||||||
#
|
#
|
||||||
# VALID_ARCHITECTURES = IA32 X64 AARCH64
|
# VALID_ARCHITECTURES = IA32 X64 AARCH64 ARM
|
||||||
#
|
#
|
||||||
|
|
||||||
[Sources.Common]
|
[Sources.Common]
|
||||||
@ -37,8 +37,8 @@
|
|||||||
[Sources.IA32, Sources.X64]
|
[Sources.IA32, Sources.X64]
|
||||||
X86StandaloneMmMemLibInternal.c
|
X86StandaloneMmMemLibInternal.c
|
||||||
|
|
||||||
[Sources.AARCH64]
|
[Sources.AARCH64, Sources.ARM]
|
||||||
AArch64/StandaloneMmMemLibInternal.c
|
ArmStandaloneMmMemLibInternal.c
|
||||||
|
|
||||||
[Packages]
|
[Packages]
|
||||||
MdePkg/MdePkg.dec
|
MdePkg/MdePkg.dec
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
#
|
#
|
||||||
# The following information is for reference only and not required by the build tools.
|
# The following information is for reference only and not required by the build tools.
|
||||||
#
|
#
|
||||||
# VALID_ARCHITECTURES = AARCH64
|
# VALID_ARCHITECTURES = AARCH64|ARM
|
||||||
#
|
#
|
||||||
#
|
#
|
||||||
|
|
||||||
|
@ -29,10 +29,10 @@
|
|||||||
## MM Memory Operation.
|
## MM Memory Operation.
|
||||||
MemLib|Include/Library/StandaloneMmMemLib.h
|
MemLib|Include/Library/StandaloneMmMemLib.h
|
||||||
|
|
||||||
[LibraryClasses.AArch64]
|
[LibraryClasses.AArch64, LibraryClasses.ARM]
|
||||||
## @libraryclass Defines a set of interfaces for the MM core entrypoint for
|
## @libraryclass Defines a set of interfaces for the MM core entrypoint for
|
||||||
## AArch64.
|
## AArch64 and ARM.
|
||||||
StandaloneMmCoreEntryPoint|Include/Library/AArch64/StandaloneMmCoreEntryPoint.h
|
StandaloneMmCoreEntryPoint|Include/Library/Arm/StandaloneMmCoreEntryPoint.h
|
||||||
|
|
||||||
[Guids]
|
[Guids]
|
||||||
gStandaloneMmPkgTokenSpaceGuid = { 0x18fe7632, 0xf5c8, 0x4e63, { 0x8d, 0xe8, 0x17, 0xa5, 0x5c, 0x59, 0x13, 0xbd }}
|
gStandaloneMmPkgTokenSpaceGuid = { 0x18fe7632, 0xf5c8, 0x4e63, { 0x8d, 0xe8, 0x17, 0xa5, 0x5c, 0x59, 0x13, 0xbd }}
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
PLATFORM_VERSION = 1.0
|
PLATFORM_VERSION = 1.0
|
||||||
DSC_SPECIFICATION = 0x00010011
|
DSC_SPECIFICATION = 0x00010011
|
||||||
OUTPUT_DIRECTORY = Build/StandaloneMm
|
OUTPUT_DIRECTORY = Build/StandaloneMm
|
||||||
SUPPORTED_ARCHITECTURES = AARCH64|X64
|
SUPPORTED_ARCHITECTURES = AARCH64|X64|ARM
|
||||||
BUILD_TARGETS = DEBUG|RELEASE
|
BUILD_TARGETS = DEBUG|RELEASE
|
||||||
SKUID_IDENTIFIER = DEFAULT
|
SKUID_IDENTIFIER = DEFAULT
|
||||||
|
|
||||||
@ -60,7 +60,7 @@
|
|||||||
StandaloneMmDriverEntryPoint|MdePkg/Library/StandaloneMmDriverEntryPoint/StandaloneMmDriverEntryPoint.inf
|
StandaloneMmDriverEntryPoint|MdePkg/Library/StandaloneMmDriverEntryPoint/StandaloneMmDriverEntryPoint.inf
|
||||||
VariableMmDependency|StandaloneMmPkg/Library/VariableMmDependency/VariableMmDependency.inf
|
VariableMmDependency|StandaloneMmPkg/Library/VariableMmDependency/VariableMmDependency.inf
|
||||||
|
|
||||||
[LibraryClasses.AARCH64]
|
[LibraryClasses.AARCH64, LibraryClasses.ARM]
|
||||||
ArmLib|ArmPkg/Library/ArmLib/ArmBaseLib.inf
|
ArmLib|ArmPkg/Library/ArmLib/ArmBaseLib.inf
|
||||||
StandaloneMmMmuLib|ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.inf
|
StandaloneMmMmuLib|ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.inf
|
||||||
ArmSvcLib|ArmPkg/Library/ArmSvcLib/ArmSvcLib.inf
|
ArmSvcLib|ArmPkg/Library/ArmSvcLib/ArmSvcLib.inf
|
||||||
@ -118,8 +118,8 @@
|
|||||||
StandaloneMmPkg/Library/StandaloneMmMemoryAllocationLib/StandaloneMmMemoryAllocationLib.inf
|
StandaloneMmPkg/Library/StandaloneMmMemoryAllocationLib/StandaloneMmMemoryAllocationLib.inf
|
||||||
StandaloneMmPkg/Library/VariableMmDependency/VariableMmDependency.inf
|
StandaloneMmPkg/Library/VariableMmDependency/VariableMmDependency.inf
|
||||||
|
|
||||||
[Components.AARCH64]
|
[Components.AARCH64, Components.ARM]
|
||||||
StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.inf
|
StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.inf
|
||||||
StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/StandaloneMmPeCoffExtraActionLib.inf
|
StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/StandaloneMmPeCoffExtraActionLib.inf
|
||||||
|
|
||||||
###################################################################################################
|
###################################################################################################
|
||||||
@ -135,6 +135,10 @@
|
|||||||
GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000 -march=armv8-a+nofp -mstrict-align
|
GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000 -march=armv8-a+nofp -mstrict-align
|
||||||
GCC:*_*_*_CC_FLAGS = -mstrict-align
|
GCC:*_*_*_CC_FLAGS = -mstrict-align
|
||||||
|
|
||||||
|
[BuildOptions.ARM]
|
||||||
|
GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000 -march=armv7-a
|
||||||
|
GCC:*_*_*_CC_FLAGS = -fno-stack-protector
|
||||||
|
|
||||||
[BuildOptions.X64]
|
[BuildOptions.X64]
|
||||||
MSFT:*_*_*_DLINK_FLAGS = /ALIGN:4096
|
MSFT:*_*_*_DLINK_FLAGS = /ALIGN:4096
|
||||||
GCC:*_GCC*_*_DLINK_FLAGS = -z common-page-size=0x1000
|
GCC:*_GCC*_*_DLINK_FLAGS = -z common-page-size=0x1000
|
||||||
|
Loading…
x
Reference in New Issue
Block a user