StandaloneMmPkg: Arm: Update to use the new StandaloneMmCpu driver

Update entry point library for Arm to use the new architecture independent
StandaloneMmCpu driver.

Signed-off-by: Tuan Phan <tphan@ventanamicro.com>
Reviewed-by: levi.yun <yeoreum.yun@arm.com>
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
This commit is contained in:
Tuan Phan
2023-09-28 14:14:04 -07:00
committed by mergify[bot]
parent e7a7169446
commit ba9c3ceaf8
4 changed files with 67 additions and 64 deletions

View File

@@ -15,6 +15,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
#include <Guid/MmramMemoryReserve.h>
#include <Guid/MpInformation.h>
#include <StandaloneMmCpu.h>
#include <Library/ArmSvcLib.h>
#include <Library/DebugLib.h>
#include <Library/HobLib.h>
@@ -41,7 +42,7 @@ STATIC CONST UINT32 mSpmMinorVerFfa = SPM_MINOR_VERSION_FFA;
#define BOOT_PAYLOAD_VERSION 1
PI_MM_ARM_TF_CPU_DRIVER_ENTRYPOINT CpuDriverEntryPoint = NULL;
PI_MM_CPU_DRIVER_ENTRYPOINT CpuDriverEntryPoint = NULL;
/**
Retrieve a pointer to and print the boot information passed by privileged
@@ -140,34 +141,46 @@ DelegatedEventLoop (
DEBUG ((DEBUG_INFO, "X6 : 0x%x\n", (UINT32)EventCompleteSvcArgs->Arg6));
DEBUG ((DEBUG_INFO, "X7 : 0x%x\n", (UINT32)EventCompleteSvcArgs->Arg7));
FfaEnabled = FeaturePcdGet (PcdFfaEnable);
if (FfaEnabled) {
Status = CpuDriverEntryPoint (
EventCompleteSvcArgs->Arg0,
EventCompleteSvcArgs->Arg6,
EventCompleteSvcArgs->Arg3
);
if (EFI_ERROR (Status)) {
DEBUG ((
DEBUG_ERROR,
"Failed delegated event 0x%x, Status 0x%x\n",
EventCompleteSvcArgs->Arg3,
Status
));
}
//
// ARM TF passes SMC FID of the MM_COMMUNICATE interface as the Event ID upon
// receipt of a synchronous MM request. Use the Event ID to distinguish
// between synchronous and asynchronous events.
//
if ((ARM_SMC_ID_MM_COMMUNICATE != (UINT32)EventCompleteSvcArgs->Arg0) &&
(ARM_SVC_ID_FFA_MSG_SEND_DIRECT_REQ != (UINT32)EventCompleteSvcArgs->Arg0))
{
DEBUG ((DEBUG_ERROR, "UnRecognized Event - 0x%x\n", (UINT32)EventCompleteSvcArgs->Arg0));
Status = EFI_INVALID_PARAMETER;
} else {
Status = CpuDriverEntryPoint (
EventCompleteSvcArgs->Arg0,
EventCompleteSvcArgs->Arg3,
EventCompleteSvcArgs->Arg1
);
if (EFI_ERROR (Status)) {
DEBUG ((
DEBUG_ERROR,
"Failed delegated event 0x%x, Status 0x%x\n",
EventCompleteSvcArgs->Arg0,
Status
));
FfaEnabled = FeaturePcdGet (PcdFfaEnable);
if (FfaEnabled) {
Status = CpuDriverEntryPoint (
EventCompleteSvcArgs->Arg0,
EventCompleteSvcArgs->Arg6,
EventCompleteSvcArgs->Arg3
);
if (EFI_ERROR (Status)) {
DEBUG ((
DEBUG_ERROR,
"Failed delegated event 0x%x, Status 0x%x\n",
EventCompleteSvcArgs->Arg3,
Status
));
}
} else {
Status = CpuDriverEntryPoint (
EventCompleteSvcArgs->Arg0,
EventCompleteSvcArgs->Arg3,
EventCompleteSvcArgs->Arg1
);
if (EFI_ERROR (Status)) {
DEBUG ((
DEBUG_ERROR,
"Failed delegated event 0x%x, Status 0x%x\n",
EventCompleteSvcArgs->Arg0,
Status
));
}
}
}