From: Achin Gupta <achin.gu...@arm.com>

This patch adds support for correctly receiving a request for a
Standalome MM driver service using the MM communication protocol
packaged as an FF-A direct request message.

Signed-off-by: Achin Gupta <achin.gu...@arm.com>
Signed-off-by: Nishant Sharma <nishant.sha...@arm.com>
---
 
StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/StandaloneMmCoreEntryPoint.c
 | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git 
a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/StandaloneMmCoreEntryPoint.c
 
b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/StandaloneMmCoreEntryPoint.c
index a763bf8509b2..e0987cba21f9 100644
--- 
a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/StandaloneMmCoreEntryPoint.c
+++ 
b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/StandaloneMmCoreEntryPoint.c
@@ -198,6 +198,8 @@ DelegatedEventLoop (
   BOOLEAN     FfaEnabled;
   EFI_STATUS  Status;
   UINTN       SvcStatus;
+  UINT16      SenderPartId;
+  UINT16      ReceiverPartId;
 
   while (TRUE) {
     ArmCallSvc (EventCompleteSvcArgs);
@@ -214,9 +216,12 @@ DelegatedEventLoop (
 
     FfaEnabled = FixedPcdGet32 (PcdFfaEnable != 0);
     if (FfaEnabled) {
+      SenderPartId = EventCompleteSvcArgs->Arg1 >> 16;
+      ReceiverPartId = EventCompleteSvcArgs->Arg1 & 0xffff;
       Status = CpuDriverEntryPoint (
                  EventCompleteSvcArgs->Arg0,
-                 EventCompleteSvcArgs->Arg6,
+                 // Assume CPU number 0
+                 0,
                  EventCompleteSvcArgs->Arg3
                  );
       if (EFI_ERROR (Status)) {
@@ -266,7 +271,7 @@ DelegatedEventLoop (
 
     if (FfaEnabled) {
       EventCompleteSvcArgs->Arg0 = ARM_SVC_ID_FFA_MSG_SEND_DIRECT_RESP;
-      EventCompleteSvcArgs->Arg1 = 0;
+      EventCompleteSvcArgs->Arg1 = ReceiverPartId << 16 | SenderPartId;
       EventCompleteSvcArgs->Arg2 = 0;
       EventCompleteSvcArgs->Arg3 = ARM_SVC_ID_SP_EVENT_COMPLETE;
       EventCompleteSvcArgs->Arg4 = SvcStatus;
-- 
2.34.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#106812): https://edk2.groups.io/g/devel/message/106812
Mute This Topic: https://groups.io/mt/100079894/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to