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 <ardb+tianocore@kernel.org>,
	Sami Mujawar <sami.mujawar@arm.com>
Subject: [edk2-platforms][PATCH v3 2/5] Platform/Sgi: dmc-620 firmware-first error handling
Date: Tue, 24 Aug 2021 11:30:24 +0530	[thread overview]
Message-ID: <20210824060027.27246-3-omkar.kulkarni@arm.com> (raw)
In-Reply-To: <20210824060027.27246-1-omkar.kulkarni@arm.com>

Enable the use of HEST table generation protocol, GHES error source
descriptor protocol and DMC-620 MM driver on ARM Neoverse Reference
Design platforms. This allows firmware-first error handling and
reporting of DMC-620 memory controller's 1-bit DRAM ECC errors.

Co-authored-by: Thomas Abraham <thomas.abraham@arm.com>
Signed-off-by: Omkar Anand Kulkarni <omkar.kulkarni@arm.com>
---
 Platform/ARM/SgiPkg/SgiPlatform.dsc.inc      | 17 +++++++++++
 Platform/ARM/SgiPkg/SgiPlatformMm.dsc.inc    | 30 ++++++++++++++++++++
 Platform/ARM/SgiPkg/PlatformStandaloneMm.fdf |  6 ++++
 Platform/ARM/SgiPkg/SgiPlatform.fdf          |  6 ++++
 4 files changed, 59 insertions(+)

diff --git a/Platform/ARM/SgiPkg/SgiPlatform.dsc.inc b/Platform/ARM/SgiPkg/SgiPlatform.dsc.inc
index 7e37732fb93c..bb32584de63d 100644
--- a/Platform/ARM/SgiPkg/SgiPlatform.dsc.inc
+++ b/Platform/ARM/SgiPkg/SgiPlatform.dsc.inc
@@ -21,6 +21,9 @@
   DEFINE LPI_EN                             = FALSE
   DEFINE CPPC_EN                            = FALSE
 
+  # To allow firmware first error handling, set this to TRUE.
+  DEFINE ENABLE_GHES_MM                     = FALSE
+
 [BuildOptions]
   *_*_*_CC_FLAGS = -D DISABLE_NEW_DEPRECATED_INTERFACES
 
@@ -208,6 +211,12 @@
   gArmTokenSpaceGuid.PcdMmBufferBase|0xFF600000
   gArmTokenSpaceGuid.PcdMmBufferSize|0x10000
 
+!if $(ENABLE_GHES_MM) == TRUE
+  ## GHESv2 Generic Error memory space
+  gArmPlatformTokenSpaceGuid.PcdGhesGenericErrorDataMmBufferBase|0xFF610000
+  gArmPlatformTokenSpaceGuid.PcdGhesGenericErrorDataMmBufferSize|0x20000
+!endif
+
 ################################################################################
 #
 # Components Section - list of all EDK II Modules needed by this Platform
@@ -365,3 +374,11 @@
 !else
   ArmPkg/Drivers/MmCommunicationDxe/MmCommunication.inf
 !endif
+
+  #
+  # GHESv2 HEST error sources support
+  #
+  MdeModulePkg/Universal/Apei/HestDxe/HestDxe.inf
+!if $(ENABLE_GHES_MM) == TRUE
+  ArmPlatformPkg/Drivers/HestMmErrorSources/HestErrorSourceDxe.inf
+!endif
diff --git a/Platform/ARM/SgiPkg/SgiPlatformMm.dsc.inc b/Platform/ARM/SgiPkg/SgiPlatformMm.dsc.inc
index 5287e1f8e568..dbba82c74f39 100644
--- a/Platform/ARM/SgiPkg/SgiPlatformMm.dsc.inc
+++ b/Platform/ARM/SgiPkg/SgiPlatformMm.dsc.inc
@@ -11,6 +11,10 @@
 # Library Class section - list of all Library Classes needed by this Platform.
 #
 ################################################################################
+[Defines]
+  # To enable DMC-620 MM driver, set this to TRUE.
+  DEFINE ENABLE_DMC620_MM                = FALSE
+
 [LibraryClasses]
   #
   # Basic
@@ -94,6 +98,25 @@
   gEfiSecurityPkgTokenSpaceGuid.PcdUserPhysicalPresence|TRUE
 !endif
 
+!if $(ENABLE_GHES_MM) == TRUE
+  ## GHESv2 Generic Error Memory Space
+  gArmPlatformTokenSpaceGuid.PcdGhesGenericErrorDataMmBufferBase|0xFF610000
+  gArmPlatformTokenSpaceGuid.PcdGhesGenericErrorDataMmBufferSize|0x20000
+!endif
+
+!if $(ENABLE_DMC620_MM) == TRUE
+  ## DMC620
+  gDmc620MmTokenSpaceGuid.PcdDmc620NumCtrl|2
+  gDmc620MmTokenSpaceGuid.PcdDmc620RegisterBase|0x4E000000
+  gDmc620MmTokenSpaceGuid.PcdDmc620CtrlSize|0x100000
+  gDmc620MmTokenSpaceGuid.PcdDmc620CorrectableErrorThreshold|10
+  gDmc620MmTokenSpaceGuid.PcdDmc620ErrSourceCount|1
+  gDmc620MmTokenSpaceGuid.PcdDmc620DramErrorSdeiEventBase|804
+  gDmc620MmTokenSpaceGuid.PcdDmc620DramOneBitErrorDataBase|0xFF610000
+  gDmc620MmTokenSpaceGuid.PcdDmc620DramOneBitErrorDataSize|0x100
+  gDmc620MmTokenSpaceGuid.PcdDmc620DramOneBitErrorSourceId|0
+!endif
+
 ###################################################################################################
 #
 # Components Section - list of the modules and components that will be processed by compilation
@@ -134,6 +157,13 @@
   }
 !endif
 
+!if $(ENABLE_GHES_MM) == TRUE
+  ArmPlatformPkg/Drivers/HestMmErrorSources/HestErrorSourceStandaloneMm.inf
+!endif
+!if $(ENABLE_DMC620_MM) == TRUE
+  Platform/ARM/Drivers/Dmc620Mm/Dmc620Mm.inf
+!endif
+
 ###################################################################################################
 #
 # BuildOptions Section - Define the module specific tool chain flags that should be used as
diff --git a/Platform/ARM/SgiPkg/PlatformStandaloneMm.fdf b/Platform/ARM/SgiPkg/PlatformStandaloneMm.fdf
index c1c24b747fa5..e029b9164570 100644
--- a/Platform/ARM/SgiPkg/PlatformStandaloneMm.fdf
+++ b/Platform/ARM/SgiPkg/PlatformStandaloneMm.fdf
@@ -48,6 +48,12 @@ READ_STATUS        = TRUE
 READ_LOCK_CAP      = TRUE
 READ_LOCK_STATUS   = TRUE
 
+!if $(ENABLE_GHES_MM) == TRUE
+  INF ArmPlatformPkg/Drivers/HestMmErrorSources/HestErrorSourceStandaloneMm.inf
+!endif
+!if $(ENABLE_DMC620_MM) == TRUE
+  INF Platform/ARM/Drivers/Dmc620Mm/Dmc620Mm.inf
+!endif
   INF StandaloneMmPkg/Core/StandaloneMmCore.inf
 !if $(SECURE_STORAGE_ENABLE) == TRUE
   INF ArmPlatformPkg/Drivers/NorFlashDxe/NorFlashStandaloneMm.inf
diff --git a/Platform/ARM/SgiPkg/SgiPlatform.fdf b/Platform/ARM/SgiPkg/SgiPlatform.fdf
index 8227ae03330c..d6e942e19b81 100644
--- a/Platform/ARM/SgiPkg/SgiPlatform.fdf
+++ b/Platform/ARM/SgiPkg/SgiPlatform.fdf
@@ -179,6 +179,12 @@ READ_LOCK_STATUS   = TRUE
   # MM Communicate
   INF ArmPkg/Drivers/MmCommunicationDxe/MmCommunication.inf
 
+  # Hest Error Source Support
+  INF MdeModulePkg/Universal/Apei/HestDxe/HestDxe.inf
+!if $(ENABLE_GHES_MM) == TRUE
+  INF ArmPlatformPkg/Drivers/HestMmErrorSources/HestErrorSourceDxe.inf
+!endif
+
   #
   # Platform driver
   #
-- 
2.17.1


  parent reply	other threads:[~2021-08-24  6:00 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-24  6:00 [edk2-platforms][PATCH v3 0/5] Platform/Sgi: Add platform support for firmware first error handling Omkar Anand Kulkarni
2021-08-24  6:00 ` [edk2-platforms][PATCH v3 1/5] Platform/ARM: Add DMC-620 ECC error handling driver Omkar Anand Kulkarni
2021-09-27 17:30   ` Sami Mujawar
2021-08-24  6:00 ` Omkar Anand Kulkarni [this message]
2021-10-04 12:45   ` [edk2-platforms][PATCH v3 2/5] Platform/Sgi: dmc-620 firmware-first error handling Sami Mujawar
2021-08-24  6:00 ` [edk2-platforms][PATCH v3 3/5] Platform/Sgi: define memory region for GHES error status block Omkar Anand Kulkarni
2021-10-04 18:23   ` Sami Mujawar
2021-08-24  6:00 ` [edk2-platforms][PATCH v3 4/5] Platform/Sgi: Define values for ACPI table header Omkar Anand Kulkarni
2021-10-04 12:46   ` Sami Mujawar
2021-08-24  6:00 ` [edk2-platforms][PATCH v3 5/5] Platform/Sgi: Add platform error handling driver Omkar Anand Kulkarni
2021-10-04 12:46   ` Sami Mujawar

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=20210824060027.27246-3-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