From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ed1-f50.google.com (mail-ed1-f50.google.com [209.85.208.50]) by mx.groups.io with SMTP id smtpd.web10.4688.1620813676329362517 for ; Wed, 12 May 2021 03:01:16 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=pfOS5d30; spf=pass (domain: linaro.org, ip: 209.85.208.50, mailfrom: etienne.carriere@linaro.org) Received: by mail-ed1-f50.google.com with SMTP id s6so26299874edu.10 for ; Wed, 12 May 2021 03:01:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=HngL6G0L41zRzdlPK0Kb7emPyBQOZAppoByEkTqw5Nc=; b=pfOS5d30RxAJYz+hhSzv8Bj+dl4AgWowmmIxTyHGq2OZLb+ooaqBMxh5YRJRf+Aa67 GaEQERF8545yPMra68QDTrzkSfja/ANiIHjfRsv/FY72tZEyE+iBswLiYtj372HWKTJi eli5IluKs8eyqtSsMiIuKyTVEReUY03TBFmH5RP0o03i0nIGs1e2wGd0enTDKW0zosat CYWj3yqPGYP7NbM2Yb7q7fHiH+LdF19M6Lw7m7kSnBD6O4xoyLfLIA7DneyeNDPV+Gk3 qtTE7HjiZYUodkLyyCSa/9cQbRiB2/LqV2K3wAhd2sQfWPCVdio+Z6KhlSV1X6U7Mf/Z BT4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=HngL6G0L41zRzdlPK0Kb7emPyBQOZAppoByEkTqw5Nc=; b=rHDGb8nm1b/qbe4mq8jksYc4QPRN9URbYMGrKMepXe240dwgghFwiHXaMGoHFYIYN2 679jlCXvdj+UUN6t1hngLFeYkStedclTq0SzIxovf2eAz0hBQ63IfZUdZXzWSKY2UeeT 1nTy7HdV8+6NYCJKdHMl0GaKSYT1NtdKmuR+MV44kKdvGQx129Gj0ujkhPBxH5rxE2+B CQ5u5o74j9fHQDBm0dA2mLtIssbxnBiKqzICdiIXmI+UwxbFRv9rzKLcc/xV8lYvAL7M GmSteCLT5+Z68PJFv5ngLryiWPsUXJ9LTCzVrHbvldQ3Q516HZvS2rWSad4oTAnOj8nS Clqg== X-Gm-Message-State: AOAM5338PkYzLf2QtLn87jwEujU8jhc46JkxCLWYKOzIlu81zTHa0CFu 5Gbz+McKOpjL1kJwVpCd8zznjPPTNgJ4zqXRsNMI3w== X-Google-Smtp-Source: ABdhPJy0yf8Wn26s7pvUDYHFhyT5rTgNBi+q5TxtybkemWUH+Krs7eVTCZ9lbQnB9isI0ujXUJn5rzGi3p2aILMPck0= X-Received: by 2002:a05:6402:19b9:: with SMTP id o25mr37278965edz.192.1620813674807; Wed, 12 May 2021 03:01:14 -0700 (PDT) MIME-Version: 1.0 References: <20210504152048.8739-1-etienne.carriere@linaro.org> <20210504152048.8739-6-etienne.carriere@linaro.org> In-Reply-To: From: "Etienne Carriere" Date: Wed, 12 May 2021 12:01:03 +0200 Message-ID: Subject: Re: [PATCH 5/5] StandaloneMmPkg: build for 32bit arm machines To: Sami Mujawar Cc: devel@edk2.groups.io, Achin Gupta , Ard Biesheuvel , Jiewen Yao , Leif Lindholm , Sughosh Ganu , nd@arm.com Content-Type: text/plain; charset="UTF-8" Hello Sami, Thanks for the comments. I'll address them in v2 if this series. Regards, Etienne On Tue, 11 May 2021 at 21:18, Sami Mujawar wrote: > > Hi Etienne, > > Thank you for this patch. > > I am getting build errors in VariableMmDependency.inf when building for > ARM. Not sure if you are getting these or it is my development > environment (I am building on a Windows Host PC). Can you let me know > which AArch32 GCC compiler you are using, please? I am using gcc 9.2 cross toolchain prebuilt by Arm (arm-linux-none-gnueabihf, 19dec2019) from: https://developer.arm.com/tools-and-software/open-source-software/developer-tools/gnu-toolchain/gnu-a/downloads > > Apart from this, there are some minor comments that I have marked inline > as [SAMI]. > > With those addressed. > > Reviewed-by: Sami Mujawar > > Regards, > > Sami Mujawar > > On 04/05/2021 04:20 PM, Etienne Carriere wrote: > > 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. > > > > Cc: Achin Gupta > > Cc: Ard Biesheuvel > > Cc: Jiewen Yao > > Cc: Leif Lindholm > > Cc: Sami Mujawar > > Cc: Sughosh Ganu > > Signed-off-by: Etienne Carriere > > --- > > StandaloneMmPkg/Core/StandaloneMmCore.inf | 2 +- > > StandaloneMmPkg/Drivers/StandaloneMmCpu/{AArch64 => }/EventHandle.c | 12 ++++++++++-- > > StandaloneMmPkg/Drivers/StandaloneMmCpu/{AArch64 => }/StandaloneMmCpu.c | 2 +- > > StandaloneMmPkg/Drivers/StandaloneMmCpu/{AArch64 => }/StandaloneMmCpu.h | 0 > > StandaloneMmPkg/Drivers/StandaloneMmCpu/{AArch64 => }/StandaloneMmCpu.inf | 0 > > StandaloneMmPkg/Include/Library/{AArch64 => Arm}/StandaloneMmCoreEntryPoint.h | 0 > > StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/{AArch64 => Arm}/CreateHobList.c | 2 +- > > StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/{AArch64 => Arm}/SetPermissions.c | 2 +- > > StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/{AArch64 => Arm}/StandaloneMmCoreEntryPoint.c | 16 ++++++++-------- > > StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf | 14 +++++++------- > > StandaloneMmPkg/Library/StandaloneMmCoreHobLib/{AArch64 => Arm}/StandaloneMmCoreHobLib.c | 0 > > StandaloneMmPkg/Library/StandaloneMmCoreHobLib/{AArch64 => Arm}/StandaloneMmCoreHobLibInternal.c | 0 > > StandaloneMmPkg/Library/StandaloneMmCoreHobLib/StandaloneMmCoreHobLib.inf | 8 ++++---- > > StandaloneMmPkg/Library/StandaloneMmMemLib/{AArch64/StandaloneMmMemLibInternal.c => ArmStandaloneMmMemLibInternal.c} | 9 ++++++++- > > StandaloneMmPkg/Library/StandaloneMmMemLib/StandaloneMmMemLib.inf | 6 +++--- > > StandaloneMmPkg/Library/VariableMmDependency/VariableMmDependency.inf | 2 +- > > StandaloneMmPkg/StandaloneMmPkg.dsc | 8 ++++---- > > 17 files changed, 49 insertions(+), 34 deletions(-) > > > > diff --git a/StandaloneMmPkg/Core/StandaloneMmCore.inf b/StandaloneMmPkg/Core/StandaloneMmCore.inf > > index 87bf6e9440..56042b7b39 100644 > > --- a/StandaloneMmPkg/Core/StandaloneMmCore.inf > > +++ b/StandaloneMmPkg/Core/StandaloneMmCore.inf > > @@ -17,7 +17,7 @@ > > PI_SPECIFICATION_VERSION = 0x00010032 > > ENTRY_POINT = StandaloneMmMain > > > > -# VALID_ARCHITECTURES = IA32 X64 AARCH64 > > +# VALID_ARCHITECTURES = IA32 X64 AARCH64 ARM > > > > [Sources] > > StandaloneMmCore.c > > diff --git a/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/EventHandle.c b/StandaloneMmPkg/Drivers/StandaloneMmCpu/EventHandle.c > > similarity index 92% > > rename from StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/EventHandle.c > > rename to StandaloneMmPkg/Drivers/StandaloneMmCpu/EventHandle.c > > index 63fbe26642..2d7fd81133 100644 > > --- a/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/EventHandle.c > > +++ b/StandaloneMmPkg/Drivers/StandaloneMmCpu/EventHandle.c > > @@ -2,6 +2,7 @@ > > > > Copyright (c) 2016 HP Development Company, L.P. > > Copyright (c) 2016 - 2021, Arm Limited. All rights reserved. > > + Copyright (c) 2021, Linaro Limited > > > > SPDX-License-Identifier: BSD-2-Clause-Patent > > > > @@ -27,6 +28,13 @@ > > > > #include "StandaloneMmCpu.h" > > > > +#ifdef MDE_CPU_AARCH64 > > +#define ARM_SMC_ID_MM_COMMUNICATE ARM_SMC_ID_MM_COMMUNICATE_AARCH64 > > +#endif > > +#ifdef MDE_CPU_ARM > > +#define ARM_SMC_ID_MM_COMMUNICATE ARM_SMC_ID_MM_COMMUNICATE_AARCH32 > > +#endif > [SAMI] Should this definition be in > ArmPkg\Include\IndustryStandard\ArmStdSmc.h? > I can see Patch 2/5 uses the above define in > ArmPkg/Drivers/MmCommunicationDxe/MmCommunication.c. That would make sense, yes. I'll update in v2. > [/SAMI] > > + > > EFI_STATUS > > EFIAPI > > MmFoundationEntryRegister ( > > @@ -92,8 +100,8 @@ PiMmStandaloneArmTfCpuDriverEntry ( > > // receipt of a synchronous MM request. Use the Event ID to distinguish > > // between synchronous and asynchronous events. > > // > > - if ((ARM_SMC_ID_MM_COMMUNICATE_AARCH64 != EventId) && > > - (ARM_SVC_ID_FFA_MSG_SEND_DIRECT_REQ_AARCH64 != EventId)) { > > + if ((ARM_SMC_ID_MM_COMMUNICATE != EventId) && > > + (ARM_SVC_ID_FFA_MSG_SEND_DIRECT_REQ != EventId)) { > > DEBUG ((DEBUG_INFO, "UnRecognized Event - 0x%x\n", EventId)); > > return EFI_INVALID_PARAMETER; > > } > > diff --git a/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.c b/StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.c > > similarity index 96% > > rename from StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.c > > rename to StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.c > > index d4590bcd19..10097f792f 100644 > > --- a/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.c > > +++ b/StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.c > > @@ -10,7 +10,7 @@ > > > > #include > > #include > > -#include > > +#include > > #include > > #include > > #include > > diff --git a/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.h b/StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.h > > similarity index 100% > > rename from StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.h > > rename to StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.h > > diff --git a/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.inf b/StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.inf > > similarity index 100% > > rename from StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.inf > > rename to StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.inf > > diff --git a/StandaloneMmPkg/Include/Library/AArch64/StandaloneMmCoreEntryPoint.h b/StandaloneMmPkg/Include/Library/Arm/StandaloneMmCoreEntryPoint.h > > similarity index 100% > > rename from StandaloneMmPkg/Include/Library/AArch64/StandaloneMmCoreEntryPoint.h > > rename to StandaloneMmPkg/Include/Library/Arm/StandaloneMmCoreEntryPoint.h > > diff --git a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/CreateHobList.c b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/CreateHobList.c > > similarity index 97% > > rename from StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/CreateHobList.c > > rename to StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/CreateHobList.c > > index 4d4cf3d5ff..85f8194687 100644 > > --- a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/CreateHobList.c > > +++ b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/CreateHobList.c > > @@ -14,7 +14,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent > > #include > > #include > > > > -#include > > +#include > > #include > > #include > > #include > > diff --git a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/SetPermissions.c b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/SetPermissions.c > > similarity index 96% > > rename from StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/SetPermissions.c > > rename to StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/SetPermissions.c > > index 4a380df4a6..cd4b90823e 100644 > > --- a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/SetPermissions.c > > +++ b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/SetPermissions.c > > @@ -14,7 +14,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent > > #include > > #include > > > > -#include > > +#include > > #include > > #include > > #include > > diff --git a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/StandaloneMmCoreEntryPoint.c b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/StandaloneMmCoreEntryPoint.c > > similarity index 94% > > rename from StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/StandaloneMmCoreEntryPoint.c > > rename to StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/StandaloneMmCoreEntryPoint.c > > index b445d6942e..e199e81bbd 100644 > > --- a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/AArch64/StandaloneMmCoreEntryPoint.c > > +++ b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/StandaloneMmCoreEntryPoint.c > > @@ -10,7 +10,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent > > > > #include > > > > -#include > > +#include > > > > #include > > #include > > @@ -182,13 +182,13 @@ DelegatedEventLoop ( > > } > > > > 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->Arg2 = 0; > > - EventCompleteSvcArgs->Arg3 = ARM_SVC_ID_SP_EVENT_COMPLETE_AARCH64; > > + EventCompleteSvcArgs->Arg3 = ARM_SVC_ID_SP_EVENT_COMPLETE; > > EventCompleteSvcArgs->Arg4 = SvcStatus; > > } else { > > - EventCompleteSvcArgs->Arg0 = ARM_SVC_ID_SP_EVENT_COMPLETE_AARCH64; > > + EventCompleteSvcArgs->Arg0 = ARM_SVC_ID_SP_EVENT_COMPLETE; > > EventCompleteSvcArgs->Arg1 = SvcStatus; > > } > > } > > @@ -273,13 +273,13 @@ InitArmSvcArgs ( > > ) > > { > > 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->Arg2 = 0; > > - InitMmFoundationSvcArgs->Arg3 = ARM_SVC_ID_SP_EVENT_COMPLETE_AARCH64; > > + InitMmFoundationSvcArgs->Arg3 = ARM_SVC_ID_SP_EVENT_COMPLETE; > > InitMmFoundationSvcArgs->Arg4 = *Ret; > > } else { > > - InitMmFoundationSvcArgs->Arg0 = ARM_SVC_ID_SP_EVENT_COMPLETE_AARCH64; > > + InitMmFoundationSvcArgs->Arg0 = ARM_SVC_ID_SP_EVENT_COMPLETE; > > InitMmFoundationSvcArgs->Arg1 = *Ret; > > } > > } > > @@ -395,7 +395,7 @@ _ModuleEntryPoint ( > > // > > 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)); > [SAMI] void * should be changed to VOID* ok > [/SAMI] > > > > finish: > > if (Status == RETURN_UNSUPPORTED) { > > diff --git a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf > > index 4fa426f58e..1762586cfa 100644 > > --- a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf > > +++ b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/StandaloneMmCoreEntryPoint.inf > > @@ -21,10 +21,10 @@ > > # VALID_ARCHITECTURES = IA32 X64 IPF EBC (EBC is for build only) > > # > > > > -[Sources.AARCH64] > > - AArch64/StandaloneMmCoreEntryPoint.c > > - AArch64/SetPermissions.c > > - AArch64/CreateHobList.c > > +[Sources.AARCH64, Sources.ARM] > > + Arm/StandaloneMmCoreEntryPoint.c > > + Arm/SetPermissions.c > > + Arm/CreateHobList.c > > > > [Sources.X64] > > X64/StandaloneMmCoreEntryPoint.c > > @@ -34,14 +34,14 @@ > > MdeModulePkg/MdeModulePkg.dec > > StandaloneMmPkg/StandaloneMmPkg.dec > > > > -[Packages.AARCH64] > > +[Packages.ARM, Packages.AARCH64] > > ArmPkg/ArmPkg.dec > > > > [LibraryClasses] > > BaseLib > > DebugLib > > > > -[LibraryClasses.AARCH64] > > +[LibraryClasses.ARM, LibraryClasses.AARCH64] > > StandaloneMmMmuLib > > ArmSvcLib > > > > @@ -51,7 +51,7 @@ > > gEfiStandaloneMmNonSecureBufferGuid > > gEfiArmTfCpuDriverEpDescriptorGuid > > > > -[FeaturePcd.AARCH64] > > +[FeaturePcd.ARM, FeaturePcd.AARCH64] > > gArmTokenSpaceGuid.PcdFfaEnable > > > > [BuildOptions] > > diff --git a/StandaloneMmPkg/Library/StandaloneMmCoreHobLib/AArch64/StandaloneMmCoreHobLib.c b/StandaloneMmPkg/Library/StandaloneMmCoreHobLib/Arm/StandaloneMmCoreHobLib.c > > similarity index 100% > > rename from StandaloneMmPkg/Library/StandaloneMmCoreHobLib/AArch64/StandaloneMmCoreHobLib.c > > rename to StandaloneMmPkg/Library/StandaloneMmCoreHobLib/Arm/StandaloneMmCoreHobLib.c > > diff --git a/StandaloneMmPkg/Library/StandaloneMmCoreHobLib/AArch64/StandaloneMmCoreHobLibInternal.c b/StandaloneMmPkg/Library/StandaloneMmCoreHobLib/Arm/StandaloneMmCoreHobLibInternal.c > > similarity index 100% > > rename from StandaloneMmPkg/Library/StandaloneMmCoreHobLib/AArch64/StandaloneMmCoreHobLibInternal.c > > rename to StandaloneMmPkg/Library/StandaloneMmCoreHobLib/Arm/StandaloneMmCoreHobLibInternal.c > > diff --git a/StandaloneMmPkg/Library/StandaloneMmCoreHobLib/StandaloneMmCoreHobLib.inf b/StandaloneMmPkg/Library/StandaloneMmCoreHobLib/StandaloneMmCoreHobLib.inf > > index a2559920e8..34ed536480 100644 > > --- a/StandaloneMmPkg/Library/StandaloneMmCoreHobLib/StandaloneMmCoreHobLib.inf > > +++ b/StandaloneMmPkg/Library/StandaloneMmCoreHobLib/StandaloneMmCoreHobLib.inf > > @@ -22,7 +22,7 @@ > > LIBRARY_CLASS = HobLib|MM_CORE_STANDALONE > > > > # > > -# VALID_ARCHITECTURES = X64 AARCH64 > > +# VALID_ARCHITECTURES = X64 AARCH64 ARM > > # > > [Sources.common] > > Common.c > > @@ -30,9 +30,9 @@ > > [Sources.X64] > > X64/StandaloneMmCoreHobLib.c > > > > -[Sources.AARCH64] > > - AArch64/StandaloneMmCoreHobLib.c > > - AArch64/StandaloneMmCoreHobLibInternal.c > > +[Sources.AARCH64, Sources.ARM] > > + Arm/StandaloneMmCoreHobLib.c > > + Arm/StandaloneMmCoreHobLibInternal.c > > > > [Packages] > > MdePkg/MdePkg.dec > > diff --git a/StandaloneMmPkg/Library/StandaloneMmMemLib/AArch64/StandaloneMmMemLibInternal.c b/StandaloneMmPkg/Library/StandaloneMmMemLib/ArmStandaloneMmMemLibInternal.c > > similarity index 86% > > rename from StandaloneMmPkg/Library/StandaloneMmMemLib/AArch64/StandaloneMmMemLibInternal.c > > rename to StandaloneMmPkg/Library/StandaloneMmMemLib/ArmStandaloneMmMemLibInternal.c > > index 4124959e04..fa7df46413 100644 > > --- a/StandaloneMmPkg/Library/StandaloneMmMemLib/AArch64/StandaloneMmMemLibInternal.c > > +++ b/StandaloneMmPkg/Library/StandaloneMmMemLib/ArmStandaloneMmMemLibInternal.c > > @@ -20,6 +20,13 @@ > > // > > 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. > > > > @@ -31,7 +38,7 @@ MmMemLibInternalCalculateMaximumSupportAddress ( > > { > > UINT8 PhysicalAddressBits; > > > > - PhysicalAddressBits = 36; > > + PhysicalAddressBits = ARM_PHYSICAL_ADDRESS_BITS; > > > > // > > // Save the maximum support address in one global variable > > diff --git a/StandaloneMmPkg/Library/StandaloneMmMemLib/StandaloneMmMemLib.inf b/StandaloneMmPkg/Library/StandaloneMmMemLib/StandaloneMmMemLib.inf > > index 062b0d7a11..b29d97a746 100644 > > --- a/StandaloneMmPkg/Library/StandaloneMmMemLib/StandaloneMmMemLib.inf > > +++ b/StandaloneMmPkg/Library/StandaloneMmMemLib/StandaloneMmMemLib.inf > > @@ -28,7 +28,7 @@ > > # > > # 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] > > @@ -37,8 +37,8 @@ > > [Sources.IA32, Sources.X64] > > X86StandaloneMmMemLibInternal.c > > > > -[Sources.AARCH64] > > - AArch64/StandaloneMmMemLibInternal.c > > +[Sources.AARCH64, Sources.ARM] > > + ArmStandaloneMmMemLibInternal.c > > > > [Packages] > > MdePkg/MdePkg.dec > > diff --git a/StandaloneMmPkg/Library/VariableMmDependency/VariableMmDependency.inf b/StandaloneMmPkg/Library/VariableMmDependency/VariableMmDependency.inf > > index a2a059c5d6..ffb2a6d083 100644 > > --- a/StandaloneMmPkg/Library/VariableMmDependency/VariableMmDependency.inf > > +++ b/StandaloneMmPkg/Library/VariableMmDependency/VariableMmDependency.inf > > @@ -20,7 +20,7 @@ > > # > > # The following information is for reference only and not required by the build tools. > > # > > -# VALID_ARCHITECTURES = AARCH64 > > +# VALID_ARCHITECTURES = AARCH64|ARM > > # > > # > > > > diff --git a/StandaloneMmPkg/StandaloneMmPkg.dsc b/StandaloneMmPkg/StandaloneMmPkg.dsc > > index 0c45df95e2..01bfbe8cc5 100644 > > --- a/StandaloneMmPkg/StandaloneMmPkg.dsc > > +++ b/StandaloneMmPkg/StandaloneMmPkg.dsc > > @@ -20,7 +20,7 @@ > > PLATFORM_VERSION = 1.0 > > DSC_SPECIFICATION = 0x00010011 > > OUTPUT_DIRECTORY = Build/StandaloneMm > > - SUPPORTED_ARCHITECTURES = AARCH64|X64 > > + SUPPORTED_ARCHITECTURES = AARCH64|X64|ARM > > BUILD_TARGETS = DEBUG|RELEASE > > SKUID_IDENTIFIER = DEFAULT > > > > @@ -60,7 +60,7 @@ > > StandaloneMmDriverEntryPoint|MdePkg/Library/StandaloneMmDriverEntryPoint/StandaloneMmDriverEntryPoint.inf > > VariableMmDependency|StandaloneMmPkg/Library/VariableMmDependency/VariableMmDependency.inf > > > > -[LibraryClasses.AARCH64] > > +[LibraryClasses.AARCH64, LibraryClasses.ARM] > > ArmLib|ArmPkg/Library/ArmLib/ArmBaseLib.inf > > StandaloneMmMmuLib|ArmPkg/Library/StandaloneMmMmuLib/ArmMmuStandaloneMmLib.inf > > ArmSvcLib|ArmPkg/Library/ArmSvcLib/ArmSvcLib.inf > > @@ -118,7 +118,7 @@ > > StandaloneMmPkg/Library/StandaloneMmMemoryAllocationLib/StandaloneMmMemoryAllocationLib.inf > > StandaloneMmPkg/Library/VariableMmDependency/VariableMmDependency.inf > > > > -[Components.AARCH64] > > +[Components.AARCH64, Components.ARM] > > StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/StandaloneMmCpu.inf > [SAMI] I think this should be > StandaloneMmPkg/Drivers/StandaloneMmCpu/StandaloneMmCpu.inf. ouch, right. thanks. > [/SAMI] > > StandaloneMmPkg/Library/StandaloneMmPeCoffExtraActionLib/StandaloneMmPeCoffExtraActionLib.inf > > > > @@ -131,7 +131,7 @@ > > # module style (EDK or EDKII) specified in [Components] section. > > # > > ################################################################################################### > > -[BuildOptions.AARCH64] > > +[BuildOptions.AARCH64, BuildOptions.ARM] > > GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000 -march=armv8-a+nofp -mstrict-align > > GCC:*_*_*_CC_FLAGS = -mstrict-align > > >