From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by mx.groups.io with SMTP id smtpd.web11.1227.1689086235536945552 for ; Tue, 11 Jul 2023 07:37:15 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: nishant.sharma@arm.com) 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 733402F4; Tue, 11 Jul 2023 07:37:57 -0700 (PDT) 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 553EA3F740; Tue, 11 Jul 2023 07:37:14 -0700 (PDT) From: "Nishant Sharma" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Sami Mujawar , Thomas Abraham , Sayanta Pattanayak , Achin Gupta Subject: [edk2-platforms][PATCH V1 01/20] ArmPkg: Change PcdFfaEnable flag datatype Date: Tue, 11 Jul 2023 15:36:39 +0100 Message-Id: <20230711143658.781597-2-nishant.sharma@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230711143658.781597-1-nishant.sharma@arm.com> References: <20230711143658.781597-1-nishant.sharma@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable FeatureFlag type PCD flags are declared by typecasting an integer value to BOOLEAN. These flags cannot be use in assembly code as assembler does not recognise C primitive types. Change the flag data type from BOOLEAN to UINT32. Signed-off-by: Nishant Sharma --- ArmPkg/ArmPkg.dec = | 14 +++++++------- ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.inf = | 4 ++-- StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntry= Point.inf | 4 ++-- ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.c = | 8 ++++---- StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/StandaloneMmCoreE= ntryPoint.c | 8 ++++---- 5 files changed, 19 insertions(+), 19 deletions(-) diff --git a/ArmPkg/ArmPkg.dec b/ArmPkg/ArmPkg.dec index 1a16d044c94b..c36c23e2e059 100644 --- a/ArmPkg/ArmPkg.dec +++ b/ArmPkg/ArmPkg.dec @@ -155,13 +155,6 @@ # hardware coherency (i.e., no virtualization or cache coherent DMA) gArmTokenSpaceGuid.PcdNormalMemoryNonshareableOverride|FALSE|BOOLEAN|0= x00000043 =20 -[PcdsFeatureFlag.AARCH64, PcdsFeatureFlag.ARM] - ## Used to select method for requesting services from S-EL1.

- # TRUE - Selects FF-A calls for communication between S-EL0 and SPM= C.
- # FALSE - Selects SVC calls for communication between S-EL0 and SPMC= .
- # @Prompt Enable FF-A support. - gArmTokenSpaceGuid.PcdFfaEnable|FALSE|BOOLEAN|0x0000005B - [PcdsFixedAtBuild.common] gArmTokenSpaceGuid.PcdTrustzoneSupport|FALSE|BOOLEAN|0x00000006 =20 @@ -298,6 +291,13 @@ # not currently supported. gArmTokenSpaceGuid.PcdArmNonSecModeTransition|0x3c9|UINT32|0x0000003E =20 + ## Used to select method for requesting services from S-EL1.

+ # 1 - Selects FF-A calls for communication between S-EL0 and SPMC. + # 0 - Selects SVC calls for communication between S-EL0 and SPMC. + # Using unsigned integer as boolean does not work on assembler. + # @Prompt Enable FF-A support. + gArmTokenSpaceGuid.PcdFfaEnable|0|UINT32|0x0000005B + =20 # # These PCDs are also defined as 'PcdsDynamic' or 'PcdsPatchableInModule= ' to be diff --git a/ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.inf = b/ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.inf index ff20e5898051..3c733585f573 100644 --- a/ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.inf +++ b/ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.inf @@ -1,6 +1,6 @@ #/** @file # -# Copyright (c) 2017 - 2021, Arm Limited. All rights reserved.
+# Copyright (c) 2017 - 2023, Arm Limited. All rights reserved. # # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -23,7 +23,7 @@ ArmPkg/ArmPkg.dec MdePkg/MdePkg.dec =20 -[FeaturePcd.ARM, FeaturePcd.AARCH64] +[FixedPcd] gArmTokenSpaceGuid.PcdFfaEnable =20 [LibraryClasses] diff --git a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Standalon= eMmCoreEntryPoint.inf b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoin= t/StandaloneMmCoreEntryPoint.inf index 75cfb98c0e75..dc6d3d859911 100644 --- a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCore= EntryPoint.inf +++ b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCore= EntryPoint.inf @@ -1,7 +1,7 @@ ## @file # Module entry point library for DXE core. # -# Copyright (c) 2017 - 2021, Arm Ltd. All rights reserved.
+# Copyright (c) 2017 - 2023, Arm Ltd. All rights reserved. # # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -51,7 +51,7 @@ gEfiStandaloneMmNonSecureBufferGuid gEfiArmTfCpuDriverEpDescriptorGuid =20 -[FeaturePcd.ARM, FeaturePcd.AARCH64] +[FixedPcd] gArmTokenSpaceGuid.PcdFfaEnable =20 # diff --git a/ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.c b/= ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.c index d55aff76201e..1a41a289ef17 100644 --- a/ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.c +++ b/ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.c @@ -1,7 +1,7 @@ /** @file File managing the MMU for ARMv8 architecture in S-EL0 =20 - Copyright (c) 2017 - 2021, Arm Limited. All rights reserved.
+ Copyright (c) 2017 - 2023, Arm Limited. All rights reserved. Copyright (c) 2021, Linaro Limited SPDX-License-Identifier: BSD-2-Clause-Patent =20 @@ -54,7 +54,7 @@ SendMemoryPermissionRequest ( } =20 ArmCallSvc (SvcArgs); - if (FeaturePcdGet (PcdFfaEnable)) { + if (FixedPcdGet32 (PcdFfaEnable) !=3D 0) { // Get/Set memory attributes is an atomic call, with // StandaloneMm at S-EL0 being the caller and the SPM // core being the callee. Thus there won't be a @@ -163,7 +163,7 @@ GetMemoryPermissions ( // Prepare the message parameters. // See [1], Section 13.5.5.1 MM_SP_MEMORY_ATTRIBUTES_GET_AARCH64. ZeroMem (&SvcArgs, sizeof (ARM_SVC_ARGS)); - if (FeaturePcdGet (PcdFfaEnable)) { + if (FixedPcdGet32 (PcdFfaEnable) !=3D 0) { // See [2], Section 10.2 FFA_MSG_SEND_DIRECT_REQ. SvcArgs.Arg0 =3D ARM_SVC_ID_FFA_MSG_SEND_DIRECT_REQ; SvcArgs.Arg1 =3D ARM_FFA_DESTINATION_ENDPOINT_ID; @@ -218,7 +218,7 @@ RequestMemoryPermissionChange ( // Prepare the message parameters. // See [1], Section 13.5.5.2 MM_SP_MEMORY_ATTRIBUTES_SET_AARCH64. ZeroMem (&SvcArgs, sizeof (ARM_SVC_ARGS)); - if (FeaturePcdGet (PcdFfaEnable)) { + if (FixedPcdGet32 (PcdFfaEnable) !=3D 0) { // See [2], Section 10.2 FFA_MSG_SEND_DIRECT_REQ. SvcArgs.Arg0 =3D ARM_SVC_ID_FFA_MSG_SEND_DIRECT_REQ; SvcArgs.Arg1 =3D ARM_FFA_DESTINATION_ENDPOINT_ID; diff --git a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/Stand= aloneMmCoreEntryPoint.c b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPo= int/Arm/StandaloneMmCoreEntryPoint.c index 96de10405af8..5dd1d9747995 100644 --- a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/StandaloneMm= CoreEntryPoint.c +++ b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/StandaloneMm= CoreEntryPoint.c @@ -2,7 +2,7 @@ Entry point to the Standalone MM Foundation when initialized during th= e SEC phase on ARM platforms =20 -Copyright (c) 2017 - 2021, Arm Ltd. All rights reserved.
+Copyright (c) 2017 - 2023, Arm Ltd. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent =20 **/ @@ -140,7 +140,7 @@ DelegatedEventLoop ( DEBUG ((DEBUG_INFO, "X6 : 0x%x\n", (UINT32)EventCompleteSvcArgs->Ar= g6)); DEBUG ((DEBUG_INFO, "X7 : 0x%x\n", (UINT32)EventCompleteSvcArgs->Ar= g7)); =20 - FfaEnabled =3D FeaturePcdGet (PcdFfaEnable); + FfaEnabled =3D FixedPcdGet32 (PcdFfaEnable !=3D 0); if (FfaEnabled) { Status =3D CpuDriverEntryPoint ( EventCompleteSvcArgs->Arg0, @@ -225,7 +225,7 @@ GetSpmVersion ( UINT32 SpmVersion; ARM_SVC_ARGS SpmVersionArgs; =20 - if (FeaturePcdGet (PcdFfaEnable)) { + if (FixedPcdGet32 (PcdFfaEnable) !=3D 0) { SpmVersionArgs.Arg0 =3D ARM_SVC_ID_FFA_VERSION_AARCH32; SpmVersionArgs.Arg1 =3D mSpmMajorVerFfa << SPM_MAJOR_VER_SHIFT; SpmVersionArgs.Arg1 |=3D mSpmMinorVerFfa; @@ -293,7 +293,7 @@ InitArmSvcArgs ( OUT INT32 *Ret ) { - if (FeaturePcdGet (PcdFfaEnable)) { + if (FixedPcdGet32 (PcdFfaEnable) !=3D 0) { InitMmFoundationSvcArgs->Arg0 =3D ARM_SVC_ID_FFA_MSG_SEND_DIRECT_RES= P; InitMmFoundationSvcArgs->Arg1 =3D 0; InitMmFoundationSvcArgs->Arg2 =3D 0; --=20 2.34.1