[edk2-devel] [edk2-platforms][PATCH v2 2/5] Platform/Sgi: dmc-620 firmware-first error handling

Omkar Anand Kulkarni omkar.kulkarni at arm.com
Sat Jul 10 16:24:27 UTC 2021


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 at arm.com>
Signed-off-by: Omkar Anand Kulkarni <omkar.kulkarni at 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..1eb80c29ca3b 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
+  #
+  ArmPlatformPkg/Drivers/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 2b461d5afbcb..c3a240ac8ee1 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 474c9c0ce764..3a97871815ef 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..a7100743bbc4 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 ArmPlatformPkg/Drivers/Apei/HestDxe/HestDxe.inf
+!if $(ENABLE_GHES_MM) == TRUE
+  INF ArmPlatformPkg/Drivers/HestMmErrorSources/HestErrorSourceDxe.inf
+!endif
+
   #
   # Platform driver
   #
-- 
2.17.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#77671): https://edk2.groups.io/g/devel/message/77671
Mute This Topic: https://groups.io/mt/84115314/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-






More information about the edk2-devel-archive mailing list