public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Omkar Anand Kulkarni" <omkar.kulkarni@arm.com>
To: devel@edk2.groups.io
Cc: Ard Biesheuvel <ard.biesheuvel@arm.com>,
	Leif Lindholm <leif@nuviainc.com>,
	Sami Mujawar <sami.mujawar@arm.com>,
	Jiewen Yao <jiewen.yao@intel.com>
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	[thread overview]
Message-ID: <20201030084156.8291-5-omkar.kulkarni@arm.com> (raw)
In-Reply-To: <20201030084156.8291-1-omkar.kulkarni@arm.com>

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 <thomas.abraham@arm.com>
Signed-off-by: Omkar Anand Kulkarni <omkar.kulkarni@arm.com>
---
 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/SgiPlatform.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
 
 [PcdsFixedAtBuild]
   gArmSgiTokenSpaceGuid.PcdDramBlock2Base|0|UINT64|0x00000002
diff --git a/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLib.inf b/Platform/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 @@
 
   gArmTokenSpaceGuid.PcdMmBufferBase
   gArmTokenSpaceGuid.PcdMmBufferSize
+  gArmPlatformTokenSpaceGuid.PcdGhesGenericErrorDataMmBufferBase
+  gArmPlatformTokenSpaceGuid.PcdGhesGenericErrorDataMmBufferSize
 
   gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress
 
+[FeaturePcd]
+  gArmSgiTokenSpaceGuid.PcdGhesMmSupported
+
 [Guids]
   gArmSgiPlatformIdDescriptorGuid
   gEfiHobListGuid          ## CONSUMES  ## SystemTable
diff --git a/Platform/ARM/SgiPkg/Library/PlatformLib/PlatformLibMem.c b/Platform/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 @@
 
 // Total number of descriptors, including the final "end-of-table" descriptor.
 #define MAX_VIRTUAL_MEMORY_MAP_DESCRIPTORS                 \
-          (11 + (FixedPcdGet32 (PcdChipCount) * 2))
+          (11 + (FixedPcdGet32 (PcdChipCount) * 2)) +      \
+          (FeaturePcdGet (PcdGhesMmSupported))
 
 /**
   Returns the Virtual Memory Map of the platform.
@@ -221,6 +222,14 @@ ArmPlatformGetVirtualMemoryMap (
   VirtualMemoryTable[Index].Length          = PcdGet64 (PcdMmBufferSize);
   VirtualMemoryTable[Index].Attributes      = ARM_MEMORY_REGION_ATTRIBUTE_UNCACHED_UNBUFFERED;
 
+#if (FeaturePcdGet (PcdGhesMmSupported))
+  // GHESv2 Generic Error Memory Space
+  VirtualMemoryTable[++Index].PhysicalBase  = PcdGet64 (PcdGhesGenericErrorDataMmBufferBase);
+  VirtualMemoryTable[Index].VirtualBase     = PcdGet64 (PcdGhesGenericErrorDataMmBufferBase);
+  VirtualMemoryTable[Index].Length          = PcdGet64 (PcdGhesGenericErrorDataMmBufferSize);
+  VirtualMemoryTable[Index].Attributes      = ARM_MEMORY_REGION_ATTRIBUTE_DEVICE;
+#endif
+
   // End of Table
   VirtualMemoryTable[++Index].PhysicalBase  = 0;
   VirtualMemoryTable[Index].VirtualBase     = 0;
-- 
2.17.1


  parent reply	other threads:[~2020-10-30  8:42 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-30  8:41 [edk2-platforms][PATCH 0/6] Platform/ARM/Sgi: Add DMC620 1-bit ECC error handling Omkar Anand Kulkarni
2020-10-30  8:41 ` [edk2-platforms][PATCH 1/6] Platform/ARM: Add DMC-620 RAS error handling driver Omkar Anand Kulkarni
2020-10-30  8:41 ` [edk2-platforms][PATCH 2/6] Platform/ARM/Sgi: Install SDEI ACPI table Omkar Anand Kulkarni
2020-10-30  8:41 ` [edk2-platforms][PATCH 3/6] Platform/Arm/Sgi: Install HEST " Omkar Anand Kulkarni
2020-10-30  8:41 ` Omkar Anand Kulkarni [this message]
2020-10-30  8:41 ` [edk2-platforms][PATCH 5/6] Platform/Arm/Sgi: dmc-620 firmware-first error handling Omkar Anand Kulkarni
2020-10-30  8:41 ` [edk2-platforms][PATCH 6/6] Platform/Arm/Sgi575: Define values for ACPI table header Omkar Anand Kulkarni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201030084156.8291-5-omkar.kulkarni@arm.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox