From nobody Sat Feb 7 06:49:14 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+106807+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+106807+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=arm.com ARC-Seal: i=1; a=rsa-sha256; t=1689086252; cv=none; d=zohomail.com; s=zohoarc; b=L0AEEd/fjuvMkRhzrji+dQY6dg+3qpIfFheErLdIE+wnSww1fbUQeb6jB/7aYTzfdrIvYvpLy3P85MFiAkDGdmiaSSy4rJ0RidlznZkaUaa6cakfHHimgUB7wqcN3bAwKCHexl3AF9+reIcfHDowDW1IP4Vl5KauFouT4n1M7Bo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1689086252; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=KOLeOE/DfUJrVJjZooSSxu27SrdxyE127GuFjqIv5PA=; b=RGCKS/iv53082UfQ46ziNUxmGcxCVADOPJxhbDtomtc5RolPNF5bzqfVmczd5TnnE7zUpwLEtiLaAZHzrZXfD9h+rhbi9UocCQ+HCkCHKDWls2t63Kysieh5QiogtNovAU7xK3JarrMywcf4GkUDyREDZwNDynLnbZ7JVluen1A= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+106807+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1689086252835650.059188979515; Tue, 11 Jul 2023 07:37:32 -0700 (PDT) Return-Path: DKIM-Signature: a=rsa-sha256; bh=iuy+QqCmqWBRLigBwpUDL3prfzZqN08xhr/EGsd5e+w=; c=relaxed/simple; d=groups.io; h=X-Received:X-Received:X-Received:X-Received:From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Unsubscribe:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:X-Gm-Message-State:Content-Transfer-Encoding; s=20140610; t=1689086252; v=1; b=Zd2gMxKGy3XmfhmNmjLQskwGyJ6boE2WV0MmHUSsinlxDjhNnES7IAgJB/vXNu9PratOeAyf 1X/85m5veQUd5Uzx2BLPlUH7aqdC4nyOLR3qRGBHDSrMNk88Rdgz4xCYMcxv2emLEQnxniJatdC ne0rhMKvjDNBErOMq7fTRlsI= X-Received: by 127.0.0.2 with SMTP id ijpKYY1788612xJLVhd9B1Rp; Tue, 11 Jul 2023 07:37:32 -0700 X-Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web10.1277.1689086250840632971 for ; Tue, 11 Jul 2023 07:37:30 -0700 X-Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id B786D2F4; Tue, 11 Jul 2023 07:38:12 -0700 (PDT) X-Received: from usa.arm.com (iss-desktop02.cambridge.arm.com [10.1.196.79]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 9A04B3F740; Tue, 11 Jul 2023 07:37:29 -0700 (PDT) From: "Nishant Sharma" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Sami Mujawar , Thomas Abraham , Sayanta Pattanayak , Achin Gupta Subject: [edk2-devel] [edk2-platforms][PATCH V1 15/20] ArmPkg/MmCommunicationDxe: Add support for obtaining FF-A partition ID Date: Tue, 11 Jul 2023 15:36:53 +0100 Message-Id: <20230711143658.781597-16-nishant.sharma@arm.com> In-Reply-To: <20230711143658.781597-1-nishant.sharma@arm.com> References: <20230711143658.781597-1-nishant.sharma@arm.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,nishant.sharma@arm.com X-Gm-Message-State: YABwW53HRNqpxUdRejkchckwx1787277AA= Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1689086254695100067 Content-Type: text/plain; charset="utf-8" From: Achin Gupta This patch invokes the FFA_ID_GET to obtain and stash the ID of the the FF-A partition that implements the DXE MM communication driver. This ID is used in subsequent patches for sending and receiving MM communication protocol requests and responses that are packaged as FF-A messages. Signed-off-by: Achin Gupta Signed-off-by: Nishant Sharma --- ArmPkg/Include/IndustryStandard/ArmFfaSvc.h | 1 + ArmPkg/Drivers/MmCommunicationDxe/MmCommunication.c | 22 +++++++++++++++++= +++ 2 files changed, 23 insertions(+) diff --git a/ArmPkg/Include/IndustryStandard/ArmFfaSvc.h b/ArmPkg/Include/I= ndustryStandard/ArmFfaSvc.h index 4a51f9fb56af..20eeb822ea56 100644 --- a/ArmPkg/Include/IndustryStandard/ArmFfaSvc.h +++ b/ArmPkg/Include/IndustryStandard/ArmFfaSvc.h @@ -17,6 +17,7 @@ #define ARM_FFA_SVC_H_ =20 #define ARM_SVC_ID_FFA_VERSION_AARCH32 0x84000063 +#define ARM_SVC_ID_FFA_ID_GET_AARCH32 0x84000069 #define ARM_SVC_ID_FFA_MSG_SEND_DIRECT_REQ_AARCH32 0x8400006F #define ARM_SVC_ID_FFA_MSG_SEND_DIRECT_RESP_AARCH32 0x84000070 #define ARM_SVC_ID_FFA_MSG_SEND_DIRECT_REQ_AARCH64 0xC400006F diff --git a/ArmPkg/Drivers/MmCommunicationDxe/MmCommunication.c b/ArmPkg/D= rivers/MmCommunicationDxe/MmCommunication.c index a6fcd590a65b..f907ccf7349f 100644 --- a/ArmPkg/Drivers/MmCommunicationDxe/MmCommunication.c +++ b/ArmPkg/Drivers/MmCommunicationDxe/MmCommunication.c @@ -23,6 +23,11 @@ =20 #include "MmCommunicate.h" =20 +// +// Partition ID if FF-A support is enabled +// +STATIC UINT16 mFfaPartId; + // // Address, Length of the pre-allocated buffer for communication with the = secure // world. @@ -288,6 +293,23 @@ GetMmCompatibility ( Status =3D EFI_UNSUPPORTED; } =20 + // If FF-A is supported then discover our ID. + if (FixedPcdGet32 (PcdFfaEnable) !=3D 0) { + + // Get our ID + ZeroMem(&SmcArgs, sizeof(SmcArgs)); + SmcArgs.Arg0 =3D ARM_SVC_ID_FFA_ID_GET_AARCH32; + ArmCallSmc (&SmcArgs); + if (SmcArgs.Arg0 =3D=3D ARM_SVC_ID_FFA_ERROR_AARCH32) { + DEBUG ((DEBUG_ERROR, "Unable to retrieve FF-A partition ID (%d).\n",= SmcArgs.Arg2)); + return EFI_UNSUPPORTED; + } + DEBUG ((DEBUG_INFO, "FF-A partition ID =3D 0x%lx.\n", SmcArgs.Arg2)); + mFfaPartId =3D SmcArgs.Arg2; + + return EFI_SUCCESS; + } + return Status; } =20 --=20 2.34.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#106807): https://edk2.groups.io/g/devel/message/106807 Mute This Topic: https://groups.io/mt/100079888/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-