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.web09.10734.1604047332925842277 for ; Fri, 30 Oct 2020 01:42:13 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: arm.com, ip: 217.140.110.172, mailfrom: omkar.kulkarni@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 9C436D6E; Fri, 30 Oct 2020 01:42:12 -0700 (PDT) Received: from usa.arm.com (a076764.blr.arm.com [10.162.16.42]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id F30E33F719; Fri, 30 Oct 2020 01:42:10 -0700 (PDT) From: "Omkar Anand Kulkarni" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Leif Lindholm , Sami Mujawar , Jiewen Yao Subject: [edk2-platforms][PATCH 4/6] Platform/Arm/Sgi: define memory region for GHES error status block Date: Fri, 30 Oct 2020 14:11:54 +0530 Message-Id: <20201030084156.8291-5-omkar.kulkarni@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201030084156.8291-1-omkar.kulkarni@arm.com> References: <20201030084156.8291-1-omkar.kulkarni@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Allow platforms to define the base address and size of the memory region that is reserved for MM drivers to populate the GHES generic error status block with information about the platform error. Co-authored-by: Thomas Abraham Signed-off-by: Omkar Anand Kulkarni --- Platform/ARM/SgiPkg/SgiPlatform.dec | 1 + Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLib.inf | 5 +++++ Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLibMem.c | 11 ++++++++++= - 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/Platform/ARM/SgiPkg/SgiPlatform.dec b/Platform/ARM/SgiPkg/Sg= iPlatform.dec index 099652734c0e..5dd27c40d1e9 100644 --- a/Platform/ARM/SgiPkg/SgiPlatform.dec +++ b/Platform/ARM/SgiPkg/SgiPlatform.dec @@ -33,6 +33,7 @@ gArmSgiTokenSpaceGuid.PcdVirtioNetSupported|FALSE|BOOLEAN|0x00000010 gArmSgiTokenSpaceGuid.PcdHestSupported|FALSE|BOOLEAN|0x0000000C gArmSgiTokenSpaceGuid.PcdSdeiSupported|FALSE|BOOLEAN|0x0000000D + gArmSgiTokenSpaceGuid.PcdGhesMmSupported|FALSE|BOOLEAN|0x0000000E =20 [PcdsFixedAtBuild] gArmSgiTokenSpaceGuid.PcdDramBlock2Base|0|UINT64|0x00000002 diff --git a/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLib.inf b/Pl= atform/ARM/SgiPkg/Library/PlatformLib/PlatformLib.inf index 464a7cde4513..f62dd1a1f00b 100644 --- a/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLib.inf +++ b/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLib.inf @@ -63,9 +63,14 @@ =20 gArmTokenSpaceGuid.PcdMmBufferBase gArmTokenSpaceGuid.PcdMmBufferSize + gArmPlatformTokenSpaceGuid.PcdGhesGenericErrorDataMmBufferBase + gArmPlatformTokenSpaceGuid.PcdGhesGenericErrorDataMmBufferSize =20 gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress =20 +[FeaturePcd] + gArmSgiTokenSpaceGuid.PcdGhesMmSupported + [Guids] gArmSgiPlatformIdDescriptorGuid gEfiHobListGuid ## CONSUMES ## SystemTable diff --git a/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLibMem.c b/P= latform/ARM/SgiPkg/Library/PlatformLib/PlatformLibMem.c index e30819c5cd55..216b0de3522a 100644 --- a/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLibMem.c +++ b/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLibMem.c @@ -17,7 +17,8 @@ =20 // Total number of descriptors, including the final "end-of-table" descr= iptor. #define MAX_VIRTUAL_MEMORY_MAP_DESCRIPTORS \ - (11 + (FixedPcdGet32 (PcdChipCount) * 2)) + (11 + (FixedPcdGet32 (PcdChipCount) * 2)) + \ + (FeaturePcdGet (PcdGhesMmSupported)) =20 /** Returns the Virtual Memory Map of the platform. @@ -221,6 +222,14 @@ ArmPlatformGetVirtualMemoryMap ( VirtualMemoryTable[Index].Length =3D PcdGet64 (PcdMmBufferSiz= e); VirtualMemoryTable[Index].Attributes =3D ARM_MEMORY_REGION_ATTRIB= UTE_UNCACHED_UNBUFFERED; =20 +#if (FeaturePcdGet (PcdGhesMmSupported)) + // GHESv2 Generic Error Memory Space + VirtualMemoryTable[++Index].PhysicalBase =3D PcdGet64 (PcdGhesGeneric= ErrorDataMmBufferBase); + VirtualMemoryTable[Index].VirtualBase =3D PcdGet64 (PcdGhesGeneric= ErrorDataMmBufferBase); + VirtualMemoryTable[Index].Length =3D PcdGet64 (PcdGhesGeneric= ErrorDataMmBufferSize); + VirtualMemoryTable[Index].Attributes =3D ARM_MEMORY_REGION_ATTRIB= UTE_DEVICE; +#endif + // End of Table VirtualMemoryTable[++Index].PhysicalBase =3D 0; VirtualMemoryTable[Index].VirtualBase =3D 0; --=20 2.17.1